This article has multiple issues. Please help improve it or discuss these issues on the talk page . (Learn how and when to remove these template messages)
(Learn how and when to remove this template message) |

In mathematics, a **magic hypercube** is the *k*-dimensional generalization of magic squares and magic cubes, that is, an *n* × *n* × *n* × ... × *n* array of integers such that the sums of the numbers on each pillar (along any axis) as well as on the main space diagonals are all the same. The common sum is called the magic constant of the hypercube, and is sometimes denoted *M*_{k}(*n*). If a magic hypercube consists of the numbers 1, 2, ..., *n*^{k}, then it has magic number

- Perfect and Nasik magic hypercubes
- Notations
- Construction
- KnightJump construction
- Latin prescription construction
- Multiplication
- Aspects
- Basic manipulations
- Component permutation
- Coordinate permutation
- Monagonal permutation
- Digitchanging
- Pathfinders
- Qualifications
- See also
- References
- Further reading
- External links

- .

For *k* = 4, a magic hypercube may be called a **magic tesseract**, with sequence of magic numbers given by OEIS: A021003 .

The side-length *n* of the magic hypercube is called its *order*. Four-, five-, six-, seven- and eight-dimensional magic hypercubes of order three have been constructed by J. R. Hendricks.

Marian Trenkler proved the following theorem: A *p*-dimensional magic hypercube of order *n* exists if and only if *p* > 1 and *n* is different from 2 or *p* = 1. A construction of a magic hypercube follows from the proof.

The R programming language includes a module, ` library(magic)`, that will create magic hypercubes of any dimension with *n* a multiple of 4.

If, in addition, the numbers on every cross section diagonal also sum up to the hypercube's magic number, the hypercube is called a perfect magic hypercube; otherwise, it is called a semiperfect magic hypercube. The number *n* is called the order of the magic hypercube.

The above definition of "perfect" assumes that one of the older definitions for perfect magic cubes is used. See Magic Cube Classes. The * Universal Classification System for Hypercubes* (John R. Hendricks) requires that for any dimension hypercube,

in order to keep things in hand a special notation was developed:

- : positions within the hypercube
- : vector through the hypercube

Note: The notation for position can also be used for the value on that position. Then, where it is appropriate, dimension and order can be added to it, thus forming: ^{n}[_{k}i]_{m}

As is indicated 'k' runs through the dimensions, while the coordinate 'i' runs through all possible values, when values 'i' are outside the range it is simply moved back into the range by adding or subtracting appropriate multiples of m, as the magic hypercube resides in n-dimensional modular space.

There can be multiple 'k' between bracket, these can't have the same value, though in undetermined order, which explains the equality of:

Of course given 'k' also one value 'i' is referred to.

When a specific coordinate value is mentioned the other values can be taken as 0, which is especially the case when the amount of 'k's are limited using pe. #k=1 as in:

("axial"-neighbor of )

