cirq_google.serialization.CircuitOpDeserializer

Describes how to serialize CircuitOperations.

Inherits From: OpDeserializer

Methods

can_deserialize_proto

View source

Whether the given operation can be serialized by this serializer.

from_proto

View source

Turns a cirq.google.api.v2.CircuitOperation proto into a CircuitOperation.

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 CircuitOperation represented by proto.

Raises
ValueError If the circuit operatio proto cannot be deserialied because it is malformed.