From c20962665a0878a96d071415ba3c6396c9f89674 Mon Sep 17 00:00:00 2001 From: Pete Shadbolt Date: Mon, 15 Feb 2016 17:55:36 +0000 Subject: [PATCH] Not working --- abp.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/abp.py b/abp.py index 09c087e..9ec8e8d 100644 --- a/abp.py +++ b/abp.py @@ -7,9 +7,18 @@ Porting Anders and Briegel to Python stab_rep = {None: "-", 0: "X", 1: "Y", 2: "Z"} -def rightphase(n): - """ This is dumb. TODO: get rid """ - return n % 4 +class RightPhase(object): + + def __init__(self, phase): + self.phase = phase % 4 + + def conjugate + + +class LocalOperator(object): + + def __init__(self): + pass class Stabilizer(object): @@ -20,7 +29,7 @@ class Stabilizer(object): self.rowsigns = [None for i in range(n)] for i in range(n): - self.rowsigns[i] = 0 + self.rowsigns[i] = RightPhase(0) for j in range(n): if i == j: self.paulis[i][j] = lco_x @@ -32,7 +41,8 @@ class Stabilizer(object): self.conjugate(i, j, graph.vertices[j].vertex_operator) def conjugate(self, i, j, vertex_operator): - self.rowsigns[j] = self.rowsigns[j] + self.paulis[i][j].conjugate(vertex_operator) + self.rowsigns[j] = self.rowsigns[j] + \ + self.paulis[i][j].conjugate(vertex_operator) def __str__(self): return "\n".join(" ".join(stab_rep[x] for x in row) for row in self.paulis)