![]() |
Describes how to serialize CircuitOperations.
Inherits From: OpDeserializer
Methods
can_deserialize_proto
can_deserialize_proto(
proto: cirq_google.api.v2.program_pb2.Operation
)
Whether the given operation can be serialized by this serializer.
from_proto
from_proto(
proto: cirq_google.api.v2.program_pb2.Operation
,
*,
constants: List[cirq_google.api.v2.program_pb2.Constant
],
deserialized_constants: List[Any]
) -> cirq.Operation
Turns a cirq_google Operation proto into a stimcirq object.
Args | |
---|---|
proto
|
The proto object to be deserialized. |
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 stimcirq object |
Raises | |
---|---|
ValueError
|
If stimcirq is not installed or the object is not recognized. |