def clifford_mat(c, numQubits):
"""
Return the matrix unitary the implements the qubit clifford C
"""
assert numQubits <= 2, "Oops! I only handle one or two qubits"
if numQubits == 1:
return C1[c]
else:
c = C2Seqs[c]
mat = np.kron(clifford_mat(c[0][0], 1), clifford_mat(c[0][1], 1))
if c[1]:
mat = np.dot(entangling_mat(c[1]), mat)
if c[2]:
mat = np.dot(
np.kron(
clifford_mat(c[2][0], 1), clifford_mat(c[2][1], 1)), mat)
return mat
评论列表
文章目录