final first commit
This commit is contained in:
10
qibojit-benchmarks/graphs/generate_random_graphs.py
Normal file
10
qibojit-benchmarks/graphs/generate_random_graphs.py
Normal file
@@ -0,0 +1,10 @@
|
||||
"""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)
|
||||
Reference in New Issue
Block a user