Open
Description
Is your feature request related to a use case or problem? Please describe.
In #3580, a circuit containing CircuitOperation
s will print those operations inline. This can make the diagram much larger in the best case, and impossible to read in more complex situations.
Describe the solution you'd like
CircuitOperation
s should be printed outside the circuit, with an identifier replacing them inline. Example:
a, b, c = cirq.LineQubit.range(2)
op = cirq.CircuitOperation(cirq.FrozenCircuit(
cirq.H(a), cirq.CZ(a, b), cirq.H(a)
))
circuit = cirq.Circuit(
cirq.X(a), cirq.H(b), cirq.X(c),
op.with_qubits(c, a),
)
print(circuit)
# output
circuit body:
0 --X--[ (1) subcircuit ]--
|
1 --H--+-------------------
|
2 --X--[ (0) subcircuit ]--
subcircuit:
0 --H--@--H--
|
1 -----@-----
Some way to explicitly name FrozenCircuits would be useful for this.
What is the urgency from your perspective for this issue? Is it blocking important work?
P2 - we should do it in the next couple of quarters
Metadata
Metadata
Assignees
Labels
introduces/modifies 3-5 concepts, takes max up to a month for an advanced contributorFor beginners in QC, this will help picking up some knowledge. Bit harder than "good first issues"Describes new functionalityWe want to do this, but it needs an agreed upon design before implementationA consensus emerged that this bug report, feature request, or other action should be worked on