-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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? |
hey can I have a shot at this |
1ucian0
added a commit
to 1ucian0/qiskit-terra
that referenced
this issue
May 21, 2022
Co-authored-by: ewinston <ewinston@users.noreply.github.com> Co-authored-by: hhyap <hhyap@users.noreply.github.com>
mergify bot
added a commit
that referenced
this issue
May 23, 2022
* Checks if DiagonalGate has modulus 1 - Fixes #3842 Co-authored-by: ewinston <ewinston@users.noreply.github.com> Co-authored-by: hhyap <hhyap@users.noreply.github.com> * reno * Fix release-note typo Co-authored-by: ewinston <ewinston@users.noreply.github.com> Co-authored-by: hhyap <hhyap@users.noreply.github.com> Co-authored-by: Jake Lishman <jake@binhbar.com> 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: