  The transport of angular momentum is capital during the formation of low-mass
stars; too little removal and rotation ensures stellar densities are never
reached, too much and the absence of rotation means no protoplanetary disks can
form. Magnetic diffusion is seen as a pathway to resolving this long-standing
problem. We investigate the impact of including resistive MHD in simulations of
the gravitational collapse of a 1 solar mass gas sphere, from molecular cloud
densities to the formation of the protostellar seed; the second Larson core. We
used the AMR code RAMSES to perform two 3D simulations of collapsing magnetised
gas spheres, including self-gravity, radiative transfer, and a non-ideal gas
equation of state to describe H2 dissociation which leads to the second
collapse. The first run was carried out under the ideal MHD approximation,
while ambipolar and ohmic diffusion was incorporated in the second calculation.
In the ideal MHD simulation, the magnetic field dominates the energy budget
everywhere inside and around the first core, fueling interchange instabilities
and driving a low-velocity outflow. High magnetic braking removes essentially
all angular momentum from the second core. On the other hand, ambipolar and
ohmic diffusion create a barrier which prevents amplification of the magnetic
field beyond 0.1 G in the first Larson core which is now fully thermally
supported. A significant amount of rotation is preserved and a small
Keplerian-like disk forms around the second core. When studying the radiative
efficiency of the first and second core accretion shocks, we found that it can
vary by several orders of magnitude over the 3D surface of the cores. Magnetic
diffusion is a pre-requisite to star-formation; it enables the formation of
protoplanetary disks in which planets will eventually form, and also plays a
determinant role in the formation of the protostar itself.
