View source on GitHub |
Describes how to serialize CircuitOperations.
Inherits From: OpSerializer
Methods
can_serialize_operation
can_serialize_operation(
op: cirq.Operation
) -> bool
Whether the given operation can be serialized by this serializer.
to_proto
to_proto(
op: cirq.CircuitOperation,
msg: Optional[cirq_google.api.v2.program_pb2.CircuitOperation
] = None,
*,
arg_function_language: Optional[str] = '',
constants: List[cirq_google.api.v2.program_pb2.Constant
],
raw_constants: Dict[Any, int]
) -> cirq_google.api.v2.program_pb2.CircuitOperation
Returns the cirq.google.api.v2.CircuitOperation message as a proto dict.
Note that this function requires constants and raw_constants to be pre-populated with the circuit in op.