Backend Interfaces

QPU

class pulser.QPUBackend(sequence, connection)

Backend for sequence execution on a QPU.

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 parameters for each job to execute. Each mapping must contain a defined ‘runs’ field specifying the number of times to run the same sequence. If the sequence is parametrized, the values for all the variables necessary to build the sequence must be given in it’s own mapping, for each job, under the ‘variables’ field.

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

validate_sequence(sequence)

Validates a sequence prior to submission.

Parameters:

sequence (Sequence) – The sequence to validate.

Return type:

None

Emulators

Configuration

class pulser.EmulatorConfig(backend_options=<factory>, sampling_rate=1.0, evaluation_times='Full', initial_state='all-ground', with_modulation=False, prefer_device_noise_model=False, noise_model=<factory>)

The configuration for emulator backends.

backend_options

A dictionary of backend-specific options.

sampling_rate

The fraction of samples to extract from the pulse sequence for emulation.

Type:

float

evaluation_times

The times at which results are returned. Choose between:

  • “Full”: The times are set to be the ones used to define the Hamiltonian to the solver.

  • “Minimal”: The times are set to only include initial and final times.

  • “Final”: Returns only the result at the end of the sequence.

  • A list of times in µs if you wish to only include those specific times.

  • A float to act as a sampling rate for the resulting state.

Type:

float | Sequence[float] | EVAL_TIMES_LITERAL

initial_state

The initial state from which emulation starts. Choose between:

  • “all-ground” for all atoms in the ground state

  • An array of floats with a shape compatible with the system

Type:

Literal[‘all-ground’] | Sequence[complex]

with_modulation

Whether to emulate the sequence with the programmed input or the expected output.

Type:

bool

prefer_device_noise_model

If the sequence’s device has a default noise model, this option signals the backend to prefer it over the noise model given with this configuration.

Type:

bool

noise_model

An optional noise model to emulate the sequence with. Ignored if the sequence’s device has default noise model and prefer_device_noise_model=True.

Type:

NoiseModel

Local

class pulser_simulation.QutipBackend(sequence, config=EmulatorConfig(backend_options={}, sampling_rate=1.0, evaluation_times='Full', initial_state='all-ground', with_modulation=False, prefer_device_noise_model=False, noise_model=NoiseModel(noise_types=(), runs=15, samples_per_run=5, state_prep_error=0.005, p_false_pos=0.01, p_false_neg=0.05, temperature=50.0, laser_waist=175.0, amp_sigma=0.05, relaxation_rate=0.01, dephasing_rate=0.05, hyperfine_dephasing_rate=0.001, depolarizing_rate=0.05, eff_noise_rates=(), eff_noise_opers=())))

A backend for emulating the sequences using qutip.

Parameters:
  • sequence (Sequence) – The sequence to emulate.

  • config (EmulatorConfig, default: EmulatorConfig(backend_options={}, sampling_rate=1.0, evaluation_times='Full', initial_state='all-ground', with_modulation=False, prefer_device_noise_model=False, noise_model=NoiseModel(noise_types=(), runs=15, samples_per_run=5, state_prep_error=0.005, p_false_pos=0.01, p_false_neg=0.05, temperature=50.0, laser_waist=175.0, amp_sigma=0.05, relaxation_rate=0.01, dephasing_rate=0.05, hyperfine_dephasing_rate=0.001, depolarizing_rate=0.05, eff_noise_rates=(), eff_noise_opers=()))) – The configuration for the Qutip emulator.

run(progress_bar=False, **qutip_options)

Emulates the sequence using QuTiP’s solvers.

Parameters:
  • progress_bar (bool, default: False) – If True, the progress bar of QuTiP’s solver will be shown. If None or False, no text appears.

  • options

    Used as arguments for qutip.Options(). If specified, will override SimConfig solver_options. If no max_step value is provided, an automatic one is calculated from the Sequence’s schedule (half of the shortest duration among pulses and delays). Refer to the QuTiP docs for an overview of the parameters.

Returns:

In particular, returns NoisyResults if the noise model in EmulatorConfig requires it. Otherwise, returns CoherentResults.

Return type:

SimulationResults

Remote

class pulser_pasqal.EmuTNBackend(sequence, connection, config=None)

An emulator backend using tensor network simulation.

Configurable fields in EmulatorConfig:
  • sampling_rate: Defaults to 0.1. This value must remain low to use this backend efficiently.

  • backend_options:
    • precision (str): The precision of the simulation. Can be “low”, “normal” or “high”. Defaults to “normal”.

    • max_bond_dim (int): The maximum bond dimension of the Matrix Product State (MPS). Defaults to 500.

All other parameters should not be changed from their default values.

Parameters:
  • sequence (pulser.Sequence) – The sequence to send to the backend.

  • connection (PasqalCloud) – An open PasqalCloud connection.

  • config (EmulatorConfig | None, default: None) – An EmulatorConfig to configure the backend. If not provided, the default configuration is used.

class pulser_pasqal.EmuFreeBackend(sequence, connection, config=None)

An emulator backend using free Hamiltonian time evolution.

Configurable fields in EmulatorConfig:
  • backend_options:
    • with_noise (bool): Whether to add noise to the simulation. Defaults to False.

All other parameters should not be changed from their default values.

Parameters:
  • sequence (pulser.Sequence) – The sequence to send to the backend.

  • connection (PasqalCloud) – An open PasqalCloud connection.

  • config (EmulatorConfig | None, default: None) – An EmulatorConfig to configure the backend. If not provided, the default configuration is used.

Remote backend connection

class pulser_pasqal.PasqalCloud(username='', password='', project_id='', **kwargs)

Manager of the connection to PASQAL’s cloud platform.

The cloud connection enables to run sequences on simulators or on real QPUs.

Parameters:
  • username (str, default: '') – Your username in the PASQAL cloud platform.

  • password (str, default: '') – The password for your PASQAL cloud platform account.

  • project_id (str, default: '') – The project ID associated to the account.

  • kwargs (Any) – Additional arguments to provide to the pasqal_cloud.SDK()