Deterministic preparation of a dual-species two-ion crystal

The demand for efficient preparation methods for dual-species ion crystals is rapidly expanding across quantum technology and fundamental physics applications with trapped ions. We present a deterministic and efficient technique to produce such crystals, utilizing the segmented structure of a linear Paul trap. By precisely tailoring the trapping potentials, we can split, move, and discard parts of an ion chain. This process is automated in a sequence that converts a larger ion sample into the desired configuration. A critical component of our approach is the accurate identification of crystal constituents. This is achieved by matching the measured positions of fluorescing ions against theoretical expectations for larger crystals, thus facilitating the detection of non-fluorescing ions and enabling accurate ion counting. We demonstrate that our method reliably produces two-ion crystals within minutes. These results represent a significant advance in the production of two-species ion crystals with applications ranging from quantum logic spectroscopy and optical clocks to quantum computing and simulation with trapped ions.

Here, we present a technique for preparing such a dualspecies two-ion crystal.The process relies on modifying the confining dc potentials to iteratively split a dualspecies ion chain.The constituents of each sub-crystal are detected and the more favorable one is kept in the trap, while the other one is expelled from the trap.Repeating this process successively reduces the size of the ion chain, finally leading to a dual-species two-ion crystal.While the composition of the sub-samples after the splitting operation is probabilistic, the possibility of remerging and repeating the splitting renders the entire preparation scheme deterministic.Ion detection is based on position-resolved fluorescence detection of one ion species and from that inferring the other non-fluorescing ion species' position.
Different techniques can be used to load ions into a radiofrequency trap, such as ionizing an atomic vapor from an electrically [45] or optically heated oven [46], a laser cooled atomic cloud [47,48] or by ablating atoms with a laser [49,50].All of those approaches have advantages and drawbacks.
Typically, oven loading is slower than ablation loading.More rapid buildup of atom flux for faster loading can be achieved by increasing the oven temperature [51], but leads to a high background pressure inside the vacuum chamber.Loading from a pre-cooled ensemble of atoms requires substantial technical overhead and suitable laser cooling transitions for the atomic species.For ablation loading, there is a trade-off between fast loading and control over the exact amount of ions, since the loading process is governed by Poisson statistics [52], which means that higher laser intensities yield a higher probability of successful loading, but results in a loss of control over the ion number.Additionally, variations in beam pointing, target surface degradation and laser intensity have a strong impact on the number of loaded ions [50,[53][54][55][56][57][58].
These limitations for ablation loading can be alleviated by subtractive preparation schemes, where a larger ion crystal is loaded and then reduced to the desired size by removing selected ions.In addition to the improved robustness of these schemes, large crystals of laser-cooled ions provide faster sympathetic cooling for co-trapped species that cannot be laser-cooled directly.This circumvents the problem of long crystalization times that have been observed for example in aluminum quantum logic clocks [29,38,59] or recapture of highly charged ions [60].
In previously demonstrated subtractive schemes [61][62][63], the removed ions are selected by their charge-to-mass ratio making it difficult to control the exact number of remaining ions.Furthermore, different ionic species with similar charge-to-mass ratio cannot be individually removed, which can be relevant for molecular or highly charged ion experiments.Unlike previously demonstrated methods, the ejection approach presented here is independent of the ion species being removed.As a result, this approach offers the capability to generate dual-species ion crystals with arbitrary composition.An extension to multi-species ion crystals is possible if the composition of the ensemble can be determined.

II. EXPERIMENTAL SETUP
The experiment at hand is a trapped ion spectroscopy setup.We use a linear Paul trap, for trapping ions at ultrahigh vacuum (<10 −10 mbar).A CAD-render of the trap can be found in Fig. 1.The distance between electrodes and the ions is 0.5 mm.The two opposing dc blades are segmented into five electrodes each, which can be individually addressed to provide axial confinement.With these segments, a double-well potential, resulting in two axially separated trapping regions, can be realized.A more detailed description of a similar trap and its construction can be found in [64].The experiments described here were performed with 40 Ca + and 25 Mg + ions.The calcium ions are laser-cooled with light at 397 nm.The resulting fluorescence of the ions is imaged on an Electron Multiplying Charge-Coupled Device (EMCCD) camera using a single aspheric lens.The magnesium ions are not laser-cooled and therefore not directly detectable by the imaging system, but appear as dark defects in the coulomb crystal.
Both ion species are loaded via ablation loading with a matchbox-sized laser at 515 nm (Mountain Photonics GmbH, IOP 0515L-21C-NI-NT-NF).The laser is pulsed with a repetition rate of 3.5 kHz and provides pulse powers of approximately 30 µJ.It can either be focused onto a calcium or magnesium target inside the vacuum chamber, using a motorized mirror.The ablated calcium ions are photo-ionized, resembling the scheme described in [65].Magnesium-25 is loaded from an enriched target without an ionization laser, similar to experiments with other species [58].
After ion loading, the trapping parameters fulfill ω x,y ≫ ω z , where ω x,y are the radial and ω z the axial trap frequencies of a single trapped ion.In our case these values are ω x = 2π×750 kHz, ω y = 2π×950 kHz and ω z = 2π×143 kHz.This configuration results in the ions aligning in a linear chain along the axial trap direction, see Fig. 2.

III. ION DETECTION
To determine the composition of a dual-species crystal containing calcium and magnesium ions, two detection steps are required.For laser-cooled calcium ions the employed imaging system resolves the individual ions, which are typically separated by a few micrometer for the used trap settings, see Fig. 2 a).Therefore the calcium ions' positions can be extracted by detecting fluorescence peaks in the camera image.These measured positions are compared to pre-calculated theoretical values [66] for ion crystals of different sizes, revealing information about the number of non-fluorescing magnesium ions present in the crystal.This process is discussed in detail in the following sections.

