qiskit-documentation/docs/api/qiskit/0.29/qiskit.chemistry.algorithms...

101 lines
3.9 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: AdaptVQE
description: API reference for qiskit.chemistry.algorithms.AdaptVQE
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.chemistry.algorithms.AdaptVQE
---
# AdaptVQE
<Class id="qiskit.chemistry.algorithms.AdaptVQE" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.9/qiskit/chemistry/algorithms/ground_state_solvers/adapt_vqe.py" signature="AdaptVQE(transformation, solver, threshold=1e-05, delta=1, max_iterations=None)" modifiers="class">
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
<Function id="qiskit.chemistry.algorithms.AdaptVQE.evaluate_operators" signature="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 also `StateFn` for more details.
* **operators** (`Union`\[`WeightedPauliOperator`, `OperatorBase`, `list`, `dict`]) either a single, list or dictionary of `WeightedPauliOperator``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.
</Function>
### returns\_groundstate
<Function id="qiskit.chemistry.algorithms.AdaptVQE.returns_groundstate" signature="AdaptVQE.returns_groundstate()">
Whether the eigensolver returns the ground state or only ground state energy.
**Return type**
`bool`
</Function>
### solve
<Function id="qiskit.chemistry.algorithms.AdaptVQE.solve" signature="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 auxiliary `FermionicOperator` instances to evaluate at the ground state.
**Raises**
[**AquaError**](qiskit.aqua.AquaError "qiskit.aqua.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.
</Function>
## Attributes
### solver
<Attribute id="qiskit.chemistry.algorithms.AdaptVQE.solver">
Returns the minimum eigensolver or factory.
**Return type**
`Union`\[`MinimumEigensolver`, `MinimumEigensolverFactory`]
</Attribute>
### transformation
<Attribute id="qiskit.chemistry.algorithms.AdaptVQE.transformation">
Returns the transformation used to obtain a qubit operator from the molecule.
**Return type**
`Transformation`
</Attribute>
</Class>