(#j=n-1 can be left unspecified) j now runs through all the values in [0..k-1,k+1..n-1].

Further: without restrictions specified 'k' as well as 'i' run through all possible values, in combinations same letters assume same values. Thus makes it possible to specify a particular line within the hypercube (see r-agonal in pathfinder section)

Note: as far as I know this notation is not in general use yet(?), Hypercubes are not generally analyzed in this particular manner.

Further: "**perm(0..n-1)**" specifies a permutation of the n numbers 0..n-1.

Besides more specific constructions two more general construction method are noticeable:

This construction generalizes the movement of the chessboard horses (vectors ) to more general movements (vectors ). The method starts at the position P_{0} and further numbers are sequentially placed at positions further until (after m steps) a position is reached that is already occupied, a further vector is needed to find the next free position. Thus the method is specified by the n by n+1 matrix:

This positions the number 'k' at position:

**C. Planck** gives in his 1905 article "**The theory of Path Nasiks**" conditions to create with this method "Path Nasik" (or modern {perfect}) hypercubes.

(modular equations). This method is also specified by an n by n+1 matrix. However this time it multiplies the n+1 vector [x_{0},..,x_{n-1},1], After this multiplication the result is taken modulus m to achieve the n (Latin) hypercubes:

LP_{k}= (_{l=0}Σ^{n-1}LP_{k,l}x_{l}+ LP_{k,n}) % m

of radix m numbers (also called "**digits**"). On these LP_{k}'s "**digit changing**" (?i.e. Basic manipulation) are generally applied before these LP_{k}'s are combined into the hypercube:

^{n}H_{m}=_{k=0}Σ^{n-1}LP_{k}m^{k}

**J.R.Hendricks** often uses modular equation, conditions to make hypercubes of various quality can be found on http://www.magichypercubes.com/Encyclopedia at several places (especially p-section)

Both methods fill the hypercube with numbers, the knight-jump guarantees (given appropriate vectors) that every number is present. The Latin prescription only if the components are orthogonal (no two digits occupying the same position)

Amongst the various ways of compounding, the multiplication^{ [1] } can be considered as the most basic of these methods. The **basic multiplication** is given by:

^{n}H_{m1}*^{n}H_{m2}:^{n}[_{k}i]_{m1m2}=^{n}[ [[_{k}i \ m_{2}]_{m1}m_{1}^{n}]_{m2}+ [_{k}i % m_{2}]_{m2}]_{m1m2}

Most compounding methods can be viewed as variations of the above, As most qualifiers are invariant under multiplication one can for example place any aspectial variant of ^{n}H_{m2} in the above equation, besides that on the result one can apply a manipulation to improve quality. Thus one can specify pe the J. R. Hendricks / M. Trenklar doubling. These things go beyond the scope of this article.

A hypercube knows **n! 2 ^{n}** Aspectial variants, which are obtained by coordinate reflection ([

^{n}H_{m}^{~R perm(0..n-1)}; R =_{k=0}Σ^{n-1}((reflect(k)) ? 2^{k}: 0) ; perm(0..n-1) a permutation of 0..n-1

Where reflect(k) true iff coordinate k is being reflected, only then 2^{k} is added to R. As is easy to see, only n coordinates can be reflected explaining 2^{n}, the n! permutation of n coordinates explains the other factor to the total amount of "Aspectial variants"!

Aspectial variants are generally seen as being equal. Thus any hypercube can be represented shown in **"normal position"** by:

[_{k}0] = min([_{k}θ ; θ ε {-1,0}]) (by reflection) [_{k}1 ; #k=1] < [_{k+1}1 ; #k=1] ; k = 0..n-2 (by coordinate permutation)

(explicitly stated here: [_{k}0] the minimum of all corner points. The axial neighbour sequentially based on axial number)

Besides more specific manipulations, the following are of more general nature

**#[perm(0..n-1)]**: component permutation**^[perm(0..n-1)]**: coordinate permutation (n == 2: transpose)**_2**: monagonal permutation (axis ε [0..n-1])^{axis}[perm(0..m-1)]**=[perm(0..m-1)]**: digit change

Note: '#', '^', '_' and '=' are essential part of the notation and used as manipulation selectors.

Defined as the exchange of components, thus varying the factor m^{k} in m^{perm(k)}, because there are n component hypercubes the permutation is over these n components

The exchange of coordinate [_{k}i] into [_{perm(k)}i], because of n coordinates a permutation over these n directions is required.

The term **transpose** (usually denoted by ^{t}) is used with two dimensional matrices, in general though perhaps "coordinate permutation" might be preferable.

Defined as the change of [_{k}**i**] into [_{k}**perm(i)**] alongside the given "axial"-direction. Equal permutation along various axes can be combined by adding the factors 2^{axis}. Thus defining all kinds of r-agonal permutations for any r. Easy to see that all possibilities are given by the corresponding permutation of m numbers.

Noted be that **reflection** is the special case:

~R = _R[n-1,..,0]

Further when all the axes undergo the same ;permutation (R = 2^{n}-1) an **n-agonal permutation** is achieved, In this special case the 'R' is usually omitted so:

_[perm(0..n-1)] = _(2^{n}-1)[perm(0..n-1)]

Usually being applied at component level and can be seen as given by **[ _{k}i]** in

J. R. Hendricks called the directions within a hypercubes "**pathfinders**", these directions are simplest denoted in a ternary number system as:

Pf_{p}where: p =_{k=0}Σ^{n-1}(_{k}i + 1) 3^{k}<==><_{k}i> ; i ε {-1,0,1}

This gives 3^{n} directions. since every direction is traversed both ways one can limit to the upper half [(3^{n}-1)/2,..,3^{n}-1)] of the full range.

With these pathfinders any line to be summed over (or r-agonal) can be specified:

[_{j}0_{k}p_{l}q ; #j=1 #k=r-1 ; k > j ] <_{j}1_{k}θ_{l}0 ; θ ε {-1,1} > ; p,q ε [0,..,m-1]

which specifies all (broken) r-agonals, p and q ranges could be omitted from this description. The main (unbroken) r-agonals are thus given by the slight modification of the above:

[_{j}0_{k}0_{l}-1_{s}p ; #j=1 #k+#l=r-1 ; k,l > j ] <_{j}1_{k}1_{l}-1_{s}0 >

A hypercube ^{n}H_{m} with numbers in the analytical numberrange [0..m^{n}-1] has the magic sum:

^{n}S_{m}= m (m^{n}- 1) / 2.

Besides more specific qualifications the following are the most important, "summing" of course stands for "summing correctly to the magic sum"

- {
**r-agonal**} : all main (unbroken) r-agonals are summing. - {
**pan r-agonal**} : all (unbroken and broken) r-agonals are summing. - {
**magic**} : {1-agonal n-agonal} - {
**perfect**} : {pan r-agonal; r = 1..n}

Note: This series doesn't start with 0 since a nill-agonal doesn't exist, the numbers correspond with the usual name-calling: 1-agonal = monagonal, 2-agonal = diagonal, 3-agonal = triagonal etc.. Aside from this the number correspond to the amount of "-1" and "1" in the corresponding pathfinder.

In case the hypercube also sum when all the numbers are raised to the power p one gets p-multimagic hypercubes. The above qualifiers are simply prepended onto the p-multimagic qualifier. This defines qualifications as {r-agonal 2-magic}. Here also "2-" is usually replaced by "bi", "3-" by "tri" etc. ("1-magic" would be "monomagic" but "mono" is usually omitted). The sum for p-Multimagic hypercubes can be found by using Faulhaber's formula and divide it by m^{n-1}.

Also "magic" (i.e. {1-agonal n-agonal}) is usually assumed, the Trump/Boyer {diagonal} cube is technically seen {1-agonal 2-agonal 3-agonal}.

Nasik magic hypercube gives arguments for using {**nasik**} as synonymous to {**perfect**}. The strange generalization of square 'perfect' to using it synonymous to {diagonal} in cubes is however also resolve by putting curly brackets around qualifiers, so {**perfect**} means {pan r-agonal; r = 1..n} (as mentioned above).

some minor qualifications are:

- {
} : {all order 2 subhyper cubes sum to 2^{n}compact^{n}^{n}S_{m}/ m} - {
} : {all pairs halve an n-agonal apart sum equal (to (m^{n}complete^{n}- 1)}

{** ^{n}compact**} might be put in notation as :

{

Where:

[

for {complete} the complement of [

for squares: {** ^{2}compact ^{2}complete**} is the "modern/alternative qualification" of what Dame Kathleen Ollerenshaw called most-perfect magic square, {

Caution: some people seems to equate {compact} with {

consequences of {

In mathematics, the **geometric algebra** (**GA**) of a vector space with a quadratic form is an algebra over a field, the Clifford algebra of a vector space with a quadratic form with its multiplication operation called the **geometric product**. The algebra elements are called multivectors, which contains both the scalars and the vector space .

In mathematics, the **Cauchy–Schwarz inequality**, also known as the **Cauchy–Bunyakovsky–Schwarz inequality**, is a useful inequality in many mathematical fields, such as linear algebra, analysis, probability theory, vector algebra and other areas. It is considered to be one of the most important inequalities in all of mathematics.

In geometry, a **hypercube** is an *n*-dimensional analogue of a square and a cube. It is a closed, compact, convex figure whose 1-skeleton consists of groups of opposite parallel line segments aligned in each of the space's dimensions, perpendicular to each other and of the same length. A unit hypercube's longest diagonal in *n* dimensions is equal to .

In quantum mechanics, a **density matrix** is a matrix that describes the quantum state of a physical system. It allows for the calculation of the probabilities of the outcomes of any measurement performed upon this system, using the Born rule. It is a generalization of the more usual state vectors or wavefunctions: while those can only represent pure states, density matrices can also represent *mixed states*. Mixed states arise in quantum mechanics in two different situations: first when the preparation of the system is not fully known, and thus one must deal with a statistical ensemble of possible preparations, and second when one wants to describe a physical system which is entangled with another, as its state can not be described by a pure state.

In linear algebra, the **permanent** of a square matrix is a function of the matrix similar to the determinant. The permanent, as well as the determinant, is a polynomial in the entries of the matrix. Both are special cases of a more general function of a matrix called the immanant.

In mathematics, a **magic cube** is the 3-dimensional equivalent of a magic square, that is, a number of integers arranged in a *n* × *n* × *n* pattern such that the sums of the numbers on each row, on each column, on each pillar and on each of the four main space diagonals are equal to the same number, the so-called magic constant of the cube, denoted *M*_{3}(*n*). It can be shown that if a magic cube consists of the numbers 1, 2, ..., *n*^{3}, then it has magic constant

In mathematics, a **perfect magic cube** is a magic cube in which not only the columns, rows, pillars, and main space diagonals, but also the cross section diagonals sum up to the cube's magic constant.

In quantum mechanics, a **Slater determinant** is an expression that describes the wave function of a multi-fermionic system. It satisfies anti-symmetry requirements, and consequently the Pauli principle, by changing sign upon exchange of two electrons. Only a small subset of all possible fermionic wave functions can be written as a single Slater determinant, but those form an important and useful subset because of their simplicity.

The **Wigner–Eckart theorem** is a theorem of representation theory and quantum mechanics. It states that matrix elements of spherical tensor operators in the basis of angular momentum eigenstates can be expressed as the product of two factors, one of which is independent of angular momentum orientation, and the other a Clebsch–Gordan coefficient. The name derives from physicists Eugene Wigner and Carl Eckart, who developed the formalism as a link between the symmetry transformation groups of space and the laws of conservation of energy, momentum, and angular momentum.

In physics, the **Clebsch–Gordan** (**CG**) **coefficients** are numbers that arise in angular momentum coupling in quantum mechanics. They appear as the expansion coefficients of total angular momentum eigenstates in an uncoupled tensor product basis. In more mathematical terms, the CG coefficients are used in representation theory, particularly of compact Lie groups, to perform the explicit direct sum decomposition of the tensor product of two irreducible representations. The name derives from the German mathematicians Alfred Clebsch and Paul Gordan, who encountered an equivalent problem in invariant theory.

In geometry, a **space diagonal** of a polyhedron is a line connecting two vertices that are not on the same face. Space diagonals contrast with face diagonals, which connect vertices on the same face as each other.

Every magic cube may be assigned to one of six **magic cube classes**, based on the cube characteristics.

A **pantriagonal magic cube** is a magic cube where all 4*m*^{2} pantriagonals sum correctly. There are 4 one-segment, 12(*m* − 1) two-segment, and 4(*m* − 2)(*m* − 1) three-segment pantriagonals. This class of magic cubes may contain some simple magic squares and/or pandiagonal magic squares, but not enough to satisfy any other classifications.

The **Peres–Horodecki criterion** is a necessary condition, for the joint density matrix of two quantum mechanical systems and , to be separable. It is also called the **PPT** criterion, for *positive partial transpose*. In the 2x2 and 2x3 dimensional cases the condition is also sufficient. It is used to decide the separability of mixed states, where the Schmidt decomposition does not apply.

In quantum field theory and statistical mechanics, the **Mermin–Wagner theorem** states that continuous symmetries cannot be spontaneously broken at finite temperature in systems with sufficiently short-range interactions in dimensions *d* ≤ 2. Intuitively, this means that long-range fluctuations can be created with little energy cost and since they increase the entropy they are favored.

In combinatorics, the **Eulerian number***A*(*n*, *m*) is the number of permutations of the numbers 1 to *n* in which exactly *m* elements are greater than the previous element. They are the coefficients of the **Eulerian polynomials**:

In graph theory, the **hypercube graph***Q _{n}* is the graph formed from the vertices and edges of an n-dimensional hypercube. For instance, the cubical graph

A * Nasik magic hypercube* is a magic hypercube with the added restriction that all possible lines through each cell sum correctly to where

A **magic hyperbeam** is a variation on a magic hypercube where the orders along each direction may be different. As such a **magic hyperbeam** generalises the two dimensional **magic rectangle** and the three dimensional **magic beam**, a series that mimics the series magic square, magic cube and magic hypercube. This article will mimic the magic hypercubes article in close detail, and just as that article serves merely as an introduction to the topic.

The **Mandelbulb** is a three-dimensional fractal, constructed by Daniel White and Paul Nylander using spherical coordinates in 2009.

- ↑ this is a n-dimensional version of (pe.): Alan Adler magic square multiplication

- J.R.Hendricks: Magic Squares to Tesseract by Computer, Self-published, 1998, 0-9684700-0-9
- Planck, C., M.A.,M.R.C.S., The Theory of Paths Nasik, 1905, printed for private circulation. Introductory letter to the paper

- The Magic Encyclopedia Articles by Aale de Winkel
- Magic Cubes and Hypercubes - References Collected by Marian Trenkler
- An algorithm for making magic cubes by Marian Trenkler

- multimagie.com Articles by Christian Boyer
- magichypercube.com A magic cube generator

This page is based on this Wikipedia article

Text is available under the CC BY-SA 4.0 license; additional terms may apply.

Images, videos and audio are available under their respective licenses.

Text is available under the CC BY-SA 4.0 license; additional terms may apply.

Images, videos and audio are available under their respective licenses.