quantax.optimizer.QNGD#

class quantax.optimizer.QNGD#

Abstract class of quantum natural gradient descent.

The key function of the class is get_step, which provides the update of parameters by solving the quantum natural gradient descent equation \(\bar O \dot \theta = \bar \epsilon\), in which \(\bar O = \frac{1}{\sqrt{N_s}}(\frac{1}{\psi} \frac{\partial \psi}{\partial \theta} - \left< \frac{1}{\psi} \frac{\partial \psi}{\partial \theta} \right>)\) and \(\bar \epsilon\) should be defined in the child class.

__init__(state: Variational, imag_time: bool = True, solver: Callable[[Array, Array], Array] | None = None, kazcmarz_mu: float = 0.0)#
Parameters:
  • state – Variational state to be optimized.

  • imag_time – Whether to use imaginary-time evolution, default to True.

  • solver – The numerical solver for the matrix inverse, default to auto_pinv_eig.

  • use_kazcmarz – Whether to use the kazcmarz scheme, default to False.

property state: Variational#

Variational state to be optimized.

property holomorphic: bool#

Whether the state is holomorphic.

property vs_type: int#

The vs_type of the state.

property imag_time: bool#

Whether to use imaginary-time evolution.

property kazcmarz_mu: float#

Whether to use the kazcmarz scheme.

get_Ebar() Array#

Method for computing \(\bar \epsilon\) in QNGD equaion, specified by the child class.

get_Obar(samples: Samples) Array#

Calculate \(\bar O = \frac{1}{\sqrt{N_s}}(\frac{1}{\psi} \frac{\partial \psi}{\partial \theta} - \left< \frac{1}{\psi} \frac{\partial \psi}{\partial \theta} \right>)\) for given samples.

solve(Obar: Array, Ebar: Array) Array#

Solve the equation \(\bar O \dot \theta = \bar \epsilon\) for given \(\bar O\) and \(\bar \epsilon\).

get_step(samples: Samples) Array#

Obtain the optimization step by solving the equation \(\bar O \dot \theta = \bar \epsilon\) for given samples.