Models of quantum computing rely on transformations of the states of a quantum memory. We study mathematical aspects of a model proposed by Wu in which the memory state is changed via the scattering of incoming particles. This operation causes the memory content to deviate from a pure state, i.e. induces impurity. For nonrelativistic particles scattered from a two-state memory and sufficiently general interaction potentials in (1+1) dimensions, we express impurity in terms of quaternionic commutators. In this context, pure memory states correspond to null hyperbolic quaternions. In the case with point interactions, the scattering process amounts to appropriate rotations of quaternions in the frequency domain. Our work complements previous analyses by Margetis and Myers (2006 J. Phys. A 39 11567).