Skip to content

Reference

qedma_api.clients.client.Client

Bases: BaseClient

set_provider

set_provider(provider: IBMQProvider) -> None

Set the provider of the client. (e.g. IBMQProvider)

register_qpu_token

register_qpu_token(token: str) -> None

registers the QPU vendor token.

Parameters:

Name Type Description Default
token str

The vendor token.

required

unregister_qpu_token

unregister_qpu_token() -> None

Unregisters a vendor token for an account.

qedma_api.clients.base_client.BaseClient

Bases: ABC

create_job

create_job(
    *,
    circuit: QuantumCircuit,
    observables: ObservablesGroups | None = None,
    observables_metadata: Sequence[ObservableMetadata]
    | None = None,
    parameters: Mapping[str | Parameter, Sequence[float]]
    | None = None,
    precision: float | PrecisionPerFactor | None = None,
    backend: str,
    empirical_time_estimation: bool = False,
    description: str = "",
    circuit_options: CircuitOptions | None = None,
    precision_mode: PrecisionMode | None = None,
    shots: int | None = None,
    enable_notifications: bool = True,
    single_mitigation_step: bool = False
) -> ClientJobDetails

Submit a new job to the API Gateway.

Parameters:

Name Type Description Default
circuit QuantumCircuit

The circuit to run.

required
observables ObservablesGroups | None

The observables to measure. Can be either models.Observable, Sequence[models.Observable], or qiskit.quantum_info.SparsePauliOp.

None
precision float | PrecisionPerFactor | None

The target absolute precision to achieve for each input observable. If a PrecisionPerFactor is provided, it should be a map from a quantum error tuning factor (error amplification or reduction factor) to the desired precision at that factor (for all observables).

None
backend str

The backend (QPU) to run on. (e.g., ibm_fez)

required
parameters Mapping[str | Parameter, Sequence[float]] | None

Used when a parameterized circuit is provided. The parameters to run the circuit with (mapping from parameter to sequence of values, all parameters must have the same number of values) If given, the number of observables must be equal to the number of values.

None
empirical_time_estimation bool

Whether to use empirical time estimation.

False
description str

A description for the job.

''
circuit_options CircuitOptions | None

Additional options for a circuit.

None
precision_mode PrecisionMode | None

The precision mode to use. Can only be used when parameters are set.

None
shots int | None

The number of shots to execute. Only used when error_suppression_only=True.

None
enable_notifications bool

Whether to enable email notifications for this job.

True
single_mitigation_step bool

Whether to run mitigation in a single step. Default is False.

False

Returns:

Type Description
ClientJobDetails

The job's details including its ID.

start_job

start_job(
    job_id: str,
    max_qpu_time: timedelta,
    options: JobOptions | None = None,
    force_start: bool = False,
) -> None

Start running an estimation job.

Parameters:

Name Type Description Default
job_id str

The ID of the job.

required
max_qpu_time timedelta

The maximum allowed QPU time.

required
options JobOptions | None

Additional options for the job (see JobOptions).

None
force_start bool

If True, the job will automatically start once the estimation completes.

False

run_device_characterization

run_device_characterization(
    *,
    circuit: QuantumCircuit,
    backend: str,
    enable_notifications: bool = True
) -> CharacterizationJobDetails

Submit a new job to the API Gateway.

Parameters:

Name Type Description Default
circuit QuantumCircuit

The circuit to choose the best layout for (acccording to the infidelities).

required
backend str

The backend (QPU) to run on. (e.g., ibm_fez)

required
enable_notifications bool

Whether to enable email notifications for this job.

True

Returns:

Type Description
CharacterizationJobDetails

The layout selected circuit and a dict containing the device characterization: - a dictionary from qubit index to measurement error (dict[int, float]) - a dictionary of gate infidelities per gate type and qubits (dict[tuple[str, tuple[int, int]]])

cancel_job

cancel_job(job_id: str) -> None

Cancel a job. Please note that the cancel_job API will prevent QESEM from sending new circuits to the QPU. Circuits which are already running on the QPU cannot be cancelled.

Parameters:

Name Type Description Default
job_id str

The job_id to cancel

required

get_job

get_job(
    job_id: str,
    *,
    include_circuits: bool = False,
    include_results: bool = False,
    qedma_observable_model: bool = False
) -> ClientJobDetails

Get a job's details.

Parameters:

Name Type Description Default
job_id str

The ID of the job.

required
include_circuits bool

Whether to include the input circuit.

False
include_results bool

Whether to include the result of the job (if it is ready).

False
qedma_observable_model bool

Whether to return the results with Qedma's observable model, or Qiskit SparsePauliOp.

False

Returns:

Type Description
ClientJobDetails

Details about the job, with the data from the flags.

get_jobs

get_jobs(
    jobs_ids: list[str],
    *,
    include_circuits: bool = False,
    include_results: bool = False,
    qedma_observable_model: bool = False
) -> list[ClientJobDetails]

Get multiple jobs' details.

Parameters:

Name Type Description Default
jobs_ids list[str]

The IDs of the jobs.

required
include_circuits bool

Whether to include the input circuits.

False
include_results bool

Whether to include the results of the jobs (if they are ready).

False
qedma_observable_model bool

Whether to return the results with Qedma's observable model, or Qiskit SparsePauliOp.

False

Returns:

Type Description
list[ClientJobDetails]

Details about the jobs, with the data from the flags.

list_jobs

list_jobs(
    skip: int = 0, limit: int = 50
) -> list[JobDetails]

Paginate jobs.

Parameters:

Name Type Description Default
skip int

How many jobs to skip.

0
limit int

Maximum amount of jobs to return.

50

Returns:

Type Description
list[JobDetails]

The list of requested jobs.

get_characterization_jobs

get_characterization_jobs(
    jobs_ids: list[str],
) -> list[CharacterizationJobDetails]

Get multiple jobs' details.

Parameters:

Name Type Description Default
jobs_ids list[str]

The IDs of the jobs.

required

Returns:

Type Description
list[CharacterizationJobDetails]

the characterization jobs details.

wait_for_time_estimation

wait_for_time_estimation(
    job_id: str,
    *,
    interval: timedelta = STATUS_POLLING_INTERVAL,
    max_poll_time: timedelta | None = None
) -> timedelta | None

Wait until a job reaches the time-estimation part, and get the estimation.

Parameters:

Name Type Description Default
job_id str

The ID of the job.

required
interval timedelta

The interval between two polls. Defaults to 10 seconds.

STATUS_POLLING_INTERVAL
max_poll_time timedelta | None

Max time until a timeout. If left empty, the method will return only when the job finishes.

None

Returns:

Type Description
timedelta | None

The time estimation of the job.

wait_for_job_complete

wait_for_job_complete(
    job_id: str,
    *,
    interval: timedelta = STATUS_POLLING_INTERVAL,
    max_poll_time: timedelta | None = None,
    qedma_observable_model: bool = False
) -> ClientJobDetails

Wait until the job finishes, and get the results. While the job is running, this function also prints the job's current step and intermediate results

Parameters:

Name Type Description Default
job_id str

The ID of the job.

required
interval timedelta

The interval between two polls. Defaults to 10 seconds.

STATUS_POLLING_INTERVAL
max_poll_time timedelta | None

Max time until a timeout. If left empty, the method will return only when the job finishes.

None
qedma_observable_model bool

Whether to return the results with Qedma's observable model, or Qiskit SparsePauliOp.

False

Returns:

Type Description
ClientJobDetails

The details of the job, including its results.

wait_for_characterization_job_complete

wait_for_characterization_job_complete(
    job_id: str,
    *,
    interval: timedelta = STATUS_POLLING_INTERVAL,
    max_poll_time: timedelta | None = None
) -> CharacterizationJobDetails

Wait until the job finishes, and get the results. While the job is running, this function also prints the job's current step and intermediate results

Parameters:

Name Type Description Default
job_id str

The ID of the job.

required
interval timedelta

The interval between two polls. Defaults to 10 seconds.

STATUS_POLLING_INTERVAL
max_poll_time timedelta | None

Max time until a timeout. If left empty, the method will return only when the job finishes.

None

Returns:

Type Description
CharacterizationJobDetails

The job results

qedma_api.models

Qedma Public API

JobStatus

Bases: str, Enum

The status of a job.

ESTIMATING class-attribute instance-attribute

ESTIMATING = 'ESTIMATING'

Job was created and QESEM is currently estimating it.

ESTIMATED class-attribute instance-attribute

ESTIMATED = 'ESTIMATED'

Job was estimated. Issue the qedma_client.start_job() api request to initiate the execution.

RUNNING class-attribute instance-attribute

