Cirq icon indicating copy to clipboard operation
Cirq copied to clipboard

Add `name` to `cirq.CircuitOperation`

Open tanujkhattar opened this issue 2 years ago • 2 comments

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

tanujkhattar avatar Jul 07 '22 18:07 tanujkhattar

Xref #3605

daxfohl avatar Jul 07 '22 21:07 daxfohl

From Cirq sync - maybe call it display_name to avoid the name being used as an ID.

verult avatar Aug 10 '22 18:08 verult