qrunch.quantum.algorithms.second_quantization.vqes.adaptive_vqe

Module containing adaptive VQE.

Classes

SecondQuantizationAdaptiveVqe

VQE that takes an adaptive VQE as the underlying algorithm.

class SecondQuantizationAdaptiveVqe

Bases: SecondQuantizationAdaptiveVqeAlgorithm

VQE that takes an adaptive VQE as the underlying algorithm.

__init__(vqe: PauliAdaptiveVqeAlgorithm, mapper: Mapper | None = None) → None

Initialize adaptive VQE.

Parameters:
Return type:

None

clear_cache() → None

Clear the cache of the underlying VQE.

Return type:

None

classmethod persistence_checkpoints() → list[str]

Define the persistence checkpoints used during the adaptive vqe.

These checkpoints specify computational stages where intermediate results can be saved and loaded to optimize computations and ensure reproducibility.

Return type:

list[str]

run(second_quantized_operator: T, gate_pool: GatePool, initial_ansatz: Circuit, callback: AdaptiveIterationCallback | None = None, input_result: SecondQuantizationAdaptiveVqeResult[T] | None = None) → SecondQuantizationAdaptiveVqeResult[T]

Run the VQE and find the eigenvalue.

Parameters:
  • second_quantized_operator (T) – The operator whose expectation value should be minimized.

  • gate_pool (GatePool) – The set of gates to choose from when building the ansatz.

  • initial_ansatz (Circuit) – The starting ansatz circuit. Gates from the gate_pool is appended to this.

  • callback (AdaptiveIterationCallback | None) – An optional callback function that is called at each minimizer iteration.

  • input_result (SecondQuantizationAdaptiveVqeResult[T] | None) – A prior results that should be refined.

Return type:

SecondQuantizationAdaptiveVqeResult[T]