# ms_displacements

ions.ms_displacements(drives, lamb_dicke_parameters, relative_detunings, sample_times=None, *, name=None)

Calculate the displacements for each mode and ion combination where ions are described by a Mølmer–Sørensen-type interaction.

Use this function to calculate the displacements for each ion and each mode at the final time of the drives, or at the sample times that you provide.

### Parameters

• drives (list [Pwc or None ]) – The piecewise-constant drives, $\{\gamma_j\}$, one for each of the $N$
• lamb_dicke_parameters (np.ndarray) – The laser-ion coupling strength, $\{\eta_{jkl}\}$(3, N, N), where the dimensions indicate, respectively, axis, collective mode, and ion.
• relative_detunings (np.ndarray) – The difference $\{\delta_{jk} = \nu_{jk} - \delta\}$ (in Hz) between each motional mode frequency and the laser detuning from the qubit transition frequency $\omega_0$(3, N), where the dimensions indicate, respectively, axis and collective mode.
• sample_times (np.ndarray or None , optional) – The times (in seconds) at which to calculate the displacements, $\{t_i\}$
• name (str or None , optional) – The name of the node.

### Returns

Displacements $\{\eta_{jkl}\alpha_{jkl}(t_i)\}$(T, 3, N, N_d), where the dimensions indicate, respectively, time, axis, collective mode, and ion. Otherwise, the shape is (3, N, N_d), with the outer time dimension removed. Here, N_d is the number of addressed ions (drives that are not None); the displacements of undriven ions are not returned (as they are zero).

### Return type

Tensor(complex)

Graph.ions.ms_infidelity : Final operational infidelity of a Mølmer–Sørensen gate.

boulderopal.ions.obtain_ion_chain_properties : Function to calculate the properties of an ion chain.

## Notes

This function calculates, at sample times $\{t_i\}$, the contribution to the displacement of mode $k$ in dimension $j$ from ion $l$, namely $\eta_{jkl}\alpha_{jkl}(t_i)$

$\alpha_{jkl}(t) \equiv \int_0^t d\tau \frac{\gamma_l(\tau)}{2} \exp(i 2 \pi \delta_{jk} \tau) .$

You can calculate the state-dependent displacement by summing over the contributions from all ions. That is, using the displacement superoperator $\mathcal{D}_{jk}$, the displacement in phase space for mode $(j,k)$

$\mathcal{D}_{jk} \left(\sum_{l=1}^N \sigma_{x,l}\eta_{jkl}\alpha_{jkl}(t_i) \right) .$

## Examples

Refer to the How to optimize error-robust Mølmer–Sørensen gates for trapped ions user guide to find how to use this and related nodes.