III.1. Bright ion detection
To detect the bright calcium ions' positions and quantity, an image is taken using an EMCCD camera with a 14 bit brightness resolution and an exposure time of 0.2 s, see Fig. 2 a).The image quality is compromised by noise, predominantly electronic noise, background photons and defective (bright) pixels.In order to mitigate this noise, the image is post-processed.False ion detections due to single bright pixels are effectively suppressed by applying a gaussian filter with a width of one pixel and setting pixels below a certain threshold to zero brightness.A good initial guess for this threshold is provided by the "otsu" threshold determination from the python scikitimage module (skimage.filters.thresholdotsu, V0.20.0, [67]).Lower detection errors are obtained by increasing this threshold by 200 (out of the full dynamic range of 14 bit), which was determined in a heuristic approach.A detailed description of the Otsu threshold determination can be found in reference [68].
Afterwards, the peak detection function (skimage.feature.peaklocal max, [67]) from scikit-image is used to determine the bright ions' positions with a resolution of one pixel.To avoid double counting of single ions, we chose a minimum distance of six pixels (approx.4 µm) between detected ion positions.
The bright ion detection works well for linear ion chains and slight zig-zag configurations with up to approximately 20 ions.An example for this process can be found in Fig. 2 b).

III.2. Dark ion detection
In the experiments described here, magnesium ions are not laser-cooled and thereby cannot be detected via fluorescence imaging.However, when the bright calcium ions' positions are determined, the dark magnesium ions quantity and location in the crystal can be inferred.This is done by comparing pre-calculated equilibrium positions to the detected positions of the calcium ions.A similar method has been used to count ions in a long chain, where only the central part of the chain was imaged [69].
Since the ion chain is mostly aligned along the vertical camera axis, we only consider the ions' vertical position component.
The equilibrium positions of ions in a linear chain are calculated following [66].In order to map the calculated ion positions to an expected pixel position on the camera P theo j , a calibration is needed, as described in Appendix A.
The total number of bright and dark ions n is determined by minimizing the measure b(n), defined as which is the mean distance of the measured ion positions P i of the fluorescing ions to the closest theoretically determined position P theo j (n).n bright is the number of fluorescing ions, determined by the previously described measurement.The number of dark ions n dark is determined by subtracting n bright from n.For the minimization of b(n), the total number of ions was limited to n < min(2n bright , 23).This choice helps to mitigate detection errors as described in Section III.3.The normalization of b(n) to the number of bright ions is analogous to a reduced χ 2 analysis and allows comparing the quality of the fit between crystals of different sizes.
The result of such a dark ion position determination can be found in Fig. 2 c), with typical deviation between detected and calculated ion positions below one pixel, see Fig. 2 d).

