SamplerRandomBitstrings#
Module: iqm.qaoa.backends
- class iqm.qaoa.backends.SamplerRandomBitstrings[source]#
Bases:
SamplerBackendA sampler that ignores the QAOA and just produces random bitstrings of the correct length.
Methods
Produce random bitstrings to act as samples from the QAOA.
- sample(qaoa_object, shots, seed=None)[source]#
Produce random bitstrings to act as samples from the QAOA.
The
qaoa_objectis used only to get the number of qubits (which corresponds to the length of the bitstrings). The number of uniformly random bitstrings produced isshotsand they are arranged in a dictionary just like counts from aqiskitmeasurement.This method overrides the dispatching method
sample()ofSamplerBackendbecause there is no point in doing any kind of dispatching here.- Parameters:
- Returns:
A dictionary whose keys are the produced random bitstrings and values their frequencies in the random set.
- Return type:
Inheritance
