-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update documentation on qudits #5196
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
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@@ -84,16 +84,14 @@ | |||
"id": "9c07f9b01c71" |
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.
of the class cirq.Qid
class.
too much class
>unitary evolution on three qudits, a qubit, a qutrit, and another qutrit,
so six things? 3 + 1 + 1+ 1. Maybe a colon is supposed to be here?
Reply via 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.
yeah, think also that we decided that cirq.Class
could be used for first instance and then not repeated. For notebooks this doesn't seem to matter as it doesn't deep link.
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.
fixed
Removed outputs from notebook. |
I just took a look at the beginning of this before realizing how extensive the changes were. I'm OOO until monday, so unassigning myself for review |
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 a few nits.
docs/qudits.ipynb
Outdated
@@ -84,16 +84,14 @@ | |||
"id": "9c07f9b01c71" | |||
}, | |||
"source": [ | |||
"Most of the time in quantum computation, we work with qubits, which are 2-level quantum systems. A qu-*d*-it is a generalization of a qubit to a d-level or d-dimension system.\n", | |||
"Most of the time in quantum computation, we work with qubits, which are 2-level quantum systems. But it is possible to also define quantum computation with higher dimensional systems. A qu-*d*-it is a generalization of a qubit to a d-level or d-dimension system. For example, the state of a single qubit is a superposition of two basis states, $|\\psi\\rangle=\\alpha|0\\rangle+\\beta|1\\rangle$, whereas the state of a qudit for a three dimensional system is a superposition of three basis states $|\\psi\\rangle=\\alpha|0\\rangle+\\beta|1\\rangle+\\gamma|2\\rangle$.\n", |
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 don't think this is a complete sentence as written. Perhaps change to "However, it is possible..."
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
docs/qudits.ipynb
Outdated
"\n", | ||
"Both qubits and qudits are represented by a `Qid` object.\n", | ||
"To apply a gate to some qudits, the dimensions of the qudits must match the dimensions it works on. For example, if a gate represents a unitary evolution on three qudits, a qubit, a qutrit, and another qutrit, the gate's \"qid shape\" is `(2, 3, 3)` and its `on` method will accept exactly 3 `Qid`s with dimension 2, 3, and 3, respectively.\n", |
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.
Maybe add a colon or something here (or parentheses) to show that the qubit, qutrit and qutrit are the 3 qudits.
For example, if a gate represents a unitary evolution on three qudits**:** a qubit, a qutrit, and another qutrit, then the gate's ...
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.
rewrote as three sentences to make clearer.
docs/qudits.ipynb
Outdated
" \n", | ||
" This gate acts on three-level systems. In the computational basis of\n", | ||
" this system it enacts the transformation U|x> = |x + 1 mod 3>, or\n", | ||
" in other words U|0> = |1>, U|1> = |2>, and U|2> = |0>.\n", |
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. Consider using right angle bracket "〉" rather than ">".
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
" def _qid_shape_(self):\n", | ||
" # By implementing this method this gate implements the\n", |
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: Can this be a docstring with triple quotes rather than line comments? Same below.
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
Automerge cancelled: A required status check is not present. Missing statuses: ['Typescript lint check', 'Typescript tests', 'Typescript tests coverage'] |
No description provided.