qrunch.quantum.samplers.memory_restricted_sampler
Module containing the a memory restricted estimator.
Classes
Class for sampling using the memory restricted sampler. |
- class MemoryRestrictedSampler
Bases:
SamplerClass 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
- clear_cache() None
Clear the measurement cache.
- Return type:
None
- run(circuits: MeasurementCircuit | Sequence[MeasurementCircuit]) 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.
- Return type:
QuantumMeasurement | list[QuantumMeasurement]
- validate_shots_type(shots_type: Type[int | None]) list[str]
Validate that the sampler supports the given shots type. Return a list of error messages if not supported.
- Parameters:
shots_type (Type[int | None])
- Return type:
list[str]