qrunch.quantum.samplers.memory_restricted_sampler

Module containing the a memory restricted estimator.

Classes

MemoryRestrictedSampler

Class for sampling using the memory restricted sampler.

class MemoryRestrictedSampler

Bases: Sampler

Class for sampling using the memory restricted sampler.

__init__(options: MemoryRestrictedSimulatorOptions | None = None, measurement_cache: MeasurementCache | None = None, error_mitigator: SamplerErrorMitigator | None = None) None

Initiate an instance of the MemoryRestrictedEstimator.

Parameters:
  • options (MemoryRestrictedSimulatorOptions | None) – Options to be used in the MemoryRestrictedSampler.

  • measurement_cache (MeasurementCache | None) – Cache to use for storing and reusing measurements.

  • error_mitigator (SamplerErrorMitigator | None) – Error mitigator to be used for encoding the measurement more error resistantly.

Return type:

None

run(circuits: MeasurementCircuit | Sequence[MeasurementCircuit], shots: int | None) QuantumMeasurement | list[QuantumMeasurement]

Start job for sampling on the given circuits a given number of times.

Parameters:
  • circuits (MeasurementCircuit | Sequence[MeasurementCircuit]) – Measurement circuit or sequence of circuits to be sampled.

  • shots (int | None) – Number of measurements to perform.

Return type:

QuantumMeasurement | list[QuantumMeasurement]

supports_shots_equals_none() bool

Return whether the sampler supports shots = None.

Return type:

bool