# new_cpmg_sequence

Source: https://docs.q-ctrl.com/references/qctrl-open-controls/qctrlopencontrols/new_cpmg_sequence

```python
qctrlopencontrols.new_cpmg_sequence(duration, offset_count, pre_post_rotation=False, name=None)
```

Creates the Carr-Purcell-Meiboom-Gill sequence.

### Parameters
* **duration** (*float*) – Total duration of the sequence $\tau$ (in seconds).
* **offset_count** (*int*) – Number of offsets $n$.
* **pre_post_rotation** (*bool* *,* *optional*) – If `True`, a $X_{\pi/2}$ rotation is added at the
  start and end of the sequence. Defaults to `False`.
* **name** (*string* *,* *optional*) – Name of the sequence. Defaults to `None`.
### Returns
The Carr-Purcell-Meiboom-Gill sequence.
### Return type
[DynamicDecouplingSequence](https://docs.q-ctrl.com/references/qctrl-open-controls/qctrlopencontrols/DynamicDecouplingSequence.md#qctrlopencontrols.DynamicDecouplingSequence)

### SEE ALSO
[`new_carr_purcell_sequence`](https://docs.q-ctrl.com/references/qctrl-open-controls/qctrlopencontrols/new_carr_purcell_sequence.md#qctrlopencontrols.new_carr_purcell_sequence)

## Notes

The Carr-Purcell-Meiboom-Gill sequence <sup>[1](#id2)</sup> has the same timing and number of offsets as the
Carr-Purcell sequence. However, the intermediate $\pi$ rotations are applied along the
$Y$ axis. That is, it consists of $Y_{\pi}$ operations applied at times

$$
t_i = \frac{\tau}{n} \left(i - \frac{1}{2}\right) \;,
$$

where $i = 1, \cdots, n$.

## References

* <a id='id2'>**[1]**</a> [S. Meiboom and D. Gill, Review of Scientific Instruments 29:8, 688 (1958).](https://doi.org/10.1063/1.1716296)