RUNNING = 'RUNNING'

Job started running. Monitor its progress using the qedma_client.wait_for_job_complete() method.

SUCCEEDED class-attribute instance-attribute

SUCCEEDED = 'SUCCEEDED'

Job finished successfully. The user can now get the results via the qedma_client.get_job() API with the include_results = True flag.

FAILED class-attribute instance-attribute

FAILED = 'FAILED'

Job failed. Review the error message in the job.errors field.

CANCELLED class-attribute instance-attribute

CANCELLED = 'CANCELLED'

The job was cancelled by the user.

TranspilationLevel

Bases: str, Enum

MINIMAL class-attribute instance-attribute

MINIMAL = 'minimal'

Minimal transpilation: the mitigated circuit will closely resemble the input circuit structurally.

MINIMAL_WITH_LAYOUT_OPT class-attribute instance-attribute

MINIMAL_WITH_LAYOUT_OPT = 'minimal_with_layout_opt'

Minimal transpilation: the mitigated circuit will closely resemble the input circuit structurally. Additionally, the qubit layout will be optimized.

STANDARD class-attribute instance-attribute

STANDARD = 'standard'

Prepares several alternative transpilations and chooses the one that minimizes QPU time.

ObservableMetadata

Bases: BaseModel

Metadata for a quantum observable.

description instance-attribute

description: str

Description of the observable

Observable

Bases: RootModel[dict[ObsTerm, float]]

A quantum observable represented as a mapping of ObsTerm strings to their coefficients.

qubits property

qubits: set[int]

Returns a set of qubits that are used in the observable.

observables_to_qubits staticmethod

observables_to_qubits(
    observables: list[Observable],
) -> set[int]

Returns a set of qubits that are used in the observables.

from_sparse_pauli_op classmethod

from_sparse_pauli_op(pauli_op: SparsePauliOp) -> Observable

Convert a qiskit.quantum_info.SparsePauliOp to an Observable.

SparsePauliOp, like all of qiskit, uses little-endian convention. This means that the operator Pauli("XY") or SparsePauliOp(["XY"],[1]) have the "X" acting on qubit 1 and "Y" acting on qubit 0.

Parameters:

Name Type Description Default
pauli_op SparsePauliOp

The SparsePauliOp to convert

required

Returns:

Type Description
Observable

An Observable instance representing the same operator

Raises:

Type Description
ValueError

If the SparsePauliOp contains phases or complex coefficients, or if it contains only identity Paulis with zero coefficients

to_sparse_pauli_op

to_sparse_pauli_op(
    num_qubits: int | None = None,
) -> SparsePauliOp

Convert this Observable to a qiskit.quantum_info.SparsePauliOp.

SparsePauliOp, like all of qiskit, uses little-endian convention. This means that the operator Pauli("XY") or SparsePauliOp(["XY"],[1]) have the "X" acting on qubit 1 and "Y" acting on qubit 0.

Parameters:

Name Type Description Default
num_qubits int | None

The number of qubits in the resulting SparsePauliOp. If None, it will be determined from the highest qubit index in the observable

None

from_sparse_observable classmethod

from_sparse_observable(
    sparse_obs: SparseObservable,
) -> Observable

Convert a qiskit.quantum_info.SparseObservable to an Observable.

SparseObservable, like all of qiskit, uses little-endian convention. This means that the operator SparseObservable("XY") have the "X" acting on qubit 1 and "Y" acting on qubit 0.

Parameters:

Name Type Description Default
sparse_obs SparseObservable

The qiskit.quantum_info.SparseObservable to convert

required

Returns:

Type Description
Observable

An Observable instance representing the same operator

Raises:

Type Description
ValueError

If the SparseObservable contains phases or complex coefficients, or if it contains only identity Paulis with zero coefficients

to_sparse_observable

to_sparse_observable(
    num_qubits: int | None = None,
) -> SparseObservable

Convert this Observable to a qiskit.quantum_info.SparseObservable.

SparseObservable, like all of qiskit, uses little-endian convention. This means that the operator SparseObservable("XY") have the "X" acting on qubit 1 and "Y" acting on qubit 0.

Parameters:

Name Type Description Default
num_qubits int | None

The number of qubits in the resulting SparseObservable. If None, it will be determined from the highest qubit index in the observable

None

ExpectationValue

Bases: ResponseBase

Result of a quantum measurement, containing both the measured value and its uncertainty.

