cirq.json_serializable_dataclass(_cls: Optional[Type] = None, *, namespace: Optional[str] = None, init: bool = True, repr: bool = True, eq: bool = True, order: bool = False, unsafe_hash: bool = False, frozen: bool = False)[source]

Create a dataclass that supports JSON serialization

This function defers to the ordinary dataclass decorator but appends
the _json_dict_ protocol method which automatically determines
the appropriate fields from the dataclass.
  • namespace – An optional prefix to the value associated with the key “cirq_type”. The namespace name will be joined with the class name via a dot (.)

  • repr, eq, order, unsafe_hash, frozen (init,) – Forwarded to the dataclass constructor.