iqm.iqm_client.iqm_client.RunResult#

class iqm.iqm_client.iqm_client.RunResult(*, status, measurements=None, message=None, metadata, warnings=None)#

Bases: BaseModel

Results of a circuit execution job.

  • measurements is present iff the status is 'ready'.

  • message carries additional information for the 'failed' status.

  • If the status is 'pending compilation' or 'pending execution', measurements and message are None.

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

status

current status of the job, in {'pending compilation', 'pending execution', 'ready', 'failed', 'aborted'}

measurements

if the job has finished successfully, the measurement results for the circuit(s)

message

if the job failed, an error message

metadata

metadata about the job

warnings

list of warning messages

Methods

from_dict(inp)

Parses the result from a dict.

Parameters:
status: Status#

current status of the job, in {'pending compilation', 'pending execution', 'ready', 'failed', 'aborted'}

measurements: CircuitMeasurementResultsBatch | None#

if the job has finished successfully, the measurement results for the circuit(s)

message: str | None#

if the job failed, an error message

metadata: Metadata#

metadata about the job

warnings: list[str] | None#

list of warning messages

static from_dict(inp)#

Parses the result from a dict.

Parameters:

inp (dict[str, str | dict]) – value to parse, has to map to RunResult

Returns:

parsed job result

Return type:

RunResult

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]] = {'measurements': FieldInfo(annotation=Union[list[dict[str, list[list[int]]]], NoneType], required=False, default=None), 'message': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'metadata': FieldInfo(annotation=Metadata, required=True), 'status': FieldInfo(annotation=Status, required=True), 'warnings': FieldInfo(annotation=Union[list[str], NoneType], required=False, default=None)}#

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

This replaces Model.__fields__ from Pydantic V1.