value instance-attribute

value: float

The expected value of the quantum measurement

error_bar instance-attribute

error_bar: float

The standard error associated with the measurement

ScaleExpectationValue

Bases: ExpectationValue

Result of a quantum measurement, containing both the measured value and its uncertainty.

scale instance-attribute

scale: float

The quantum error tuning scale (error amplification or reduction scale)

NoiseScalingResult

Bases: ResponseBase

scale_factors property

scale_factors: list[float]

List of scale factors used in the noise scaling results

ZNEResult

Bases: ExpectationValue

Result of an extrapolation to zero noise

extrapolation instance-attribute

extrapolation: str

The extrapolation method used (e.g., 'exponential', 'linear', 'quadratic')

scale_factors instance-attribute

scale_factors: list[float]

The scale factors used in the extrapolation

QesemObservableResult

Bases: ResponseBase

Collection of quantum measurement results for a single observable

qesem property

qesem: ExpectationValue | None

Alias for QESEM field

CircuitQesemResults

Bases: RootModel[list[tuple[Observable, QesemObservableResult]]]

Collection of quantum measurement results for a single circuit, pairing observables and quantum error tuning factor (error amplification or reduction factor) with their measured expectation values.

QesemResults

Bases: RootModel[list[CircuitQesemResults]]

Collection of quantum measurement results for multiple circuits.

CircuitQiskitResults

Bases: list[tuple[SparseObservable, QesemObservableResult]]

Collection of quantum measurement results for a single circuit, pairing observables and quantum error tuning factor (error amplification or reduction factor) with their measured expectation values.

QesResults

Bases: ResponseBase

Quantum Error suppression results

PrecisionMode

Bases: str, Enum

Precision mode types when executing a parameterized circuit.

JOB class-attribute instance-attribute

JOB = 'JOB'

QESEM will treat the precision as a precision for the sum of the expectation values.

CIRCUIT class-attribute instance-attribute

CIRCUIT = 'CIRCUIT'

QESEM will target the specified precision for each circuit.

ExecutionMode

Bases: str, Enum

The mode of execution.

SESSION class-attribute instance-attribute

SESSION = 'SESSION'

QESEM will execute the job in a single IBM dedicated session.

BATCH class-attribute instance-attribute

BATCH = 'BATCH'

QESEM will execute the job in multiple IBM batches.

JobOptions

Bases: RequestBase

Additional options for a job request

execution_mode class-attribute instance-attribute

execution_mode: ExecutionMode = Field(default=BATCH)

Execution mode type. Default is BATCH

CircuitOptions

Bases: RequestBase

Qesem circuits circuit_options

error_suppression_only class-attribute instance-attribute

error_suppression_only: bool = False

No error mitigation. This results in a much shorter but biased run. When True, the shots parameter becomes mandatory, while precision and observables will be ignored!

twirl class-attribute instance-attribute

twirl: bool | None = None

Use twirls during transpilation. Only relevant when error_suppression_only is True (Otherwise it is always on).

transpilation_level class-attribute instance-attribute

transpilation_level: TranspilationLevel = Field(
    default=STANDARD
)

Transpilation level type

parallel_execution class-attribute instance-attribute

parallel_execution: bool = False

Whether to parallel the circuit over multiple copies (if possible). Useful for small circuits over large QPUs.

BareCircuit

Bases: RequestBase

circuit instance-attribute

circuit: QuantumCircuit

The quantum circuit to be executed.

ParameterizedCircuit

Bases: BareCircuit

parameters class-attribute instance-attribute

parameters: dict[str, tuple[float, ...]] | None = None

Optional dictionary mapping parameter names to their values for parameterized circuits.

PrecisionPerFactor

Bases: RootModel[dict[float, float]]

A dictionary mapping quantum error tuning factors (error amplification or reduction factors) to desired precisions (for all observables).

Circuit

Bases: ParameterizedCircuit

A quantum circuit configuration including the circuit itself, observables to measure, and execution parameters.

observables instance-attribute

observables: tuple[Observable, ...]

Tuple of observables to be measured. Each observable represents a measurement configuration.

observables_metadata class-attribute instance-attribute

observables_metadata: tuple[
    ObservableMetadata, ...
] | None = None

Tuple of metadata for the observables. Each metadata corresponds to the observable at the same index.

precision instance-attribute

precision: float | PrecisionPerFactor

