The purpose of this post is to flesh out some of the subtleties of the Stern-Gerlach experiment which historically was a demonstration of angular momentum quantization in quantum mechanics.
Problem #\(1\): What should the charge \(Q\) of the particles used in a Stern-Gerlach experiment be? What kind of magnet should one construct? Which direction should the atoms be thrown in relative to the magnetic field \(\textbf B\) of the magnet? Where can one get a source of atoms to fire into experiment? What other experimental considerations are relevant here?
Solution #\(1\): The particles should be neutral \(Q=0\) otherwise their dynamics would be dominated by the magnetic force \(\textbf F_{\textbf B}=q\dot{\textbf x}\times\textbf B\) rather than the “Zeeman force” which is classically \(\textbf F_Z=\left(\boldsymbol{\mu}\cdot\frac{\partial}{\partial\textbf x}\right)\textbf B\) (although in principle one could still use charged particles such as electrons \(e^-\) provided one applies a suitable \(\textbf E\)-field to implement a velocity selector). As the classical formula for \(\textbf F_Z\) makes apparent, the \(\textbf B\)-field must be non-uniform/inhomogeneous/have some gradient \(\frac{\partial\textbf B}{\partial\textbf x}\neq 0\). A simple, asymmetric construction such as the one below would suffice, providing a gradient \(\frac{\partial\textbf B}{\partial z}\neq\textbf 0\) along the \(z\)-axis (i.e. \(|\textbf B|\) is stronger near the tip of the south magnetic pole piece):

