qrunch.chemistry.ground_state_problem.calculators.vqe_creator

Module containing all the VQE (Variational Quantum Eigensolver) algorithms with chemistry-tailored defaults.

Functions

chemistry_default_boson_estimator()

Create an ExcitationGateEstimator configured for BEAST-VQE (recommended default).

chemistry_default_boson_sampler()

Create an ExcitationGateSampler configured for BEAST-VQE (recommended default).

chemistry_default_fermion_estimator()

Create an ExcitationGateEstimator configured for FAST-VQE (recommended default).

chemistry_default_fermion_sampler()

Create an ExcitationGateSampler configured for FAST-VQE (recommended default).

fast_gate_selector_creator()

Create a FAST Gate selector creator, with chemistry defaults.

vqe_creator()

Create a VQE algorithm creator.

Classes

IterativeVqeCreator

creator for all types of VQE algorithms.

OrbitalOptimizedIterativeVqeCreator

creator for all types of VQE algorithms.

VqeCreator

creator for all types of VQE algorithms.

class IterativeVqeCreator

Bases: object

creator for all types of VQE algorithms.

static beast() BeastSecondQuantizationAdaptiveVqeCreator

Narrow the VQE type to BEAST-VQE (without orbital optimization) with chemistry defaults.

Return type:

BeastSecondQuantizationAdaptiveVqeCreator

static paired_electron_approximation() SecondQuantizationAdaptiveVqeCreator

Narrow to paired electron approximation version (without orbital optimization).

Return type:

SecondQuantizationAdaptiveVqeCreator

static standard() SecondQuantizationAdaptiveVqeCreator

Narrow the VQE type to an adaptive VQE (defaults to FAST-VQE), with chemistry default settings.

An adaptive VQE is a VQE that grows the ansatz during the optimization, by selecting gates from a pool. The difference between FAST-VQE and other adaptive schemes, such as ADAPT-VQE (https://arxiv.org/pdf/1812.11173) is the gate selection strategy. FAST-VQE uses a heuristic strategy to select gates (either a heuristic gradient or heuristic selected CI), while ADAPT-VQE uses the exact gradient.

To use ADAPT-VQE instead of FAST-VQE, use the with_gate_selector() method with a gate_selector created by following the adapt-path in the gate_selector_creator().

Return type:

SecondQuantizationAdaptiveVqeCreator

class OrbitalOptimizedIterativeVqeCreator

Bases: object

creator for all types of VQE algorithms.

static beast() BeastSecondQuantizationAdaptiveOrbitalOptimizationVqeCreator

Narrow the VQE type to BEAST-VQE with orbital optimization with chemistry defaults.

BEAST-VQE is an iterative VQE (grows the ansatz during the optimization, by selecting gates from a pool), that is specific to bosonic encoding of paired electrons in molecular ground state energy problems.

In addition, the adaptive orbital optimization VQE also optimizes the molecular orbitals to find a better basis for the problem. This is particularly useful in the bosonic-encoding case, where the orbital optimization can significantly improve the accuracy of the results.

Return type:

BeastSecondQuantizationAdaptiveOrbitalOptimizationVqeCreator

static paired_electron_approximation() SecondQuantizationAdaptiveOrbitalOptimizationVqeCreator

Narrow to paired electron approximation version with orbital optimization.

It grows the ansatz during the optimization, by selecting gates from a pool, that is specific to bosonic encoding of paired electrons in molecular ground state energy problems. This enables a specialized gate set (only singles, corresponding to paired-excitations, are needed), and a highly simplified Hamiltonian whose expectation value can be measured only using three distinct measurement bases.

In addition, the adaptive orbital optimization VQE also optimizes the molecular orbitals to find a better basis for the problem. This is particularly useful in the bosonic-encoding case, where the orbital optimization can significantly improve the accuracy of the results.

Return type:

SecondQuantizationAdaptiveOrbitalOptimizationVqeCreator

static standard() SecondQuantizationAdaptiveOrbitalOptimizationVqeCreator

Narrow the VQE type to an adaptive VQE (defaults to FAST-VQE), with chemistry default settings.

An adaptive VQE is a VQE that grows the ansatz during the optimization, by selecting gates from a pool. The difference between FAST-VQE and other adaptive schemes, such as ADAPT-VQE (https://arxiv.org/pdf/1812.11173) is the gate selection strategy. FAST-VQE uses a heuristic strategy to select gates (either a heuristic gradient or heuristic selected CI), while ADAPT-VQE uses the exact gradient.

To use ADAPT-VQE instead of FAST-VQE, use the with_gate_selector() method with a gate_selector created by following the adapt-path in the gate_selector_creator().

Return type:

SecondQuantizationAdaptiveOrbitalOptimizationVqeCreator

class VqeCreator

Bases: object

creator for all types of VQE algorithms.

static fixed_ansatz() SecondQuantizationBasicVqeCreator

Narrow the VQE type to a basic VQE, with chemistry defaults.

A basic VQE is a VQE that does not grow the ansatz, but uses a fixed ansatz provided by the user.

Return type:

SecondQuantizationBasicVqeCreator

static iterative() IterativeVqeCreator

Narrow the VQE type to an iterative VQE (defaults to FAST-VQE), with chemistry default settings.

An adaptive VQE is a VQE that grows the ansatz during the optimization, by selecting gates from a pool. The difference between FAST-VQE and other adaptive schemes, such as ADAPT-VQE (https://arxiv.org/pdf/1812.11173) is the gate selection strategy. FAST-VQE uses a heuristic strategy to select gates (either a heuristic gradient or heuristic selected CI), while ADAPT-VQE uses the exact gradient.

To use ADAPT-VQE instead of FAST-VQE, use the with_gate_selector() method with a gate_selector created by following the adapt-path in the gate_selector_creator().

Return type:

IterativeVqeCreator

static iterative_with_orbital_optimization() OrbitalOptimizedIterativeVqeCreator

Narrow to an iterative VQE with orbital optimization.

It defaults to OO-FAST-VQE, with chemistry default settings.

An adaptive VQE is a VQE that grows the ansatz during the optimization, by selecting gates from a pool. The difference between FAST-VQE and other adaptive schemes, such as ADAPT-VQE (https://arxiv.org/pdf/1812.11173) is the gate selection strategy. FAST-VQE uses a heuristic strategy to select gates (either a heuristic gradient or heuristic selected CI), while ADAPT-VQE uses the exact gradient.

To use ADAPT-VQE instead of FAST-VQE, use the with_gate_selector() method with a gate_selector created by following the adapt-path in the gate_selector_creator().

Return type:

OrbitalOptimizedIterativeVqeCreator

chemistry_default_boson_estimator() ExcitationGateEstimator

Create an ExcitationGateEstimator configured for BEAST-VQE (recommended default).

Return type:

ExcitationGateEstimator

chemistry_default_boson_sampler() ExcitationGateSampler

Create an ExcitationGateSampler configured for BEAST-VQE (recommended default).

Return type:

ExcitationGateSampler

chemistry_default_fermion_estimator() ExcitationGateEstimator

Create an ExcitationGateEstimator configured for FAST-VQE (recommended default).

Return type:

ExcitationGateEstimator

chemistry_default_fermion_sampler() ExcitationGateSampler

Create an ExcitationGateSampler configured for FAST-VQE (recommended default).

Return type:

ExcitationGateSampler

fast_gate_selector_creator() FastGateSelectorCreator

Create a FAST Gate selector creator, with chemistry defaults. Configured for FAST-VQE (recommended default).

Return type:

FastGateSelectorCreator

vqe_creator() VqeCreator

Create a VQE algorithm creator.

Return type:

VqeCreator