††thanks: Equal contribution††thanks: Equal contribution

# Deterministic preparation of a dual-species two-ion crystal

Maximilian J. Zawierucha<EMAIL_ADDRESS>Physikalisch-Technische
Bundesanstalt, Bundesallee 100, 38116 Braunschweig, Germany  Institut für
Quantenoptik, Leibniz Universität Hannover, Welfengarten 1, 30167 Hannover
Till Rehmert  Physikalisch-Technische Bundesanstalt, Bundesallee 100, 38116
Braunschweig, Germany  Institut für Quantenoptik, Leibniz Universität
Hannover, Welfengarten 1, 30167 Hannover  Jonas Keller  Physikalisch-
Technische Bundesanstalt, Bundesallee 100, 38116 Braunschweig, Germany  Tanja
E. Mehlstäubler  Physikalisch-Technische Bundesanstalt, Bundesallee 100, 38116
Braunschweig, Germany  Institut für Quantenoptik, Leibniz Universität
Hannover, Welfengarten 1, 30167 Hannover  Piet O. Schmidt  Physikalisch-
Technische Bundesanstalt, Bundesallee 100, 38116 Braunschweig, Germany
Institut für Quantenoptik, Leibniz Universität Hannover, Welfengarten 1, 30167
Hannover  Fabian Wolf<EMAIL_ADDRESS>Physikalisch-Technische
Bundesanstalt, Bundesallee 100, 38116 Braunschweig, Germany

###### Abstract

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.

##  I Introduction

Trapped ions have been established as a versatile platform for advancing the
field of atomic, molecular, and optical physics over the past few decades.
Unprecedented accuracies in trapped ion clocks [1, 2, 3, 4, 5], highly
sensitive sensors [6, 7, 8, 9, 10, 11, 12] and quantum computers [13, 14, 15]
are just some of the outstanding applications which are being pursued. While
many of these experiments are possible with a single species of ions,
extending the control capabilities to dual-species ion systems enables a
richer variety of experiments and is even a necessity for certain
applications. For instance, co-trapped ions of a different species can serve
as an in situ sensor for perturbing fields [16, 17, 18], or for sympathetic
cooling of an ion species with no (accessible) laser-cooling transition [19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34]. The latter has
enabled the development of optical quantum logic clocks [35, 2, 36, 37, 38],
precision spectroscopy on highly charged [39, 40] and molecular ions [41, 42]
and helps to preserve coherence for quantum information processing [43, 44].

