Ver código fonte

Adding stabilizers

master
Pete Shadbolt 8 anos atrás
pai
commit
552d8576ed
2 arquivos alterados com 18 adições e 15 exclusões
  1. +0
    -15
      abp/graphstate.py
  2. +18
    -0
      abp/stabilizer.py

+ 0
- 15
abp/graphstate.py Ver arquivo

@@ -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 arquivo

@@ -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


Carregando…
Cancelar
Salvar