qrunch.quantum.algorithms.pauli.vqes.adapt_gate_selector

Implementation of ADAPT-VQE (https://arxiv.org/pdf/1812.11173).

The core logic that defines the ADAPT-specific behavior is defined in the ADAPTGateSelector, and the class for running the ADAPT-VQE algorithm is just a class that calls the AdaptiveVqe class with the ADAPTGateSelector and some standard options.

Classes

AdaptGateSelector

Implementation of the GateSelector for ADAPT-VQE.

class AdaptGateSelector

Bases: GateSelector

Implementation of the GateSelector for ADAPT-VQE.

This gate selector uses the gate parameter gradient as the importance metric and does not perform any modifications on the gate pool.

Using this in the AdaptiveVQE results in an implementation of the ADAPT-VQE algorithm.

__init__(estimator: Estimator, shots: int | ShotsPerGroup | None) → None

Initialize the ADAPT GateSelector.

Parameters:
Return type:

None

clear_cache() → None

Clear the cache of the estimator used in the Gate selector.

Return type:

None

register_gate_pool(gate_pool: GatePool) → None

Register the gate pool.

Parameters:

gate_pool (GatePool) – the gate pool to register in the GateSelector. The GateSelector can only choose gates from this.

Return type:

None

select_gates(observable: HermitianPauliSum, circuit: Circuit, *, number_of_gates: int = 1) → list[GatePoolOperator]

Select the best gates from the gate pool for minimizing the expectation value of the observable.

Parameters:
  • observable (HermitianPauliSum) – The observable whose expectation value should be minimized.

  • circuit (Circuit) – The circuit to extend with a gate from the gate pool.

  • number_of_gates (int) – Number of gates to select.

Returns:

The gate to append to the circuit.

Return type:

list[GatePoolOperator]