Advanced Topics

This section is under development.

Entanglement with Pair Operators

For studying entanglement, use pair operator bases that can create correlations.

Kubo-Mori (Duhamel) Derivatives

For a matrix exponential family \(\rho(\theta) = e^H\) with \(H = \sum_a \theta_a F_a - \psi(\theta) I\), the exact derivative is

\[\frac{\partial \rho}{\partial \theta_a} = \int_0^1 e^{(1-s)H} \bigl(F_a - \langle F_a \rangle I\bigr) e^{sH}\,\mathrm{d}s.\]

This is the Kubo-Mori (Duhamel) derivative, and it is what rho_derivative() computes.

Choosing a method

Three numerical strategies are available via the method argument:

method

Cost

Accuracy

When to use

'duhamel_block' (default)

1 expm on a \(2n \times 2n\) matrix

Machine precision

Robust default; handles ill-conditioned \(H\)

'duhamel_spectral'

1 eigh + kernel application

Machine precision

When eigendecomposition is cheap and \(H\) is well-conditioned

'duhamel'

50 expm calls (trapezoid)

~10⁻⁵

Validation / cross-checking only

The block method (default since January 2026) implements Higham’s identity:

\[\begin{split}\exp\begin{pmatrix} H & F \\ 0 & H \end{pmatrix} = \begin{pmatrix} e^H & D\exp_H[F] \\ 0 & e^H \end{pmatrix}\end{split}\]

so the Duhamel integral is “compiled away” into a single matrix exponential. This avoids explicit quadrature and eigendecomposition, and delegates all numerical work to the highly-optimised scipy.linalg.expm (Padé + scaling and squaring).

Higher-order derivatives and cumulants

The block trick extends to 2nd and 3rd Fréchet derivatives via 3×3 / 4×4 block matrices. These are available as utilities in qig.duhamel for computing:

  • the Hessian of \(\psi(\theta)\) (2nd cumulant / BKM Fisher metric),

  • the 3rd cumulant contraction \((\nabla G)[\theta]\) for small systems.

Third-Order Cumulants

The third cumulant \(\nabla G = \nabla \nabla \nabla \psi\) describes how the Fisher metric varies across the manifold. It is available via the block Fréchet method in qig.duhamel and is used internally for validation.

Optimisation on Manifolds

Constrained optimisation techniques for quantum state spaces are implemented in qig.dynamics and qig.generic_decomposition.

See Also