-
Notifications
You must be signed in to change notification settings - Fork 983
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
Complete gate zoo and fix gate docs #5344
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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 with many nits
g = exp(i·π·t). | ||
$$ | ||
\begin{bmatrix} | ||
1 & 0 & 0 & 0 \\ |
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 nit applies throughout: A lot of the matrices have few non-zero elements and they are easier to read if the zeros are not explicitly shown:
$$
\begin{bmatrix}
1 & & & \\
& 1 & & \\
& & 1 & \\
& & & e^{i \pi t} \\
\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.
For this one I'm going to open an issue. I struggled with this myself. For three qubit gates the sparse representation is a definite yes. But I worry a bit that not showing the 0s will confuse users
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.
0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ | ||
0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ | ||
0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ | ||
0 & 0 & 0 & 0 & 0 & 0 & 0 & e^{i \pi t} |
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 a nice example showing the advantage of implicit zeros I advocated for in another comment. It takes some eye-strain to recognize that this is diagonal.)
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 here for 3 qubit gates, but left 2 qubit gates in #5359
Completes work for #852