III.3. Benchmark and limitation
In order to benchmark the performance of the dark ion detection scheme, it was run on a dataset with sample size 205 456.The data was generated by recording ion chains with lengths of up to ten fluorescing ions.The previously described process was used to infer the camera position P i of the fluorescing ions.Dual-species ion chains were simulated by selectively removing position data from the purely bright dataset.The dark ion detection algorithm was used to predict the ion chain configuration.In this implementation of the detection algorithm a maximum number of 20 ions was assumed.Fig. 3 a) illustrates the detection error for different ratios of dark and bright ions.Each scatter represents one particular configuration of ions.Configurations with a larger fraction of dark to bright ions are more prone to detection errors.Also configurations with n bright > n dark can be detected incorrectly.These false detections are caused by falsely assuming an ion chain with n bright < n dark .The resulting errors can be mitigated by restricting the theoretical configurations, that are compared to the bright ion positions to configurations with n ′ bright ≥ n ′ dark .When describing restrictions for the detection algorithm, a prime ( ′ ) is added to the ion number.Fig. 3 shows that this restriction suppresses errors entirely for configurations with n bright ≥ n dark , at the cost of restricting the detection algorithm to this subset of configurations.Experimentally, this precondition can be easily met by an appropriate choice of loading parameters.The condition n ′ bright ≥ n ′ dark can be generalized by introducing the limiting ratio n ′ bright /n ′ dark .The previously described precondition corresponds to n ′ bright /n ′ dark ≥ 1. Fig. 3 c) shows the detection error in dependence of the limiting ratio and illustrates the trade-off between a low average detection error and a large number of detectable configurations.In all experiments described here, a limiting ratio of n ′ bright /n ′ dark = 1 was used.More details regarding the origin of the detection errors can be found in

Appendix C.
Additionally there are technical limitations of the detection scheme, restricting its application to 23 ions with the parameters used.Larger ion numbers lead to formation of 3D crystals for the chosen trapping parameters.These structures cannot be interpreted by our detection method.To align larger ion crystals linearly, a higher radial confinement is necessary, which is infeasible in our setup.In general, increasing the ion number increases the ion density in the center of the trap for a given axial confinement.Therefore it becomes more difficult to distinguish between ion chains with similar ion numbers.Overcoming this limitation would require higher spatial resolution of the imaging system or operating at a lower axial confinement to get a larger separation of the ions.The implementation presented here does only determine the ions position P i with one pixel resolution.More advanced peak detection methods could be used to interpolate the region between camera pixels, thereby providing higher resolution.Decreasing the axial potential has its limits, as a very low axial confinement leads to fluctuating ion positions, because the position becomes much more sensitive to external electric field perturbations.Also, increasingly larger ion chains may no longer be within the detection region.

