瀏覽代碼

Add pics

master
Pete Shadbolt 8 年之前
父節點
當前提交
126c819d2c
共有 4 個文件被更改,包括 5 次插入5 次删除
  1. +4
    -4
      abp/fancy.py
  2. +1
    -1
      abp/graphstate.py
  3. +0
    -0
      img/demo.gif
  4. 二進制
      img/viz.png

+ 4
- 4
abp/fancy.py 查看文件

@@ -48,13 +48,13 @@ class GraphState(graphstate.GraphState, networkx.Graph):
#self.ws.close()
#self.connect_to_server()

def layout(self, dim=2):
def layout(self):
""" Automatically lay out the graph """
pos = networkx.spring_layout(self, dim, scale=np.sqrt(self.order()))
pos = networkx.spring_layout(self, 3, scale=np.sqrt(self.order()))
middle = np.average(pos.values(), axis=0)
pos = {key: value - middle for key, value in pos.items()}
for key, (x, y) in pos.items():
self.node[key]["position"] = util.xyz(x, y, 0)
for key, (x, y, z) in pos.items():
self.node[key]["position"] = util.xyz(x, y, z)

def add_vops(self):
""" Automatically add vops if they're not present """


+ 1
- 1
abp/graphstate.py 查看文件

@@ -114,7 +114,7 @@ class GraphState(object):
va = self.node[a]["vop"]
vb = self.node[b]["vop"]
new_edge, self.node[a]["vop"], self.node[b]["vop"] = \
clifford.cz_table[edge, va, vb]
clifford.cz_table[int(edge), va, vb]
if new_edge != edge:
self.toggle_edge(a, b)



demo.gif → img/demo.gif 查看文件


二進制
img/viz.png 查看文件

Before After
Width: 529  |  Height: 321  |  Size: 10KB

Loading…
取消
儲存