---
title: AdaptVQE (v0.46)
description: API reference for qiskit.algorithms.minimum_eigensolvers.AdaptVQE in qiskit v0.46
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.AdaptVQE
---

# AdaptVQE

*class* `qiskit.algorithms.minimum_eigensolvers.AdaptVQE(solver, *, gradient_threshold=1e-05, eigenvalue_threshold=1e-05, max_iterations=None, threshold=None)`

[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.46/qiskit/algorithms/minimum_eigensolvers/adapt_vqe.py)

Bases: `VariationalAlgorithm`, [`MinimumEigensolver`](/docs/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.MinimumEigensolver "qiskit.algorithms.minimum_eigensolvers.minimum_eigensolver.MinimumEigensolver")

The Adaptive Variational Quantum Eigensolver algorithm.

[AdaptVQE](https://arxiv.org/abs/1812.11173) is a quantum algorithm which creates a compact ansatz from a set of evolution operators. It iteratively extends the ansatz circuit, by selecting the building block that leads to the largest gradient from a set of candidates. In chemistry, this is usually a list of orbital excitations. Thus, a common choice of ansatz to be used with this algorithm is the Unitary Coupled Cluster ansatz implemented in Qiskit Nature. This results in a wavefunction ansatz which is uniquely adapted to the operator whose minimum eigenvalue is being determined. This class relies on a supplied instance of [`VQE`](/docs/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQE "qiskit.algorithms.minimum_eigensolvers.VQE") to find the minimum eigenvalue. The performance of AdaptVQE significantly depends on the minimization routine.

```python
from qiskit.algorithms.minimum_eigensolvers import AdaptVQE, VQE
from qiskit.algorithms.optimizers import SLSQP
from qiskit.primitives import Estimator
from qiskit.circuit.library import EvolvedOperatorAnsatz

# get your Hamiltonian
hamiltonian = ...

# construct your ansatz
ansatz = EvolvedOperatorAnsatz(...)

vqe = VQE(Estimator(), ansatz, SLSQP())

adapt_vqe = AdaptVQE(vqe)

eigenvalue, _ = adapt_vqe.compute_minimum_eigenvalue(hamiltonian)
```

The following attributes can be set via the initializer but can also be read and updated once the AdaptVQE object has been constructed.

### solver

a [`VQE`](/docs/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQE "qiskit.algorithms.minimum_eigensolvers.VQE") instance used internally to compute the minimum eigenvalues. It is a requirement that the [`ansatz`](/docs/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQE#ansatz "qiskit.algorithms.minimum_eigensolvers.VQE.ansatz") of this solver is of type [`EvolvedOperatorAnsatz`](/docs/api/qiskit/0.46/qiskit.circuit.library.EvolvedOperatorAnsatz "qiskit.circuit.library.EvolvedOperatorAnsatz").

### gradient\_threshold

once all gradients have an absolute value smaller than this threshold, the algorithm has converged and terminates.

### eigenvalue\_threshold

once the eigenvalue has changed by less than this threshold from one iteration to the next, the algorithm has converged and terminates. When this case occurs, the excitation included in the final iteration did not result in a significant improvement of the eigenvalue and, thus, the results from this iteration are not considered.

### max\_iterations

the maximum number of iterations for the adaptive loop. If `None`, the algorithm is not bound in its number of iterations.

> **Deprecated since version 0.24.0\_pending**
>
> `qiskit.algorithms.minimum_eigensolvers.adapt_vqe.AdaptVQE.__init__()`’s argument `threshold` is pending deprecation as of qiskit-terra 0.24.0. It will be marked deprecated in a future release, and then removed no earlier than 3 months after the release date. Instead, use the argument `gradient_threshold`, which behaves identically.

**Parameters**

- **solver** ([*VQE*](/docs/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQE "qiskit.algorithms.minimum_eigensolvers.VQE")) – a [`VQE`](/docs/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQE "qiskit.algorithms.minimum_eigensolvers.VQE") instance used internally to compute the minimum eigenvalues. It is a requirement that the [`ansatz`](/docs/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQE#ansatz "qiskit.algorithms.minimum_eigensolvers.VQE.ansatz") of this solver is of type [`EvolvedOperatorAnsatz`](/docs/api/qiskit/0.46/qiskit.circuit.library.EvolvedOperatorAnsatz "qiskit.circuit.library.EvolvedOperatorAnsatz").
- **gradient\_threshold** ([*float*](https://docs.python.org/3/library/functions.html#float)) – once all gradients have an absolute value smaller than this threshold, the algorithm has converged and terminates.
- **eigenvalue\_threshold** ([*float*](https://docs.python.org/3/library/functions.html#float)) – once the eigenvalue has changed by less than this threshold from one iteration to the next, the algorithm has converged and terminates. When this case occurs, the excitation included in the final iteration did not result in a significant improvement of the eigenvalue and, thus, the results from this iteration are not considered.
- **max\_iterations** ([*int*](https://docs.python.org/3/library/functions.html#int) *| None*) – the maximum number of iterations for the adaptive loop. If `None`, the algorithm is not bound in its number of iterations.
- **threshold** ([*float*](https://docs.python.org/3/library/functions.html#float) *| None*) – once all gradients have an absolute value smaller than this threshold, the algorithm has converged and terminates. Defaults to `1e-5`.

## Attributes

### initial\_point

Returns the initial point of the internal [`VQE`](/docs/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQE "qiskit.algorithms.minimum_eigensolvers.VQE") solver.

### threshold

The threshold for the gradients.

Once all gradients have an absolute value smaller than this threshold, the algorithm has converged and terminates.

> **Deprecated since version 0.24.0\_pending**
>
> The property `qiskit.algorithms.minimum_eigensolvers.adapt_vqe.AdaptVQE.threshold` is pending deprecation as of qiskit-terra 0.24.0. It will be marked deprecated in a future release, and then removed no earlier than 3 months after the release date. Instead, use the gradient\_threshold attribute.

## Methods

### compute\_minimum\_eigenvalue

`compute_minimum_eigenvalue(operator, aux_operators=None)`

Computes the minimum eigenvalue.

**Parameters**

- **operator** (*BaseOperator |* [*PauliSumOp*](/docs/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp")) – Operator whose minimum eigenvalue we want to find.
- **aux\_operators** (*ListOrDict\[BaseOperator |* [*PauliSumOp*](/docs/api/qiskit/0.46/qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp")*] | None*) – Additional auxiliary operators to evaluate.

**Raises**

- [**TypeError**](https://docs.python.org/3/library/exceptions.html#TypeError) – If an ansatz other than [`EvolvedOperatorAnsatz`](/docs/api/qiskit/0.46/qiskit.circuit.library.EvolvedOperatorAnsatz "qiskit.circuit.library.EvolvedOperatorAnsatz") is provided.
- [**QiskitError**](/docs/api/qiskit/0.46/exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – If all evaluated gradients lie below the convergence threshold in the first iteration of the algorithm.

**Returns**

An [`AdaptVQEResult`](/docs/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.AdaptVQEResult "qiskit.algorithms.minimum_eigensolvers.AdaptVQEResult") which is a [`VQEResult`](/docs/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.VQEResult "qiskit.algorithms.minimum_eigensolvers.VQEResult") but also but also includes runtime information about the AdaptVQE algorithm like the number of iterations, termination criterion, and the final maximum gradient.

**Return type**

[AdaptVQEResult](/docs/api/qiskit/0.46/qiskit.algorithms.minimum_eigensolvers.AdaptVQEResult "qiskit.algorithms.minimum_eigensolvers.AdaptVQEResult")

### supports\_aux\_operators

*classmethod* `supports_aux_operators()`

Whether computing the expectation value of auxiliary operators is supported.

If the minimum eigensolver computes an eigenvalue of the main `operator` then it can compute the expectation value of the `aux_operators` for that state. Otherwise they will be ignored.

**Returns**

True if aux\_operator expectations can be evaluated, False otherwise

**Return type**

[bool](https://docs.python.org/3/library/functions.html#bool)
