Explorar el Código

Adding stabilizers

master
Pete Shadbolt hace 8 años
padre
commit
552d8576ed
Se han modificado 2 ficheros con 18 adiciones y 15 borrados
  1. +0
    -15
      abp/graphstate.py
  2. +18
    -0
      abp/stabilizer.py

+ 0
- 15
abp/graphstate.py Ver fichero

@@ -401,21 +401,6 @@ class GraphState(object):
state.act_local_rotation(mapping[i], clifford.unitaries[n["vop"]])
return state

def to_stabilizer(self):
""" Get the stabilizer tableau. Work in progress!
"""
return
output = {a: {} for a in self.node}
for a, b in it.product(self.node, self.node):
if a == b:
output[a][b] = "X"
elif a in self.adj[b]:
output[a][b] = "Z"
else:
output[a][b] = "I"
# TODO: signs
return output

def __eq__(self, other):
""" Check equality between GraphStates """
return self.adj == other.adj and self.node == other.node


+ 18
- 0
abp/stabilizer.py Ver fichero

@@ -0,0 +1,18 @@
class Stabilizer(object):
def __init__(self, g):
""" Construct a Stabilizer from a Graphstate """
pass

def to_stabilizer(self):
""" Get the stabilizer tableau. Work in progress!
"""
for a, b in it.product(self.node, self.node):
output[a]["sign"] = 1
if a == b:
output[a][b] = "X"
elif a in self.adj[b]:
output[a][b] = "Z"
else:
output[a][b] = "I"
return output


Cargando…
Cancelar
Guardar