Bladeren bron

Broken `conjugate` operator

master
Pete Shadbolt 8 jaren geleden
bovenliggende
commit
c00e214955
1 gewijzigde bestanden met toevoegingen van 7 en 2 verwijderingen
  1. +7
    -2
      abp.py

+ 7
- 2
abp.py Bestand weergeven

@@ -17,10 +17,10 @@ class Stabilizer(object):
def __init__(self, graph):
n = graph.nqubits
self.paulis = [[None for i in range(n)] for j in range(n)]
self.signs = [None for i in range(n)]
self.rowsigns = [None for i in range(n)]

for i in range(n):
signs[i] = 0
self.rowsigns[i] = 0
for j in range(n):
if i == j:
self.paulis[i][j] = lco_x
@@ -29,6 +29,11 @@ class Stabilizer(object):
else:
self.paulis[i][j] = lco_id

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)

def __str__(self):
return "\n".join(" ".join(stab_rep[x] for x in row) for row in self.paulis)



Laden…
Annuleren
Opslaan