MO,
The external potential framework in HOOMD-blue is currently limited to potentials as a function of position. To implement magnetic torque, you would:
1. Extend PotentialExternal and PotentialExternalGPU to evaluate torques.
2. Update EvaluatorWalls, EvaluatorExternalPeriodic, and EvaluatorExternalElectricField with the new API. Only function headers need to change, these methods would ignore orientation and compute a 0 torque.
3. Implement EvaluatorExternalMagneticDipole, the export methods, the Python interface, and unit tests.
I would prefer to see a general API that can compute torques as a function of both position and orientation. Please submit your changes with a pull request so that others in the community can make use of them. For detailed discussions on implementation details, open an issue on GitHub.