Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amplitude Estimation algorithms #5517

Merged
merged 63 commits into from
Jan 13, 2021
Merged

Amplitude Estimation algorithms #5517

merged 63 commits into from
Jan 13, 2021

Conversation

Cryoris
Copy link
Contributor

@Cryoris Cryoris commented Dec 14, 2020

Summary

Adds the refactored amplitude estimation algorithms with a separated problem-algorithm workflow.

Details and comments

Add the refactored Amplitude Estimation algorithms:

  • AmplitudeEstimation (Brassard et al.)
  • MaximumLikelihoodAmplitudeEstimation (Suzuki et al.)
  • IterativeAmplitudeEstimation (Grinko et al.)
  • FasterAmplitudeEstimation (Nakaji)

The algorithms are separated from the problem-specific information, such as the A
and Q operators. This information is encapsulated in an
EstimationProblem. Each of the algorithms is thus re-usable for different problems and
different algorithms can easily be compared on the same problem.

The result objects are also more consistent and explicitly differ between the estimates for the amplitude (in [0,1]) and the post processed estimation.

@Cryoris Cryoris requested a review from a team as a code owner December 14, 2020 15:47
woodsp-ibm
woodsp-ibm previously approved these changes Jan 12, 2021
stefan-woerner
stefan-woerner previously approved these changes Jan 12, 2021
@Cryoris Cryoris added automerge Changelog: New Feature Include in the "Added" section of the changelog labels Jan 12, 2021
@Cryoris Cryoris removed the automerge label Jan 13, 2021
@Cryoris Cryoris dismissed stale reviews from stefan-woerner and woodsp-ibm via 52dd6a2 January 13, 2021 15:16
@Cryoris Cryoris merged commit 21f78dc into Qiskit:master Jan 13, 2021
@Cryoris Cryoris deleted the ae branch January 13, 2021 22:08
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request Jan 25, 2021
This commit adds a missing phase of pi to the grover operator circuit
library entry. It is a backport from Qiskit#5517.
mergify bot added a commit that referenced this pull request Jan 25, 2021
… (#5673)

* Fix global phase tracking around DAGCircuit.substitute_node. (#5618)

* DAGCircuit.__eq__ to check .global_phase and .calibrations.

* Fix BasisTranslator and Unroller global phase for substitute_node.

* Update releasenotes/notes/dagcircuit-fix-substitute-node-global-phase-usage-ee05476a7d0b24c6.yaml

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Update releasenotes/notes/dagcircuit-fix-substitute-node-global-phase-usage-ee05476a7d0b24c6.yaml

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 89cd41e)

* Backport global phase from #5517 on grover operator

This commit adds a missing phase of pi to the grover operator circuit
library entry. It is a backport from #5517.

* Remove backport of phase and calibrartions check to dagcircuit eq

In #5618 the dagcircuit __eq__ method was updated to also compare the
global_phase and calibrations property. This was done to ensure we
preserve both through a transpilation and other transforms since when we
assert a circuit is equal to the expect result it will also check phase.
However, this has backwards compatibility implications since comparing 2
QuantumCircuits would previously ignore global phase. This commit
removes this piece from the backport and just leave the phase
corrections as the backport.

Co-authored-by: Kevin Krsulich <kevin.krsulich@ibm.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
ElePT pushed a commit to ElePT/qiskit that referenced this pull request Jun 27, 2023
* 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>
ElePT pushed a commit to ElePT/qiskit-algorithms-test that referenced this pull request Jul 17, 2023
* 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 Qiskit/qiskit#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants