I think this whole bit is unnecessary.  `(kx*kx-ky*ky)/k2` is already computed as `_cos`.  And `2*kx*ky/k2` is `_sin`.  So you basically do:
```
g1_k =  self._cos*E_k + self._sin*B_k
g2_k = -self._sin*E_k + self._cos*B_k
kappa_k = -self._cos*g1_k + self._sin*g2_k
```
If you expand out the math of this last line, it is equivalent to `kappa_k = -E_k`.

So, (a) this would be a lot more efficient than effectively redoing the whole calculation to end up back where you started, and (b) it seems like there is either a sign error in my derivation or a sign error in the code.  Not sure which, but I expected to end up with `kappa_k = E_k`, since I thought that was basically the definition of `E_k`.