cirq.CircuitDiagramInfo
Describes how to draw an operation in a circuit diagram.
cirq.CircuitDiagramInfo(
wire_symbols: Iterable[str],
exponent: Any = 1,
connected: bool = True,
exponent_qubit_index: Optional[int] = None,
auto_exponent_parens: bool = True
) -> None
Used in the notebooks
Args |
wire_symbols
|
The symbols that should be shown on the qubits
affected by this operation. Must match the number of qubits that
the operation is applied to.
|
exponent
|
An optional convenience value that will be appended onto
an operation's final gate symbol with a caret in front
(unless it's equal to 1). For example, the square root of X gate
has a text diagram exponent of 0.5 and symbol of 'X' so it is
drawn as 'X^0.5'.
|
connected
|
Whether or not to draw a line connecting the qubits.
|
exponent_qubit_index
|
The qubit to put the exponent on. (The k'th
qubit is the k'th target of the gate.) Defaults to the bottom
qubit in the diagram.
|
auto_exponent_parens
|
When this is True, diagram making code will
add parentheses around exponents whose contents could look
ambiguous (e.g. if the exponent contains a dash character that
could be mistaken for an identity wire). Defaults to True.
|
Raises |
ValueError
|
If wire_symbols is a string, and not an iterable
of strings.
|
Methods
with_wire_symbols
View source
with_wire_symbols(
new_wire_symbols: Iterable[str]
)
__eq__
View source
__eq__(
other: _SupportsValueEquality
) -> bool
__ne__
View source
__ne__(
other: _SupportsValueEquality
) -> bool
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-27 UTC."],[],[]]