Files
qibo-final/qibojit-benchmarks/graphs/generate_random_graphs.py
2026-05-19 17:19:36 +08:00

11 lines
334 B
Python

"""Generate random regular graphs for MaxCut QAOA benchmark."""
import json
import networkx
for nqubits in range(4, 31, 2):
graph = networkx.random_regular_graph(3, nqubits)
data = networkx.readwrite.json_graph.node_link_data(graph)
with open(f"randomgraph_3_{nqubits}.json", "w") as file:
json.dump(data, file)