Target precision for the error mitigated expectation value measurements (a.k.a, 0.0 error reduction factor). If a PrecisionPerFactor is provided, it should be a map from a quantum error tuning factor (error amplification or reduction factor) to the desired precision at that factor (for all observables).

options instance-attribute

options: CircuitOptions

Additional options for circuit execution

_precision_per_factor_to_float

_precision_per_factor_to_float() -> Circuit

Transform a precision per factor with single key 0.0 to a float for backward compatibility and convenience.

ErrorSuppressionCircuit

Bases: ParameterizedCircuit

shots instance-attribute

shots: int

Amount of shots to run this circuit. Only viable when error-suppression only is True!

options instance-attribute

options: CircuitOptions

Additional options for circuit execution

QPUTime

Bases: TypedDict

Time metrics for quantum processing unit (QPU) usage.

execution instance-attribute

execution: timedelta

Actual time spent executing the quantum circuit on the QPU

estimation instance-attribute

estimation: NotRequired[timedelta]

Estimated time required for QPU execution, may not be present

TranspiledCircuit

Bases: BaseModel

Circuit to be executed on QPU

circuit instance-attribute

circuit: QuantumCircuit

The quantum circuit after optimization, ready for execution.

qubit_maps class-attribute instance-attribute

qubit_maps: list[dict[int, int]] = Field(
    validation_alias=AliasChoices("qubit_maps", "qubit_map")
)

A list of mapping between logical qubits in the original circuit and physical qubits on the QPU, one for each copy of the original circuit (if parallel execution is not used, will contain only one mapping).

num_measurement_bases instance-attribute

num_measurement_bases: int

Number of different measurement bases required for this circuit

ExecutionDetails

Bases: ResponseBase

Detailed statistics about the quantum circuit execution.

total_shots instance-attribute

total_shots: int

Total number of times the quantum circuit was executed

mitigation_shots instance-attribute

mitigation_shots: int

Number of shots used for error mitigation

gate_fidelities instance-attribute

gate_fidelities: dict[str, float]

Dictionary mapping gate names to their measured fidelities on the QPU

transpiled_circuits class-attribute instance-attribute

transpiled_circuits: list[TranspiledCircuit] | None = None

List of circuits after optimization and mapping to the QPU architecture.

JobStep

Bases: BaseModel

Represents a single step in a job progress

JobProgress

Bases: BaseModel

Represents job progress, i.e. a list of sequential steps

JobDetails

Bases: ResponseBase

Detailed information about a quantum job, including its status, execution details, and results.

account_id instance-attribute

account_id: str

The unique identifier of the user account

account_email instance-attribute

account_email: str

The email address associated with the user account

job_id instance-attribute

job_id: str

The unique identifier of the job

description class-attribute instance-attribute

description: str = ''

Optional description of the job

masked_account_token instance-attribute

masked_account_token: str

Partially hidden account authentication token

masked_qpu_token instance-attribute

masked_qpu_token: str

Partially hidden QPU access token

qpu_name instance-attribute

qpu_name: str

Name of the quantum processing unit (or simulator) being used

circuit class-attribute instance-attribute

circuit: Circuit | ErrorSuppressionCircuit | None = None

The quantum circuit to be executed. Returns only if include_circuit is True

precision_mode class-attribute instance-attribute

precision_mode: PrecisionMode | None = None

The precision mode used for execution. Can only be used when parameters are set.

status instance-attribute

status: JobStatus

Current status of the job

analytical_qpu_time_estimation instance-attribute

analytical_qpu_time_estimation: timedelta | None

Theoretical estimation of QPU execution time

empirical_qpu_time_estimation class-attribute instance-attribute

empirical_qpu_time_estimation: timedelta | None = None

Measured estimation of QPU execution time based on actual runs

total_execution_time instance-attribute

total_execution_time: timedelta

Total time taken for the job execution. Includes QPU and classical processing time.

created_at instance-attribute

created_at: datetime

Timestamp when the job was created

updated_at instance-attribute

updated_at: datetime

Timestamp when the job was last updated

qpu_time instance-attribute

qpu_time: QPUTime | None

Actual QPU time used for execution and estimation.

qpu_time_limit class-attribute instance-attribute

qpu_time_limit: timedelta | None = None

Maximum allowed QPU execution time

warnings class-attribute instance-attribute

warnings: list[str] | None = None

List of warning messages generated during job execution

