Gradient

This section provides an overview of the Quantum Natural Gradient in the LogosQ Library.

Quantum Natural Gradient (QNG)

Standard Gradient Descent

The standard gradient descent update rule:

θt+1=θt−η∇θL(θt)\theta_{t+1} = \theta_t - \eta \nabla_\theta \mathcal{L}(\theta_t)

where:

  • L(θ)\mathcal{L}(\theta) is the cost function
  • θ\theta are the parameters
  • η\eta is the learning rate (step size)
  • ∇θ\nabla_\theta denotes the gradient with respect to θ\theta

Natural Gradient Descent (Classical)

The natural gradient descent modification:

θt+1=θt−ηF−1∇θL(θt)\theta_{t+1} = \theta_t - \eta F^{-1} \nabla_\theta \mathcal{L}(\theta_t)

where:

  • FF is the Fisher information matrix
  • F−1F^{-1} is the inverse of the Fisher information matrix

Quantum Natural Gradient

The quantum analog using the Fubini-Study metric tensor:

θt+1=θt−ηg+∇θL(θt)\theta_{t+1} = \theta_t - \eta g^{+} \nabla_\theta \mathcal{L}(\theta_t)

where:

  • gijg_{ij} is the Fubini-Study metric tensor
  • g+g^{+} is the pseudo-inverse of the metric tensor

Variational Quantum Circuit Structure

A variational quantum circuit is represented as:

∣ψ(θ)⟩=WLVL(θL)WL−1⋯V1(θ1)W0∣ψ0⟩|\psi(\theta)\rangle = W_L V_L(\theta_L) W_{L-1} \cdots V_1(\theta_1) W_0 |\psi_0\rangle

where:

  • ∣ψ0⟩|\psi_0\rangle is the initial state
  • WℓW_\ell are layers of non-parametrized quantum gates
  • Vℓ(θℓ)V_\ell(\theta_\ell) are layers of parametrized quantum gates
  • θℓ={θ0(ℓ),…,θn(ℓ)}\theta_\ell = \{\theta^{(\ell)}_0, \dots, \theta^{(\ell)}_n\} are parameters for layer ℓ\ell

Parametrized Gate Form

Parametrized gates are written as:

X(θi(ℓ))=eiθi(ℓ)Ki(ℓ)X(\theta^{(\ell)}_{i}) = e^{i\theta^{(\ell)}_{i} K^{(\ell)}_i}

where:

  • Ki(ℓ)K^{(\ell)}_i is the generator of the parametrized operation

Block-Diagonal Fubini-Study Metric Tensor

For each parametric layer ℓ\ell, the nℓ×nℓn_\ell \times n_\ell block-diagonal submatrix is:

gij(ℓ)=14Re[⟨ψℓ−1∣KiKj∣ψℓ−1⟩−⟨ψℓ−1∣Ki∣ψℓ−1⟩⟨ψℓ−1∣Kj∣ψℓ−1⟩]g_{ij}^{(\ell)} = \frac{1}{4}\text{Re}\left[\langle \psi_{\ell-1} | K_i K_j | \psi_{\ell-1}\rangle - \langle \psi_{\ell-1} | K_i | \psi_{\ell-1}\rangle \langle \psi_{\ell-1} | K_j | \psi_{\ell-1}\rangle\right]

where:

  • ∣ψℓ−1⟩=Wℓ−1Vℓ−1(θℓ−1)⋯V1(θ1)W0∣ψ0⟩|\psi_{\ell-1}\rangle = W_{\ell-1} V_{\ell-1}(\theta_{\ell-1}) \cdots V_1(\theta_1) W_0 |\psi_0\rangle
  • Ki≡Ki(ℓ)K_i \equiv K_i^{(\ell)} (for brevity)

Diagonal Terms of Metric Tensor

The diagonal elements are given by variance:

gii(ℓ)=14Var(Ki)=14(⟨Ki2⟩−⟨Ki⟩2)g_{ii}^{(\ell)} = \frac{1}{4}\text{Var}(K_i) = \frac{1}{4}\left(\langle K_i^2 \rangle - \langle K_i \rangle^2\right)

Off-Diagonal Terms of Metric Tensor

The off-diagonal elements are given by covariance:

gij(ℓ)=14Cov(Ki,Kj)=14(⟨KiKj⟩−⟨Ki⟩⟨Kj⟩)g_{ij}^{(\ell)} = \frac{1}{4}\text{Cov}(K_i, K_j) = \frac{1}{4}\left(\langle K_i K_j \rangle - \langle K_i \rangle \langle K_j \rangle\right)

where i≠ji \neq j.

Complete Block-Diagonal Metric Tensor

The full block-diagonal approximation combines all layer submatrices:

g=(g(0)0⋯00g(1)⋯0⋮⋮⋱⋮00⋯g(L))g = \begin{pmatrix} g^{(0)} & 0 & \cdots & 0 \\ 0 & g^{(1)} & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & g^{(L)} \end{pmatrix}

Computational Complexity

For a variational circuit with:

  • dd parameters
  • LL parametrized layers

Total quantum evaluations per optimization step:

  • Standard gradient descent: 2d2d evaluations
  • Quantum natural gradient: 2d+L2d + L evaluations

Key Properties

  1. Fubini-Study reduces to Fisher information: In the classical limit, the Fubini-Study metric tensor reduces to the Fisher information matrix

  2. Imaginary-time evolution: In the limit η→0\eta \rightarrow 0, QNG dynamics are equivalent to imaginary-time evolution within the variational subspace

  3. Symmetry: The block-diagonal matrices are real and symmetric: gij(ℓ)=gji(ℓ)g_{ij}^{(\ell)} = g_{ji}^{(\ell)}

  4. Parametrization invariance: The natural gradient is invariant with respect to parametrization, providing optimal step sizes automatically