The number of possibilities is governed by
P68
48 ’1:01 94 1078, which is reduced by the 12-fold axial
symmetry and the planar symmetry to ‘‘only’’ about
4.2474 1076 possibilities. It is simply not possible to
screen, even numerically, so many possibilities and one
can only find a ‘‘better’’ combination, but one cannot
guarantee it is the best one. We implemented a simple
algorithm for this purpose that generates random combinations.
This algorithm evaluates the spherical harmonics
expansion at the center of the magnet and computes a
quality factor based on the different terms in the expansion
and on a weighting function that defined priorities on the
terms to be reduced.