cirq.google.SerializingArg

class cirq.google.SerializingArg(serialized_name: str, serialized_type: Type[Union[int, float, List[bool], str, sympy.core.symbol.Symbol, sympy.core.add.Add, sympy.core.mul.Mul]], op_getter: Union[str, Callable[cirq.Operation, Union[int, float, List[bool], str, sympy.core.symbol.Symbol, sympy.core.add.Add, sympy.core.mul.Mul]]], required: bool = True)[source]

Specification of the arguments for a Gate and its serialization.

Parameters
  • 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.

__init__(serialized_name: str, serialized_type: Type[Union[int, float, List[bool], str, sympy.core.symbol.Symbol, sympy.core.add.Add, sympy.core.mul.Mul]], op_getter: Union[str, Callable[cirq.Operation, Union[int, float, List[bool], str, sympy.core.symbol.Symbol, sympy.core.add.Add, sympy.core.mul.Mul]]], required: bool = True) → None

Initialize self. See help(type(self)) for accurate signature.

Attributes

required