Skip to content

Commit

Permalink
Amplitude Estimation algorithms (#5517)
Browse files Browse the repository at this point in the history
* ae codes

* add tests

* update docstrings in result objects

* add reno

* fix old aqua dependencies

* fix cyclic imports

* try fixing windows tests no. 1

* fix test

* try fixing windows attempt #2

* stefan's first comments

* accumulate -> evaluate in AE
* prob to meas 1 -> prob good state

* stefans comments pt. 2

* fix lint & indent

* add faster ae + bernoulli tests

* fix > 1 qubit case

* add comments

* add FAE specific tests

* raise error for rescale on custom q operator

* play with the oracles

* fix classicalregister > 1

* use correct reflection and rm X gates around oracle

* fix construction of rescaled est. problem

* fix phase in grover op

* adjust result objects

* adjust fae result object

* fix minus sign and lint

* rm trailing whitespaces

* fix tests

* fix lint

* rm utf8 header

* move rescale to problem, add evalschedule to MLAE

* code review suggestions

* state and obj.qubits not optional in estimation problem
* add QAE algos to documentation
* allow setting post processing and is good state to None to use default
* rm quantum instance logic from interface
* fix typehints for is good state
* add Faster AE to reno
* reset shots to user defined shots in FAE

* fix doc build (hopefully)

* add result classes to docs

* make grover op optional in setter

* rm reno -- there will be a global one

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 13, 2021
1 parent 799ad14 commit 21f78dc
Show file tree
Hide file tree
Showing 11 changed files with 3,223 additions and 0 deletions.
38 changes: 38 additions & 0 deletions qiskit/algorithms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,25 @@
Grover
GroverResult
Amplitude Estimators
++++++++++++++++++++
.. autosummary::
:toctree: ../stubs/
:nosignatures:
AmplitudeEstimator
AmplitudeEstimatorResult
AmplitudeEstimation
AmplitudeEstimationResult
EstimationProblem
FasterAmplitudeEstimation
FasterAmplitudeEstimationResult
IterativeAmplitudeEstimation
IterativeAmplitudeEstimationResult
MaximumLikelihoodAmplitudeEstimation
MaximumLikelihoodAmplitudeEstimationResult
Eigensolvers
++++++++++++
Algorithms to find eigenvalues of an operator. For chemistry these can be used to find excited
Expand Down Expand Up @@ -109,6 +128,14 @@
from .algorithm_result import AlgorithmResult
from .variational_algorithm import VariationalAlgorithm, VariationalResult
from .amplitude_amplifiers import Grover, GroverResult
from .amplitude_estimators import (
AmplitudeEstimator, AmplitudeEstimatorResult,
AmplitudeEstimation, AmplitudeEstimationResult,
FasterAmplitudeEstimation, FasterAmplitudeEstimationResult,
IterativeAmplitudeEstimation, IterativeAmplitudeEstimationResult,
MaximumLikelihoodAmplitudeEstimation, MaximumLikelihoodAmplitudeEstimationResult,
EstimationProblem
)
from .eigen_solvers import NumPyEigensolver, Eigensolver, EigensolverResult
from .factorizers import Shor, ShorResult
from .minimum_eigen_solvers import (VQE, VQEResult, QAOA,
Expand All @@ -122,6 +149,17 @@
'VariationalResult',
'Grover',
'GroverResult',
'AmplitudeEstimator',
'AmplitudeEstimatorResult',
'AmplitudeEstimation',
'AmplitudeEstimationResult',
'FasterAmplitudeEstimation',
'FasterAmplitudeEstimationResult',
'IterativeAmplitudeEstimation',
'IterativeAmplitudeEstimationResult',
'MaximumLikelihoodAmplitudeEstimation',
'MaximumLikelihoodAmplitudeEstimationResult',
'EstimationProblem',
'NumPyEigensolver',
'Eigensolver',
'EigensolverResult',
Expand Down
34 changes: 34 additions & 0 deletions qiskit/algorithms/amplitude_estimators/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""The Amplitude Estimators package."""

from .amplitude_estimator import AmplitudeEstimator, AmplitudeEstimatorResult
from .ae import AmplitudeEstimation, AmplitudeEstimationResult
from .fae import FasterAmplitudeEstimation, FasterAmplitudeEstimationResult
from .iae import IterativeAmplitudeEstimation, IterativeAmplitudeEstimationResult
from .mlae import MaximumLikelihoodAmplitudeEstimation, MaximumLikelihoodAmplitudeEstimationResult
from .estimation_problem import EstimationProblem

__all__ = [
'AmplitudeEstimator',
'AmplitudeEstimatorResult',
'AmplitudeEstimation',
'AmplitudeEstimationResult',
'FasterAmplitudeEstimation',
'FasterAmplitudeEstimationResult',
'IterativeAmplitudeEstimation',
'IterativeAmplitudeEstimationResult',
'MaximumLikelihoodAmplitudeEstimation',
'MaximumLikelihoodAmplitudeEstimationResult',
'EstimationProblem',
]
Loading

0 comments on commit 21f78dc

Please sign in to comment.