SamplerResonance#
- class iqm.qaoa.backends.SamplerResonance(token, server_url='https://cocos.resonance.meetiqm.com/garnet', transpiler='SparseTranspiler')[source]#
Bases:
SamplerBackend
A sampler that runs the circuit on IQM Resonance and returns the result.
- Parameters:
Methods
sample
(qaoa_object, shots, **kwargs)Samples from the QAOA on a quantum computer via IQM Resonance.
- sample(qaoa_object, shots, **kwargs)[source]#
Samples from the QAOA on a quantum computer via IQM Resonance.
First, it creates a
QuantumCircuit
(using a custom transpilation approach) and then sends it to IQM Resonance. The dictionary of counts is obtained from qiskit and then the bitstrings are reversed, so they don’t use the qiskit convention of the first bit being on the right of the bitstring.- Parameters:
qaoa_object (QUBOQAOA) – The
QUBOQAOA
object, to be sampled from.shots (int) – The number of samples (measurements) to take.
**kwargs (Any) – Extra keyword arguments for constructing the transpiled circuit before sending it to Resonance. Mainly intended for
seed_transpiler
, a random seed for the transpilation.
- Returns:
A dictionary whose keys are the measured bitstrings and values their frequencies in the results.
- Return type: