Factoring Overview Minor Embedding Sample
I am working through the example code for the factoring overview. It's super interesting and informative but I had a question about the minor embedding portion of the example here:
When the D‑Wave quantum computer solves a problem, it uses quantum phenomena such as superposition and tunneling to explore all possible solutions simultaneously and find a set of the best ones. Because the sampled solution is probabilistic, returned solutions may differ between runs. Typically, when submitting a problem to the system, we ask for many samples, not just one. This way, we see multiple “best” answers and reduce the probability of settling on a suboptimal answer.
In the code below, num_reads should provide enough samples to make it likely a valid answer is among them.
from helpers.embedding import embeddings
# Set a pre-calculated minor-embeding
embedding = embeddings[sampler.solver.id]
bqm_embedded = dimod.embed_bqm(bqm, embedding, target_adjacency, 3.0)
# Confirm mapping of variables from a0, b0, etc to indexed qubits
print("Variable a0 in embedded BQM: ", 'a0' in bqm_embedded)
print("First five nodes in QPU graph: ", sampler.structure.nodelist[:5])
---- (appologies for the plaintext code, I don't know how to embed code snippets here)
I expected the output to be something like:
Variable a0 in embedded BQM: True First five nodes in QPU graph: [a0, b0, a1, b1, a2]
or something like that. Instead what was returned was:
Variable a0 in embedded BQM: False First five nodes in QPU graph: [0, 1, 2, 3, 4]
I feel like this is incorrect, since it seems like from the descriptive text the mapping failed.
I was wondering why this didn't work as described, and if it is what I am not understanding about the accompanying descriptions.