# Filter functions

The filter function is a computational heuristic employed to simply calculate the sensitivity of a control solution to a time-dependent noise channel expressed in the Fourier domain.

## Definition

The filter function is derived based on the measure for robust control, and is therefore understood as a heuristic for robustness. Let $H_{c}(t)$ be a control Hamiltonian, implementing a control solution over duration $\tau$, on a system defined on a Hilbert space $\mathcal{H}$. Let $P$ denote the projection matrix defining a subspace of $\mathcal{H}$ on which robustness is to be evalulated.

The filter function associated with the $k$th noise channel with respect to $P$ is defined

\begin{align} F_{k}(\omega) \equiv \frac{1}{\text{Tr}\left(P\right)} \text{Tr}\left( P\left[ \mathscr{F} \left\{\tilde{N}'_{k}(t)\right\} \mathscr{F} \left\{\tilde{N}'_{k}(t)\right\}^\dagger \right]P \right). \end{align}

Here $\mathscr{F}$ denotes the Fourier transform

\begin{align} \mathscr{F}\left\{\tilde{N}'_{k}(t)\right\} \equiv \int_{-\infty}^{\infty}dt e^{-i\omega t} \tilde{N}'_{k}(t) \end{align}

implemented element-wise on the time-dependent matrix $\tilde{N}’_{k}(t)$ defined by

\begin{align} \tilde{N}'_{k}(t) = \tilde{N}_{k}(t)- \frac{\text{Tr}\left(P\tilde{N}_{k}(t)P\right)}{\text{Tr}\left(P\right)}\mathbb{I} \hspace{1cm} \text{for} \hspace{1cm} t\in[0,\tau]\ \end{align}

and where $$\tilde{N}'_{k}(t)=0$$ at all other times. The (unprimed) matrix $\tilde{N}_{k}(t)$ is the dynamic generator (in the toggling frame) for the $k$th noise channel, defined by the similarity transform

\begin{align} \tilde{N}_{k}(t) \equiv {U_{c}}^\dagger(t)N_{k} (t)U_{c}(t) \end{align}

where $N_{k} (t)$ is the noise-axis operators for the $k$th noise channel in the lab frame, and $U_{c}(t)$ is the unitary evolution operator for the control Hamiltonian $H_{c}(t)$.

Let $p_{l}$ be the $l$th diagonal element of $P$, then the filter function may be re-expressed in the more useful computational form

\begin{align} F_{k}(\omega) = \frac{1}{\text{Tr}\left(P\right)} \sum_{l=1}^D p_{l} \sum_{q=1}^{D} \left| \mathscr{F} \left\{ \tilde{N}'_{k}(t) \right\}_{lq} \right|^2 \end{align}.

That is, take the Fourier transform of each matrix element of the time-dependent operator $\tilde{N}’_{k}(t),$ sum the complex modulus square of every element, weighted by the diagonal elements $p_{l}$, and divide through by $\text{Tr}(P)$, the dimension of the quantum system subspace. This computational algorithm is protected by Provisional Patent Application #2018902650.

## First-order infidelity

The filter function may be calculated in this framework for arbitrary single and multi-qubit controls in order to capture the effect of time-varying noise on the control operation. This is an efficient and effective formalism for evaluating robustness of a given control solution. In particular the contribution to robustness infidelity due to the $k$th noise channel is approximated, to first order, as the overlap integral of a noise power spectrum and the associated filter function. Specifically

\begin{align} \mathcal{O}_{k} &= \frac{1}{2\pi} \int_{-\infty}^{\infty} S_{k}(\omega) F_{k}(\omega) d\omega \\ \mathcal{I}_{robust} &= 1 - \mathcal{F}_{robust} \approx \frac{1}{2} \left(1 - \exp\left(-2 \sum_{k=1}^{p} \mathcal{O}_k\right)\right) \end{align}

The below image shows how small values of the filter function lead to a net reduction in noise-induced error from a given noise channel and for a given quantum operation.

## Derivation

This derivation of the filter function is summarized below. Let $\mathcal{H}$ be a $D$-dimensional Hilbert space for some quantum system. We write the total hamiltonian

\begin{align} H_{tot}(t)=H_{c}(t)+ H_{n}(t) \end{align}

as the sum of control $(c)$ and noise $(n)$ components

\begin{align} H_{c}(t) &= \sum_{j=1}^{n}\alpha_{j}(t)C_{j},\\ \\ H_{n}(t) &= \sum_{k=1}^{p}\beta_{k}(t)N_{k} (t). \end{align}

The control Hamiltonian, $H_{c}(t)$, captures target evolution associated with the control dynamics generated by $n$ participating control operators, $C_{j}\in\mathcal{H}$. The noise Hamiltonian, $H_{n}(t)$, captures interactions with $p$ independent noise channels. Distortions in the target evolution due to uncontrolled noisy dynamics are captured by the noise operators, $N_{k} \in\mathcal{H}$, where the noise fields $\beta_{k}(t)$ are assumed to be a classical zero-mean wide-sense stationary processes with associated noise power spectral densities, $S_{k}(\omega)$.

The fidelity of target operations generated by $H_{c}(t)$ is therefore reduced by interactions captured by $H_{n}(t)$. To compute the resulting average infidelity we move to a frame rotating with the control Hamiltonian, the so-called toggling frame. In this frame noise Hamiltonian responsible for the errors takes the form

\begin{align} %\text{\emph{toggling-frame noise Hamiltonian}:} %\hspace{1cm} \tilde{H}_{n}(t) \equiv {U_{c}}^\dagger(t)H_{n}(t)U_{c}(t) = \sum_{k=1}^{p}\beta_{k}(t)\tilde{N}_{k}(t) \end{align}

where the noise-axis operators in the toggling-frame are defined by

\begin{align} \tilde{N}_{k}(t) \equiv {U_{c}}^\dagger(t)N_{k} (t)U_{c}(t). \end{align}

$\tilde{H}_{n}(t)$ then satisfies the Schrödinger equation

\begin{align} i\frac{d}{dt}\tilde{U}_{n}(t) &= \tilde{H}_{n}(t)\tilde{U}_{n}(t) \hspace{1cm} \text{where} \hspace{1cm} \tilde{U}_{n} = {U_{c}}^\dagger U_{tot}, %i\frac{d}{dt}\Un(t,0) &= H_{n}(t)\Un(t,0), \end{align}

and the infidelity measured by the measure for robust control takes the form

\begin{align} \mathcal{I}_{robust} = 1 -\left\langle\left|\frac{\text{Tr}\left(P \tilde{U}_{n}(\tau) P\right)}{\text{Tr}\left(P\right)} \right|^2\right\rangle. \end{align}

This is generally challenging to compute, requiring approximation methods. To achieve this we generalize the framework developed by Green et al. and focus on computational simplicity and extensibility to higher dimensions. In this framework the error contributed by the noise channels over the duration of the control is approximated, to first order, via a truncated Magnus expansion. Each noise channel then contributes a term to the average infidelity in the spectral domain, expressed as an overlap integral between the noise power spectrum and an appropriate filter function, $F_{k}(\omega)$. Explicitly, the infidelity measure for robust control, averaged over noise realizations, is approximated to first order as

\begin{align} \mathcal{I}_{robust} = 1 - \mathcal{F}_{robust} & \approx \sum_{k=1}^{p} \frac{1}{2\pi} \int_{-\infty}^{\infty} S_{k}(\omega) F_{k}(\omega) d\omega \end{align}

## Exceptions

Filter functions as defined above are used throughout the Q-CTRL package to evaluate the performance of controlled quantum systems. Mølmer-Sørensen control drives are an exception. In this case filter functions are computed by performing Fourier analysis on the displacement operator

\begin{aligned} U_\text{spin-mode}(t) \equiv \exp \Bigg( \sum_{\mu=1}^{N} \hat{S}^{(\mu)}_{x} \otimes \sum_{k=1}^{M} \left( \alpha^{(\mu)}_{k}(t) \hat{a}^\dagger_{k} - \left( \alpha^{(\mu)}_{k}(t)\right)^{*} \hat{a}_{k} \right) \Bigg) \end{aligned}.

describing spin-mode coupling. In this context, the filter function captures the robustness of the given control in achieving the ideal decoupling condition

\begin{aligned} &\text{spin-mode decoupling:} && && U_\text{spin-mode}(\tau) &&=&& \mathbb{I} \end{aligned}

in the presence of amplitude or detuning noise.