-
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
DiagonalGate does not raise when diagonal entries do not have modulus 1 #3842
Labels
Comments
Hey guys! I would like to give it a try. Just to be sure I understood it correctly, the second entry of the list which is 0 seems to be the problem right? Maybe the if case in Line 59 only checks the first entry, therefore no error is raised? |
1ucian0
added
the
status: pending PR
It has one or more PRs pending to solve this issue
label
Mar 1, 2020
hey can I have a shot at this |
1ucian0
changed the title
diag_gate does not raise when diagonal entries do not have modulus 1
DiagonalGate does not raise when diagonal entries do not have modulus 1
May 21, 2022
1ucian0
removed
the
status: pending PR
It has one or more PRs pending to solve this issue
label
May 21, 2022
1ucian0
added a commit
to 1ucian0/qiskit-terra
that referenced
this issue
May 21, 2022
Co-authored-by: ewinston <[email protected]> Co-authored-by: hhyap <[email protected]>
mergify bot
added a commit
that referenced
this issue
May 23, 2022
* Checks if DiagonalGate has modulus 1 - Fixes #3842 Co-authored-by: ewinston <[email protected]> Co-authored-by: hhyap <[email protected]> * reno * Fix release-note typo Co-authored-by: ewinston <[email protected]> Co-authored-by: hhyap <[email protected]> Co-authored-by: Jake Lishman <[email protected]> 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
Information
What is the current behavior?
diag_gate
allows entries whose modulus are not one.Steps to reproduce the problem
What is the expected behavior?
An error should be raised.
Suggested solutions
Line 59 in https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/extensions/quantum_initializer/diag.py#L59:
if not np.abs( np.abs(z) - 1 ) < _EPS:
The text was updated successfully, but these errors were encountered: