def _kraus_to_stinespring(data, input_dim, output_dim):
stine_pair = [None, None]<EOL>for i, kraus in enumerate(data):<EOL><INDENT>if kraus is not None:<EOL><INDENT>num_kraus = len(kraus)<EOL>stine = np.zeros((output_dim * num_kraus, input_dim),<EOL>dtype=complex)<EOL>for j, mat in enumerate(kraus):<EOL><INDENT>vec = np.zeros(num_kraus)<EOL>vec[j] = <NUM_LIT:1><EOL>stine += np.kron(mat, vec[:, None])<EOL><DEDENT>stine_pair[i] = stine<EOL><DEDENT><DEDENT>return tuple(stine_pair)<EOL>
Transform Kraus representation to Stinespring representation.