125 lines
6.9 KiB
Plaintext
125 lines
6.9 KiB
Plaintext
---
|
||
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
|
||
---
|
||
|
||
<span id="qiskit-chemistry-algorithms-adaptvqe" />
|
||
|
||
# qiskit.chemistry.algorithms.AdaptVQE
|
||
|
||
<Class id="qiskit.chemistry.algorithms.AdaptVQE" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.8/qiskit/chemistry/algorithms/ground_state_solvers/adapt_vqe.py" signature="AdaptVQE(transformation, solver, threshold=1e-05, delta=1, max_iterations=None)" modifiers="class">
|
||
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.
|
||
|
||
### \_\_init\_\_
|
||
|
||
<Function id="qiskit.chemistry.algorithms.AdaptVQE.__init__" signature="__init__(transformation, solver, threshold=1e-05, delta=1, max_iterations=None)">
|
||
**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.
|
||
</Function>
|
||
|
||
## Methods
|
||
|
||
| | |
|
||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
|
||
| [`__init__`](#qiskit.chemistry.algorithms.AdaptVQE.__init__ "qiskit.chemistry.algorithms.AdaptVQE.__init__")(transformation, solver\[, …]) | **type transformation**`FermionicTransformation` |
|
||
| [`evaluate_operators`](#qiskit.chemistry.algorithms.AdaptVQE.evaluate_operators "qiskit.chemistry.algorithms.AdaptVQE.evaluate_operators")(state, operators) | Evaluates additional operators at the given state. |
|
||
| [`returns_groundstate`](#qiskit.chemistry.algorithms.AdaptVQE.returns_groundstate "qiskit.chemistry.algorithms.AdaptVQE.returns_groundstate")() | Whether the eigensolver returns the ground state or only ground state energy. |
|
||
| [`solve`](#qiskit.chemistry.algorithms.AdaptVQE.solve "qiskit.chemistry.algorithms.AdaptVQE.solve")(driver\[, aux\_operators]) | Computes the ground state. |
|
||
|
||
## Attributes
|
||
|
||
| | |
|
||
| ------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
|
||
| [`solver`](#qiskit.chemistry.algorithms.AdaptVQE.solver "qiskit.chemistry.algorithms.AdaptVQE.solver") | Returns the minimum eigensolver or factory. |
|
||
| [`transformation`](#qiskit.chemistry.algorithms.AdaptVQE.transformation "qiskit.chemistry.algorithms.AdaptVQE.transformation") | Returns the transformation used to obtain a qubit operator from the molecule. |
|
||
|
||
### evaluate\_operators
|
||
|
||
<Function id="qiskit.chemistry.algorithms.AdaptVQE.evaluate_operators" signature="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`, `List`\[`float`], `Dict`\[`str`, `List`\[`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="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="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>
|
||
|
||
### 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>
|
||
|