Function Differentiation#

The approximation of differential operators is key to efficiently solve partial differential equations.

Finite Differences#

The second-order finite difference method approximates the first and second derivatives of f(x) as

\[\frac{\partial f(x)}{\partial x} = \frac{f(x + \Delta x) - f(x - \Delta x)}{2 \Delta x} + O(\Delta x^2),\]
\[\frac{\partial^2 f(x)}{\partial x^2} = \frac{f(x + \Delta x) - 2 f(x) + f(x - \Delta x)}{ \Delta x^2} + O(\Delta x^2).\]

This is translated into the quantum register representation using the displacement operator

\[\begin{split}\hat{\Sigma}^+|s\rangle = \left\{ \begin{array}{ll} |s+1\rangle, & s < 2^{n} \\ 0 & \mbox{else.} \end{array} \right. \quad \hat{\Sigma}^- = \left(\hat{\Sigma}^+\right)^\dagger,\end{split}\]

leading to

\[\ket{\partial_{x}f^{(n)}} \simeq \frac{1}{2\Delta{x}}\left(\hat{\Sigma}^+-\hat{\Sigma}^-\right)\ket{f^{(n)}},\]
\[\ket{\partial^2_{x}f^{(n)}} \simeq \frac{1}{\Delta{x}^2}\left(\hat{\Sigma}^+-2\mathbb{I}+\hat{\Sigma}^-\right)\ket{f^{(n)}}.\]

This approximation is improved with a smoother formula to avoid noise resilience following Holoborodko.

An example on how to use these functions is shown in Differentiation.ipynb.

smooth_finite_differences_mpo(L, order[, ...])

Finite differences operator with noise resilience.

Hermite Distributed Approximate Functionals (HDAF)#

Fourier approximation#

Ref. García-Ripoll [GR21] shows that the quantum Fourier transform \(\mathcal{F}\) can be used to construct as differential operator as

\[D(-i\nabla) := \mathcal{F}^{-1} \sum_{\lbrace s \rbrace} D(p_s)\ket{s}\!\bra{s} \mathcal{F}.\]

This can be obtained combining the seemps.analysis.operators.p_to_n_mpo() function with SeeMPS’s QFT seemps.qft.qft(). However, the QFT is not yet optimally implemented for this task, since the bond dimension scales linearly with the number of sites.