# How is the magnetic field zero when the magnetic dipole moment is zero?

So, my teacher was trying to explain me about Diamagnetic substances and he said that :

Suppose the atom of an element has 4 electrons revolving around the nucleus in 4 different orbits. The electrons will be revolving around the nucleus and also spinning about their own axis. So the net magnetic moment will be due to both the spinning and the revolutionary motion of the electrons around the nucleus. Now if the vector sum of the magnetic dipole moment of all the 4 electrons is zero then their Magnetic field will also be zero. And such substances are called Diamagnetic Substances.

The part that I couldn't understand was that how will the magnetic field be zero if the magnetic moment is zero. As far as I know as a Highschool student :

$$\vec{M} = i\vec{A} ~\text{or}~ \vec{M} = m\vec{l}_{eff}$$ where $$i$$ is the current, $$\vec{A}$$ is the area vector, $$m$$ is the pole strength, $$\vec{l}_{eff}$$ is the effective length between the two poles. And I know one relation between $$\vec{B}$$ (Magnetic field) and $$\vec{M}$$(Magnetic Dipole moment) which is that the torque experienced by a Magnetic Dipole :

$$\vec{\tau} = \vec{M} \times \vec{B}$$

As an example, for $$\vec{B_1}$$ there exist a $$\vec{B_2}$$ such that they are equal and opposite and thus cancels each other(in fig).
The field caused by a magnetic dipole $$\vec{M}$$ is proportional to $$\vec{M}$$. The formula $$\vec{\tau} = \vec{M} \times \vec{B}$$ describes the response of a dipole to an applied field $$\vec{B}$$. (The corresponding statements for a point electric charge would be the field $$\vec{E} = q \vec{r}/ 4\pi \epsilon_0 r^3$$ caused by the charge $$q$$, and the force $$\vec{f} = q {\vec E}$$ on a charge owing to some applied electric field $$\vec{E}$$.)