process_tomography.py 文件源码

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

项目:grove 作者: rigetticomputing 项目源码 文件源码
def process_fidelity(self, reference_unitary):
        """
        Compute the quantum process fidelity of the estimated state with respect to a unitary
        process. For non-sparse reference_unitary, this implementation this will be expensive in
        higher dimensions.

        :param (qutip.Qobj|matrix-like) reference_unitary: A unitary operator that induces a process
         as ``rho -> other*rho*other.dag()``, can also be a superoperator or Pauli-transfer matrix.
        :return: The process fidelity, a real number between 0 and 1.
        :rtype: float
        """
        if isinstance(reference_unitary, qt.Qobj):
            if not reference_unitary.issuper or reference_unitary.superrep != "super":
                sother = qt.to_super(reference_unitary)
            else:
                sother = reference_unitary
            tm_other = self.pauli_basis.transfer_matrix(sother)
        else:
            tm_other = csr_matrix(reference_unitary)
        dimension = self.pauli_basis.ops[0].shape[0]
        return np.trace(tm_other.T * self.r_est).real / dimension ** 2
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号