JobConfig

class JobConfig(shots=None, simulator_cluster=None, qpu_system=None, use_circuit_packing=None, tag='default', force_sampling=False)[source]

Bases: object

Configuration for a Qoro Service job.

Exactly one of simulator_cluster or qpu_system should be set to target the job. If neither is provided, the service defaults to the qoro_maestro simulator cluster.

Attributes Summary

force_sampling

Whether to force sampling instead of expectation value measurements.

qpu_system

The QPU system to target, can be a string name or a QPUSystem object.

shots

Number of shots for the job.

simulator_cluster

The simulator cluster to target, can be a string name or a SimulatorCluster object.

tag

Tag to associate with the job for identification.

use_circuit_packing

Whether to use circuit packing optimization.

Methods Summary

override(other)

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

Attributes Documentation

force_sampling: bool = False

Whether to force sampling instead of expectation value measurements.

qpu_system: QPUSystem | str | None = None

The QPU system to target, can be a string name or a QPUSystem object.

shots: int | None = None

Number of shots for the job.

simulator_cluster: SimulatorCluster | str | None = None

The simulator cluster to target, can be a string name or a SimulatorCluster object.

tag: str = 'default'

Tag to associate with the job for identification.

use_circuit_packing: bool | None = None

Whether to use circuit packing optimization.

Methods Documentation

override(other)[source]

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

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

If the override sets simulator_cluster, any existing qpu_system is cleared (and vice versa), so the mutual-exclusivity constraint is preserved.

Parameters:

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

Return type:

JobConfig

Returns:

A new JobConfig instance with the merged configurations.