Does the electrons in Stern-Gerlach aplliance change their energies and how? When an electron goes thru a Stern-Gerlach appliance it changes its spin projection. Then there must be a change of energy content of the electron due to this event. But it is also known that magnetic field carries no energy. So I wonder where the energy (if any) can come from?
 A: After realizing that the electron energy does not depend on the projection of the spin it seems obvious that the energy of the electron doesn't change when it passes a magnetic field (or SG). But then something very peculiar immerges: 
1.the state of something changes without any energy exchange 
2.the magnet induces a change in the electron but it doesn't change a bit
A: First of all the SG experiment cannot be performed with free electrons in a beam for example because electrons carry charge that would generate when passing through an external z-axis magnetic field the full EM Lorentz force:
$$
\mathbf{F}=q \mathbf{E}+q \mathbf{v} \times \mathbf{B}
$$
This would force the electron to translate forward with a spiral trajectory that would totally mess up the SG experiment and its goal which is the measurement of the quantization of electron spin in space in only two possible states spin up or spin down.
Therefore, the original SG experiment was performed with silver atoms which as all atoms are charge combinatoric neutral and there is no Lorentz force generated.
The atoms are subjected only due to their valance electrons magnetic moment $m$ (spin magnetic dipole moment)  to a torque $τ$ from the SG magnet $B$ field:
$$
\tau=\mathbf{m} \times \mathbf{B}
$$
and their spin is quantized as measured in the projection screen apparatus positioned behind the SG magnet exit.
The atoms exit the SG magnet before hitting the screen having changed their initial linear trajectory entering the magnet to a parabolic trajectory upwards or downwards on exit due to their interaction with the magnet's B field.
Therefore not a closed loop path (spirals) trajectory which would imply normally that zero work has been done by the SG magnet on the atoms. Which means instead that for the parabolic trajectory, work (energy transfer) has been actually done on the atoms by the external magnetic B field manifested as a change in the forward movement direction  of the atoms (i.e. acceleration).
