numpy.ndarray QUBO to D-Wave
Hello all.
I created a QUBO matrix in a numpy.ndarray, I wonder, how can I send it to be solved in D-Wave?
This is my QUBO matrix: http://www.sharecsv.com/s/051ba20b9dcd3e50135315063b420ae1/qubo.csv
Thank you
Hello all.
I created a QUBO matrix in a numpy.ndarray, I wonder, how can I send it to be solved in D-Wave?
This is my QUBO matrix: http://www.sharecsv.com/s/051ba20b9dcd3e50135315063b420ae1/qubo.csv
Thank you
Comments
Just an update, I read about the "D-Wave Hybrid" and seems that D-Wave recommends using it because is better than qbsolv, right?
So, how to send a numpy.ndarray QUBO matrix (like the previous CVS) to dwave-hybrid? I found one example with a Dictionary {(x,y): value} (e.g.: Q1 = {(0,0):1,(1,1):1,(0,1):1} ), is this right? This format is very different from the QUBO file that requires nCouplers and nNodes.
I tried ``` bqm = dimod.BinaryQuadraticModel({}, qubo, 0, 'BINARY') ``` but I got this error: "ValueError: no self-loops allowed, therefore (0, 0) is not an allowed interaction"
Hi John,
We have a convenience function for doing just this!
Here is an example of the function call to use:
bqm = dimod.BinaryQuadraticModel.from_numpy_matrix(array)
I hope this was helpful!
Thank you, worked. ;)
Please sign in to leave a comment.