Skip to content
This repository was archived by the owner on Dec 7, 2021. It is now read-only.

Refactor QAE using the Grover operator #1234

Merged
merged 53 commits into from
Sep 15, 2020

Conversation

Cryoris
Copy link
Contributor

@Cryoris Cryoris commented Sep 4, 2020

Summary

Part of the Finance refactor, where the GroverOperator is used in both Grover's algorithm and all Amplitude Estimation algorithms.

Details and comments

Updates the signature to comply with the GroverOperator names and the plan for Grover's algorithm and uses the GroverOperator internally where possibly. The old tests are maintained in test_amplitude_estimation_circuitfactory until the circuit factories are deleted.

The tests should also be refactored at some point to test less standard cases (to be faster) and more corner cases (to test more precisely). But this is part of a later PR.

Draft because the

  • docstrings need to be double-checked
  • the tests aren't completely ready yet
  • the Git history must be cleaned up

@Cryoris Cryoris marked this pull request as draft September 4, 2020 13:19
@woodsp-ibm woodsp-ibm added this to the 0.8 milestone Sep 11, 2020
@woodsp-ibm
Copy link
Member

Given the various changes to the Grover and AE algos at what point is a reno release note relevant. It could be done for here to note the changes on how these are built out.

@woodsp-ibm woodsp-ibm added the Changelog: API Change Include in the Changed section of the changelog label Sep 11, 2020
@Cryoris Cryoris requested a review from pbark as a code owner September 14, 2020 10:26
@Cryoris
Copy link
Contributor Author

Cryoris commented Sep 14, 2020

I added a reno 👍

Also I removed the deprecation warnings if a CircuitFactory is passed, since there are still several classes based on the circuit factory (mainly MultivariateProblem and UnivariateProblem) that should be deprecated, along with a suggestion on how to use circuits instead, before raising warnings in QAE. The goal for this is this release, but I'd rather do all deprecations together.

@Cryoris Cryoris merged commit e44bb20 into qiskit-community:master Sep 15, 2020
@Cryoris Cryoris deleted the grover-operator branch September 15, 2020 09:03
pbark pushed a commit to pbark/qiskit-aqua that referenced this pull request Sep 16, 2020
* make AE work on circuits

* rename a_operator to state_in

* make use of library PEC and AncillaRegister

* simplify iqae, dont ask for num_ancilla anymore

* add new signature to AE and loads of deprecation warnings

* ignore warnings add post processing

* move to new test file

* all AE variants running

* split is_good_state in objective qubits and callable

* fix docstrings and unused imports

* cleanup, remove _append

* mv to using bitstr oracle

* fix qubit caching, rm BitOracle

* adapt to updates in GroverOperator

* rm trailing IQFT type

* update docstrings, remove global invalid name

* delete temporary bit oracle & grover op

* update docstrings

* fix missing value_to_estimation, filter depr. warn

* rm callable as objective_qubits

* use math for ratio Ki+1/Ki

* improve docstrings and error messages

* Update test/aqua/test_amplitude_estimation_circuitfactory.py

Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>

* add type hints to PEC

* remove support for circuits in PEC component

if circuits are used as A/Q operators in QAE, the PEC form the circuit library is used instead

* don't deprecte circuit factories yet

* add reno

* fix a/q_factory = None

* try to fix RST in reno

Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com>
Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
manoelmarques added a commit to qiskit-community/qiskit-finance that referenced this pull request Jan 19, 2021
…1234)

* make AE work on circuits

* rename a_operator to state_in

* make use of library PEC and AncillaRegister

* simplify iqae, dont ask for num_ancilla anymore

* add new signature to AE and loads of deprecation warnings

* ignore warnings add post processing

* move to new test file

* all AE variants running

* split is_good_state in objective qubits and callable

* fix docstrings and unused imports

* cleanup, remove _append

* mv to using bitstr oracle

* fix qubit caching, rm BitOracle

* adapt to updates in GroverOperator

* rm trailing IQFT type

* update docstrings, remove global invalid name

* delete temporary bit oracle & grover op

* update docstrings

* fix missing value_to_estimation, filter depr. warn

* rm callable as objective_qubits

* use math for ratio Ki+1/Ki

* improve docstrings and error messages

* Update test/aqua/test_amplitude_estimation_circuitfactory.py

Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>

* add type hints to PEC

* remove support for circuits in PEC component

if circuits are used as A/Q operators in QAE, the PEC form the circuit library is used instead

* don't deprecte circuit factories yet

* add reno

* fix a/q_factory = None

* try to fix RST in reno

Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com>
Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
mtreinish added a commit to Qiskit/qiskit-bot that referenced this pull request Mar 22, 2021
In the upcoming qiskit-terra release a large chunk of qiskit-aqua's
history was migrated into qiskit-terra. These commit messages use
qiskit-aqua's commit summary line in the form of
"qiskit-community/qiskit-aqua#1234" which breaks PR lookup because the regex
match returns that full string which raises a Value error when later we
try to convert the match string into an int. This commit avoids that
error by catching the value error and just skipping that PR lookup,
since it isn't relevant for the changelog anyway.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Changelog: API Change Include in the Changed section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants