Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

Algorithms

qiskit.algorithms

It contains a collection of quantum algorithms, for use with quantum computers, to carry out research and investigate how to solve problems in different domains on near-term quantum devices with short depth circuits.

Algorithms configuration includes the use of optimizers which were designed to be swappable sub-parts of an algorithm. Any component and may be exchanged for a different implementation of the same component type in order to potentially alter the behavior and outcome of the algorithm.

Quantum algorithms are run via a QuantumInstance which must be set with the desired backend where the algorithm’s circuits will be executed and be configured with a number of compile and runtime parameters controlling circuit compilation and execution. It ultimately uses Terra for the actual compilation and execution of the quantum circuits created by the algorithm and its components.


Algorithms

It contains a variety of quantum algorithms and these have been grouped by logical function such as minimum eigensolvers and amplitude amplifiers.

Amplitude Amplifiers

AmplificationProblemThe amplification problem is the input to amplitude amplification algorithms, like Grover.
AmplitudeAmplifierThe interface for amplification algorithms.
GroverGrover's Search algorithm.
GroverResultGrover Result.

Amplitude Estimators

AmplitudeEstimatorThe Amplitude Estimation interface.
AmplitudeEstimatorResultThe results object for amplitude estimation algorithms.
AmplitudeEstimationThe Quantum Phase Estimation-based Amplitude Estimation algorithm.
AmplitudeEstimationResultThe AmplitudeEstimation result object.
EstimationProblemThe estimation problem is the input to amplitude estimation algorithm.
FasterAmplitudeEstimationThe Faster Amplitude Estimation algorithm.
FasterAmplitudeEstimationResultThe result object for the Faster Amplitude Estimation algorithm.
IterativeAmplitudeEstimationThe Iterative Amplitude Estimation algorithm.
IterativeAmplitudeEstimationResultThe IterativeAmplitudeEstimation result object.
MaximumLikelihoodAmplitudeEstimationThe Maximum Likelihood Amplitude Estimation algorithm.
MaximumLikelihoodAmplitudeEstimationResultThe MaximumLikelihoodAmplitudeEstimation result object.

Eigensolvers

Algorithms to find eigenvalues of an operator. For chemistry these can be used to find excited states of a molecule, and qiskit-nature has some algorithms that leverage chemistry specific knowledge to do this in that application domain.

Primitive-based Eigensolvers

These algorithms are based on the Qiskit Primitives, a new execution paradigm that replaces the use of QuantumInstance in algorithms. To ensure continued support and development, we recommend using the primitive-based Eigensolvers in place of the legacy QuantumInstance-based ones.

eigensolversEigensolvers Package (qiskit.algorithms.eigensolvers)

Legacy Eigensolvers

These algorithms, still based on the QuantumInstance, are superseded by the primitive-based versions in the section above but are still supported for now.

EigensolverPending deprecation: Eigensolver Interface.
EigensolverResultPending deprecation: Eigensolver Result.
NumPyEigensolverPending deprecation: NumPy Eigensolver algorithm.
VQDPending deprecation: Variational Quantum Deflation algorithm.
VQDResultPending deprecation: VQD Result.

Time Evolvers

Algorithms to evolve quantum states in time. Both real and imaginary time evolution is possible with algorithms that support them. For machine learning, Quantum Imaginary Time Evolution might be used to train Quantum Boltzmann Machine Neural Networks for example.

Primitive-based Time Evolvers

These algorithms are based on the Qiskit Primitives, a new execution paradigm that replaces the use of QuantumInstance in algorithms. To ensure continued support and development, we recommend using the primitive-based Time Evolvers in place of the legacy QuantumInstance-based ones.

RealTimeEvolverInterface for Quantum Real Time Evolution.
ImaginaryTimeEvolverInterface for Quantum Imaginary Time Evolution.
TimeEvolutionResultClass for holding time evolution result.
TimeEvolutionProblemTime evolution problem class.
PVQDThe projected Variational Quantum Dynamics (p-VQD) Algorithm.
PVQDResultThe result object for the p-VQD algorithm.
SciPyImaginaryEvolverClassical Evolver for imaginary time evolution.
SciPyRealEvolverClassical Evolver for real time evolution.
VarQITEVariational Quantum Imaginary Time Evolution algorithm.
VarQRTEVariational Quantum Real Time Evolution algorithm.

Legacy Time Evolvers

These algorithms, still based on the QuantumInstance, are superseded by the primitive-based versions in the section above but are still supported for now.

