Skip to content

Commit

Permalink
Update readme, license
Browse files Browse the repository at this point in the history
  • Loading branch information
shinich1 committed Jul 9, 2024
1 parent 05795a3 commit c563fc0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 47 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@

END OF TERMS AND CONDITIONS

Copyright 2022 Shinichi Sunami
Copyright 2022-2024 Shinichi Sunami

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ from graphix import Circuit
circuit = Circuit(4)
circuit.h(0)
...
pattern = circuit.transpile()
pattern = circuit.transpile().pattern
pattern.draw_graph()
```
<img src="https://github.com/TeamGraphix/graphix/assets/33350509/de17c663-f607-44e2-945b-835f4082a940" alt="logo" width="750">
<img src="https://github.com/TeamGraphix/graphix/assets/33350509/de17c663-f607-44e2-945b-835f4082a940" alt="graph_flow" width="750">

<small>note: this graph is generated from QAOA circuit, see [our example code](examples/qaoa.py). Arrows indicate the [*causal flow*](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.74.052310) of MBQC and dashed lines are the other edges of the graph. the vertical dashed partitions and the labels 'l:n' below indicate the execution *layers* or the order in the graph (measurements should happen from left to right, and nodes in the same layer can be measured simultaneously), based on the partial order associated with the (maximally-delayed) flow. </small>

Expand All @@ -50,7 +50,7 @@ pattern.draw_graph()
pattern.perform_pauli_measurements()
pattern.draw_graph()
```
<img src="https://github.com/TeamGraphix/graphix/assets/33350509/3c30a4c9-f912-4a36-925f-2ff446a07c68" alt="logo" width="140">
<img src="https://github.com/TeamGraphix/graphix/assets/33350509/3c30a4c9-f912-4a36-925f-2ff446a07c68" alt="graph_gflow" width="140">

<small>(here, the graph is visualized based on [*generalized flow*](https://iopscience.iop.org/article/10.1088/1367-2630/9/8/250).)</small>

Expand Down Expand Up @@ -80,7 +80,7 @@ Many thanks for letting us know about this work - at the time of the writing we

## Contributing

We use [GitHub issues](https://github.com/TeamGraphix/graphix/issues) for tracking feature requests and bugs reports.
We use [GitHub issues](https://github.com/TeamGraphix/graphix/issues) for tracking feature requests and bug reports.

## Discord Server

Expand Down
42 changes: 0 additions & 42 deletions examples/tn_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,48 +128,6 @@ def ansatz(circuit, n, gamma, beta, iterations):
fig, ax = plt.subplots(figsize=(13, 10))
color = ["Open", "Close"]

# # Rebuilding the graph to be visualizable
# # Ignoring dangling edges when plotting, but coloring according to them
# ind_map, tag_map, default_output_nodes = mbqc_tn.ind_map, mbqc_tn.tag_map, mbqc_tn.default_output_nodes
# nodes = set()
# nodes.update(list(tag_map["Open"])) # The node has "dangling" index
# nodes.update(list(tag_map["Close"]))
# edges = []
# for i in ind_map.items():
# if len(i[1]) < 2:
# continue
# edges.append(list(i[1]))
# input_nodes = []
# for node in nodes:
# candidate = True
# for edge in edges:
# if edge[1] == node:
# candidate = False
# continue
# if candidate:
# input_nodes.append(node)
# for i in range(0, len(default_output_nodes)):
# default_output_nodes[i] = str(default_output_nodes[i])
# out_nodes = []
# for i in tag_map.items():
# if i[0] in default_output_nodes:
# out_nodes.append(list(i[-1])[-1])
# meas_planes = pattern.get_meas_plane()
# # meas_planes = dict()
# # for c in ["M", "Z", "C", "X"]:
# # if c in tag_map.keys():
# # for i in list(tag_map[c]):
# # meas_planes[i] = c
# # for i in nodes:
# # if i not in meas_planes.keys():
# # meas_planes[i] = ""

# # G = nx.Graph()
# # G.add_nodes_from(nodes)
# # G.add_edges_from(edges)
# # f, l_k = find_gflow(G, input=set(input_nodes), output=set(out_nodes), meas_planes=meas_planes)
# pos = GraphVisualizer(G, input_nodes, out_nodes).get_pos_from_gflow(g=f, l_k=l_k)

mbqc_tn.draw(
ax=ax,
color=color,
Expand Down

0 comments on commit c563fc0

Please sign in to comment.