cirq.circuit_diagram_info(val: Any, args: Optional[cirq.protocols.circuit_diagram_info.CircuitDiagramInfoArgs] = None, default=cirq.CircuitDiagramInfo(wire_symbols=(), exponent=1, connected=True))[source]

Requests information on drawing an operation in a circuit diagram.

Calls circuit_diagram_info on val. If val doesn’t have
circuit_diagram_info, or it returns NotImplemented, that indicates that
diagram information is not available.
  • val – The operation or gate that will need to be drawn.
  • args – A CircuitDiagramInfoArgs describing the desired drawing style.
  • default – A default result to return if the value doesn’t have circuit diagram information. If not specified, a TypeError is raised instead.

If val has no _circuit_diagram_info_ method or it returns NotImplemented, then default is returned (or a TypeError is raised if no default is specified).

Otherwise, the value returned by _circuit_diagram_info_ is returned.


TypeErrorval doesn’t have circuit diagram information and default was not specified.