# ms_infidelity

Graph.ms_infidelity(phases, displacements, target_phases, mean_phonon_numbers=None, *, name=None)

Calculate the final operational infidelity of the Mølmer–Sørensen gate.

This function calculates the operational infidelity with respect to the target phases that you specify in the target_phases array. It can use the tensors returned from ms_phases() and ms_displacements() to calculate the infidelity tensor.

Parameters:
• phases (np.ndarray(real) or Tensor(real)) – Acquired phases $$\{\Phi_{kl}\}$$ for all ion pairs with shape (N, N) without time samples or (T, N, N), where T is the number of samples and N is the number of ions. For each sample the phases array must be a strictly lower triangular matrix.

• displacements (np.ndarray(complex) or Tensor(complex)) – Motional displacements $$\{\eta_{jkl} \alpha_{jkl}\}$$ in phase-space with shape (3, N, N) without time samples or (T, 3, N, N), where T is the number of samples, 3 is the number of spatial axes, and N is the number of ions that is equal to the number of modes along an axis. The first dimension $$j$$ indicates the axis, the second dimension $$k$$ indicates the mode number along the axis, and the third dimension $$l$$ indicates the ion.

• target_phases (np.ndarray) – 2D array containing target relative phases $$\{\psi_{kl}\}$$ between ion pairs. For ions $$k$$ and $$l$$, with $$k > l$$, the total relative phase target is the $$(k, l)$$-th element. The target_phases must be a strictly lower triangular matrix.

• mean_phonon_numbers (np.ndarray or None, optional) – 2D array with shape (3, N) of positive real numbers for each motional mode which corresponds to the mean phonon occupation $$\{\bar{n}_{jk}\}$$ of the given mode, where 3 is the number of spatial axes and N is the number of ions. If not provided, $$\bar{n}_{jk} = 0$$, meaning no occupation of each mode.

• name (str or None, optional) – The name of the node.

Returns:

A scalar or 1D tensor of infidelities with shape (T,) where T is the number of samples and one infidelity value per sample.

Return type:

Tensor(real)

ms_dephasing_robust_cost

Cost for robust optimization of a Mølmer–Sørensen gate.

ms_displacements

Displacements for each mode/ion combination.

ms_phases

Relative phases for all pairs of ions.

Notes

The infidelity is calculated according to 

$\begin{split}1 - \mathcal{F}_\mathrm{av} = 1 - \left| \left( \prod_{\substack{k=1 \\ l<k}}^N \cos ( \Phi_{kl} - \psi_{kl}) \right) \left( 1 - \sum_{j=1}^3 \sum_{k,l=1}^N \left[ |\eta_{jkl}|^2 |\alpha_{jkl}|^2 \left(\bar{n}_{jk}+\frac{1}{2} \right) \right] \right) \right|^2 ,\end{split}$

which assumes that the displacements $$\alpha_{jkl}$$ are small and eliminates terms of the fourth or higher order in them.

References

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.