QUBO embedding and Solver
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?
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)