# new_carr_purcell_sequence

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

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

Creates the Carr-Purcell 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 sequence.
### Return type
[DynamicDecouplingSequence](https://docs.q-ctrl.com/references/qctrl-open-controls/qctrlopencontrols/DynamicDecouplingSequence.md#qctrlopencontrols.DynamicDecouplingSequence)

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

## Notes

The Carr-Purcell sequence <sup>[1](#id2)</sup> is parameterized by the number of offsets $n$
and duration $\tau$. The sequence is made up of a set of $X_{\pi}$
operations applied at

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

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

## References

* <a id='id2'>**[1]**</a> [H. Y. Carr and E. M. Purcell, Physical Review 94, 630 (1954).](https://link.aps.org/doi/10.1103/PhysRev.94.630)