errors class-attribute instance-attribute

errors: list[str] | None = None

List of error messages generated during job execution

empirical_estimation_mitigation_results class-attribute instance-attribute

empirical_estimation_mitigation_results: QesemResults | None = (
    None
)

Mitigation results obtained during empirical time estimation.

intermediate_results class-attribute instance-attribute

intermediate_results: QesemResults | None = None

Partial results obtained during job execution.

results class-attribute instance-attribute

results: QesResults | QesemResults | None = None

Final results of the quantum computation. Returns only if include_results is True

execution_details class-attribute instance-attribute

execution_details: ExecutionDetails | None = None

Information about the execution process. Includes total shots, mitigation shots, and gate fidelities.

empirical_estimation_execution_details class-attribute instance-attribute

empirical_estimation_execution_details: ExecutionDetails | None = (
    None
)

Information about the empirical time estimation execution process. Includes total shots, mitigation shots, and gate fidelities.

progress class-attribute instance-attribute

progress: JobProgress | None = None

Current progress information of the job. Printed automatically when calling qedma_client.wait_for_job_complete().

execution_mode instance-attribute

execution_mode: ExecutionMode

The mode of execution.

enable_notifications class-attribute instance-attribute

enable_notifications: bool = True

Whether to enable email notifications for this job.

CharacterizationJobStatus

Bases: str, Enum

The status of a job.

RUNNING class-attribute instance-attribute

RUNNING = 'RUNNING'

Job started running. Monitor its progress using the qedma_client.wait_for_job_complete() method.

SUCCEEDED class-attribute instance-attribute

SUCCEEDED = 'SUCCEEDED'

Job finished successfully. The user can now get the results via the qedma_client.get_job() API with the include_results = True flag.

FAILED class-attribute instance-attribute

FAILED = 'FAILED'

Job failed. Review the error message in the job.errors field.

CANCELLED class-attribute instance-attribute

CANCELLED = 'CANCELLED'

The job was cancelled by the user.

CharacterizationJobDetails

Bases: ResponseBase

Detailed information about a quantum job, including its status, execution details, and results.

account_id instance-attribute

account_id: str

The unique identifier of the user account

account_email instance-attribute

account_email: str

The email address associated with the user account

job_id instance-attribute

job_id: str

The unique identifier of the job

masked_account_token instance-attribute

masked_account_token: str

Partially hidden account authentication token

masked_qpu_token instance-attribute

masked_qpu_token: str

Partially hidden QPU access token

qpu_name instance-attribute

qpu_name: str

Name of the quantum processing unit (or simulator) being used

circuit instance-attribute

circuit: BareCircuit | None

The quantum circuit to choose the layout for

status instance-attribute

Current status of the job

created_at instance-attribute

created_at: datetime

Timestamp when the job was created

updated_at instance-attribute

updated_at: datetime

Timestamp when the job was last updated

warnings class-attribute instance-attribute

warnings: list[str] | None = None

List of warning messages generated during job execution

errors class-attribute instance-attribute

errors: list[str] | None = None

List of error messages generated during job execution

measurement_errors class-attribute instance-attribute

measurement_errors: dict[int, float] | None = None

qubits measurement errors

gate_infidelities class-attribute instance-attribute

gate_infidelities: list[GateInfidelity] | None = None

Gate infidelities per gate type and qubits

layout_optimized_circuit class-attribute instance-attribute

layout_optimized_circuit: BareCircuit | None = None

The quantum circuit after layout optimization

qubit_map class-attribute instance-attribute

qubit_map: dict[int, int] | None = None

The chosen mapping of the layout optimization process

enable_notifications class-attribute instance-attribute

enable_notifications: bool = True

Whether to enable email notifications for this job.

JobRequestBase

Bases: RequestBase

Request to create a new job

validate_precision_mode

validate_precision_mode() -> Self

Validates the precision mode.

CharacterizationJobRequestBase

Bases: RequestBase

Request to create a new job

validate_circuit_type

validate_circuit_type() -> Self

Validates the circuit type.

StartJobRequest

Bases: RequestBase

Start a job.

GetJobsDetailsResponse

Bases: ResponseBase

An internal object.

GetCharJobsDetailsResponse

Bases: ResponseBase

An internal object.

RegisterQpuTokenRequest

Bases: RequestBase

Store qpu token request model

DecomposeResponse

Bases: ResponseBase

