Skip to content

Results are limited to Pulser v1.3.0

Product news
You are reading Pulser v1.3.0, an older version of this documentation. Go to the latest version (v1.10.0)

SequenceSamples

class pulser.sampler.SequenceSamples(channels, samples_list, _ch_objs, _basis_ref=<factory>, _slm_mask=<factory>, _magnetic_field=None, _measurement=None)

Bases: object

Gather samples for each channel in a sequence.

Attributes

channel_samples

Mapping between the channel name and its samples.

eigenbasis

The basis of eigenstates used for simulation.

max_duration

The maximum duration among the channel samples.

used_bases

The bases with non-zero pulses.

channels

samples_list

Methods

extend_duration

Extend the duration of each samples to a new duration.

to_nested_dict

Format in the nested dictionary form.

Signatures

extend_duration(new_duration)

Extend the duration of each samples to a new duration.

Return type:

SequenceSamples

to_nested_dict(all_local=False, samples_type='array')

Format in the nested dictionary form.

This is the format expected by pulser_simulation.QutipEmulator().

Parameters:
  • all_local (bool, default: False) – Forces all samples to be distributed by their individual targets, even when applied by a global channel.

  • samples_type (Literal['abstract', 'array', 'tensor'], default: 'array') – The array type to return the samples in. Can be “array” (the default), “tensor” or “abstract”.

Return type:

dict

Returns:

A nested dictionary splitting the samples according to their addressing (‘Global’ or ‘Local’), the targeted basis and, in the ‘Local’ case, the targeted qubit.

property channel_samples: dict[str, ChannelSamples]

Mapping between the channel name and its samples.

property eigenbasis: list[Literal['u', 'd', 'r', 'g', 'h', 'x']]

The basis of eigenstates used for simulation.

property max_duration: int

The maximum duration among the channel samples.

property used_bases: set[str]

The bases with non-zero pulses.