# Ions

Source: https://docs.q-ctrl.com/references/boulder-opal/boulderopal/ions

The ions module provides functions to simulate and optimize Mølmer–Sørensen-type
operations on trapped ion systems.

To calculate the properties of an ion chain, such as the Lamb–Dicke parameters and relative
detunings, use boulderopal.ions.obtain_ion_chain_properties.
To run a simulation or optimization, use the classes below to describe the system in terms
of drives.
For example to create a complex-valued drive for simulation use boulderopal.ions.Drive.
Then pass the classes to either boulderopal.ions.ms_simulate or
boulderopal.ions.ms_optimize depending on whether you want to run
a simulation or an optimization.

If you want to model Mølmer–Sørensen interactions in graphs, see [Mølmer–Sørensen gates](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/nodes.md#molmersorensen-gates).

For a quick introduction, see the [Optimize Mølmer–Sørensen gates for trapped ions](https://docs.q-ctrl.com/boulder-opal/tutorials/optimize-molmer-sorensen-gates-for-trapped-ions)
tutorial.

## Classes

|||
|---------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [ComplexOptimizableDrive](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/ions/ComplexOptimizableDrive.md#boulderopal.ions.ComplexOptimizableDrive)   | A piecewise-constant complex-valued optimizable drive.   |
| [Drive](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/ions/Drive.md#boulderopal.ions.Drive)                                                         | A piecewise-constant complex-valued drive.               |
| [OptimizableDrive](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/ions/OptimizableDrive.md#boulderopal.ions.OptimizableDrive)                        | Abstract class for optimizable drives.                   |
| [RealOptimizableDrive](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/ions/RealOptimizableDrive.md#boulderopal.ions.RealOptimizableDrive)            | A piecewise-constant real-valued optimizable drive.      |

## Functions

|||
|-------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ms_optimize](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/ions/ms_optimize.md#boulderopal.ions.ms_optimize)                                                 | Find optimal pulses to perform a target Mølmer–Sørensen-type operation on a system composed of ions.                                                                         |
| [ms_simulate](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/ions/ms_simulate.md#boulderopal.ions.ms_simulate)                                                 | Simulate a Mølmer–Sørensen-type operation on a system composed of ions.                                                                                                      |
| [obtain_ion_chain_properties](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/ions/obtain_ion_chain_properties.md#boulderopal.ions.obtain_ion_chain_properties) | Calculate the Lamb–Dicke parameters, frequencies (or relative detunings if a laser detuning is provided), and eigenvectors of the collective motional modes of an ion chain. |
