-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix VQD callback not being used #8576
Conversation
Fixes Qiskit#415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally.
Fixes Qiskit#415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally.
… into qeom_commit_aerpauliexpectation # Conflicts: # qiskit/opflow/expectations/aer_pauli_expectation.py
… into qeom_commit_aerpauliexpectation # Conflicts: # qiskit/opflow/expectations/aer_pauli_expectation.py
… into qeom_commit_aerpauliexpectation
… into qeom_commit_aerpauliexpectation # Conflicts: # test/python/opflow/test_aer_pauli_expectation.py
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Use a generator instead of list
Co-authored-by: Julien Gacon <gaconju@gmail.com>
…ation-653d8e16de4eca07.yaml Co-authored-by: Julien Gacon <gaconju@gmail.com>
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 2921681226
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I did have a small question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks for the fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
* Added support for non-hermitian operators in AerPauliExpectation Fixes Qiskit#415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally. * Added support for non-hermitian operators in AerPauliExpectation Fixes Qiskit#415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally. * Add a test case for non-hermitian operators. * Add a test case for non-hermitian operators. * Add a test case for non-hermitian operators. * Update test/python/opflow/test_aer_pauli_expectation.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update aer_pauli_expectation.py Use a generator instead of list * Update qiskit/opflow/expectations/aer_pauli_expectation.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update releasenotes/notes/add-support-non-hermitian-op-aerpauliexpectation-653d8e16de4eca07.yaml Co-authored-by: Julien Gacon <gaconju@gmail.com> * Add a test case for PauliOp * Change the test cases from using ~StateFn() to using StateFn(, is_measurement=True) * Fix the formatting * Working point for QEOM * Small changes + Release note * Undesired change * Undesired change * Indentation error * Parenthesis * Minor changes in docstring * Minor changes in docstring Co-authored-by: Julien Gacon <gaconju@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Added support for non-hermitian operators in AerPauliExpectation Fixes Qiskit/qiskit#415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally. * Added support for non-hermitian operators in AerPauliExpectation Fixes Qiskit/qiskit#415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally. * Add a test case for non-hermitian operators. * Add a test case for non-hermitian operators. * Add a test case for non-hermitian operators. * Update test/python/opflow/test_aer_pauli_expectation.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update aer_pauli_expectation.py Use a generator instead of list * Update qiskit/opflow/expectations/aer_pauli_expectation.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update releasenotes/notes/add-support-non-hermitian-op-aerpauliexpectation-653d8e16de4eca07.yaml Co-authored-by: Julien Gacon <gaconju@gmail.com> * Add a test case for PauliOp * Change the test cases from using ~StateFn() to using StateFn(, is_measurement=True) * Fix the formatting * Working point for QEOM * Small changes + Release note * Undesired change * Undesired change * Indentation error * Parenthesis * Minor changes in docstring * Minor changes in docstring Co-authored-by: Julien Gacon <gaconju@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fix #8575
This small change consists in adding the following lines during the call of the energy_evaluation() in VQD. These lines were taken from the VQE algorithm.
The corresponding test is modified accordingly.
The callback also keeps track of the current step in the VQD algorithm.