Kinetically constrained ring-polymer molecular dynamics for non-adiabatic chemical reactions.