cirq.google.DeserializingArg

class cirq.google.DeserializingArg(serialized_name: str, constructor_arg_name: str, value_func: Optional[Callable[Union[int, float, List[bool], str, sympy.core.symbol.Symbol, sympy.core.add.Add, sympy.core.mul.Mul], Any]] = None, required: bool = True)[source]

Specification of the arguments to deserialize an argument to a gate.

Parameters
  • serialized_name – The serialized name of the gate that is being deserialized.

  • constructor_arg_name – The name of the argument in the constructor of the gate corresponding to this serialized argument.

  • value_func – Sometimes a value from the serialized proto needs to converted to an appropriate type or form. This function takes the serialized value and returns the appropriate type. Defaults to None.

  • required – Whether a value must be specified when constructing the deserialized gate. Defaults to True.

__init__(serialized_name: str, constructor_arg_name: str, value_func: Optional[Callable[Union[int, float, List[bool], str, sympy.core.symbol.Symbol, sympy.core.add.Add, sympy.core.mul.Mul], Any]] = None, required: bool = True) → None

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

Attributes

required

value_func