Embedding QUBOs to Pegasus
Hello,
I am trying to embed QUBOs onto Pegasus hardware, but I am unsure if my approach is correct.
I am noticing that only trivial QUBOs will produce a response from the following code.
I assume that the size parameter "m" for the pegasus_graph function should be 16 based on the code sample here: https://docs.ocean.dwavesys.com/en/stable/examples/topology_samplers.html
I have tested the code for up to thirty minutes without a response from the find_embedding function. I have tried changing the chainlength_patience parameter to no avail.
import networkx as nx
import dwave_networkx as dnx
from minorminer import find_embedding
from networkx import draw
from dwave_networkx.drawing.qubit_layout import draw_qubit_graph, draw_embedding, draw_yield
from dwave_networkx.generators.pegasus import pegasus_graph, pegasus_coordinates
import matplotlib.pyplot as plt
import sys
if __name__ == "__main__":
# Simple example here:
# https://github.com/dwavesystems/minorminer
infilename = "test.csv"
# first, we construct a Pegasus graph
# https://www.dwavesys.com/media/jwwj5z3z/14-1026a-c_next-generation-topology-of-dw-quantum-processors.pdf
infile = open(infilename,"r")
q = []
for line in infile.readlines():
splt = line.strip().split(',')
q.append( (int(splt[0]), int(splt[1])) )
infile.close()
G = dnx.pegasus_graph(16)
emb = find_embedding(q, G.edges(), verbose=0, chainlength_patience=3)
Comments
Hi Toby,
Can you please share the input file, test.csv?
You are right that the size parameter(m) is 16 in you code example(G = dnx.pegasus_graph(16)). I need to look at the input file to understand the issue better.
Hi Tanvi,
Thank you for the reply.
I have uploaded two files to my website:
https://huskinson.net/test.csv
https://huskinson.net/test2.csv
In test.csv, I am able to do the embedding. In test2.csv, the embedding hangs, and I don't know why. It is actually the same problem, just the representation is more dense (but with fewer initial qubits).
Please sign in to leave a comment.