Specification of the arguments for a Gate and its serialization.
cirq.google.SerializingArg(
serialized_name: str,
serialized_type: Type[cirq.google.arg_func_langs.ARG_LIKE
],
op_getter: Union[str, Callable[['cirq.Operation'], arg_func_langs.ARG_LIKE]],
required: bool = True,
default: Any = None
)
Args |
serialized_name
|
The name of the argument when it is serialized.
|
serialized_type
|
The type of the argument when it is serialized.
|
op_getter
|
The name of the property or attribute for getting the
value of this argument from a gate, or a function that takes a
operation and returns this value. The later can be used to supply
a value of the serialized arg by supplying a lambda that
returns this value (i.e. lambda x: default_value )
|
required
|
Whether this argument is a required argument for the
serialized form.
|
default
|
default value. avoid serializing if this is the value.
Note that the DeserializingArg must also have this as default.
|
Attributes |
serialized_name
|
Dataclass field
|
serialized_type
|
Dataclass field
|
op_getter
|
Dataclass field
|
required
|
Dataclass field
|
default
|
Dataclass field
|
Methods
__eq__
__eq__(
other
)
Class Variables |
default
|
None
|
required
|
True
|