Skip to content
Pasqal Documentation

EmulationConfig

class pulser.backend.EmulationConfig(*, observables=(), default_evaluation_times=(1.0,), initial_state=None, with_modulation=False, interaction_matrix=None, prefer_device_noise_model=False, noise_model=NoiseModel(noise_types=()), **backend_options)

Bases: BackendConfig, Generic[StateType]

Configures an emulation on a backend.

Parameters:
  • observables (Sequence[Observable], default: ()) – A sequence of observables to compute at specific evaluation times. The observables without specified evaluation times will use this configuration’s ‘default_evaluation_times’.

  • default_evaluation_times (Sequence[SupportsFloat] | Literal[‘Full’], default: (1.0,)) – The default times at which observables are computed. Can be a sequence of unique relative times between 0 (the start of the sequence) and 1 (the end of the sequence), in ascending order. Can also be specified as “Full”, in which case every step in the emulation will also be an evaluation time.

  • initial_state (StateType | None, default: None) – The initial state from which emulation starts. If specified, the state type needs to be compatible with the emulator backend. If left undefined, defaults to starting with all qudits in the ground state.

  • with_modulation (bool, default: False) – Whether to emulate the sequence with the programmed input or the expected output.

  • interaction_matrix (ArrayLike | None, default: None) – An optional interaction matrix to replace the interaction terms in the Hamiltonian. For an N-qudit system, must be an NxN symmetric matrix where entry (i, j) dictates the interaction coefficient between qudits i and j, ie it replaces the C_n/r_{ij}^n term.

  • prefer_device_noise_model (bool, default: False) – If True, uses the noise model of the sequence’s device (if the sequence’s device has one), regardless of the noise model given with this configuration.

  • noise_model (NoiseModel, default: NoiseModel(noise_types=())) – 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.

Note

Additional parameters may be provided. It is up to the emulation backend that receives a configuration with extra parameters to assess whether it recognizes them and how it will use them. To know all parameters expected by an EmulatorBackend, consult its associated EmulationConfig subclass found under ‘EmulatorBackend.default_config’.

Attributes

observables

default_evaluation_times

initial_state

with_modulation

interaction_matrix

prefer_device_noise_model

noise_model

Methods

from_abstract_repr

Deserialize an EmulationConfig from an abstract JSON object.

is_evaluation_time

Assesses whether a relative time is an evaluation time.

is_time_in_evaluation_times

Checks if a time is within a collection of evaluation times.

to_abstract_repr

Serialize EmulationConfig to a JSON formatted str.

Signatures

classmethod from_abstract_repr(obj_str)

Deserialize an EmulationConfig from an abstract JSON object.

Parameters:

obj_str (str) – the JSON string representing the sequence encoded in the abstract JSON format.

Returns:

The EmulationConfig instance.

Return type:

EmulationConfig

is_evaluation_time(t, tol=1e-06)

Assesses whether a relative time is an evaluation time.

Return type:

bool

static is_time_in_evaluation_times(t, evaluation_times, tol=1e-06)

Checks if a time is within a collection of evaluation times.

Return type:

bool

to_abstract_repr(skip_validation=False)

Serialize EmulationConfig to a JSON formatted str.

Return type:

str