Source: cirosantilli/magnetic-quantum-number

= Magnetic quantum number
{title2=$m_l$}
{wiki}

Fixed <quantum angular momentum> in a given direction.

Can range between $\pm l$.

E.g. consider <gallium> which is 1s2 2s2 2p6 3s2 3p6 4s2 3d10 4p1:
* the electrons in <s-orbitals> such as 1s, 2d, and 3d are $l=0$, and so the only value for $m_l$ is 0
* the electrons in <p-orbitals> such as 2p, 3p and 4p are $l=1$, and so the possible values for $m_l$ are -1, 0 and 1
* the electrons in <d-orbitals> such as 2d are $l=2$, and so the possible values for $m_l$ are -2, -1, 0 and 1 and 2

The z component of the <quantum angular momentum> is simply:
$$
L_z = m_l \hbar
$$
so e.g. again for gallium:
* <s-orbitals>: necessarily have 0 z angular momentum
* <p-orbitals>: have either 0, $- \hbar$ or $+ \hbar$ z angular momentum

Note that this direction is arbitrary, since for a fixed <azimuthal quantum number> (and therefore fixed total angular momentum), we can only know one direction for sure. $z$ is normally used by convention.