RealEvolverPending deprecation: Interface for Quantum Real Time Evolution.
ImaginaryEvolverPending deprecation: Interface for Quantum Imaginary Time Evolution.
TrotterQRTEPending deprecation: Quantum Real Time Evolution using Trotterization.
EvolutionResultPending deprecation: Class for holding evolution result.
EvolutionProblemPending deprecation: Evolution problem class.

Variational Quantum Time Evolution

Classes used by variational quantum time evolution algorithms - VarQITE and VarQRTE.

time_evolvers.variationalVariational Quantum Time Evolutions (qiskit.algorithms.time_evolvers.variational)

Trotterization-based Quantum Real Time Evolution

Package for primitives-enabled Trotterization-based quantum time evolution algorithm - TrotterQRTE.

time_evolvers.trotterizationThis package contains Trotterization-based Quantum Real Time Evolution algorithm.

Factorizers

Algorithms to find factors of a number.

ShorThe deprecated Shor's factoring algorithm.
ShorResultThe deprecated Shor Result.

Gradients

Algorithms to calculate the gradient of a quantum circuit.

gradientsGradients (qiskit.algorithms.gradients)

Linear Solvers

Algorithms to solve linear systems of equations.

linear_solversThe deprecated Linear solvers (qiskit.algorithms.linear_solvers) It contains classical and quantum algorithms to solve systems of linear equations such as HHL. Although the quantum algorithm accepts a general Hermitian matrix as input, Qiskit's default Hamiltonian evolution is exponential in such cases and therefore the quantum linear solver will not achieve an exponential speedup. Furthermore, the quantum algorithm can find a solution exponentially faster in the size of the system than their classical counterparts (i.e. logarithmic complexity instead of polynomial), meaning that reading the full solution vector would kill such speedup (since this would take linear time in the size of the system). Therefore, to achieve an exponential speedup we can only compute functions from the solution vector (the so called observables) to learn information about the solution. Known efficient implementations of Hamiltonian evolutions or observables are contained in the following subfolders:

Minimum Eigensolvers

Algorithms that can find the minimum eigenvalue of an operator.

Primitive-based Minimum Eigensolvers

These algorithms are based on the Qiskit Primitives, a new execution paradigm that replaces the use of QuantumInstance in algorithms. To ensure continued support and development, we recommend using the primitive-based Minimum Eigensolvers in place of the legacy QuantumInstance-based ones.

minimum_eigensolversMinimum Eigensolvers Package (qiskit.algorithms.minimum_eigensolvers)

Legacy Minimum Eigensolvers

These algorithms, still based on the QuantumInstance, are superseded by the primitive-based versions in the section above but are still supported for now.

MinimumEigensolverPending deprecation: Minimum Eigensolver Interface.
MinimumEigensolverResultPending deprecation: Minimum Eigensolver Result.
NumPyMinimumEigensolverPending deprecation: Numpy Minimum Eigensolver algorithm.
QAOAPending deprecation: Quantum Approximate Optimization Algorithm.
VQEPending deprecation: Variational Quantum Eigensolver algorithm.

Optimizers

Classical optimizers for use by quantum variational algorithms.

optimizersOptimizers (qiskit.algorithms.optimizers) It contains a variety of classical optimizers for use by quantum variational algorithms, such as VQE. Logically, these optimizers can be divided into two categories:

Phase Estimators

Algorithms that estimate the phases of eigenstates of a unitary.

HamiltonianPhaseEstimationRun the Quantum Phase Estimation algorithm to find the eigenvalues of a Hermitian operator.
HamiltonianPhaseEstimationResultStore and manipulate results from running HamiltonianPhaseEstimation.
PhaseEstimationScaleSet and use a bound on eigenvalues of a Hermitian operator in order to ensure phases are in the desired range and to convert measured phases into eigenvectors.
PhaseEstimationRun the Quantum Phase Estimation (QPE) algorithm.
PhaseEstimationResultStore and manipulate results from running PhaseEstimation.
IterativePhaseEstimationRun the Iterative quantum phase estimation (QPE) algorithm.

State Fidelities

Algorithms that compute the fidelity of pairs of quantum states.

state_fidelitiesState Fidelity Interfaces (qiskit.algorithms.state_fidelities)

Exceptions

AlgorithmError(*message)For Algorithm specific errors.

Utility methods

Utility methods used by algorithms.

eval_observables(quantum_instance, ...[, ...])Pending deprecation: Accepts a list or a dictionary of operators and calculates their expectation values - means and standard deviations.
estimate_observables(estimator, ...[, ...])Accepts a sequence of operators and calculates their expectation values - means and metadata.

Utility classes

Utility classes used by algorithms (mainly for type-hinting purposes).

AlgorithmJob(function, *args, **kwargs)This empty class is introduced for typing purposes.
Was this page helpful?
Report a bug or request content on GitHub.