Here, we present a technique for preparing such a dual-species two-ion
crystal. The process relies on modifying the confining dc potentials to
iteratively split a dual-species 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 re-merging 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 [53, 54, 50, 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, 59, 38] 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}\text{\,}\mathrm{mbar}$). A CAD-render of the trap can be found
in Fig. 1. The distance between electrodes and the ions is
$0.5\text{\,}\mathrm{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}\text{Ca}^{+}$ and
${}^{25}\text{Mg}^{+}$ ions. The calcium ions are laser-cooled with light at
$397\text{\,}\mathrm{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.

Figure 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\text{\,}\mathrm{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.

Both ion species are loaded via ablation loading with a matchbox-sized laser
at $515\text{\,}\mathrm{nm}$ (Mountain Photonics GmbH, IOP 0515L-21C-NI-NT-
NF). The laser is pulsed with a repetition rate of $3.5\text{\,}\mathrm{kHz}$
and provides pulse powers of approximately
$30\text{\,}\mathrm{\SIUnitSymbolMicro 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
$\omega_{x,y}\gg\omega_{z}$, where $\omega_{x,y}$ are the radial and
$\omega_{z}$ the axial trap frequencies of a single trapped ion. In our case
these values are $\omega_{x}=2\pi\times$$750\text{\,}\mathrm{kHz}$,
$\omega_{y}=2\pi\times$$950\text{\,}\mathrm{kHz}$ and
$\omega_{z}=2\pi\times$$143\text{\,}\mathrm{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\text{\,}\mathrm{bit}$ brightness resolution
and an exposure time of $0.2\text{\,}\mathrm{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 scikit-image module
(skimage.filters.threshold_otsu, V0.20.0, [67]). Lower detection errors are
obtained by increasing this threshold by 200 (out of the full dynamic range of
$14\text{\,}\mathrm{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.peak_local_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\text{\,}\mathrm{\SIUnitSymbolMicro
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^{\text{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

$\displaystyle b(n)=\sum_{i}\frac{\min_{\forall
j}\left|P_{i}-P^{\text{theo}}_{j}(n)\right|^{2}}{n_{\text{bright}}},$ (1)

which is the mean distance of the measured ion positions $P_{i}$ of the
fluorescing ions to the closest theoretically determined position
$P^{\text{theo}}_{j}(n)$. $n_{\text{bright}}$ is the number of fluorescing
ions, determined by the previously described measurement. The number of dark
ions $n_{\text{dark}}$ is determined by subtracting $n_{\text{bright}}$ from
$n$. For the minimization of $b(n)$, the total number of ions was limited to
$n<\min(2n_{\text{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 $\chi^{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).

Figure 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.

###  III.3 Benchmark and limitation

Figure 3: Simulated detection error for ion crystals with $n\leq 10$ for
different ratios between dark and bright ions. a) shows the detection error,
where arbitrary ion configurations with $n^{\prime}\leq 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.

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_{\mathrm{bright}}>n_{\mathrm{dark}}$ can be detected incorrectly. These
false detections are caused by falsely assuming an ion chain with
$n_{\mathrm{bright}}<n_{\mathrm{dark}}$. The resulting errors can be mitigated
by restricting the theoretical configurations, that are compared to the bright
ion positions to configurations with $n^{\prime}_{\mathrm{bright}}\geq
n^{\prime}_{\mathrm{dark}}$. When describing restrictions for the detection
algorithm, a prime $(^{\prime})$ is added to the ion number. Fig. 3 shows that
this restriction suppresses errors entirely for configurations with
$n_{\mathrm{bright}}\geq n_{\mathrm{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^{\prime}_{\mathrm{bright}}\geq n^{\prime}_{\mathrm{dark}}$
can be generalized by introducing the limiting ratio
$n^{\prime}_{\mathrm{bright}}/n^{\prime}_{\mathrm{dark}}$. The previously
described precondition corresponds to
$n^{\prime}_{\mathrm{bright}}/n^{\prime}_{\mathrm{dark}}\geq 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^{\prime}_{\mathrm{bright}}/n^{\prime}_{\mathrm{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 1. 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.

Figure 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.

For the splitting operations, the ions are initially confined in a shallow
potential ($\omega_{z}=2\pi\times$$143\text{\,}\mathrm{kHz}$) and the voltage
on the center electrode (V3) 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 $\Delta U$ to the outer electrodes (V1 and
V5). A measurement of the dependence of the splitting ratio on the
differential voltage is shown in Fig. 5. From these measurements, $\Delta 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.

Figure 5:  Calibration of the splitting process. A ten ion crystal was split
and the ions on the left side were counted. The measurement was repeated ten
times for each value of $\Delta U$. The crosses denote the average ion number
detected on the left side. The circles show each measurement result, with its
frequency encoded in the visibility of the circle. The red dashed line shows a
fit to the data, which is used to infer the voltage $U_{0}$, needed to split
the crystal into equal parts, shown by the dotted line.

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 sub-
chains back, while keeping both parts separated. This is achieved by
increasing the outer electrodes’ voltage on one of the sides: V1 (or V5) and
applying a small trapping potential with the inner electrodes (V2 and V4).

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 V4 (or V2)
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\text{\,}\mathrm{V}$ at V1 (or V5) and increasing the center
voltage, V3, 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_{\text{bright}}\geq
n_{\text{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 sub-chains 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 1. 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 sub-chains 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 1.

Step | condition | action
---|---|---
1 | $n_{\text{bright}}\geq n_{\text{dark}}>0$ |
|  left | right |
| False | False | error
| False | True | discard left
| True | False | discard right
| True | True | continue
2 | $n_{\text{dark}}^{\text{left}}>n_{\text{dark}}^{\text{right}}$ | discard left
| $n_{\text{dark}}^{\text{left}}<n_{\text{dark}}^{\text{right}}$ | discard right
| $n_{\text{dark}}^{\text{left}}=n_{\text{dark}}^{\text{right}}$ | continue
3 | $n_{\text{bright}}^{\text{left}}>n_{\text{bright}}^{\text{right}}$ | discard right
| $n_{\text{bright}}^{\text{left}}<n_{\text{bright}}^{\text{right}}$ | discard left
| $n_{\text{bright}}^{\text{left}}=n_{\text{bright}}^{\text{right}}$ | discard any side;
|  | we discard left
Table 1: Decision process for discarding one side of the ion chain after
split.

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 $\sim$$100\text{\,}\mathrm{s}$ in our
setup. The runtime is mainly determined by the conservative waiting time of
$18\text{\,}\mathrm{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
$\lceil\log_{2}{(n)}-1\rceil$, with $n$ being the total number of ions. Since
only integer values of splitting operations are possible, the ceiling function
($\lceil\ \rceil$) is needed. This estimate is indicated by the blue line in
Fig. 6. Most median values follow that expected curve.

Figure 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.

##  VI Outlook

The presented scheme of ion crystal preparation can be extended to produce ion
crystals with an arbitrary dual-species 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. 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.

##  IX Author Contributions

T. R., M. J. Z. and F. W. conceived the main idea of this research and carried
out the experiments. Furthermore T. R., M. J. Z., P. O. S. and F. W. advanced
the work by interpreting the results, steering the research and writing the
manuscript. J. K. and T. E. M. contributed the idea of the dark ion detection
principle and proved its usefulness in another experimental setup. T. R. and
M. J. Z. contributed equally to this work.

## References

  * Ludlow  _et al._ [2015] A. D. Ludlow, M. M. Boyd, J. Ye, E. Peik, and P. O. Schmidt, Reviews of Modern Physics 87, 637 (2015).
  * Brewer  _et al._ [2019] S. M. Brewer, J.-S. Chen, A. M. Hankin, E. R. Clements, C. W. Chou, D. J. Wineland, D. B. Hume, and D. R. Leibrandt, Physical Review Letters 123, 033201 (2019).
  * Huntemann  _et al._ [2016] N. Huntemann, C. Sanner, B. Lipphardt, C. Tamm, and E. Peik, Physical Review Letters 116, 063001 (2016).
  * Zhiqiang  _et al._ [2023] Z. Zhiqiang, K. J. Arnold, R. Kaewuam, and M. D. Barrett, Science Advances 9, eadg1971 (2023).
  * Huang  _et al._ [2022] Y. Huang, B. Zhang, M. Zeng, Y. Hao, Z. Ma, H. Zhang, H. Guan, Z. Chen, M. Wang, and K. Gao, Physical Review Applied 17, 034041 (2022).
  * Brownnutt  _et al._ [2015] M. Brownnutt, M. Kumph, P. Rabl, and R. Blatt, Reviews of Modern Physics 87, 1419 (2015).
  * Wolf  _et al._ [2019] F. Wolf, C. Shi, J. C. Heip, M. Gessner, L. Pezzè, A. Smerzi, M. Schulte, K. Hammerer, and P. O. Schmidt, Nature Communications 10, 2929 (2019).
  * Campbell and Hamilton [2017] W. C. Campbell and P. Hamilton, Journal of Physics B: Atomic, Molecular and Optical Physics 50, 064002 (2017).
  * Baumgart  _et al._ [2016] I. Baumgart, J.-M. Cai, A. Retzker, M. B. Plenio, and C. Wunderlich, Physical Review Letters 116, 240801 (2016).
  * Gilmore  _et al._ [2021] K. A. Gilmore, M. Affolter, R. J. Lewis-Swan, D. Barberena, E. Jordan, A. M. Rey, and J. J. Bollinger, Science 373, 673 (2021).
  * Biercuk  _et al._ [2010] M. J. Biercuk, H. Uys, J. W. Britton, A. P. VanDevender, and J. J. Bollinger, Nature Nanotechnology 5, 646 (2010).
  * McCormick  _et al._ [2019] K. C. McCormick, J. Keller, S. C. Burd, D. J. Wineland, A. C. Wilson, and D. Leibfried, Nature 572, 86 (2019).
  * Cirac and Zoller [1995] J. I. Cirac and P. Zoller, Physical Review Letters 74, 4091 (1995).
  * Blatt and Wineland [2008] R. Blatt and D. Wineland, Nature 453, 1008 (2008).
  * Bruzewicz  _et al._ [2019] C. D. Bruzewicz, J. Chiaverini, R. McConnell, and J. M. Sage, Applied Physics Reviews 6, 021314 (2019).
  * Barrett  _et al._ [2019] M. D. Barrett, K. J. Arnold, and M. S. Safronova, Physical Review A 100, 043418 (2019).
  * Wolf [2024] F. Wolf, Phys. Rev. Lett. 132, 083202 (2024).
  * Steinel  _et al._ [2023] M. Steinel, H. Shao, M. Filzinger, B. Lipphardt, M. Brinkmann, A. Didier, T. E. Mehlstäubler, T. Lindvall, E. Peik, and N. Huntemann, Physical Review Letters 131, 083002 (2023).
  * Wübbena  _et al._ [2012] J. B. Wübbena, S. Amairi, O. Mandel, and P. O. Schmidt, Physical Review A 85, 043412 (2012).
  * King  _et al._ [2021] S. A. King, L. J. Spieß, P. Micke, A. Wilzewski, T. Leopold, J. R. Crespo López-Urrutia, and P. O. Schmidt, Physical Review X 11, 041049 (2021).
  * Rugango  _et al._ [2015] R. Rugango, J. E. Goeders, T. H. Dixon, J. M. Gray, N. B. Khanyile, G. Shu, R. J. Clark, and K. R. Brown, New Journal of Physics 17, 035009 (2015).
  * Wan  _et al._ [2015] Y. Wan, F. Gebert, F. Wolf, and P. O. Schmidt, Phys. Rev. A 91, 043425 (2015).
  * Sels  _et al._ [2022] S. Sels, F. M. Maier, M. Au, P. Fischer, C. Kanitz, V. Lagaki, S. Lechner, E. Leistenschneider, D. Leimbach, E. M. Lykiardopoulou, A. A. Kwiatkowski, T. Manovitz, Y. N. Vila Gracia, G. Neyens, P. Plattner, S. Rothe, L. Schweikhard, M. Vilen, R. N. Wolf, and S. Malbrunot-Ettenauer, Physical Review Research 4, 033229 (2022).
  * Meiners  _et al._ [2018] T. Meiners, M. Niemann, J. Mielke, M. Borchert, N. Pulido, J. M. Cornejo, S. Ulmer, and C. Ospelkaus, Hyperfine Interactions 239, 26 (2018).
  * Cui  _et al._ [2018] K.-f. Cui, J.-j. Shang, S.-j. Chao, S.-m. Wang, J.-b. Yuan, P. Zhang, J. Cao, Hua-lin Shu, and X.-r. Huang, Journal of Physics B: Atomic, Molecular and Optical Physics 51, 045502 (2018).
  * Calvin  _et al._ [2018] A. T. Calvin, S. S. Janardan, J. J. Condoluci, R. Rugango, E. Pretzsch, G. Shu, and K. R. Brown, The Journal of Physical Chemistry A 10.1021/acs.jpca.7b12823 (2018).
  * Ohtsubo  _et al._ [2017] N. Ohtsubo, Y. Li, K. Matsubara, T. Ido, and K. Hayasaka, Optics Express 25, 11725 (2017).
  * Chen  _et al._ [2017] J.-S. Chen, S. M. Brewer, C. W. Chou, D. J. Wineland, D. R. Leibrandt, and D. B. Hume, Physical Review Letters 118, 053002 (2017).
  * Guggemos  _et al._ [2015] M. Guggemos, D. Heinrich, O. A. Herrera-Sancho, R. Blatt, and C. F. Roos, New Journal of Physics 17, 103001 (2015).
  * Willitsch  _et al._ [2008] S. Willitsch, M. T. Bell, A. D. Gingell, and T. P. Softley, Phys. Chem. Chem. Phys. 10, 7200 (2008).
  * Kwapień  _et al._ [2007] T. Kwapień, U. Eichmann, and W. Sandner, Physical Review A 75, 063418 (2007).
  * Ryjkov  _et al._ [2006] V. L. Ryjkov, X. Zhao, and H. A. Schuessler, Physical Review A 74, 023401 (2006).
  * Ostendorf  _et al._ [2006] A. Ostendorf, C. B. Zhang, M. A. Wilson, D. Offenberg, B. Roth, and S. Schiller, Physical Review Letters 97, 243005 (2006).
  * Roth  _et al._ [2005] B. Roth, U. Fröhlich, and S. Schiller, Physical Review Letters 94, 10.1103/PhysRevLett.94.053001 (2005).
  * Schmidt  _et al._ [2005] P. O. Schmidt, T. Rosenband, C. Langer, W. M. Itano, J. C. Bergquist, and D. J. Wineland, Science 309, 749 (2005).
  * Cui  _et al._ [2022] K. Cui, S. Chao, C. Sun, S. Wang, P. Zhang, Y. Wei, J. Yuan, J. Cao, H. Shu, and X. Huang, The European Physical Journal D 76, 140 (2022).
  * Guggemos  _et al._ [2019] M. Guggemos, M. Guevara-Bertsch, D. Heinrich, O. A. Herrera-Sancho, Y. Colombe, R. Blatt, and C. F. Roos, New Journal of Physics 21, 103003 (2019).
  * Kramer [2023] J. A. Kramer 10.15488/13300 (2023).
  * Micke  _et al._ [2020] P. Micke, T. Leopold, S. A. King, E. Benkler, L. J. Spieß, L. Schmöger, M. Schwarz, J. R. C. López-Urrutia, and P. O. Schmidt, Nature 578, 60 (2020).
  * King  _et al._ [2022] S. A. King, L. J. Spieß, P. Micke, A. Wilzewski, T. Leopold, E. Benkler, R. Lange, N. Huntemann, A. Surzhykov, V. A. Yerokhin, J. R. Crespo López-Urrutia, and P. O. Schmidt, Nature 611, 43 (2022).
  * Chou  _et al._ [2020] C. W. Chou, A. L. Collopy, C. Kurz, Y. Lin, M. E. Harding, P. N. Plessow, T. Fortier, S. Diddams, D. Leibfried, and D. R. Leibrandt, Science 367, 1458 (2020).
  * Wolf  _et al._ [2016] F. Wolf, Y. Wan, J. C. Heip, F. Gebert, C. Shi, and P. O. Schmidt, Nature 530, 457 (2016).
  * Wang  _et al._ [2017] Y. Wang, M. Um, J. Zhang, S. An, M. Lyu, J.-N. Zhang, L.-M. Duan, D. Yum, and K. Kim, Nature Photonics 11, 646 (2017).
  * Wang  _et al._ [2021] P. Wang, C.-Y. Luan, M. Qiao, M. Um, J. Zhang, Y. Wang, X. Yuan, M. Gu, J. Zhang, and K. Kim, Nature Communications 12, 233 (2021).
  * Ballance  _et al._ [2017] T. G. Ballance, J. F. Goodwin, B. Nichol, L. J. Stephenson, C. J. Ballance, and D. M. Lucas, arXiv:1710.02489 [physics, physics:quant-ph] (2017).
  * Gao  _et al._ [2021] S. Gao, W. J. Hughes, D. M. Lucas, T. G. Ballance, and J. F. Goodwin, Review of Scientific Instruments 92, 033205 (2021).
  * Sage  _et al._ [2012] J. M. Sage, A. J. Kerman, and J. Chiaverini, Physical Review A 86, 013417 (2012).
  * Bruzewicz  _et al._ [2016] C. D. Bruzewicz, R. McConnell, J. Chiaverini, and J. M. Sage, Nature Communications 7, 13005 (2016).
  * Leibrandt  _et al._ [2007a] D. R. Leibrandt, R. J. Clark, J. Labaziewicz, P. Antohi, W. Bakr, K. R. Brown, and I. L. Chuang, Phys. Rev. A 76, 055403 (2007a).
  * Wu  _et al._ [2021] Q. Wu, M. Filzinger, Y. Shi, Z. Wang, and J. Zhang, Review of Scientific Instruments 92, 063201 (2021).
  * Ballance  _et al._ [2018] T. G. Ballance, J. F. Goodwin, B. Nichol, L. J. Stephenson, C. J. Ballance, and D. M. Lucas, Review of Scientific Instruments 89, 053102 (2018).
  * Leibrandt  _et al._ [2007b] D. R. Leibrandt, R. J. Clark, J. Labaziewicz, P. Antohi, W. Bakr, K. R. Brown, and I. L. Chuang, Physical Review A 76, 055403 (2007b).
  * Shi  _et al._ [2023] X. Shi, S. L. Todaro, G. L. Mintzer, C. D. Bruzewicz, J. Chiaverini, and I. L. Chuang, arXiv 10.48550/arXiv.2303.02143 (2023).
  * White  _et al._ [2022] B. M. White, P. J. Low, Y. de Sereville, M. L. Day, N. Greenberg, R. Rademacher, and C. Senko, Physical Review A 105, 033102 (2022).
  * Osada and Noguchi [2022] A. Osada and A. Noguchi, Journal of Physics Communications 6, 015007 (2022).
  * Vrijsen  _et al._ [2019] G. Vrijsen, Y. Aikyo, R. F. Spivey, I. V. Inlek, and J. Kim, Optics Express 27, 33907 (2019).
  * Olmschenk and Becker [2017] S. Olmschenk and P. Becker, Applied Physics B 123, 99 (2017).
  * Zimmermann  _et al._ [2012] K. Zimmermann, M. V. Okhapkin, O. A. Herrera-Sancho, and E. Peik, Applied Physics B 107, 883 (2012).
  * Sun  _et al._ [2022] C. Sun, K. Cui, S. Chao, Y. Wei, J. Yuan, J. Cao, H. Shu, and X. Huang, Review of Scientific Instruments 93, 113201 (2022).
  * Schmöger  _et al._ [2015] L. Schmöger, O. O. Versolato, M. Schwarz, M. Kohnen, A. Windberger, B. Piest, S. Feuchtenbeiner, J. Pedregosa-Gutierrez, T. Leopold, P. Micke, A. K. Hansen, T. M. Baumann, M. Drewsen, J. Ullrich, P. O. Schmidt, and J. R. C. López-Urrutia, Science 347, 1233 (2015).
  * Fulford  _et al._ [1980] J. E. Fulford, D. Nhu‐Hoa, R. J. Hughes, R. E. March, R. F. Bonner, and G. J. Wong, Journal of Vacuum Science and Technology 17, 829 (1980).
  * Londry and Hager [2003] F. A. Londry and J. W. Hager, Journal of the American Society for Mass Spectrometry 14, 1130 (2003).
  * Schmidt  _et al._ [2020] J. Schmidt, D. Hönig, P. Weckesser, F. Thielemann, T. Schaetz, and L. Karpa, Applied Physics B 126, 176 (2020).
  * Leopold  _et al._ [2019] T. Leopold, S. A. King, P. Micke, A. Bautista-Salvador, J. C. Heip, C. Ospelkaus, J. R. Crespo López-Urrutia, and P. O. Schmidt, Review of Scientific Instruments 90, 073201 (2019).
  * Lucas  _et al._ [2004] D. Lucas, A. Ramos, J. Home, M. McDonnell, S. Nakayama, J.-P. Stacey, S. Webster, D. Stacey, and A. Steane, Physical Review A 69, 012711 (2004).
  * James [1998] D. James, Applied Physics B: Lasers and Optics 66, 181 (1998).
  * van der Walt  _et al._ [2014] S. van der Walt, J. L. Schönberger, J. Nunez-Iglesias, F. Boulogne, J. D. Warner, N. Yager, E. Gouillart, T. Yu, and the scikit-image contributors, PeerJ 2, e453 (2014).
  * Otsu [1979] N. Otsu, IEEE Transactions on Systems, Man, and Cybernetics 9, 62 (1979).
  * Kamsap  _et al._ [2016] M. R. Kamsap, C. Champenois, J. Pedregosa-Gutierrez, M. Houssin, and M. Knoop, arXiv:1604.04303 [physics, physics:quant-ph] (2016).
  * Bourdeauducq  _et al._ [2022] S. Bourdeauducq, whitequark, R. Jördens, D. Nadlinger, Y. Sionneau, and F. Kermarrec, Artiq (2022).
  * Splatt  _et al._ [2009] F. Splatt, M. Harlander, M. Brownnutt, F. Zähringer, R. Blatt, and W. Hänsel, New Journal of Physics 11, 103008 (2009).
  * Okada  _et al._ [2010] K. Okada, M. Wada, T. Takayanagi, S. Ohtani, and H. A. Schuessler, Phys. Rev. A 81, 013420 (2010).
  * Kielpinski  _et al._ [2002] D. Kielpinski, C. Monroe, and D. J. Wineland, Nature 417, 709 (2002).
  * Pino  _et al._ [2020] J. M. Pino, J. M. Dreiling, C. Figgatt, J. P. Gaebler, S. A. Moses, C. H. Baldwin, M. Foss-Feig, D. Hayes, K. Mayer, C. Ryan-Anderson, and B. Neyenhuis, arXiv:2003.01293 [quant-ph] (2020).

##  Appendix A Transformation from calculated ion positions to camera pixels

The theoretically determined position of the $j$-th ion with respect to the
center of the ion chain is given by $x^{\prime}_{j}=lu_{j}$, where $u_{j}$ is
the dimensionless equilibrium position that can be computed analytically for
two and three ions and needs to be calculated numerically for larger ion
chains [66]. The length scale $l$ is for singly ionized ions given by

$\displaystyle
l^{3}=\frac{e^{2}}{4\pi\epsilon_{0}C_{\mathrm{trap}}U_{\mathrm{dc}}},$ (2)

where $e$ is the charge of the electron, $\epsilon_{0}$ is the permitivity of
free space, $C_{\mathrm{trap}}$ is a constant given by the geometry of the ion
trap and $U_{\mathrm{dc}}$ is the voltage that provides the axial confinement.

The position of the image on the camera $P^{\text{theo}}_{j}$ is related to
the ion’s position $u_{j}$ by $P^{\text{theo}}_{j}=P_{0}+Ku_{j}$, where
$P_{0}$ denotes the center of the ion chain on the camera chip and
$K=lM/s_{\mathrm{px}}$ is a factor that accounts for the magnification factor
$M$ of the imaging system and the pixel size $s_{\mathrm{px}}$. The values for
$P_{0}$ and $K$ are inferred from loading a known number of fluorescing ions
($\geq 2$) and determining their position on the camera image.

##  Appendix B Split ratio calibration

Measuring the amount of ions on one side of the double-well potential for
different differential voltages $\Delta U$ between electrodes V1 and V5 and
fitting a model to the data, allows to find a value for $\Delta U$ matching
the desired splitting ratio. Here we are interested in a splitting ratio of 1.

The amount of ions in the left well after the split, resembles the heuristic
function

$\displaystyle n_{\text{left}}(\Delta U)=\frac{n}{2}\tanh\left(-A\left(\Delta
U-\Delta U_{0}\right)+1\right),$ (3)

where $n$ is the total number of ions, $A$ a scaling factor and $\Delta U_{0}$
is the differential voltage, for which the ion crystal is split in half. A fit
of 3 to measured data can be found in Fig. 5.

##  Appendix C Detection errors

When detecting the ion chain configuration, errors can occur if there is no
limit to the amount of dark ions. Most of these errors originate in ion chain
configurations for which some ion positions are similar for different
configurations. In this context, similar means that the position cannot be
differentiated with the given experimental position resolution. If only these
similar ion positions are occupied by bright ions, the different
configurations are indistinguishable to the algorithm. For large ion crystals
the density of ions increases and thereby those ion chains often have a subset
of ion positions which are almost identical to some ion positions of a smaller
ion crystal. The most obvious example of a position which is similar in many
ion chains, is the center position in an odd-numbered ion crystal. If only one
fluorescing ion is trapped, it is impossible to determine the total chain
size, since non fluorescing ions could be present and located on each side of
the bright central ion. An illustration for a typical false detection can be
found in Fig. 7.

Figure 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^{\prime}_{\mathrm{dark}}/n^{\prime}_{\mathrm{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.

These errors can be mitigated by limiting the allowed ion chain configurations
to ones with $n^{\prime}_{\mathrm{bright}}\geq n^{\prime}_{\mathrm{dark}}$ or
by a more accurate bright ion position determination (this would however not
solve the problem with only one fluorescing ion in the center).