  The effects of hyperfine structure on ultracold molecular collisions in
external fields are largely unexplored due to major computational challenges
associated with rapidly proliferating hyperfine and rotational channels coupled
by highly anisotropic intermolecular interactions. We explore a new basis set
for incorporating the effects of hyperfine structure and external magnetic
fields in quantum scattering calculations on ultracold molecular collisions.
The basis is composed of direct products of the eigenfunctions of the total
{\it rotational} angular momentum (TRAM) of the collision complex $J_r$ and the
electron/nuclear spin basis functions of the collision partners. The separation
of the rotational and spin degrees of freedom ensures rigorous conservation of
$J_r$ even in the presence of external magnetic fields and isotropic hyperfine
interactions. The resulting block-diagonal structure of the scattering
Hamiltonian enables coupled-channel calculations on highly anisotropic
atom-molecule and molecule-molecule collisions to be performed independently
for each value of $J_r$, with an added advantage of eliminating the unphysical
states present in the total angular momentum representation. We illustrate the
efficiency of the TRAM basis by calculating state-to-state cross sections for
ultracold He + YbF collisions in a magnetic field. The size of the TRAM basis
required to reach numerical convergence is 8 times smaller than that of the
uncoupled basis used previously, providing a computational gain of three orders
of magnitude. The TRAM basis is therefore well suited for rigorous quantum
scattering calculations on ultracold molecular collisions in the presence of
hyperfine interactions and external magnetic fields.
