Hi!
Recently I'm reading your code in repo psi4/psi4numpy and know how to implement eom-ccsd method in python.
In the process of reading the code, I'm confused about the code block where you make the sub-matrix of similarly transformed Hamiltonian.

As well for that build sigma2.
I have searched many materials (like origin paper of Stanton, many body method in chemistry and physics by Bartlett), but I still don't know how to derive these equations. I have read repo pyqchem written by jjgoing, where he constructs HSS, HSD, HDS and HDD them diagonalize it. This seems different from your method.
Could you tell me where to find the reference of these equations? I really appreciate your help.