qulacsvis.models.circuit module

class qulacsvis.models.circuit.CircuitData(qubit_count: int, layer_count: int, gates: Sequence[Sequence[qulacsvis.models.circuit.GateData]])[source]

Bases: object

classmethod from_dict(kvs: Optional[Union[dict, list, str, int, float, bool]], *, infer_missing=False) dataclasses_json.api.A
static from_gate_sequence(gates: Sequence[qulacsvis.models.circuit.GateData], qubit_count: Optional[int] = None) qulacsvis.models.circuit.CircuitData[source]

Construct a CircuitData model from a list of gates.

Parameters
  • gates (Sequence[GateData]) – List of gates

  • qubit_count (int optional) – Number of qubits this quantum circuit has

Returns

CircuitData – Constructed CircuitData model

Return type

CircuitData

classmethod from_json(s: Union[str, bytes, bytearray], *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) dataclasses_json.api.A
gates: Sequence[Sequence[qulacsvis.models.circuit.GateData]]
layer_count: int
qubit_count: int
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) dataclasses_json.mm.SchemaF[dataclasses_json.mm.A]
to_dict(encode_json=False) Dict[str, Optional[Union[dict, list, str, int, float, bool]]]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: Optional[Union[int, str]] = None, separators: Optional[Tuple[str, str]] = None, default: Optional[Callable] = None, sort_keys: bool = False, **kw) str
class qulacsvis.models.circuit.ControlQubitInfo(index: int, control_value: int)[source]

Bases: object

control_value: int
classmethod from_dict(kvs: Optional[Union[dict, list, str, int, float, bool]], *, infer_missing=False) dataclasses_json.api.A
classmethod from_json(s: Union[str, bytes, bytearray], *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) dataclasses_json.api.A
index: int
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) dataclasses_json.mm.SchemaF[dataclasses_json.mm.A]
to_dict(encode_json=False) Dict[str, Optional[Union[dict, list, str, int, float, bool]]]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: Optional[Union[int, str]] = None, separators: Optional[Tuple[str, str]] = None, default: Optional[Callable] = None, sort_keys: bool = False, **kw) str
class qulacsvis.models.circuit.GateData(name: str, target_bits: List[int] = <factory>, control_bit_infos: List[qulacsvis.models.circuit.ControlQubitInfo] = <factory>)[source]

Bases: object

control_bit_infos: List[qulacsvis.models.circuit.ControlQubitInfo]
classmethod from_dict(kvs: Optional[Union[dict, list, str, int, float, bool]], *, infer_missing=False) dataclasses_json.api.A
classmethod from_json(s: Union[str, bytes, bytearray], *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) dataclasses_json.api.A
property indices: Tuple[int, ...]
property max_index: int
property min_index: int
name: str
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) dataclasses_json.mm.SchemaF[dataclasses_json.mm.A]
target_bits: List[int]
to_dict(encode_json=False) Dict[str, Optional[Union[dict, list, str, int, float, bool]]]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: Optional[Union[int, str]] = None, separators: Optional[Tuple[str, str]] = None, default: Optional[Callable] = None, sort_keys: bool = False, **kw) str