Cirq
Cirq copied to clipboard
Add `name` to `cirq.CircuitOperation`
Is your feature request related to a use case or problem? Please describe.
cirq.CircuitOperation
is useful to wrap circuits in an operation and thus build nested circuits. However, when printing a circuit containing a circuit operation, it currently prints out the entire nested circuit. This blows up quickly for large circuits and there is currently no way to attach a "name" field to a circuit operation, which can be used as it's string representation.
A similar example is cirq.MatrixGate
which accepts an optional keyword argument name
; which, if specified, is used in it's circuit diagram instead of printing out the entire matrix of the operation.
Describe the solution you'd like
Add name
field to circuit operation and use it in it's circuit diagram representation.
What is the urgency from your perspective for this issue? Is it blocking important work? P1
Xref #3605
From Cirq sync - maybe call it display_name
to avoid the name being used as an ID.