iqm.iqm_client.iqm_client.Circuit#

class iqm.iqm_client.iqm_client.Circuit(*, name, instructions, metadata=None)#

Bases: BaseModel

Quantum circuit to be executed.

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].

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()#

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].

This replaces Model.__fields__ from Pydantic V1.