We present 3D MHD simulations of purely toroidal and mixed poloidal-toroidal
magnetic field configurations to study the behavior of the Tayler instability.
For the first time the simultaneous action of rotation and magnetic diffusion
are taken into account and the effects of a poloidal field on the dynamic
evolution of unstable toroidal magnetic fields is included. In the absence of
diffusion, fast rotation (rotation rate compared to Alfv\'en frequency) is able
to suppress the instability when the rotation and magnetic axes are aligned and
when the radial field strength gradient p < 1.5. When diffusion is included,
this system turns unstable for diffusion dominated and marginally diffusive
dominated regions. If the magnetic and rotation axes are perpendicular to each
other the stabilizing effect induced by the Coriolis force is scale dependent
and decreases with increasing wavenumber. In toroidal fields with radial field
gradients bigger than p > 1.5, rapid rotation does not suppress the instability
but instead introduces a damping factor to the growth rate in agreement with
the analytic predictions. For the mixed poloidal-toroidal fields we find an
unstable axisymmetric mode, not predicted analytically, right at the stability
threshold for the non-axisymmetric modes; it has been argued that an
axisymmetric mode is necessary for the closure of the Tayler-Spruit dynamo
loop.Comment: 12 pages, 12 figures. Accepted for publication in A&