AdaptVQE
class AdaptVQE(transformation, solver, threshold=1e-05, delta=1, max_iterations=None)
Bases: qiskit.chemistry.algorithms.ground_state_solvers.ground_state_eigensolver.GroundStateEigensolver
A ground state calculation employing the AdaptVQE algorithm.
Parameters
- transformation (
FermionicTransformation
) – a fermionic driver to operator transformation strategy. - solver (
MinimumEigensolverFactory
) – a factory for the VQE solver employing a UCCSD variational form. - threshold (
float
) – the energy convergence threshold. It has a minimum value of 1e-15. - delta (
float
) – the finite difference step size for the gradient computation. It has a minimum value of 1e-5. - max_iterations (
Optional
[int
]) – the maximum number of iterations of the AdaptVQE algorithm.
Methods
evaluate_operators
AdaptVQE.evaluate_operators(state, operators)
Evaluates additional operators at the given state.
Parameters
- state (
Union
[str
,dict
,Result
,list
,ndarray
,Statevector
,QuantumCircuit
,Instruction
,OperatorBase
]) – any kind of input that can be used to specify a state. See alsoStateFn
for more details. - operators (
Union
[WeightedPauliOperator
,OperatorBase
,list
,dict
]) – either a single, list or dictionary ofWeightedPauliOperator``s or any kind of operator implementing the ``OperatorBase
.
Return type
Union
[float
, None
, List
[Optional
[float
]], Dict
[str
, List
[Optional
[float
]]]]
Returns
The expectation value of the given operator(s). The return type will be identical to the format of the provided operators.
returns_groundstate
AdaptVQE.returns_groundstate()
Whether the eigensolver returns the ground state or only ground state energy.
Return type
bool
solve
AdaptVQE.solve(driver, aux_operators=None)
Computes the ground state.
Parameters
- driver (
BaseDriver
) – a chemistry driver. - aux_operators (
Union
[List
[FermionicOperator
],List
[BosonicOperator
],None
]) – Additional auxiliaryFermionicOperator
instances to evaluate at the ground state.
Raises
AquaError – if a solver other than VQE or a variational form other than UCCSD is provided or if the algorithm finishes due to an unforeseen reason.
Return type
Union
[ElectronicStructureResult
, VibronicStructureResult
]
Returns
An AdaptVQEResult which is an ElectronicStructureResult but also includes runtime information about the AdaptVQE algorithm like the number of iterations, finishing criterion, and the final maximum gradient.
Attributes
solver
Returns the minimum eigensolver or factory.
Return type
Union
[MinimumEigensolver
, MinimumEigensolverFactory
]
transformation
Returns the transformation used to obtain a qubit operator from the molecule.
Return type
Transformation