Make scattering matrices compatible with conservation laws
The last in a series of merge requests to implement scattering states with conservation laws and discrete symmetries, based on work originally started in !15 (closed). Modes with discrete symmetries and conservation laws were implemented in !38 (merged) and !57 (merged). In this MR, the scattering matrix is made compatible with conservation laws.
Blocked by !57 (merged) (required to implement tests without unreasonable amount of effort).