@@ -614,66 +614,11 @@ def reshuffle(op: Matrix, order: Sequence[int]) -> Matrix:
614614 )
615615
616616
617- # TODO(@yutuer21): check jit able and ad
618617@partial (
619618 interfaces .args_to_tensor , # type: ignore
620619 argnums = [0 ],
621620 gate_to_tensor = True ,
622621)
623- # def choi_to_kraus(choi: Matrix, atol: float = 1e-5, Maxkraus: Optional[int] = None) -> Matrix:
624- # r"""
625- # Convert the Choi matrix representation to Kraus operator representation.
626-
627- # This can be done by firstly geting eigen-decomposition of Choi-matrix
628-
629- # .. math::
630- # \Lambda = \sum_k \gamma_k \vert \phi_k \rangle \langle \phi_k \vert
631-
632- # Then define Kraus operators
633-
634- # .. math::
635- # K_k = \sqrt{\gamma_k} V_k
636-
637- # where :math:`\gamma_k\geq0` and :math:`\phi_k` is the col-val vectorization of :math:`V_k` .
638-
639-
640- # :Examples:
641-
642-
643- # >>> kraus = tc.channels.phasedampingchannel(0.2)
644- # >>> superop = tc.channels.kraus_to_choi(kraus)
645- # >>> kraus_new = tc.channels.choi_to_kraus(superop)
646-
647-
648- # :param choi: Choi matrix
649- # :type choi: Matrix
650- # :return: A list of Kraus operators
651- # :rtype: Sequence[Matrix]
652- # """
653- # dim = backend.shape_tuple(choi)
654- # input_dim = _safe_sqrt(dim[0])
655- # output_dim = _safe_sqrt(dim[1])
656-
657- # #if is_hermitian_matrix(choi, atol=atol):
658- # # Get eigen-decomposition of Choi-matrix
659- # e, v = backend.eigh(choi) # value of e is from minimal to maxmal
660-
661- # # CP-map Kraus representation
662- # kraus = []
663- # for val, vec in zip(backend.real(e), backend.transpose(v)):
664- # if val > atol:
665- # k = backend.sqrt(backend.cast(val, dtypestr)) * backend.transpose(
666- # backend.reshape(vec, [output_dim, input_dim]), [1, 0]
667- # )
668- # kraus.append(k)
669-
670- # if not kraus:
671- # kraus.append(backend.zeros([output_dim, input_dim], dtype=dtypestr))
672- # return kraus
673-
674- # # raise ValueError("illegal Choi matrix")
675-
676-
677622def choi_to_kraus (
678623 choi : Matrix , truncation_rules : Optional [Dict [str , Any ]] = None
679624) -> Matrix :
0 commit comments