Mathematica
Here is the method:
- Ignore all factors of 'i' since quaternions come with i, j, and k pre-installed.
- Group 4-vectors together. Examples:
- (c t, R)
- (E, P c)
- (d/dt, c d/dR)
- Keep all constants as a check: c, h, G
- If possible, make dimensionless
- Treat the wave function as quaternion-valued (3 complex numbers that share the same real)