-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Miscellaneous Doc Fixes #5754
Miscellaneous Doc Fixes #5754
Conversation
0 & 0 & 1 & 0 \\ | ||
0 & 0 & 0 & e^{i rads} \\ | ||
\end{bmatrix} | ||
|
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.
Missing closing $$
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.
Good catch. Added.
such that: $U = Z^{\phi_0 / \pi} Y^{\phi_1 / \pi} Z^{\phi_2 / \pi}$. | ||
for the Pauli matrices Y and Z. That is, phasing around Z by $\phi_0$ radians, | ||
then rotating around Y by $\phi_1$ radians, and then phasing again by | ||
$\phi_2$ radians will produce the same effect as the original unitary. |
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.
There is inconsistency here in the order the rotations are applied between the formula and the text.
(Recall that for functions A, B and C the composition U=ABC is the result of applying C first followed by B followed by A. Yeah. I know. I have a book about character theory that switched function application notation from f(x) to (x)f to "fix" the problem.)
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.
Good catch. Changed the ordering and added a short note.
r"""Breaks down a 2x2 unitary into more useful ZYZ angle parameters. | ||
|
||
Given a unitary U, this function returns three angles: $\phi_0, \phi_1, \phi_2$, | ||
such that: $U = Z^{\phi_0 / \pi} Y^{\phi_1 / \pi} Z^{\phi_2 / \pi}$. |
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.
nit: Remove dot since the sentence doesn't terminate after the formula.
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.
Done.
@@ -71,7 +71,13 @@ def _rotation_matrix(angle: float) -> np.ndarray: | |||
|
|||
|
|||
def deconstruct_single_qubit_matrix_into_angles(mat: np.ndarray) -> Tuple[float, float, float]: | |||
"""Breaks down a 2x2 unitary into more useful ZYZ angle parameters. | |||
r"""Breaks down a 2x2 unitary into more useful ZYZ angle parameters. |
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.
I'd remove "more useful". It's judgmental and incorrect. Matrix is more useful in some cases and angles are more useful in others (try computing the trace from the angles).
Suggestion:
Breaks down a 2x2 unitary into ZYZ rotation angles.
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.
Done.
@@ -12,6 +12,8 @@ | |||
# See the License for the specific language governing permissions and | |||
# limitations under the License. | |||
|
|||
"""Transformers for compiling to Google-specific Sycamore gate.""" |
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.
Optional: I'd say "Google-specific gates" since we may have others in future (and we're unlikely to remember to come back to fix the 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.
Changed to "Transformers for compiling to Google-specific gates, such as Sycamore" since Sycamore is currently the only transformer we have currently, but, as you point out, this could expand.
Thanks for the detailed review! PTAL |
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.
LGTM
Miscellaneous Doc Fixes Adding module strings so that package doc pages show up better. Adding a few doc strings. Changing a two-line summary to one-line. Changing FSimGate to remove "gate family" which has a particular meaning in cirq.
Miscellaneous Doc Fixes Adding module strings so that package doc pages show up better. Adding a few doc strings. Changing a two-line summary to one-line. Changing FSimGate to remove "gate family" which has a particular meaning in cirq.
Miscellaneous Doc Fixes
Adding module strings so that package doc pages show up better.
Adding a few doc strings.
Changing a two-line summary to one-line.
Changing FSimGate to remove "gate family" which has a particular meaning in cirq.