Formulate and solve a simple QUBO
import dimod
from dwave.system import DWaveSampler, EmbeddingComposite
# A simple 2-variable QUBO: minimize x0*x1 - x0 - x1
Q = {(0, 0): -1, (1, 1): -1, (0, 1): 2}
sampler = EmbeddingComposite(DWaveSampler())
response = sampler.sample_qubo(Q, num_reads=100)
print(response.first.sample) # lowest energy solution
print(response.first.energy)
This submits a simple 2-variable QUBO to the Advantage QPU. The EmbeddingComposite automatically finds an embedding of your problem graph onto the Pegasus hardware topology. The result is the lowest-energy (best optimization) solution found across 100 annealing runs.