IV. ION OPERATIONS
The presented ion crystal preparation procedure relies on splitting an ion chain into two parts, and discarding the side which is further from a desired target crystal.The decision logic is depicted in Table I.In total, four different operations on the ion crystal are required: 1 splitting the ion chain into two sub-chains, 2 shuttling a sub-chain into the detection region, 3 determination of the composition of an ion chain, and 4 selectively discarding one of the sub-chains (left/right).These operations are implemented by applying different sets of voltages to the individual dc electrodes, realizing the required potential landscapes.The applied voltages in our realization of this method can be seen in Fig. 4.
For the splitting operations, the ions are initially confined in a shallow potential (ω z = 2π×143 kHz) and the voltage on the center electrode (V 3 ) is gradually increased, forming a double-well potential that splits the ion chain in two parts.Nomenclature of the blade segments can be found in Fig. 1.The ratio of ions in the left and right well of the potential can be controlled by shifting the equilibrium position of the ions in the axial direction before splitting.This is done by applying an additional differential voltage ∆U to the outer electrodes (V 1 and V 5 ).A measurement of the dependence of the splitting ratio on the differential voltage is shown in Fig. 5. From these measurements, ∆U can be set such, that the ion crystal is split in half.More details can be found in Appendix B. This splitting ratio voltage is applied to all ion operations.
The minima of the double-well potential formed at the end of the splitting operation are outside of our imaging region.Therefore for determination of the constituents, a shuttling operation is required to move one of the subchains back, while keeping both parts separated.This is achieved by increasing the outer electrodes' voltage on one of the sides: V 1 (or V 5 ) and applying a small trapping potential with the inner electrodes (V 2 and V 4 ).
When one of the sub-chains is shuttled into the imaging region, the other sub-chain is trapped in the region of the outer electrode.There, confinement in axial direction is partially provided by the voltage on electrode V 4 (or V 2 ) and the axial component of the rf potential in the outer region of the trap.
The last required operation is the ejection of the unwanted sub-chain from the trap.This operation is implemented by setting one side of the outer electrodes to 19 V at V 1 (or V 5 ) and increasing the center voltage, V 3 , to push the ions, trapped in one of the double-well minima, out of the trap, while the other ion sub-chain remains trapped.

V. AUTOMATION
Combining the previously discussed operations with the ion detection protocol allows to automate the process for dual-species two-ion preparation.Our implementation of this automation was integrated into the Advanced Real-Time Infrastructure for Quantum physics (ARTIQ) framework [70].

V.1. Ion preparation scheme
The automated two-ion crystal preparation starts by loading a dual-species ion chain.We select the loading parameters such, that the number of bright ions is larger than the number of dark ions, i.e.: n bright ≥ n dark > 0. Testing whether this starting condition is met is the first step of the preparation algorithm.Fulfilling this condition prevents errors in the dark ion detection (see III.3) and results in more efficient cooling of the ions.
After checking this starting condition, the main loop for the preparation algorithm starts.First the ion chain is split into two sub-chains of similar size.Both subchains are subsequently shuttled to the center segment to determine their constituents.Afterwards, one of the sub-chains is ejected, with the specific sub-chain determined based on the logical pathway depicted in Table I.Then the loop starts again with the remaining ions.The algorithm is visualized in Fig. 4.
The decision which side to discard is made according to the following logic: First, it is checked if any of the two sub-chains fulfills the "start condition" (see above).If this is not the case, the ion chains are merged and the loop is restarted.If only one of the two sub-chains fulfills the start condition, this sub-chain is kept, the other one is discarded and the loop is restarted.If both subchains fulfill the start condition, further decision factors are taken into account.First, the number of dark ions are compared.The sub-chain with fewer dark ions is kept, while the other one is discarded, since fewer dark ions are beneficial for the cooling performance.If both sub-chains do not differ in this parameter, the one with more bright ions is kept.If both sub-chains are identical, the left sub-chain is discarded, with the selection being arbitrary.This decision process is summarized in Table I.
This loop is repeated until a two-ion crystal with exactly one dark and one bright ion is left.
In addition, we have implemented a verification if the detection worked as expected.If the number of detected bright and dark ions before splitting does not match the number of bright and dark ions detected after the split, the sub-chains are re-merged and the loop is restarted.If the starting condition is no longer fulfilled at the beginning of the loop, the algorithm will stop and raise an  error.

V.2. Experimental results
The algorithm described above was run, starting from 100 ion chains containing 10 to 20 ions.Each initial ion configuration was successfully reduced to a dual-species two-ion ion chain.
The reported samples showed no instances where the algorithm failed.It typically took around four splitting operations to arrive at the final ion chain.This translates to a time of ∼100 s in our setup.The runtime is mainly determined by the conservative waiting time of 18 s per splitting cycle to make sure that the ion chain is crystallized.Fig. 6 shows the number of split operations needed to arrive at a two-ion crystal, dependent on the size of the initial ion crystal configuration.During the procedure of forming a two-ion crystal, the algorithm naturally produces ion chains which are smaller than the starting size.These intermediate ion chains were all tracked and interpreted as start configurations.Thereby smaller starting ion chain configurations could be analyzed without producing them by ion loading.With this procedure we could generate around 300 data points from 100 prepared ion crystals.
For a process that ideally splits the ion chain in the center, one would expect the number of splitting operations to follow ⌈log 2 (n) − 1⌉, with n being the total number of ions.Since only integer values of splitting operations are possible, the ceiling function (⌈ ⌉) is needed.This estimate is indicated by the blue line in Fig. 6.Most median values follow that expected curve.

VI. OUTLOOK
The presented scheme of ion crystal preparation can be extended to produce ion crystals with an arbitrary dualspecies ion composition, as long as the compositions of the sub-chains can be determined.This could be achieved by changing the decision tree or by changing the splitting ratio dynamically.Before each split operation, an optimal splitting ratio could be determined and used, in order to prepare the desired ion crystal composition, possibly combined with ion reordering [71].A dynamic splitting ratio would also increase the speed of the algorithm.
In the work presented here, only ion crystals up to 20 ions were investigated.Extending the procedure to larger numbers of ions is possible, as the algorithm runtime scales very favorably (logarithmic) with ion number.For larger ion chains the axial trapping potential would need to be lowered or the radial confinement increased.Alternatively, a more involved detection scheme could be implemented, capable of calculating and detecting ion positions in a 3D crystal [72].

VII. CONCLUSION
We have presented a simple, deterministic and efficient technique for preparing a dual-species, two-ion crystal from a large dual-species ion crystal and demonstrated an automated implementation.The method at hand produces a two-ion crystal in less than two minutes.It alleviates the need for fine tuning of loading parameters, which increases the robustness and reproducability of preparing dual-species two-ion crystals.Our method is easily extendable to produce different configurations of dual-species ion crystals and can be further optimised for speed.The presented scheme relies on experimental techniques that are available in Quantum Charge Coupled Device (QCCD) architectures for quantum computing [73,74] and are well suited for trapped ion quantum technology due to the demonstrated high level of automation.

VIII. ACKNOWLEDGMENTS
We want to thank Jan Kiethe and Elizaveta Surzhikova for developing and providing the readout script for the EMCCD camera, which was used in this work.We acknowledge the additional dark ion detection insights from Leon Schomburg and Tabea Nordmann.Additionally, we thank Lukas Spieß for careful reading of the manuscript and for providing valuable suggestions and Kai Dietze for helpful support with the Artiq experimental control.Example of configurations that are difficult to distinguish.Shown are calculated ion positions for ion chains with ion numbers between 1 and 11.Circles illustrate ion positions.Assuming three trapped bright ions (red circles), there is a configuration with 11 ions, which includes 3 ion positions almost matching the positions of the 3 trapped ions.The green rectangle marks the region of interest of our dark ion detection scheme, applying the limiting ratio of n ′ dark /n ′ bright = 1.The black lines mark the position of the three bright ions.Without the limiting ratio, the dark ion detection scheme can not reliably distinguish between the 3 bright ion configuration and the 11 ion configuration marked in red with 3 bright located at the same locations as the ions in the 3 ion crystal and 8 dark ions.

