-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[3 qubit decomposition] Extract diagonal #3472
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
Conversation
viathor
left a comment
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.
Sorry for the delay in review! It's very cool to have this in cirq! Thank you! See comments below.
viathor
left a comment
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.
This is very cool! Thank you!
cirq/linalg/decompositions.py
Outdated
| import scipy | ||
| import matplotlib.pyplot as plt | ||
| import scipy | ||
| from scipy.linalg.special_matrices import block_diag |
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.
remove line to placate linter
cirq/linalg/decompositions.py
Outdated
| return u @ YY @ u.T @ YY | ||
|
|
||
|
|
||
| def extract_right_diag(u: np.ndarray, atol=1e-15) -> np.ndarray: |
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.
remove unused atol from signature and Args section of docstring below
|
Thank you for the thorough and insightful review @viathor!! |
Adds
cirq.two_qubit_matrix_to_diagonal_and_operationsthat extracts a diagonal if it can from a 3CNOT unitary to a diagonal and a 2 CNOT unitary.Another part of #2873.