Skip to main content

FWDD

PyPI version Conda Version License: MIT CI Build

FWDD (Finite Width Dynamical Decoupling) implements Dynamical Decoupling considering the effects of FInite Pulse Widths. All times in the tutorials use microseconds $(\mu s)$.

The code presented here is used in the paper Quantum sensing with a spin ensemble in a two-dimensional material to predict noise spectra.

Installation

You can install fwdd via pip or conda (from Conda-forge).

Via pip

pip install fwdd

Via conda (Conda-forge)

conda install -c conda-forge fwdd

Local Development & Tutorials

If you are running the tutorial notebooks locally and want to make live changes, run an editable installation:

git clone https://github.com/nonohuff/FWDD.git
cd FWDD
pip install -e .

Quick Start

Here is how you can import the core modules of fwdd in your python code:

from fwdd import filter_function as ff
from fwdd import noise_spectra as ns
from fwdd import coherence_profile as cp
from fwdd import noise_learning_fitting as nlf
from fwdd import fitting_utils as fu

Coherence-Noise Relationship

A given dynamical decoupling pulse sequence of $N$ pulses (e.g. CPMG, XY8) yields a corresponding filter function, $F_N(\omega, t)$, which is related to the coherence decay as follows:

$$ \begin{align} C_N(t) = e^{-\chi_N(t)}, \quad \chi(t) = (t/T_{2})^\beta, \ \chi_N(t) = \frac{1}{\pi} \int _{0}^{\infty} d\omega S(\omega) \frac{F_N(\omega,t)}{\omega^2} \end{align} $$

Here, $C_N(t)$ is the coherence decay as a function of time characterized by two important parameters: $T_2$ - coherence time and $\beta$ - stretch factor. $F_N(\omega,t)$ is a filer function defined by the dynamical decoupling pulse sequence, and $S(\omega)$ is the power spectral density of the underlying noise (standard units $\frac{Hz^2}{Hz}$).

Delta Function Approximation

If $F_N(\omega,t)$ is approximated as a $\delta$ function peaked at $\omega_0 =\pi N/T$, where the total experiment time, $T=2N\tau+Nt_{\pi}$, $2\tau$ being the wait time between the pulses and $t_{\pi}$ is the pulse width. Then, the integral above is trival to invert and we have:

$$ \begin{equation} S(\omega) = -\pi \frac{ln(C_N(T))}{T}. \end{equation} $$

This approximation holds true when the $\pi$-pulses are themselves much shorter compared to the delay between them and as a consequence the coherence time, $T_2$.

Finite-width Pulses

When the length of the $\pi$-pulse becomes a sizable fraction of the delay (or $T_2$), such a $\delta$ approximation cannot be made. In that case, the filter function needs to be modified to accommodate for the finite pulse duration and can be expressed as:

$$ F_{N}(\omega,T)=\left|1+(-1)^{N+1}e^{i\omega T} +2\sum_{k=1}^N(-1)^ke^{i\omega t_{k}}\cos\left(\frac{\omega t_{\pi}}{2}\right)\right|^{2} $$

Where $t_k$ is the time corresponding to the center of the $k^{th}$ pulse, and $t_{\pi}$ is the pulse width.

Tutorial Notebooks

We have included several tutorial notebooks to make adapting this code to your purposes easier. They cover how we implement noise spectral densities, $S(\omega)$, the finite-width filter function, coherence profile, $C_N(t)$, and finally, how we go about fitting noise profiles to observed $C_N(t)$ data (and how to do it for you own data/noise models!). The reccomended viewwing of these notebooks are.

noise_tutorial.ipynb -> filter_function_tutorial.ipynb -> coherence_profile_tutorial.ipynb -> noise_learning_fitting.ipynb

Conventions

  • $\omega = 2 \pi f$
  • $t = \frac{1}{f}$
  • Time varibles assume microseconds, so tau_p = 0.024 means $0.024 \mu s$ or $24 ns$

Citation

If you use fwdd in your research, please cite our work:

@misc{biswas2025quantum,
  title = {Quantum sensing with a spin ensemble in a two-dimensional material},
  author = {Souvik Biswas, Giovanni Scuri, Noah Huffman, and et al.},
  year = {2025},
  eprint = {2509.08984},
  archivePrefix = {arXiv},
  primaryClass = {cs.LG},
  url = {https://arxiv.org/abs/2509.08984}
}

Metadata

Release files for fwdd 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fwdd 0.1.1
File Size Uploaded
fwdd-0.1.1.tar.gz 36.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fwdd 0.1.1
File Interpreter ABI Platform
fwdd-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 68.4 kB

Release files / fwdd-0.1.1.tar.gz

Download URL fwdd-0.1.1.tar.gz
Size 36.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bdbf8348d9176fec256baf41514a4220af4a1607545a10bd68fd26b792f99100
BLAKE2b-256 checksum
How to use checksums
25bb459156b59362a6a70bed0c87637ba3365ef4b8c1d802677c9aadec9fa5d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Release files / fwdd-0.1.1-py3-none-any.whl

Download URL fwdd-0.1.1-py3-none-any.whl
Size 32.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2838c86a9004f2a600c6bd9a6485451b21c68b895afce73b8ca6939efe54600
BLAKE2b-256 checksum
How to use checksums
eb3ce05f47326dfb197fa8000a28fd25d872be3d699c4ea7309c361f5d5ba55e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page