qat.plugins.AdaptVQEPlugin

class qat.plugins.AdaptVQEPlugin(operator_pool: List[Observable], n_iterations: int = 300, tol_vanishing_grad: float = 0.001, commutators=None)

Plugin implementation of the ADAPT-VQE algorithm, which builds ansatze by selecting operators \(\tau_k\) from a user-defined pool of operators. Once an operator is chosen, a parameterized gate \(\exp(\theta_k \tau_k)\) is added to the circuit. The method is based on the Grimsley et al. publication.

Parameters
  • operator_pool (List[Observable]) – List of operators \(\tau_k\) to choose from (they should be antihermitian). The pool of commutators is either given by the user or internally constructed from this list.

  • n_iterations (int, optional) – Maximum number of iterations to perform. Defaults to 300.

  • tol_vanishing_grad (float, optional) – threshold value of the norm-2 of the gradient vector under which to stop the computation. Defaults to 1e-3.

  • commutators (List[Observable], optional) – List of commutators between the observable and an operator from the pool, whose expectation values yield the gradient. Defaults to None, in which case it is constructed when the plugin is run.

compile(batch: Batch) Batch

Loops a batch through all the plugins present inside the QPU.

Parameters

batch (Batch) – a batch of jobs. If a single job is provided, the job is embedded into a Batch, compiled, and the first result is returned.

Returns

a batch of jobs

Return type

(Batch)