{'fraction_non_alphanumeric': 0.0344437904649794, 'fraction_numerical': 0.012218952324896998, 'mean_word_length': 4.722214737976559, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Optimized magnetic lattices for ultracold atomic ensembles

We introduce a general method for designing tailored lattices of magnetic microtraps for ultracold atoms, on the basis of patterned permanently magnetized films. A fast numerical algorithm is used to automatically generate patterns which provide optimal atom confinement while respecting desired lattice symmetries and trap parameters. The algorithm can produce finite and infinite lattices of any plane symmetry; we focus specifically on square and triangular lattices which are of interest to future experiments. Typical trap parameters are discussed as well as the impact of realistic imperfections such as finite lithographic resolution and magnetic inhomogeneity. The presented designer lattices open new avenues for quantum simulation and quantum information processing with ultracold atoms on atom chips.


I. INTRODUCTION
Ultracold atoms in periodic potentials are ideal systems for exploring a diverse range of new physics, from the behavior of individual trapped atoms to rich manybody phenomena. At the core of most current experiments are optical lattices, produced by the interference of intersecting laser beams [1][2][3], which have provided for example unprecedented access to Josephson effects [4], squeezed states [5], low-dimensional quantum gases [6] and novel quantum phases [7]. Particularly exciting applications arise in the context of quantum simulation [8] and quantum information processing [9,10], where atoms or molecules trapped in periodic arrays hold great promise for the storage and manipulation of quantum information. Lattices of magnetically trapped atoms or ensembles of atoms, interacting via a switchable Rydberg excitation, are promising systems for the generation of cluster states and other many-particle entangled states. Thus they could provide a suitable platform for implementing measurement-based quantum information processing schemes as well as exploring fault tolerant schemes [11][12][13][14].
For practical devices, an attractive alternative to optical lattices are arrays of magnetic microtraps produced by current-carrying wires or patterned magnetic films on atom chips [15][16][17][18][19][20][21]. In principle, these magnetic lattices provide robust potentials for manipulating atoms, combined with a high degree of simplicity and excellent design flexibility. For example, inter-atomic distances are not restricted to certain fractions of optical wavelengths, allowing for a trade-off between inter-site coupling strength and single-site resolution. However, de-spite these advantages, only one-dimensional and a few two-dimensional lattices have been successfully implemented or proposed to date. The problem of finding the necessary magnetization pattern, or wire shape, which generates a desired set of atom traps currently relies on experience and trial-and error; what has been lacking is a general procedure for designing lattices with arbitrary arrangements of traps with the desired properties In this paper we present a general method for creating tailored lattices of magnetic microtraps by controlling the geometric patterns of perpendicularly magnetized planar films. We employ a linear programming algorithm to find optimal single-layer magnetization patterns which produce desired lattice symmetries with specified trap parameters. This algorithm is similar to one previously used for the optimization of surface-electrode ion-trap lattices based on radio-frequency (rf) electric fields [22]. It can be used to create a wide variety of designer-lattice geometries with arbitrary trap arrangements, opening new avenues for simulating condensed matter systems and for quantum information processing with ultracold atoms on atom chips. The planar patterns generated by the algorithm are simple to fabricate and can be straightforwardly implemented in existing experiments. Currentcarrying wires tracing the edges of the optimized patterns represent an alternative experimental implementation of our results [23].
In the first part of the paper we give an overview of the defining properties of magnetic films (Section II A) and Ioffe-Pritchard traps (Section II B), followed by a description of the linear programming algorithm (Section II C). We then turn to the results of the algorithm (Section III). To highlight the flexibility of the method we focus on two desirable lattices we can generate: one square lattice and one triangular lattice, of interest for future experiments. These lattices offer tight confinement and a high degree of symmetry. In Section IV we consider typical trap parameters produced by these lattices arXiv:1006.4532v1 [quant-ph] 23 Jun 2010 and account for realistic imperfections such as finite lithographic resolution and inhomogeneity which could arise during fabrication. Section IV D discusses how these microtrap lattices can be loaded.

A. Permanent magnetic microstructures
For our present purposes of designing magnetic potentials we consider single-layer patterned magnetic thin films with perpendicular magnetization [19,21]. There is an analogy between such patterned magnetic films and an effective boundary current which would produce an equivalent magnetic field [23]. We describe magnetic fields as gradients B( r) = − ∇Ψ( r) of the scalar magnetic potential Ψ( r) [23]. In particular, the scalar magnetic potential generated above a thin (typical thickness δ z) permanently out-of-plane magnetized layer of material in the xy plane P is where µ 0 is the permeability of free space and M z is the remanent out-of-plane magnetization. Typical magnetic films achieve permanent out-of-plane magnetizations of the order of M z ∼ 10 6 A/m, and typical film thicknesses are of the order of δ ∼ 100 nm [19] (giving a magnetization current, or edge current in a wire implementation, of δM z ≈ 0.1 A); typical coercivities are around 500-1000 G, such that any external fields applied to create the microtraps do not cause remagnetization. The dimensionless function m(x, y) represents the spatial dependence of the magnetization current (i.e., the product of remanent magnetization and film thickness); we assume it to vary between 0 and 1 without loss of generality. The Green's function is and serves to propagate the planar Dirichlet boundary condition Ψ(x, y, 0) = 1 2 µ 0 δM z m(x, y) through space while satisfying Laplace's equation ∇ 2 Ψ( r) = 0.
We restrict our analysis to single-layer magnetization patterns with binary "step-like" magnetization (or thickness) variations, as they are relevant for current experiments due to the ease of patterning [19]. We note that the form of Eq. (1) is proportional to that which propagates an electric potential from an electrode plane into space [24]. Further, the shape constraints on a magnetization pattern are mathematically equivalent to those on rf electrodes for ion trapping, as will be shown in Section II B. This leads us to the conclusion that the optimization algorithm of Ref. [22], recently used to generate electrode patterns for ion trapping, is also ideally suited to designing new geometries of magnetic lattices for ultracold neutral atoms. In this sense the main goal of the remainder of this article is to find specific magnetization patterns m(x, y) which produce magnetic lattices of optimal strength (i.e., the stiffest and deepest magnetic traps for fixed magnetization current δM z ), given a set of constraints on trap arrangement and geometry.
Despite the mathematical analogies, there are several practical differences between the designs of rf ion traps and magnetic microtraps. These differences concern the spatial derivatives of the electric or magnetic scalar potentials necessary to produce stable trapping potentials. In what follows we detail the conditions necessary for generating magnetic trapping geometries of interest to current experiments.

B. Ioffe-Pritchard traps
Magnetostatic traps confine ultracold atoms of a specific hyperfine state |F, m F through a spatially varying Zeeman shift pseudo-potential [25] where g F is the level's Landé factor and µ B is the Bohr magneton. Unlike for rf ion traps [22], here the trapping minimum of V ( r) must be nonzero in order to prevent Majorana spin flips [25]. Ioffe-Pritchard (IP) type traps are the simplest traps which guarantee this property. Let us assume that we wish to trap atoms at several points r ( ) in space, with = 1, 2, 3, . . . indexing the various potential minima. Since the properties of each atom trap depend mostly on the local shape of the magnetic field, we require precise ways of specifying this shape in order to generate a desired lattice of atom traps. We base our analysis on a series expansion of the scalar magnetic potential around the trap points, where (r 1 , r 2 , r 3 ) = (x, y, z) are the Cartesian coordinates. The vectors u ( ) have components u i,j,k , respectively. In this notation, u ( ) = − B( r ( ) ) specifies the local magnetic field at the desired trap position (apart from external bias fields), while v ( ) is the local gradient tensor and w ( ) specifies the local magnetic field curvatures. As described in Ref. [25] the coefficients of Eq. (4) must be fully symmetric under permutation of indices and satisfy v ( ) since ∇ 2 Ψ = − ∇ · B = 0. We use these vectors and tensors u ( ) , v ( ) , and w ( ) as input parameters for our optimization algorithm (Section II C) in order to specify the shape and orientation of the magnetic field at the trap locations. In what follows we detail how these derivatives of Ψ are constrained to specific forms for representing a particular desired lattice of IP traps. The defining characteristics of IP traps are that each gradient tensor v ( ) has a zero eigenvalue associated with its 'Ioffe axis', and that the total local magnetic field ('Ioffe field' B I ) is parallel to this axis: v ( ) · B I = 0. We therefore fix the field gradient tensors v ( ) at the trap locations [for concrete examples we use Eq. (13)].
Although it is possible to produce self-biased magnetic microtraps which require no external fields [26], in practice a homogeneous external bias field B 0 is usually applied to produce the Ioffe field B I simultaneously at all trap sites. This dramatically simplifies loading the microtraps (see Section IV D) and ensures that the magnetic potential remains finite away from the film surface (allowing for deeper confinement). To ensure all traps have equal depths for a given bias field B 0 , we typically constrain the first-derivative vectors u ( ) to be equal, and align the Ioffe axes at all trap positions r ( ) . However, there are no a priori constraints on the actual values of these vectors and tensors.
If desired, additional constraints can be placed on the remaining two eigen-directions or the eigenvalues of the v ( ) , on the local fields u ( ) , or on the curvature tensors w ( ) in order to tailor the shapes, orientations and aspect ratios of the resulting trapping potentials. In particular, the curvature matrix of an IP trap, which defines the characteristic oscillation frequencies (trap stiffness), is given by It is important that all eigenvalues of these curvature matrices be positive for a certain homogeneous bias field B 0 = − B( r ( ) ) + B I , in order to simultaneously trap atoms at all the positions r ( ) . Unlike for rf ion traps [22], the three principal curvatures of IP traps are quite independent; prolate, spherical, oblate, and triaxial traps can be designed by judiciously choosing the conditions on the v ( ) and w ( ) as well as operating at specific Ioffe field strengths.
All constraints on the derivatives of Ψ are only specified relative to each other, not by their absolute values. The optimization algorithm of Section II C aims at discovering the magnetization pattern which satisfies the constraints outlined in this section while maximizing the absolute values of the derivatives of Ψ. The fact that Eq. (6) depends on the Ioffe field strength makes it difficult to introduce a dimensionless quantity describing the absolute strength of an optimized IP trap. However, it appears that jointly maximizing the v ( ) and w ( ) using our algorithm generally leads to deeper traps with higher trap frequencies, for fixed other physical constraints like the magnetization current δM z .

C. Optimization algorithm
The algorithm for finding the optimal magnetization pattern implementing a desired Ioffe-Pritchard trap array follows from Ref. [22]. We present it here in a more extended form.
The first step in optimizing the magnetization pattern m(x, y) consists of subdividing the atom chip surface into N small domains. The shapes of these domains are irrelevant for our purposes, and their number only serves to increase the resolution of the final magnetization pattern. It is not necessary that these domains cover the entire atom chip, that they lie in a single plane, or that they form a simply connected subset of the plane. For finite sets of traps the optimization may be performed on a finite-sized pattern in order to fully account for boundary effects. For large periodic lattices of traps it is useful to divide a single unit cell of the wallpaper group with the desired lattice symmetry into domains, and then assume that the same pattern is repeated indefinitely over the atom chip surface.
We assume that within a domain α covering an area P α of the atom chip surface, the scaled magnetization m(x, y) = m α is constant. The total scalar magnetic potential, Eq. (1), can then be decomposed into a sum over domains, where the functions are the scalar magnetic potentials induced by the domains indexed by α, assuming unit magnetization (since the term 1 2 µ 0 δM z m α has been factored out). The present algorithm can also be applied to different problems such as non-planar geometries, electrode patterns, or hybrid atom-ion traps by replacing Eq. (1) with more general expressions, or by evaluating Eq. (8) numerically using finite-element or boundary-element methods [27]. The derivatives of the scalar magnetic potential are similarly parametrized etc. With these definitions the linear conditions of Section II B can all be expressed in terms of the scaled domain magnetizations m α without knowing their values a priori. We define m as the vector with components m α , which represents the optimal magnetization pattern to be found, restricted to m α = 0 or m α = 1 for nonmagnetic or fully magnetized domains, respectively. Using this notation, each linear condition of Section II B can be formulated in the form a k · m = Cb k , where C is a common prefactor in all conditions and k indexes the different constraints. As in Ref. [22] the conditions of Section II B are never imposed as absolute numbers but only relative to each other, while their absolute magnitudes (through the prefactor C) are jointly maximized by the algorithm in order to achieve maximal strength of the Zeeman pseudo-potential for a given magnetization current δM z . All these conditions can be jointly expressed as a matrix equation with |C| to be maximized.
In periodic arrays of microtraps the magnetization pattern is most naturally expressed in terms of its Fourier amplitudesm(k x , k y ) = F[m(x, y)]. Instead of using the Green's function of Eq. (2), the propagation of the scalar magnetic potential away from the atom chip then follows from the exponential damping of each Fourier component, where Re[. . .] refers to the real part. Since the Fourier transform is a linear operation, these Fourier amplitudeŝ m(k x , k y ) can be expressed as linear functions of the domain magnetizations m α . Any linear constraints on the Fourier amplitudes can therefore also be brought into the form a k · m = b k and thus included in Eq. (10). However, we will not be using such direct Fourier constraints in our examples (Section III). The physical constraints describing the design for an atom trap lattice are thus formulated in the matrix equation of Eq. (10). If the number of domains N is large, then this linear system of equations is highly underdetermined. Which of the solutions should we choose? The inhomogeneous solution m 0 = A + · b, calculated from the pseudo-inverse A + , incorporates the main structure of the magnetization pattern we will generate. However m 0 does not satisfy the constraint that m α ∈ {0, 1}: its components are not normalized in any useful way, and they take on a continuum of values. To remedy this we decompose the target solution into m = C m 0 + m with A · m = 0. Any vector of this form satisfies Eq. (10); but it serves to illustrate that the solution m should consist of the maximum possible contribution in the inhomogeneous direction m 0 (since we wish to maximize |C|) plus just the right amounts of homogeneous solutions (in m ) in order to satisfy the binary constraints. Now we de- The optimization problem can then be expressed as a homogeneous binary integer linear program (Ã, m 0 , {0, 1}), which schematically reads thus: (i) We seek a vector m within the space satisfying the linear constraintsÃ · m = 0. This gives a set of homogeneous conditions on m which do not involve the constant C, and which express the fact that the solution m must satisfy the design constraints for the atom trap configuration, Eq. (10).
(ii) All components of the vector m must satisfy m α ∈ {0, 1}. This condition expresses the desire for a binary magnetization pattern, consisting only of nonmagnetic domains (m α = 0) and fully magnetized domains (m α = 1).
(iii) We wish to maximize |C| = | m · m 0 |/ m 0 2 , the "strength" of the solution in the inhomogeneous direction satisfying the design constraints. Larger values of |C| yield stronger atom confinement for a given magnetization current δM z .
Such integer linear programs are known to be NP-hard to optimize [28], if an exact solution even exists. Fortunately, and perhaps surprisingly, we can relax condition (ii) to 0 ≤ m α ≤ 1 ∀α = 1 . . . N without loss of accuracy but drastically decreasing the computational complexity to O(N ), making large numbers of domains (high resolution) feasible. After relaxing condition (ii) we are dealing with a linear program (Ã, m 0 , 0 . . . 1), for which very efficient algorithms are available [29]. The solution to the linear program is known to be globally optimal [29], and the obtained solutions consist of relatively large uniform patches of magnetization railed at either m(x, y) = 0 or m(x, y) = 1. Further it is known that the number of domains α which are not railed is equal to the number of independent constraints in Eq. (10) [22]. Since the number of domains can be made arbitrarily large, we are thus guaranteed to find solutions in which the ratio of un-railed to railed domains can be made vanishingly small. In practical cases the few un-railed domains usually come to lie at the edges between large railed patches and can be safely rounded to 0 or 1.

limitations of the algorithm
The optimization algorithm of the preceding section is a powerful new tool for designing magnetic lattice potentials with arbitrary geometries and trap characteristics. There are, however, some limitations which deserve mention.
Although any magnetization pattern generated by the above algorithm is guaranteed to produce the desired lattice of magnetic microtraps, it disregards the shape of the Zeeman pseudo-potential between microtraps. While this point is not critical in ion trapping applications [22], it may be of great interest for atom trapping to have efficient tunneling paths between microtraps. To this end it may be necessary to add further linear constraints on the scalar magnetic potential.
Generally, for trap stability the resultant Zeeman pseudo-potentials should not contain any points of zero magnetic field in the vicinity of the traps, since they will lead to trap losses due to tunneling from the IP traps and subsequent Majorana spin flips [25]. It is therefore more important than in ion trap setups that after a magnetization pattern m(x, y) is optimized, we check the corresponding Zeeman pseudo-potential for spurious null points. Such points can appear at unexpected locations which depend on the external bias field B 0 = − B( r ( ) )+ B I , and can often be eliminated through additional constraints on Ψ. To enforce complete elimination at the design stage of the algorithm would require non-local field constraints, which are difficult to implement directly in the optimization algorithm. Fortunately, for geometries involving only a few constraints (like the examples in Section III), the optimized magnetic potentials rarely contain any field zeros, as spurious minima would reduce the achievable Zeeman pseudopotential strength at the nominal trap positions. In more complex cases such as magnetic superlattices with multiple traps per unit cell, or lattices of traps involving higher curvature constraints [for example from Eq. (6)], it may become favorable for magnetic field zeros to occur at points of special symmetry or even anywhere in the trap lattice. In these situations extra care should be taken in choosing appropriate additional constraints for the algorithm to eliminate or shift the spurious zeros from the trapping regions.
It may be of interest to directly constrain the symmetry of the Zeeman pseudo-potential. As an example, the triangular lattice we present in Section III A 2 has a high degree of symmetry with equal barriers between sites chosen to allow for symmetric tunneling. However, direct symmetry constraints on the potential are quadratic in the coefficients m α and thus cannot be incorporated into the linear form of the algorithm. This could be partly overcome through the use of nonlinear optimization algorithms which allow both linear and nonlinear constraints on the magnetic field and pseudo-potential respectively. We have applied a nonlinear optimization algorithm to some problems; however, we find it considerably slower and limited in the achievable resolution when compared with the linear programming algorithm.

implementation
The linear optimization algorithm has been implemented independently in the Mathematica and Matlab programming environments for the general case of twodimensional Bravais lattices, where each unit cell consists of N = n 1 × n 2 identical parallelogram-shaped domains. Further, a Mathematica implementation allows optimizing non-periodic (finite) patterns with arbitrary polygonal domain shapes. All implementations use primaldual interior-point algorithms for solving the linear programs [30] and yield consistent results for the obtained optimal magnetization patterns. The typical number of domains (or Fourier modes) used in the periodic optimization is N ∼ 200 × 200 which yields smooth magnetization patterns and is a sufficiently high resolution to ensure that the corresponding magnetic potentials are precisely defined.

III. OPTIMIZED LATTICES
In this section we present results for two-dimensional periodic lattices with a single microtrap per unit cell. As discussed in Section II B, the simplest IP atom traps are constructed by constraining the magnetic field gradient to be of the form at the desired trap locations, where R φ,θ,ψ is a rotation matrix with three Euler angles specifying the orientation of the IP trap axis, ν = {sin θ sin ψ, sin θ cos ψ, cos θ}, and the orientation φ of the two perpendicular axes around this direction. The local field vector u can be left unconstrained since we are free to apply any external homogeneous bias field B 0 in order to null the local magnetic field at the traps. We have run the optimization procedure for a large set of Euler angles and computed the corresponding optimal lattice geometries. In practice we find that IP traps with in-plane Ioffe axis orientation (θ = π/2) provide good confinement, in contrast to out-of-plane traps (θ = 0) which typically result in weak or no confinement perpendicular to the surface [in the absence of curvature constraints, Eq. (6)]. We stress however that the algorithm described in Section II C is general, and constraints on all derivatives of the scalar potential (u i , v i,j , w i,j,k , and higher) can be applied to obtain any desired trap shape or orientation. In the following we give a general and two specific examples of in-plane (θ = π/2) IP magnetic lattices, chosen for their desirable properties for future planned experiments with ultracold atoms.

A. Two-wave lattices
An interesting class of IP trap arrays with in-plane Ioffe axis can be described by the three-dimensional scalar magnetic potential with α = tan −1 cos(ψ+ζ) cos ψ . It forms an oblique lattice of IP traps above the points r = n 1 {d, 0} + n 2 {d cos ζ, d sin ζ} with (n 1 , n 2 ) ∈ Z 2 , where d is the lattice period. Their Ioffe axis is {sin ψ, cos ψ, 0}, in accord with Eq. (13) for θ = π/2 and φ = π/4. The trapping height h is selected through the bias field, which must cancel the field (15) perpendicular to the Ioffe direction. What is special about these trap arrays is that there is a particular Ioffe field strength such that the Zeeman pseudo-potential (12) is invariant under exchange of the lattice axes (wallpaper group cmm), irrespective of ψ. In particular this gives rise to equal tunneling barriers in the two lattice directions. It is interesting to note that this cmm symmetry is present neither in the magnetization pattern m(x, y) ∝ Ψ(x, y, 0) nor in the bias or Ioffe fields. Therefore, using the optimization algorithm of Section II C to find binary magnetization patterns which optimally produce scalar potentials like Eq. (14), we can obtain experimentally relevant and non-trivial systems which are otherwise difficult to discover using manual methods. In what follows we perform such calculations to construct approximately cmmsymmetric square and triangular lattices of IP traps.

square lattice
Square lattices are commonly produced using optical potentials but are a considerable challenge to implement with magnetic lattices, as the high degree of symmetry typically results in points of zero magnetic field strength which lead to Majorana spin flips [25]. However, from Eq. (14) with ζ = π/2 such square lattices of IP traps are readily generated with our algorithm. All values of ψ except integer multiples of π/4 are allowed; angles ψ close to π/4+nπ/2, n ∈ Z, give maximal trapping depth.
A possible implementation of such a square lattice of IP traps is found by constraining the second derivative tensor of the scalar magnetic potential at the trapping sites to its value dictated by Eq. (14), The first and third derivatives u and w are left unconstrained. In Fig. 1 we show 2 × 2 unit cells of the optimal magnetization pattern which generates this gradient tensor for ψ = π/3 and nominal trapping height h = d/2, i.e., half the inter-trap distance. The obtained pattern is typical in that it consist of large connected regions of uniform magnetization with equal areas of magnetized and non-magnetic regions. Furthermore, the pattern resembles the 'staircase'-like structure recently experimentally demonstrated to create a two-dimensional lattice of IP traps [19,21]. This shows that the optimization algorithm can produce magnetization patterns which resemble manually optimized lattice configurations. The trapping height h is chosen by varying the bias field strength and direction. For h = h the curvature tensor may differ from Eq. (17); however, det v(0, 0, h ) = 0 for any desired trap height, and therefore we are guaranteed to be able to produce IP traps everywhere on a vertical loading trajectory. Details of a method for loading such trap arrays are described in Section IV D. Fig. 2 shows the associated Zeeman pseudo-potential in the trapping plane, brought close to cmm symmetric by using an Ioffe field strength which creates equal potential barriers in the two lattice directions [similar to Eq. (16)]. Notice that the cmm symmetry is not exact because the higher-order Fourier modes used to construct the binary  Fig. 1 at a Ioffe field strength which creates equal potential barriers (dashed separatrix) between the potential wells (blue points) in the two lattice directions (16). Darker colors signify deeper potentials. magnetization pattern (Fig. 1) perturb the simple expression of Eq. (14); neither the magnetization pattern nor the Ioffe direction are cmm symmetric, and therefore there is no a priori reason why perfect cmm symmetry should be achievable in the Zeeman pseudo-potential. However, for sufficient nominal trapping heights h/d this asymmetry may be negligible in practical applications (it is less than 3% of the potential range in Fig. 2). Further, by a slight tuning of the Ioffe field strength we can force the effective tunneling rates for trapped atoms in the two lattice directions to be exactly matched. This lattice is highly tunable: by varying the external bias field and the Ioffe field strength the barriers in the x and y lattice directions can be tuned independently, allowing time-dependent control over anisotropic tunneling rates.

triangular lattice
Ultracold atoms in triangular lattices are of great experimental interest as they exhibit a wide variety of novel quantum phases [31][32][33]. However the considerable challenge involved in optically producing triangular lattices has so far limited experiments to a single recent realization [34]. The optimization algorithm is equally easily applied to produce triangular magnetic lattices, found from Eq. (14) with ζ = π/3. For triangular lattices it would be desirable to have a Zeeman pseudo-potential which is not just cmm-symmetric, as given by Eq. (16), but fully p6m-symmetric in order to have three equivalent tunneling directions and a truly isotropic lattice. Unfortunately, as mentioned in Section II C 1 such symmetry requirements involve nonlinear constraints beyond the linear programming method. However, we find that sufficiently symmetric lattices can be obtained by applying additional linear constraints at the barrier positions.
In Fig. 3 we present a magnetization pattern which produces a useful triangular lattice of microtraps with equal barrier heights in three directions, and nominal trapping height h = d/2. The required constraints include the gradient tensor at the trap sites given by Eq. (17) with ψ = 5π/12, as well as an additional field constraint at one of the barrier positions at {x, y, z} = {d/2, 0, d/2}. The required field constraint is u y obtained automatically by nesting the linear programming algorithm within a nonlinear search algorithm aiming to null the pseudopotential barrier height difference (Fig. 4). This two-level approach is possible due to the speed of the linear programming algorithm. Although the resulting pseudopotential is not fully p6m symmetric, the effective tunnelling rates between traps could be matched experimentally by varying the Ioffe field strength B I and the trap height to independently tune the potential barriers in all three directions. As for the square lattice of the preceding section, the trapping height h is chosen by varying the bias field strength and direction, and a vertical loading trajectory of IP traps can be produced (see Section IV D).  Fig. 3 at a Ioffe field strength which creates equal potential barriers (dashed separatrix) between the potential wells (blue points) in the three lattice directions (16). Darker colors signify deeper potentials.

A. Trapping parameters
The lattice geometries of Section III provide high trap depths and strong confinement for magnetically trapped atoms. In the following we calculate the resulting trap parameters, assuming realistic parameters for a FePt thin film [19] with M z = 670 kA/m and δ = 0.3 µm (magnetization current δM z = 0.2 A) trapping 87 Rb atoms in the F = 2, m F = 2 hyperfine state of the 5 2 S 1/2 electronic ground state (g 1 = −0.501 826 71(5) and g 2 = 0.499 836 43 (5) in this level [35]). A small but optically resolvable lattice period of d = 5 µm is chosen so that nearest-neighbor interactions such as the Rydberg blockade effect would be observable [36,37].
These lattices provide sufficiently tight confinement to localize the atoms to smaller than the optical wavelength. The Lamb-Dicke parameter is η j = ω recoil /ω j where ω recoil = 2π × 3.771 kHz for the 87 Rb D 2 line. For the transverse dimensions η < 0.18 and the atoms would enter the Lamb-Dicke regime (η 2 n 1) for mean vibrational quanta n ≤ 30. The magnetic fields and Zeeman pseudo-potential strengths for the given examples scale with δM z /d and the trap frequencies scale with δM z /d 3 .

B. Microfabrication
The proposed magnetic lattices can be easily produced using conventional microfabrication techniques. Successful methods used in the past have included magnetooptical recording [38][39][40], hard-disk write head [20], grooved substrates and uniform film coating [41,42], laser ablation [43], and optical or e-beam lithography followed by reactive ion etching [19,44]. We favor lithography and ion etching since they provide greater freedom in the films used, arbitrary magnetization patterns are possible, and they can be readily extended to sub-micrometer resolution. Lithographic resolutions 50 nm are possible with e-beam lithography, but long exposure times may be required to produce reasonably large lattices. Optical lithography is comparatively simple and can produce vast lattices; however the achievable resolution is limited by diffraction within the photo-resist layer to typically 1 µm.
The optimized magnetic patterns are highly compatible with lithographic patterning, as they involve large connected magnetized regions with smooth boundaries. The effect of finite resolution is qualitatively equivalent to truncating the Fourier series expansion of the magnetic scalar potential. Because the contributions of higher Fourier modes (corresponding to small features) on the magnetic pseudo-potential decay rapidly with distance from the surface [Eq. (11)], the shape of the potential at the trap position is relatively insensitive to the fine details of the magnetization pattern. For a more quantitative analysis, a perturbative study of the dependence of the pseudopotential on the magnetization in a given domain is readily performed with the parametrizations of Eqs. (7), (9) etc. used in the optimization algorithm.
We have compared the trapping potentials produced by the optimized lattices at full numerical resolution to calculations with truncated Fourier series. Taking the triangular lattice as an example, we find that the lowest 13 Fourier modes ( k ≤ 2 × 2π d ) are sufficient to adequately reproduce the desired potential (Fig. 4). This corresponds to an effective resolution of π/ k = 0.25d. For the d = 5 µm period lattice this would require a resolution of better than ∼ 1.2 µm, which can be achieved by optical lithography. With the reduced set of Fourier modes we find the pseudo-potential in the trapping plane maintains its symmetry and deviates from the full resolution calculation (Sec. III A 2) by at most 1.5%. The trap depth increases by 0.4% while the barrier heights decrease by 0.2-0.4%; the trap frequencies increase by 0.4%, 0.1%, 1.1% in the z, y, x directions.

C. Effect of inhomogeneity
The quality of the magnetic lattices may also be affected by film roughness or magnetization inhomogeneity [17,45]. These lead to an additional randomly oriented magnetic field above the surface which causes small site-to-site variations in the potential experienced by the atoms. A simple model which takes into account random (white noise) fluctuations of the magnetization at a position above the edge of a magnetic film layer [45] is used to estimate the potential energy variations between lattice sites. A typical rms surface roughness of around 5 nm and grain size of 50 nm would cause unwanted variations of less than 20 mG corresponding to energy variations of less than 30 kHz. A more significant contribution may be due to imperfect magnetization and canting of magnetic domains. For a typical remanent-to-saturation magnetization ratio of 0.95 (squareness of the hysteresis loop) and a characteristic domain size of 50 nm, we anticipate additional variations of 60 mG (85 kHz). The estimated combined effect of surface roughness and magnetic inhomogeneity is comparable to or less than the vibrational level spacing and is therefore not expected to be a serious obstacle for experiments. The anticipated site-tosite variations could be reduced further with high quality Fe/Pt or Co/Pt multilayer thin-films, which can be atomically flat with small magnetic domains and higher squareness ratios [46].

D. Loading trajectory
Atoms can be transferred to the proposed lattices simply using an auxillary macroscopic Z-shaped wire beneath the chip surface [19]. An electric current through the Z-wire combined with an external bias field produces a single Ioffe-Pritchard magnetic trap [47], hundreds of micrometers above the film surface where the influence of the magnetic lattice is negligible.
We have computed a loading trajectory which smoothly transfers atoms from the Z-wire trap to the magnetic lattice potential generated by the pattern of Fig. 3 and a lattice spacing of d = 5 µm. We assume a Z-wire positioned 0.4 mm beneath the magnetic film, with a central segment of L = 1 mm oriented such that its Ioffe axis matches that of the microtrap lattice at the nominal trap height h = 2.5 µm. In this symmetric situation det v(0, 0, z) = 0 ∀z > 0 for the total scalar magnetic potential (lattice + Z-wire), and thus for any desired trapping height h we can still find a homogeneous in-plane bias field B 0 which creates IP traps [25]. By smoothly ramping down the Z-wire current or increasing the bias field strength, the trap minimum moves toward the surface and the Z-wire trap eventually merges with the lattice microtraps.
For each trapping height between h = 100 µm and h = h = 2.5 µm, the bias field ( B 0 ) and Z-wire current (I z ) are optimized to maintain a trap depth equal to or greater than the final depth in the lattice of > 16.5 G to prevent loss of atoms during loading [ Fig. 5(a)]. The Ioffe-field strength is chosen to start at B I = 2 G and increases during the trajectory to its final value of B I = 9.8 G to create a symmetric triangular lattice (Fig. 4). Initially the atoms are confined in the large potential well of the Z-wire trap at h = 100 µm, however the superimposed field of the lattice produces shallow secondary potential wells at z ≈ 3 µm [ Fig. 5(b)]. The magnetic field strength as a function of height z during the loading trajectory is calculated at the position of the global minimum in the xy plane. As the fields are varied to move the Z-wire trap closer to the surface the minima approach, and at a distance of around h ≈ 10 µm atoms can spill over to the secondary traps [ Fig. 5(c)]. At this stage a thermal atom cloud would begin to fragment. Evaporative cooling in the combined Z-wire+lattice trap may be very efficient as the local phase-space density could be high in the small potential wells [48][49][50]. Finally the Zwire current is ramped off completely and the atoms are confined by the lattice potential alone [ Fig. 5(d)]. The precise number of traps that can be loaded in this way is difficult to estimate since it depends on the temperature of the clouds during loading and the rate of transfer. In practice, it seems possible to load a 1.5 × 0.5 mm 2 region of the lattice [21], corresponding to ∼ 3 × 10 4 populated microtraps. Throughout the transfer we ensure no field zeros are produced in the vicinity of the atoms, such that Majorana spin flip loss can be neglected. Additionally, the field strength at the film surface is B > 120 G in the z = 1 µm plane, corresponding to a repulsive atomsurface barrier much greater than the attractive Casimir-Polder potential, thus preventing atom loss to the surface.

V. CONCLUSIONS
We have introduced a linear programming algorithm tailored to the problem of designing two-dimensional magnetic lattices of Ioffe-Pritchard traps for ultracold atoms. Previously, the design of such lattices required substantial experience and trial-and-error. The algo- rithm automatically generates single-layer binary magnetization patterns which produce desired lattice symmetries with specified trap parameters. It allows for designing non-trivial geometries which would be extremely difficult to obtain using manual methods. The strengths of the algorithm were exemplified in a desirable square magnetic lattice and in the new case of a triangular magnetic lattice potential. The generated magnetic patterns consist of smooth connected regions of uniform magnetization, which are easily fabricated using existing methods. With realistic magnetic-film parameters these lattices will produce vast arrays of microscopic IP traps with tight confinement and high trap depths. The resulting potentials are of great interest for studies of quantum gases in lattice potentials [6,7,34], condensed-matter analog systems [8,[31][32][33], or quantum information processing with neutral atoms [9][10][11][12][13][14].
The similarities between the algorithms for designing magnetic Ioffe-Pritchard traps and electric radiofrequency (rf) ion traps could be exploited to produce hybrid traps, as a natural route to confine individually controlled rf-trapped ions within magnetically trapped ultracold quantum gases [51,52]. By appropriate changes of the external bias field the neutral atoms could then be moved to overlap with the ions or separated from them in a well-controlled manner. Further, once the ions are cooled to their motional ground state the rf traps can be switched off, transferring the ions to the magnetic microtraps (provided that their magnetic moments are appropriate) in order to eliminate rf micromotion [53,54]. In practice one possible approach would be to add extra constraints in Eq. (10) to produce patterns that simultaneously provide magnetic traps for neutral atoms and, by applying rf voltages directly to the proposed magnetic structures (provided their rf impedance is suitable), rf traps for ions at the same sites or at sites of our choice. Alternatively one can pattern an appropriately shaped conductive rf layer on top of the magnetic structures, thus decoupling the patterns for atom and ion traps.