Cliffords.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:QGL 作者: BBN-Q 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号