We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following matrix cannot be decomposed even though it is unitary.
U = np.matrix([[(-0.7108860402090058-0.7033072016973199j), (-9.403468524726843e-05+9.504800300819127e-05j)], [(-9.507314515605492e-05+9.400926537078691e-05j), (-0.7031170805491339-0.7110740841596025j)]])
In fact running np.linalg.norm(U.getH()*U - np.eye(2)) returns 5.462198399343198e-16.
np.linalg.norm(U.getH()*U - np.eye(2))
5.462198399343198e-16
Reducing TOLERANCE in arb1qubit2rzandry.py from 1e-12 to 1e-10 removes the exception, so I assume this is caused by cancellation effects, similar to what happens when solving the quadratic equation: https://en.wikipedia.org/wiki/Loss_of_significance#Instability_of_the_quadratic_equation
TOLERANCE
arb1qubit2rzandry.py
1e-12
1e-10
Exception: ("Couldn't find parameters for matrix ", [[(-0.7108860402090058-0.7033072016973199j), (-9.403468524726843e-05+9.504800300819127e-05j)], [(-9.507314515605492e-05+9.400926537078691e-05j), (-0.7031170805491339-0.7110740841596025j)]], "This shouldn't happen. Maybe the matrix is not unitary?") raised in: ' File "/Users/isaac/Library/Python/3.5/lib/python/site-packages/projectq/setups/decompositions/arb1qubit2rzandry.py", line 192, in _find_parameters' ' "not unitary?")'
The text was updated successfully, but these errors were encountered:
Thanks for pointing this out! I will try to make the current implementation more robust as soon as I find time.
Sorry, something went wrong.
No branches or pull requests
The following matrix cannot be decomposed even though it is unitary.
In fact running
np.linalg.norm(U.getH()*U - np.eye(2))
returns5.462198399343198e-16
.Reducing
TOLERANCE
inarb1qubit2rzandry.py
from1e-12
to1e-10
removes the exception, so I assume this is caused by cancellation effects, similar to what happens when solving the quadratic equation: https://en.wikipedia.org/wiki/Loss_of_significance#Instability_of_the_quadratic_equationThe text was updated successfully, but these errors were encountered: