iqm.iqm_client.models.Circuit#

class iqm.iqm_client.models.Circuit(*, name: str, instructions: tuple[Instruction, ...], metadata: dict[str, Any] | None = None)#

Bases: BaseModel

Quantum circuit to be executed.

Consists of native quantum operations, each represented by an instance of the Instruction class.

Attributes

model_computed_fields

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

name

name of the circuit

instructions

instructions comprising the circuit

metadata

arbitrary metadata associated with the circuit

Methods

all_qubits()

Return the names of all qubits in the circuit.

instructions_validator(value)

Check the container of instructions and each instruction within

name_validator(value)

Check if the circuit name is a non-empty string

Parameters:
name: str#

name of the circuit

instructions: tuple[Instruction, ...]#

instructions comprising the circuit

metadata: dict[str, Any] | None#

arbitrary metadata associated with the circuit

all_qubits() set[str]#

Return the names of all qubits in the circuit.

Return type:

set[str]

classmethod name_validator(value)#

Check if the circuit name is a non-empty string

classmethod instructions_validator(value)#

Check the container of instructions and each instruction within

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'instructions': FieldInfo(annotation=tuple[Instruction, ...], required=True), 'metadata': FieldInfo(annotation=Union[dict[str, Any], NoneType], required=False, default=None), 'name': FieldInfo(annotation=str, required=True, examples=['test circuit'])}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.