cirq.SupportsJSON

An object that can be turned into JSON dictionaries.

The magic method _json_dict_ must return a trivially json-serializable type or other objects that support the SupportsJSON protocol.

During deserialization, a class must be able to be resolved (see the docstring for read_json) and must be able to be (re-)constructed from the serialized parameters. If the type defines a classmethod _from_json_dict_, that will be called. Otherwise, the cirq_type key will be popped from the dictionary and used as kwargs to the type's constructor.

Methods

_json_dict_

View source