I want to solve QUBO with non-zero diagonal elements in matrix Q using QAOA. But I want to solve for a large enough problem size (30+ variables) and hence want to divide my circuit into subcircuits. Circuit cutting didn't work out for me, because graph is dense, so I want to try divide-and-conquer approaches proposed here and here. However, both papers divide the Maxcut problem. Hence the question: How to convert QUBO (with non-zero diagonal elements) to Maxcut? In this paper it is stated and shown that QUBO and Maxcut are equivalent. However, I haven't fully understood the proof and my code based on this proof isn't working (optimal cut isn't an optimal solution). Here's the code:
h, J, ising_offset = from_Q_to_Ising(Q, qubo_offset)
G = nx.Graph()
for ki, v in h.items():
if abs(v) > 1e-3:
# add new node and connect it with other nodes where diagonal weight is non-zero
# flip the weight sign
G.add_edge(0, ki[0] + 1, weight = -v)
for kij, vij in J.items():
if abs(vij) > 1e-3:
# flip the weight sign
G.add_edge(kij[0] + 1, kij[1] + 1, weight = -v)
Would be thankful for any suggestions regarding conversion, or any other way to use these divide-and-conquer approaches or other ways to split the QAOA circuit.