def wrap(cls): cls = dataclasses.dataclass(cls, init=init, repr=repr, eq=eq, order=order, unsafe_hash=unsafe_hash, frozen=frozen) cls._json_dict_ = lambda obj: cirq.obj_to_dict_helper( obj, [f.name for f in dataclasses.fields(cls)], namespace=namespace) if registry is not None: if namespace is not None: prefix = '{}.'.format(namespace) else: prefix = '' registry.register(prefix + cls.__name__, cls) return cls
def _json_dict_(self) -> Dict[str, Any]: return cirq.obj_to_dict_helper(self, ['phi'])
def _json_dict_(self) -> Dict[str, Any]: return cirq.obj_to_dict_helper(self, ['calibration_type', 'program', 'args'])
def _json_dict_(self): return cirq.obj_to_dict_helper( self, ['hold_time', 'coupling_mhz', 'rise_time', 'padding_time'])
def _json_dict_(self): return cirq.obj_to_dict_helper(self, attribute_names=[])
def _json_dict_(self): return cirq.obj_to_dict_helper(self, [])