Decompose response model

QedmaServerError

Bases: Exception

An exception raised when the server returns an error.

ResultNotReadyError

Bases: QedmaServerError

An exception raised when the server returns an error.

ClientJobDetails

Bases: BaseModel

Detailed information about a quantum job, including its status, execution details, and results. Same as JobDetails, but meant to be returned to the client.

account_id instance-attribute

account_id: str

The unique identifier of the user account

account_email instance-attribute

account_email: str

The email address associated with the user account

job_id instance-attribute

job_id: str

The unique identifier of the job

description class-attribute instance-attribute

description: str = ''

Optional description of the job

masked_account_token instance-attribute

masked_account_token: str

Partially hidden account authentication token

masked_qpu_token instance-attribute

masked_qpu_token: str

Partially hidden QPU access token

qpu_name instance-attribute

qpu_name: str

Name of the quantum processing unit (or simulator) being used

circuit class-attribute instance-attribute

circuit: Circuit | ErrorSuppressionCircuit | None = None

The quantum circuit to be executed. Returns only if include_circuit is True

precision_mode class-attribute instance-attribute

precision_mode: PrecisionMode | None = None

The precision mode used for execution. Can only be used when parameters are set.

status instance-attribute

status: JobStatus

Current status of the job

analytical_qpu_time_estimation instance-attribute

analytical_qpu_time_estimation: timedelta | None

Theoretical estimation of QPU execution time

empirical_qpu_time_estimation class-attribute instance-attribute

empirical_qpu_time_estimation: timedelta | None = None

Measured estimation of QPU execution time based on actual runs

total_execution_time instance-attribute

total_execution_time: timedelta

Total time taken for the job execution. Includes QPU and classical processing time.

created_at instance-attribute

created_at: datetime

Timestamp when the job was created

updated_at instance-attribute

updated_at: datetime

Timestamp when the job was last updated

qpu_time instance-attribute

qpu_time: QPUTime | None

Actual QPU time used for execution and estimation.

qpu_time_limit class-attribute instance-attribute

qpu_time_limit: timedelta | None = None

Maximum allowed QPU execution time

warnings class-attribute instance-attribute

warnings: list[str] | None = None

List of warning messages generated during job execution

errors class-attribute instance-attribute

errors: list[str] | None = None

List of error messages generated during job execution

empirical_estimation_mitigation_results class-attribute instance-attribute

empirical_estimation_mitigation_results: QiskitResults | QesemResults | None = (
    None
)

Mitigation results obtained during empirical time estimation.

intermediate_results class-attribute instance-attribute

intermediate_results: QiskitResults | QesemResults | None = (
    None
)

Partial results obtained during job execution.

results class-attribute instance-attribute

results: QiskitResults | QesemResults | QesResults | None = (
    None
)

Final results of the quantum computation. Returns only if include_results is True

execution_details class-attribute instance-attribute

execution_details: ExecutionDetails | None = None

Information about the execution process. Includes total shots, mitigation shots, and gate fidelities.

empirical_estimation_execution_details class-attribute instance-attribute

empirical_estimation_execution_details: ExecutionDetails | None = (
    None
)

Information about the empirical time estimation execution process. Includes total shots, mitigation shots, and gate fidelities.

progress class-attribute instance-attribute

progress: JobProgress | None = None

Current progress information of the job. Printed automatically when calling qedma_client.wait_for_job_complete().

execution_mode instance-attribute

execution_mode: ExecutionMode

The mode of execution.

enable_notifications class-attribute instance-attribute

enable_notifications: bool = True

Whether to enable email notifications for this job.

from_job_details classmethod

from_job_details(
    job_details: JobDetails,
    qedma_observable_model: bool = False,
) -> ClientJobDetails

Convert a JobDetails object to a ClientJobDetails object.

Parameters:

Name Type Description Default
job_details JobDetails

The JobDetails object to convert.

required
qedma_observable_model bool

Whether to return the results with Qedma's observable model, or Qiskit SparsePauliOp.

False

Returns:

Type Description
ClientJobDetails

The converted ClientJobDetails object.

_unique_qubit_indices

_unique_qubit_indices(value: str) -> str

Ensure that every qubit index is referenced at most once. The Pauli string syntax is restricted by _PAULI_STRING_REGEX_STR to be a comma-separated list of terms such as "X_0" or "r_15". Extract the trailing integer of each term and verify uniqueness.