XY-n represnets a family of dynamical decoupling scripts (see ) where X and Y rotations are interchanged at equal temporal spacing. We follow the pulse sequence outlined in  and implement a macro which can generate a general number of integer repetitions.
The system implements one control quantum element
qe1 and one readout quantum element
We nest an averaging loop and a delay loop which goes over
None Wang, Z. H., De Lange, G., Ristè, D., Hanson, R., & Dobrovitski, V. V. (2012). Comparison of dynamical decoupling protocols for a nitrogen-vacancy center in diamond. Physical Review B - Condensed Matter and Materials Physics, 85(15), 1–16. https://doi.org/10.1103/PhysRevB.85.155204 Ali Ahmed, M. A., Álvarez, G. A., & Suter, D. (2013). Robustness of dynamical decoupling sequences. Physical Review A - Atomic, Molecular, and Optical Physics, 87(4), 1–6. https://doi.org/10.1103/PhysRevA.87.042309