The Magic Encyclopedia ™

Transformations
(by Aale de Winkel)

This article deals with transformations that are smewhat more complex in nature than the transformations discussed in the isomorphisms article. Mentione notations are preliminairy at best and wil be changed in a future upload once investigations make things more clear.

Transformations
The following transformations play an important part with especially pandiagonal odd order
magic square, the listed transforms can be used to transform the set of "essentially different"
square onto the set of "different" panmagic squares. For order 5 this cuts down the total
amount of panmagic squares (144) by a factor 4 to 36 essentially different magic squares
other orders have corresponding factors (yet to be determined), the formulae do not only
work for prime orders but also for none-prime orders, even when parameters are not relatively
prime, in which case continuation might might be quite arbitrarily defined (properties of
which are still under investigation, since the properties of the samples squares seems to
blur things. (The intent is to make this discussion feature independent))
all order transforms
the pan-flip The reflection of the hypercube into the 0-plane followed by a pan relocation
of the origins 0-plane onto the targets 0-plane is revered to as a pan-flip in
the panmagic square articles (0-plane is in the above generalisation relative
to the chosen 1-agonal (relavant coordinate is '0'))
Odd order tranforms
diagonal-row transform
R+ or R-
The transformation of the main dagonal into a row
With these transforms the diagonal is mapped onto the top row by:
R+: [i + j,i - j] --> [i,j] i,j = 0..m-1 (modular m)
R-: [i - j,i + j] --> [i,j] i,j = 0..m-1 (modular m)
where the formula also show all the original square subdiagonals to be
transformed into colums in either direction, this can be easily seen
to be only possible with odd orders
diagonal-column transform
C+ or C-
The transformation of the main dagonal into a column
With these transforms the diagonal is mapped onto the left column by:
C+: [i + j,i - j] --> [j,i] i,j = 0..m-1 (modular m)
C-: [i - j,i + j] --> [j,i] i,j = 0..m-1 (modular m)
where the formula also show all the original square subdiagonals to be
transformed into colums in either direction, this can be easily seen
to be only possible with odd orders
C+ and C- are related to one another by the horizontal pan-flip, moving the
first column of the above C+ to the center-column gives the coördinate transform
C+q = [(q - x + y) % m,(q + 1 + x + y) % m] (with 2 q + 1 = m)
applying this twice gives the coördinate transform
C+q2 = [(q + 1 + 2x) % m,(q + 1 + 2y) % m]
more commenly refered to as the symmetrical diagonal permutation
[ (q + 1 + 2 x) % m ; q = (m-1)/2 ; x = 0 .. m-1 ]
R+ and R- are related to C+ and C- by transposition so same thing applies
sub-diagonal changing permutation
Pa
Special main diagonal permutation to change the subdiagonal
Special diagonal permutations can be seen to change subdiagonals
in square of odd order, these transforms can be seen to be given by
[a * i % m; i = 0 .. m-1; a = 1 .. m-1]
n-agonal-1-agonal transform a generalisation of the diagonal row transform
As a generalisation of the diagonal row transform the hypercubes n-agonal
is mapped onto a hypercube 1-agonal, from each number each broken
sub n-agonal is traced and mappen sequaentially on a still free 1-agonal,
thus one obtains a new hypercube which preserve the panmagic quality
(I curently believe that it doesn't really matter which subdiagonal is
place upon which 1-agonal one merely obtains a transpositional equivalent
which when normalized gives the same hypercube)
NOTE: this a\ony works with odd orders because the sub n-agonals only
intersect the main n-agonal once.
Doubly even orders have some special transformations to make magic hypercubes
from the most basic hypercube (or other generating hypercubes)
Pandiagonal transform
P(..)
The pandiagonal transform is defined as a 2 step process on
hypercubes of order 4p
[j(2p+k)] <-> [j(4p-1-k)] (j = 0..n-1; k = 0..p-1
[jk] <-> [j(2p+k)] (j = 0..n-1; (jn-1[jk] ) % 2 = 1; k < 2p)
The first step of the process is a mirror-swap of the third and fourth quater
of each 1-agonal. The second step is a swap of alternate 1-agonal numbers with
a number 2m apart on the same 1-agonal. In overall the first step compensate
the 1-agonal off sums of the numbers modulo (2m)2, while the second swap
compensate the part of the off sums due to the high component of the numbers
note: the transform does not compensate diagonal sums, so the diagonals need
sum already to the magic sum, for the result to be diagonal thus the origin
need to be "pan anti-semimagic" or "pan block-magic" (must take a closer look
at these qualifications)
These conditions are met by the normal square, and left multiplications with
N2 or N2t of either order 2p normal square or order 2p panmagic square.
In reverse given a position [jk] coordinates when summing to an odd
number all coordinates swap with coordinates 2p further
if (jn-1[jk] ) % 2 = 1 then [jk] <-> [(jk + 2p) % 4p]
position coordinates bigger (or equal) then 2p swap with its 3p mirror
if [jk] >= 2p then [jk] <-> [6p - jk]
The thus obtained position is the position within the Generating Hypercube
corresponding with the generated hypercubes position.
bi-Pandiagonal transform
bi-P(..)
The bi-pandiagonal transform is defined as a 2 step process on
hypercubes of order 4p
[jk] <-> [(n-1-j)(4p-1-k)] (j = 0..n-2 ; k = "odd" ; k < 2p)
(j = 0..n-2 ; k = "even" ; k >= 2p)
Note: the above might be slightly off, as also I but recently noted
the the previous "odd" condition with P(..) altered in the above.
The bi-Pandiagonal transform swaps every other number with the hypercubes
center mirror positioned the result of this transformation seems to be a
magic square every other pan-relocation hence the name