Skip to content
Pasqal Documentation

Results are limited to the current section : Pulser

QPUBackend

class pulser.backend.QPUBackend(sequence, connection, *, config=None)

Bases: RemoteBackend

Backend for sequence execution on a QPU.

Parameters:
  • sequence (Sequence) – A Sequence or a list of Sequences to execute on a backend accessible via a remote connection.

  • connection (RemoteConnection) – The remote connection through which the jobs are executed.

  • config (BackendConfig | None, default: None) – An optional backend configuration. For a QPU, it can be used to define a default_num_shots.

Methods

open_batch

Creates an open batch within a context manager object.

run

Runs the sequence on the remote QPU and returns the result.

validate_job_params

Validates a list of job parameters prior to submission.

validate_sequence

Validates a sequence prior to submission.

Signatures

open_batch()

Creates an open batch within a context manager object.

Return type:

_OpenBatchContextManager

run(job_params=None, wait=False)

Runs the sequence on the remote QPU and returns the result.

Parameters:
  • job_params (list[JobParams] | None, default: None) – A list of dictionaries with the parameters to execute each job. If not given, the backend will attempt to run one job with ‘BackendConfig.default_num_shots’. If the sequence is parametrized, the values for all the variables necessary to build the sequence must be given in its own dictionary, for each job, under the ‘variables’ field. Each dictionary may contain a custom ‘runs’ field specifying the number of shots to take of the same sequence; if not given, ‘BackendConfig.default_num_shots’ is used when available.

  • wait (bool, default: False) – Whether to wait until the results of the jobs become available. If set to False, the call is non-blocking and the obtained results’ status can be checked using their status property.

Return type:

RemoteResults

Returns:

The results, which can be accessed once all sequences have been successfully executed.

static validate_job_params(job_params, max_runs)

Validates a list of job parameters prior to submission.

Return type:

None

static validate_sequence(sequence, mimic_qpu=False)

Validates a sequence prior to submission.

Return type:

None