QUBO embedding and Solver
Hi,
I'm trying to solve a Sudoku problem using QA. I reduced it to a QUBO problem and now I'm trying to implement it on the Hardware Solver.
I found this piece of code from 2014 to implement the exact same QUBO. Obviously, the SAPI was very different back then and most methods do not exist anymore or at least under a different name. Could you help me to translate the code, so it fits the current API and Hardware version? Are there any other possibilities to solve the QUBO problem?
Code:
from dwave_sapi import RemoteConnection , get_hardware_adjacency , find_embedding , EmbeddingSolver
...
def embed(self , qubo_problem , size):
A = get_hardware_adjacency(self.solver)
A_size = self.solver.properties['num_qubits ']
return find_embedding(qubo_problem , size , A, A_size ,verbose =1, tries =10, max_no_improvement =10)
def solve(self , qubo_problem , embeddings):
embedding_solver = EmbeddingSolver(self.solver , embeddings)
return embedding_solver.solve_qubo(qubo_problem , num_reads =1000)
Comments
Hi Niklas,
Here is an example of how to use the FixedEmbeddingComposite, which does the same thing:
I hope this is helpful!
Please sign in to leave a comment.