From bcd38f11d8c25a307f07db0fa13eceee05de18d9 Mon Sep 17 00:00:00 2001 From: Pete Shadbolt Date: Tue, 10 May 2016 19:50:44 +0100 Subject: [PATCH] Now we are isomorphic to Anders & Briegel :) The mistake was in the set of gates which commute with CZ --- abp/clifford.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/abp/clifford.py b/abp/clifford.py index eb46b0e..aff9b08 100644 --- a/abp/clifford.py +++ b/abp/clifford.py @@ -57,14 +57,7 @@ def find_cz(bond, c1, c2, commuters, state_table, ab_cz_table): if np.allclose(target, state_table[bondp, c1p, c2p]): options.add((bondp, c1p, c2p)) - #assert tuple(ab_cz_table[bond, c1, c2]) in options - if not tuple(ab_cz_table[bond, c1, c2]) in options: - assert len(s1)==5 or len(s2)==5 - #print len(s1), len(s2) - #print bond, c1, c2 - #print ab_cz_table[bond, c2, c2] - #print " ".join(map(str, options)) - #raise AssertionError + assert tuple(ab_cz_table[bond, c1, c2]) in options return options.pop() # Didn't find anything - this should never happen @@ -114,7 +107,7 @@ def get_state_table(unitaries): def get_commuters(unitaries): """ Get the indeces of gates which commute with CZ """ - commuters = (qi.id, qi.px, qi.pz, qi.ph, qi.hermitian_conjugate(qi.ph)) + commuters = (qi.id, qi.pz, qi.ph, qi.hermitian_conjugate(qi.ph)) return [find_clifford(u, unitaries) for u in commuters]