Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Fix type errors when used with rustworkx 0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
garrison committed Jun 9, 2023
1 parent 16e5c3b commit 830439f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qrao/encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,10 @@ def _generate_ising_terms(
def _find_variable_partition(quad: np.ndarray) -> Dict[int, List[int]]:
num_nodes = quad.shape[0]
assert quad.shape == (num_nodes, num_nodes)
graph = rx.PyGraph()
graph = rx.PyGraph() # type: ignore
graph.add_nodes_from(range(num_nodes))
graph.add_edges_from_no_data(list(zip(*np.where(quad != 0))))
node2color = rx.graph_greedy_color(graph)
graph.add_edges_from_no_data(list(zip(*np.where(quad != 0)))) # type: ignore
node2color = rx.graph_greedy_color(graph) # type: ignore
color2node: Dict[int, List[int]] = defaultdict(list)
for node, color in sorted(node2color.items()):
color2node[color].append(node)
Expand Down

0 comments on commit 830439f

Please sign in to comment.