Pārlūkot izejas kodu

Add pics

master
Pete Shadbolt pirms 8 gadiem
vecāks
revīzija
126c819d2c
4 mainītis faili ar 5 papildinājumiem un 5 dzēšanām
  1. +4
    -4
      abp/fancy.py
  2. +1
    -1
      abp/graphstate.py
  3. +0
    -0
      img/demo.gif
  4. Binārs
      img/viz.png

+ 4
- 4
abp/fancy.py Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu


Binārs
img/viz.png Parādīt failu

Pirms Pēc
Platums: 529  |  Augstums: 321  |  Izmērs: 10KB

Notiek ielāde…
Atcelt
Saglabāt