FIG. 1 .
FIG. 1. Ion trap geometry.Left: CAD render of the ion trap used in the described experiments.It is constructed using gold coated alumina pieces.Segmentation of dc electrodes is achieved by laser cutting.The top right and bottom left blades carry rf signal at 23.456 MHz for radial confinement of the ions.The other two blades carry adjustable dc electric potentials for axial confinement of the ions and for performing ion-chain shuttling and splitting operations.Right: Nomenclature and sizes of the dc segments.

FIG. 2 .
FIG. 2. Step by step illustration of the ion chain detection process.a) Unprocessed image of the ion chain taken with the EMCCD camera b) Applied gauss and otsu filters and a peak detector to find the ion positions.Red circles visualize bright calcium ions detected by the algorithm.c) Result of the dark ion detection.Empty circles indicate dark ion positions.The eight previously detected bright ions are indicated by filled circles.d) Deviation of the detected ion positions from the best matching calculated ion chain.

FIG. 3 .
FIG. 3. Simulated detection error for ion crystals with n ≤ 10 for different ratios between dark and bright ions.a) shows the detection error, where arbitrary ion configurations with n ′ ≤ 20, where compared to the detected bright ion positions.Each scatter corresponds to one ion chain configuration.The blue line denotes the average detection error for a given bright to dark ion ratio.In subfigure b) the detection error is shown with the additional restriction for the reference positions that more bright ions than dark ions are in the ion chain.The general case for different threshold ratios between dark and bright ions in the reference configurations is shown in subfigure c).See text for additional information.

FIG. 4 . 2 (FIG. 5 .
FIG. 4. Visualization of automated two ion crystal production loop.Blue and red balls depict the different ion species.Note: the ion position and distance with respect to the depicted segments is not to scale.

FIG. 6 .
FIG.6.Performance of the two-ion crystal distillation.a) shows the number of splitting operations needed to reduce a given ion crystal to a two-ion crystal.Visualization done via a box-plot due to the asymmetric error distribution.The whiskers show the min and max value, while the box extends from the first quartile to the third quartile.The red lines indicates the median and the green diamonds mark the average of the distribution.The blue curve shows the expected scaling of the algorithm.b) Histogram of the ion number occurrences during the data taking.The histogram gives the sample size for each data point in the plot above.100 dual-species ion crystal chains were prepared with ion numbers between 10 and 20 (red bars) and reduced to a two-ion crystal using the described algorithm.The blue bars show the intermediate ion crystal sizes.
This research was funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) -Project-ID 274200144 -SFB 1227 (DQ-mat), project B05 and B03 with partial support from Germany's Excellence Strategy EXC-2123 QuantumFrontiers 390837967.This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation program (grant agreement No 101019987).This work was partially funded by 22IEM01 TOCK.The project (22IEM01 TOCK) has received funding from the European Partnership on Metrology, co-financed from the European Union's Horizon Europe Research and Innovation Programme and by the Participating States.

FIG. 7 .
FIG.7.Example of configurations that are difficult to distinguish.Shown are calculated ion positions for ion chains with ion numbers between 1 and 11.Circles illustrate ion positions.Assuming three trapped bright ions (red circles), there is a configuration with 11 ions, which includes 3 ion positions almost matching the positions of the 3 trapped ions.The green rectangle marks the region of interest of our dark ion detection scheme, applying the limiting ratio of n ′ dark /n ′ bright = 1.The black lines mark the position of the three bright ions.Without the limiting ratio, the dark ion detection scheme can not reliably distinguish between the 3 bright ion configuration and the 11 ion configuration marked in red with 3 bright located at the same locations as the ions in the 3 ion crystal and 8 dark ions.

TABLE I .
Decision process for discarding one side of the ion chain after split.