-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add double-line diagrams for control keys (#4627)
Adds double-line wires to diagrams between measurement gates and their associated control gates. * Cbits are represented similarly as qubits with a double-line axis. * The measurement key name is the label of the cbit (and the key label from `M` is removed). * `@` is the symbol for writing to the cbit. * Currently we only allow write-once, but in the future we may want to allow overwrite, xor, bit-and, sum, etc. * `^` is the symbol for reading from / executing conditionally upon a cbit. * `X` below is hard-coded in the test case, but will be the conditional operation applied. * Measurement keys that are not used in control operations will not have a line associated, to reduce clutter. For example a circuit ``` cirq.Circuit( cirq.measure(q0, key='a') ControlOp(qubits=[q1], keys=['a']) ) ``` would have the following representation. ``` 0: ───M─────── ║ 1: ───╫───X─── ║ ║ a: ═══@═══^═══ ``` See `circuit_test` for more examples Parts 6 of https://tinyurl.com/cirq-feedforward.
- Loading branch information
Showing
12 changed files
with
355 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.