adapt
A Python package to run ADAPT-VQE.
Submodules
Package Contents
Classes
Class representing an individual XIPHOS calculation |
Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Attributes
- adapt.Eh = 627.5094740631
- class adapt.Xiphos(H, ref, system, pool, v_pool, H_adapt=None, H_vqe=None, sym_ops=None)[source]
Class representing an individual XIPHOS calculation
- random_adapt(params, ansatz, ref, gtol=None, Etol=None, max_depth=None, criteria='grad', guesses=0)[source]
- breadapt(params, ansatz, ref, gtol=None, Etol=None, max_depth=None, guesses=0, n=1, hf=True, threads=1, seed=0, criteria='grad')[source]
Run one or more ADAPT^N Calculations without generator diagonalization
- Parameters:
params, ansatz (list) – Lists of parameters and operator indices to use as the initial ansatz and parameters Only recommend using non-empty lists for N = 1
ref (scipy sparse matrix) – Reference matrix
gtol, Etol (float) – gradient norm and energy thresholds
max_depth (int) – Max number of operators to use
guesses (int) – Number of random guesses to try at each step
hf (bool) – Whether to try the HF (all zeros) initialization at each step
threads (int) – Number of threads to use for multiple BFGS threads
seed (int) – Seed for random number generator
criteria (string) – Criterion to use for operator addition
- Returns:
error – The error from exact diagonalization
- Return type:
float
- gd_multi_vqe(params, ansatz, guesses=0, hf=True, threads=1, F=None, follow=0, diags=None, unitaries=None)[source]
- gd_pretend_adapt(params, ansatz, ref, order=[], gtol=None, Etol=None, max_depth=None, guesses=0, hf=True, threads=1, seed=0, F=None, steps=100)[source]
Run one or more ADAPT calculations with diagonalized generators
- Parameters:
params, ansatz (list) – Lists of parameters and operator indices to use as the initial ansatz and parameters Only recommend using non-empty lists for N = 1
ref (scipy sparse matrix) – Reference matrix
gtol, Etol (float) – gradient norm and energy thresholds
max_depth (int) – Max number of operators to use
guesses (int) – Number of random guesses to try at each step
hf (bool) – Whether to try the HF (all zeros) initialization at each step
threads (int) – Number of threads to use for multiple BFGS threads
seed (int) – Seed for random number generator
F (scipy sparse matrix) – Fock operator for adiabatic optimizer
steps (int) – Number of adiabatic steps to take
- Returns:
error – The error from exact diagonalization
- Return type:
float
- gd_adapt(params, ansatz, ref, gtol=None, Etol=None, max_depth=None, guesses=0, hf=True, threads=1, seed=0, F=None, steps=100, follow=0)[source]
Run one or more ADAPT calculations with diagonalized generators
- Parameters:
params, ansatz (list) – Lists of parameters and operator indices to use as the initial ansatz and parameters Only recommend using non-empty lists for N = 1
ref (scipy sparse matrix) – Reference matrix
gtol, Etol (float) – gradient norm and energy thresholds
max_depth (int) – Max number of operators to use
guesses (int) – Number of random guesses to try at each step
hf (bool) – Whether to try the HF (all zeros) initialization at each step
threads (int) – Number of threads to use for multiple BFGS threads
seed (int) – Seed for random number generator
F (scipy sparse matrix) – Fock operator for adiabatic optimizer
steps (int) – Number of adiabatic steps to take
follow (int) – Which solution to follow. (I.e. 0 uses the recycled guess to pick the next operator. 1 uses HF if HF is True, etc.)
- Returns:
error – The error from exact diagonalization
- Return type:
float
- adapt.multi_vqe(params, ansatz, H_vqe, pool, ref, xiphos, energy=None, guesses=0, hf=True, threads=1, F=None)[source]
- adapt.solution_analysis(L, ansatz, H_vqe, pool, ref, seeds, param_list, E0s, xiphos, guess='recycled')[source]
- adapt.versions