-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Improve docstrings for controlled common gate overrides #3117
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
cirq/ops/common_gates.py
Outdated
the ZPowGate is 0, otherwise it produces a normal ControlledGate. | ||
(Note that a CZPowGate is, by definition, a controlled-ZPowGate.) | ||
Returns a `CZPowGate` or a controlled `CZPowGate` when possible. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
cirq/ops/common_gates.py
Outdated
the CXPowGate is 0, otherwise it produces a normal ControlledGate. | ||
(Note that a CCXPowGate is, by definition, a controlled-CXPowGate.) | ||
Returns a `CCXPowGate` or a controlled `CCXPowGate` when possible. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
cirq/ops/common_gates.py
Outdated
The `controlled` method of the `Gate` class, of which this class is a | ||
child, returns a `ControlledGate`. This method overrides this behavior | ||
to return a `CXPowGate` or a `ControlledGate` of a `CXPowGate, when |
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.
to return a `CXPowGate` or a `ControlledGate` of a `CXPowGate, when | |
to return a `CXPowGate` or a `ControlledGate` of a `CXPowGate`, when |
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.
Same as above. Also need to add ` before "," here and below.
If these conditions are met, then the returned object is a `CXPowGate` | ||
or, in the case that there is more than one controlled qudit, a | ||
`ControlledGate` with the `Gate` being a `CXPowGate`. In the |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
The `controlled` method of the `Gate` class, of which this class is a | ||
child, returns a `ControlledGate`. This method overrides this behavior | ||
to return a `CZPowGate` or a `ControlledGate` of a `CZPowGate`, when |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
If these conditions are met, then the returned object is a `CCXPowGate` | ||
or, in the case that there is more than one controlled qudit, a | ||
`ControlledGate` with the `Gate` being a `CCXPowGate`. In the |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
cirq/ops/common_gates.py
Outdated
the CZPowGate is 0, otherwise it produces a normal ControlledGate. | ||
(Note that a CCZPowGate is, by definition, a controlled-CZPowGate.) | ||
Returns a `CCZPowGate` or a controlled `CCZPowGate` when possible. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
cirq/ops/common_gates.py
Outdated
The `controlled` method of the `Gate` class, of which this class is a | ||
child, returns a `ControlledGate`. This method overrides this behavior | ||
to return a `CXPowGate` or a `ControlledGate` of a `CXPowGate, when |
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.
Same as above. Also need to add ` before "," here and below.
PTAL. Sorry I missed that you had suggested edits, so did those in my own branch :) |
No worries! I just like to use the suggested edits for typos because it shows the diff better. I don't usually like it to be committed - it creates too many commits, mixes authors, etc. |
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
@googlebot rescan please |
Follow up to #3113 to improve the docstrings.