Assuming that in the center, the magnetic field is of the form \(\textbf B(z)=B(z)\hat{\textbf z}\), then the Zeeman force \(\textbf F_Z=\mu_z\frac{dB}{dz}\hat{\textbf z}\) will always point along the \(z\)-axis regardless of the velocity \(\dot{\textbf x}\) or orientation of \(\boldsymbol{\mu}\). So it doesn’t make sense to fire \(\dot{\textbf x}\) along the \(z\)-axis since this will just accelerate the magnetic dipoles along the \(z\)-axis, providing no spatial separation with which to resolve their different \(\mu_z\)-values. So instead, fire orthogonally \(\dot{\textbf x}(t=0)\cdot\textbf B=0\) to the \(\textbf B\)-field in order to actually get a deflection that can be distinguished by eye depending on the value of \(\mu_z\).
The simplest way to obtain a source of particles to fire is just to have an oven at some temperature \(T\) with a small hole in it so that particles can effuse out of the hole and into the experiment; this constitutes a thermal atomic beam with posterior velocity spread \(\frac{m^2v^3}{2k_B^2T^2}e^{-mv^2/2k_BT}\). Assuming the magnetic field gradient \(dB/dz\) is constant (so that the Zeeman force \(F_Z\) is constant and the particle undergoes parabolic “free fall”) and the length of the apparatus is \(L\), it follows that a particle of initial horizontal velocity \(v\) will be deflected by an angle \(\tan\theta=\frac{\mu_zL}{Mv^2}\frac{dB}{dz}\) where \(\theta=\theta(v)\) is to be viewed as a continuous random variable with its own probability distribution derived from that of \(v\). Each value of \(\mu_z\) will not be sharp, but rather have some spread around it as a result; if the particles were charged \(Q\neq 0\) then perhaps the velocity selector trick would filter out all but one value of \(v\), giving sharper spots on a detector screen.
Finally, note that one should enclose the entire setup in an ultra-high vacuum to ensure that the atoms emerging from the oven do not collide with anything.
Problem #\(2\): Explain the quantum mechanical origins of \(\mu_z\) in the first place (i.e. why doesn’t \(\mu_z=0\) just vanish for all atoms?).
Solution #\(2\): In the low-field limit, the Zeeman splitting is \(V_Z(z)=g_fm_f\mu_BB(z)\) so one identifies \(\mu_z=-g_fm_f\mu_B\). Although the original \(^{107}\text{Ag}\) atoms with \(i=1/2\) used by Stern and Gerlach were not alkali, they were nevertheless very alkali-like, having a single \(s=1/2\) valence electron \(e^-\) in the \(5^2S_{1/2}\) ground manifold which contains two hyperfine manifolds \(f=0,1\) where \(g_f\) is undefined for \(f=0\) and in this case has value \(g_f=1\) for \(f=1\). Those \(^{107}\text{Ag}\) atoms in the hyperfine ground state \(|f,m_f\rangle=|0,0\rangle\) or in \(|1,0\rangle\) experienced no deflection; it is therefore only the atoms in the \((\textbf F^2,F_z)\)-eigenstates \(|1,\pm 1\rangle\) that experienced a Zeeman splitting and were therefore deflected in opposite directions. So in total here, one expects to get \(3\) spots on the detector screen corresponding to the quantized atomic angular momentum projections \(m_f=-1,0,1\) along the quantization axis defined by \(\textbf B\).
Problem #\(3\): A Stern-Gerlach filter is just the usual Stern-Gerlach apparatus together with an obstruction at the end that blocks unwanted deflected beams, thus allowing only certain angular momentum eigenstates to emerge from the apparatus. An unpolarized beam of neutral spin \(s=1/2\) fermions enters a Stern-Gerlach filter that passes only particles with \(m_{s,x}=1/2\). On exiting this filter, the beam enters a second Stern-Gerlach filter that passes only particles with \(m_{s,y}=1/2\). Finally, the beam passes through a third Stern-Gerlach filter that passes only particles with \(m_{s,x}=-1/2\). What fraction of the initial particles make it through?
Solution #\(3\): An unpolarized beam is described by a mixed density operator \(\rho=\frac{1}{2}1\) of maximal von Neumann entropy and vanishing Bloch vector \(\textbf b=\textbf 0\) (since in general \(\rho=\frac{1}{2}(1+\textbf b\cdot\boldsymbol{\sigma})\) and the Pauli matrices \(\sigma_i\) are linearly independent). Along any axis \(\hat{\textbf b}\in S^2\), one can write \(\rho=\frac{1}{2}|0\rangle_{\hat{\textbf b}}{_{\hat{\textbf b}}}\langle 0|+\frac{1}{2}|1\rangle_{\hat{\textbf b}}{_{\hat{\textbf b}}}\langle 1|\) where:
\[\hat{\textbf b}\cdot\textbf S|0\rangle_{\hat{\textbf b}}:=\frac{\hbar}{2}|0\rangle_{\hat{\textbf b}}\]
\[\hat{\textbf b}\cdot\textbf S|1\rangle_{\hat{\textbf b}}:=-\frac{\hbar}{2}|1\rangle_{\hat{\textbf b}}\]
In an unpolarized beam, the average spin angular momentum \(\textbf S\) along any axis \(\hat{\textbf b}\) is vanishing \(\text{Tr}\rho\hat{\textbf b}\cdot\textbf S=0\) because when the first Stern-Gerlach filter makes e.g. the \(S_x\)-measurement (so \(\hat{\textbf b}=(1,0,0)^T\)), the outcomes \(m_{s,x}\hbar=\pm\hbar/2\) are equiprobably \(1/2\) each. So \(1/2\) the particles make it through the first Stern-Gerlach filter, polarized spin-up \(|0\rangle_x\) along the \(x\)-axis. By drawing a Bloch sphere, it is evident that \(|0\rangle_x=(|0\rangle_y+i|1\rangle_y)/\sqrt{2}\) so a further \(|_y\langle 0|0\rangle_x|^2=1/2\) of the particles make it through the second Stern-Gerlach filter, collapsed to being spin-up \(|0\rangle_y\) along the \(y\)-axis. Finally, again by visualizing the Bloch sphere, one has \(|0\rangle_y=(|0\rangle_x+|1\rangle_x)/\sqrt 2\) so yet again one gets a factor of \(|_x\langle 1|0\rangle_y|^2=1/2\) the particles making it through the third Stern-Gerlach filter, polarized spin-down \(|1\rangle_x\) along the \(x\)-axis this time. Thus overall, \(1/8\) of the particles make it through.
More generally, if a spin \(s=1/2\) fermion is initially polarized spin-up along some direction \(\hat{\textbf b}\), and a Stern-Gerlach filter makes a measurement along some other direction \(\hat{\textbf b}’\) separated by angle \(\cos\theta=\hat{\textbf b}\cdot\hat{\textbf b}’\), then, in analogy to Malus’s law for spin \(s=1\) photons, in this case the probability of collapsing to the spin-up spinor \(|0\rangle_{\hat{\textbf b}’}\) along \(\hat{\textbf b}’\) is \(\cos^2\theta/2=\frac{1}{2}(1+\hat{\textbf b}\cdot\hat{\textbf b}’)\) while the probability of collapse to the spin-down spinor \(|1\rangle_{\hat{\textbf b}’}\) along \(\hat{\textbf b}’\) (which is equivalently the spin-up spinor \(|0\rangle_{-\hat{\textbf b}’}\) along \(-\hat{\textbf b}’\)) is \(\sin^2\theta/2=\frac{1}{2}(1-\hat{\textbf b}\cdot\hat{\textbf b}’)\).
Being spin \(s=1/2\) is just weird:
\[e^{-2\pi i\hat{\textbf b}\cdot\textbf S/\hbar}=-1\Rightarrow e^{-4\pi i\hat{\textbf b}\cdot\textbf S/\hbar}=1\]