ExecutionConfig

class ExecutionConfig(bond_dimension=None, truncation_threshold=None, simulator=None, simulation_method=None, api_meta=None)[source]

Bases: object

Execution configuration for a Qoro Service job.

All fields are optional. When set on a job via QoroService.set_execution_config(), unset (None) fields are omitted from the request so the server keeps its own defaults.

Attributes Summary

api_meta

Runtime pass-through metadata.

bond_dimension

MPS bond dimension.

simulation_method

Simulation method.

simulator

Simulator backend.

truncation_threshold

MPS truncation threshold.

Methods Summary

from_response(data)

Construct an ExecutionConfig from an API response dictionary.

override(other)

Creates a new config by overriding attributes with non-None values.

to_payload()

Serialize to the JSON body expected by the API.

Attributes Documentation

api_meta: dict | None = None

Runtime pass-through metadata. Forwarded to the cloud runtime; unknown keys are rejected server-side. Allowed keys and value types:

  • optimization_level (int)

  • resilience_level (int)

  • max_execution_time (int) — seconds

  • transpilation_seed (int)

  • layout_method (str)

  • routing_method (str)

  • approximation_degree (int or float)

bond_dimension: int | None = None

MPS bond dimension.

simulation_method: SimulationMethod | None = None

Simulation method.

simulator: Simulator | None = None

Simulator backend.

truncation_threshold: float | None = None

MPS truncation threshold.

Methods Documentation

static from_response(data)[source]

Construct an ExecutionConfig from an API response dictionary.

Parameters:

data (dict) – The execution_configuration dict from the API response.

Returns:

A new instance populated from the response.

Return type:

ExecutionConfig

override(other)[source]

Creates a new config by overriding attributes with non-None values.

This method ensures immutability by always returning a new ExecutionConfig object and leaving the original instance unmodified.

Parameters:

other (ExecutionConfig) – Another ExecutionConfig instance to take values from. Only non-None attributes from this instance will be used for the override.

Return type:

ExecutionConfig

Returns:

A new ExecutionConfig instance with the merged configurations.

to_payload()[source]

Serialize to the JSON body expected by the API.

None fields are omitted; enum values are converted to their integer representation.

Returns:

JSON-serializable payload for

POST /api/job/<job_id>/execution_config/.

Return type:

dict