This repository was archived by the owner on Dec 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 376
The sample() method in DictStateFn does not handle complex amplitudes #1311
Comments
ikkoham
added a commit
to ikkoham/qiskit-aqua
that referenced
this issue
Oct 26, 2020
ikkoham
added a commit
to ikkoham/qiskit-aqua
that referenced
this issue
Oct 26, 2020
manoelmarques
pushed a commit
to manoelmarques/qiskit-aqua
that referenced
this issue
Nov 9, 2020
* fix qiskit-community#1311 * fix qiskit-community#1317 * add a test of reps for trotterization * fix tests for qiskit-community#1311 * fix typing * fix qiskit-community#1321 * add release note * fix qiskit-community#1381 * add a test for to_opflow * Update qiskit/aqua/operators/converters/circuit_sampler.py Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com> * remove None from constructor * simplify logic * Revert "remove None from constructor" This reverts commit c884ebb. * add releasenote * simplify logic (not iscomplex to isreal) * remove Optional * Update qiskit/aqua/operators/legacy/weighted_pauli_operator.py * Update qiskit/aqua/operators/legacy/weighted_pauli_operator.py * Update qiskit/aqua/operators/legacy/weighted_pauli_operator.py Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com> Co-authored-by: Panagiotis Barkoutsos <bpa@zurich.ibm.com> Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
mtreinish
pushed a commit
to mtreinish/qiskit-core
that referenced
this issue
Nov 20, 2020
* fix qiskit-community/qiskit-aqua#1311 * fix qiskit-community/qiskit-aqua#1317 * add a test of reps for trotterization * fix tests for qiskit-community/qiskit-aqua#1311 * fix typing * fix qiskit-community/qiskit-aqua#1321 * add release note * fix qiskit-community/qiskit-aqua#1381 * add a test for to_opflow * Update qiskit/aqua/operators/converters/circuit_sampler.py Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com> * remove None from constructor * simplify logic * Revert "remove None from constructor" This reverts commit c884ebba123adee22f252e11f90964a6defaec38. * add releasenote * simplify logic (not iscomplex to isreal) * remove Optional * Update qiskit/aqua/operators/legacy/weighted_pauli_operator.py * Update qiskit/aqua/operators/legacy/weighted_pauli_operator.py * Update qiskit/aqua/operators/legacy/weighted_pauli_operator.py Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com> Co-authored-by: Panagiotis Barkoutsos <bpa@zurich.ibm.com> Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
manoelmarques
pushed a commit
to manoelmarques/qiskit-terra
that referenced
this issue
Dec 2, 2020
* fix qiskit-community/qiskit-aqua#1311 * fix qiskit-community/qiskit-aqua#1317 * add a test of reps for trotterization * fix tests for qiskit-community/qiskit-aqua#1311 * fix typing * fix qiskit-community/qiskit-aqua#1321 * add release note * fix qiskit-community/qiskit-aqua#1381 * add a test for to_opflow * Update qiskit/aqua/operators/converters/circuit_sampler.py Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com> * remove None from constructor * simplify logic * Revert "remove None from constructor" This reverts commit c884ebba123adee22f252e11f90964a6defaec38. * add releasenote * simplify logic (not iscomplex to isreal) * remove Optional * Update qiskit/aqua/operators/legacy/weighted_pauli_operator.py * Update qiskit/aqua/operators/legacy/weighted_pauli_operator.py * Update qiskit/aqua/operators/legacy/weighted_pauli_operator.py Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com> Co-authored-by: Panagiotis Barkoutsos <bpa@zurich.ibm.com> Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
manoelmarques
pushed a commit
to manoelmarques/qiskit-terra
that referenced
this issue
Dec 7, 2020
* fix qiskit-community/qiskit-aqua#1311 * fix qiskit-community/qiskit-aqua#1317 * add a test of reps for trotterization * fix tests for qiskit-community/qiskit-aqua#1311 * fix typing * fix qiskit-community/qiskit-aqua#1321 * add release note * fix qiskit-community/qiskit-aqua#1381 * add a test for to_opflow * Update qiskit/aqua/operators/converters/circuit_sampler.py Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com> * remove None from constructor * simplify logic * Revert "remove None from constructor" This reverts commit c884ebba123adee22f252e11f90964a6defaec38. * add releasenote * simplify logic (not iscomplex to isreal) * remove Optional * Update qiskit/aqua/operators/legacy/weighted_pauli_operator.py * Update qiskit/aqua/operators/legacy/weighted_pauli_operator.py * Update qiskit/aqua/operators/legacy/weighted_pauli_operator.py Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com> Co-authored-by: Panagiotis Barkoutsos <bpa@zurich.ibm.com> Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Information
What is the current behavior?
Throws the following exception
Steps to reproduce the problem
What is the expected behavior?
It is expected to return
{'0': 1.0}
Suggested solutions
The line
probs = np.array(list(self.primitive.values()))**2
indict_state_fn.py
is correct only in the case if all values inself.primitive
are real. To handle complex values properly it should be modified as followsThe text was updated successfully, but these errors were encountered: