# Glue code for the symplectic module # Author: Michel Barbeau, Carleton University # Version: November 21, 2016 def Cliffordspec(S): """ Returns a specification of the i-th Clifford in group Cn in a form that can be used by function "Clifford" of the QuaEC module. Example import qecc import SYMPLECTIC import cliffordglue S=SYMPLECTIC.symplectic(1,1) T=cliffordglue.Cliffordspec(S) C=qecc.Clifford(T[0],T[1]) print C X |-> +Z Z |-> +X """ # X bar Xbar=[] # Z bar Zbar=[] for j in range(0,len(S),2): Xj='' Zj='' for i in range(0,len(S),2): # X bar if S[j,i] and S[j,i+1]: Xj=Xj+'Y' elif S[j,i]: Xj=Xj+'X' elif S[j,i+1]: Xj=Xj+'Z' else: Xj=Xj+'I' # Z bar if S[j+1,i] and S[j+1,i+1]: Zj=Zj+'Y' elif S[j+1,i]: Zj=Zj+'X' elif S[j+1,i+1]: Zj=Zj+'Z' else: Zj=Zj+'I' Xbar.append(Xj) Zbar.append(Zj) return [Xbar,Zbar]