I am having trouble getting the kraus matrices(E_k)) from a unitary matrix. This task is trivial if one uses dirac notation. But supposing I was coding, I can't put in bras and kets in my code so I need a systematic way of getting kraus matrices from a unitary matrix(merely using matrices). So supposing, the environment was in the |0> and my unitary matrix was the controlled not gate. I expect my kraus matrices to be to the projection operators |0><0| and |1><1|. The system and the environment are of course 2 dimensional. P.S I do know about this definition E_k = <e_k|U|0>. It is not really helpful. |e_k> is a basis for the environment.