def _choi_to_kraus(data, input_dim, output_dim, atol=ATOL_DEFAULT):
<EOL>if is_hermitian_matrix(data, atol=atol):<EOL><INDENT>w, v = la.eigh(data)<EOL>if len(w[w < -atol]) == <NUM_LIT:0>:<EOL><INDENT>kraus = []<EOL>for val, vec in zip(w, v.T):<EOL><INDENT>if abs(val) > atol:<EOL><INDENT>k = np.sqrt(val) * vec.reshape(<EOL>(output_dim, input_dim), order='<STR_LIT:F>')<EOL>kraus.append(k)<EOL><DEDENT><DEDENT>if not kraus:<EOL><INDENT>kraus.append(np.zeros((output_dim, input_dim), dtype=complex))<EOL><DEDENT>return (kraus, None)<EOL><DEDENT><DEDENT>mat_u, svals, mat_vh = la.svd(data)<EOL>kraus_l = []<EOL>kraus_r = []<EOL>for val, vec_l, vec_r in zip(svals, mat_u.T, mat_vh.conj()):<EOL><INDENT>kraus_l.append(<EOL>np.sqrt(val) * vec_l.reshape((output_dim, input_dim), order='<STR_LIT:F>'))<EOL>kraus_r.append(<EOL>np.sqrt(val) * vec_r.reshape((output_dim, input_dim), order='<STR_LIT:F>'))<EOL><DEDENT>return (kraus_l, kraus_r)<EOL>
Transform Choi representation to Kraus representation.