Extract matrix elements for the one-body operators (if present) as \( \langle \mathrm{out} |\hat{f}| \mathrm{in}\rangle \) and for the two-body operator (if \ present) as \( \bra{\mathrm{left\hspace{0.1cm}out, right\hspace{0.1cm}out}}|\hat{v}|\ket{\mathrm{left\hspace{0.1cm}in, right\hspace{0.1cm}in}} \).