Describes how to serialize CircuitOperations.
Inherits From: OpDeserializer
Attributes |
serialized_id
|
Returns the string identifier for the accepted serialized objects.
This ID denotes the serialization format this deserializer consumes. For
example, one of the common deserializers converts objects with the id
'xy' into PhasedXPowGates.
|
Methods
from_proto
View source
from_proto(
proto: cirq_google.api.v2.program_pb2.CircuitOperation
,
*,
arg_function_language: str = '',
constants: List[cirq_google.api.v2.program_pb2.Constant
],
deserialized_constants: List[Any]
) -> cirq.CircuitOperation
Turns a cirq.google.api.v2.CircuitOperation proto into a CircuitOperation.
Args |
proto
|
The proto object to be deserialized.
|
arg_function_language
|
The arg_function_language field from
Program.Language .
|
constants
|
The list of Constant protos referenced by constant
table indices in proto . This list should already have been
parsed to produce 'deserialized_constants'.
|
deserialized_constants
|
The deserialized contents of constants .
|
Returns |
The deserialized CircuitOperation represented by proto .
|
Raises |
ValueError
|
If the circuit operatio proto cannot be deserialied because it is malformed.
|