From 42cd35410090d8d8e6364423e011d06d1aee3cc5 Mon Sep 17 00:00:00 2001 From: Elscrux Date: Tue, 3 Sep 2024 14:07:36 +0200 Subject: [PATCH] fix: Support no weight attribute --- solvers/qiskit/max-cut/maxCut_qiskit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/solvers/qiskit/max-cut/maxCut_qiskit.py b/solvers/qiskit/max-cut/maxCut_qiskit.py index 2594f0f1..2cf67fc4 100644 --- a/solvers/qiskit/max-cut/maxCut_qiskit.py +++ b/solvers/qiskit/max-cut/maxCut_qiskit.py @@ -76,7 +76,8 @@ for j in range(n): temp = G.get_edge_data(i, j, default=0) if temp != 0: - w[i, j] = temp["weight"] + weight = temp["weight"] + w[i, j] = 1 if weight is None else weight max_cut = Maxcut(w) qp = max_cut.to_quadratic_program()