The nuclear reaction matrix