# Partition function for $H=-\vec \mu \cdot \vec B$

The interaction energy between a magnetic dipole $$\mu$$ and a fixed magnetic field $$B$$ is $$E(\theta)=-B \mu cos\theta$$ where $$\theta$$ in the angle between $$B$$ and $$\mu$$.

The partition function is $$Z=\int exp(\beta \mu B \cos\theta) d\Omega$$, where $$\Omega$$ is the solid angle. I don't understand why the integral has that form, why is it over the solid angle?

Edit

The classical partition function for a system with $$f$$ degrees of freedom is $$\frac 1 {\hbar ^f} \int dr^fdp^f exp(-\beta H(r_1...r_f,p_1...p_f))$$ How can i derive the above expression from this?

The calculation of the microcanonical ensemble involves integrating over all possible energetic microstates, which in this case translate to all possible spin (or magnetic dipole) orientations. You can think about the dipole as a unit-length arrow sitting in the origin and pointing at a certain direction. In spherical coordinates all such possible orientations give you the surface of a sphere $$\int\limits_{-\pi/2}^{\pi/2}\int\limits_{0}^{2\pi} r^2\sin(\theta)d\theta d\phi=4\pi r^2|_{r=1}\to 4\pi$$ Here you just add the distribution $$e^{-\beta\mathcal{H}{(\theta)}}$$ $$\int\limits_{-\pi/2}^{\pi/2}\int\limits_{0}^{2\pi} e^{-\beta\mathcal{H}{(\theta)}} \sin(\theta)d\theta d\phi = \int\limits_{0}^{\pi}\int\limits_{0}^{2\pi} e^{-\beta\mathcal{H}{(\theta)}} d\Omega$$

Another (rather technical) way to tackle it is by a change of variable

$$Z = \int e^{-\beta E(\theta)}dE = \int e^{-\beta E(\theta)} \left(\frac{\partial E}{\partial \theta}\right)d\theta \propto \int e^{-\beta E(\theta)} \sin(\theta) d\theta$$

Where the last transition is relevant to this specific case. We only care about proportionality since factors will not affect the physical observables (entropy, pressure etc.) which can be calculated from the partition function.

I would take this approach with a grain of salt, since it does not seem to work for hamiltonians that depend on more than one dynamical variable.

• Ok i understand that this should be a possible justification for that expression. But why two states in which dipoles differs in $\phi$ should be considered different if the system is $\phi$ symmetric? Analogously the dipole could be colored (red, blu, green...), should i consider it as a degree of freedom? no because it does not affect energy Commented Jun 13, 2022 at 13:45
• You have a good point about the redundant degree of freedom and this is where my analogy fails. It can be still used since the $2\pi$ factor does not really effect any physical quantity that you might compute from the partition function. I guess that considering $\cos(\theta)$ as a variable to integrate over (like the second example in your question) is valid and provides the same partition function up to a constant multiplying factor, which is physically all that matters.
– Ben
Commented Jun 13, 2022 at 14:34
• Maybe the better way of thinking about it which has just popped into my head, I'll add it to my answer above
– Ben
Commented Jun 13, 2022 at 14:42
• wow, that is exactly the same idea i had! But then i thought, what if $E$ depends by more than one variable? and i got confused Commented Jun 13, 2022 at 15:18
• think about $E=E(q,p)$, don't you think it should become $\int exp(-\beta H(q,p)) dqdp$? Namely the classical one for continuum phase space? while if you do the total differentiation you obtain a sum of integrals Commented Jun 13, 2022 at 15:44

Magnetic field here is a preferred axis. So, if we simply integrate over $$\theta$$ our result will be dependent on the direction of this axis. One way to do it consistently is to start with Cartesian coordinates and then switch to polar ones: $$E=-\mathbf{m}\cdot\mathbf{B}$$ $$Z = \iiint dm_x dm_y dm_z\delta(m_x^2+m_y^2+m_z^2-\mu^2)e^{-\beta(m_xB_x+m_xB_y+m_zB_z)}$$ Choosing now the field along the $$z$$-axis and switching to polar coordinates should produce the correct result.

• What do you mean? $\theta$ is the angle between magnetic field and dipole. If i integrate over $\theta$ the result does not depend on the axis direction Commented Jun 13, 2022 at 11:48
• @SimoBartz $\theta$ here is measure din respect to a specific axis. If you now direct the magnetic field differently, but measure $\theta$ from the same axis, the result will be different... well, I didn't bother to check, but the method I suggest should be foolproof. Commented Jun 13, 2022 at 11:51
• what do you mean with din? Commented Jun 13, 2022 at 11:53
• in respect to a specific axis Commented Jun 13, 2022 at 11:56
• i pretty sure $\theta$ in the orientation of the angle between $\mu$ and $B$. Think about the energy $H=-\vec \mu \cdot \vec B=-\mu cos \theta B$ Commented Jun 13, 2022 at 13:41

I don’t feel that the preceding answers address the question fully. Granted, the canonical ensemble dictates that your microstates have a Boltzman weight. However, you need to apply these weights to a preexisting distribution, and there is no natural choice in the case of a continuum. You can invoke invariance by rotation which is enough to get the usual solid angle measure, but this extra assumptions that you have implicitly taken is arbitrary and does not even come from the symmetries of the Hamiltonian (merely rotation symmetric about $$\vec B$$).

The cleanest way to do it classically is to reframe it in the context of Hamiltonian mechanics (which you hinted at in your edit). The symplectic structure of phase spaces gives rise to a natural measure associated to it which solves the problem. Even in the quantum setting, you’ll need to specify the anticommutation relations of your observables before any computation.

One way to go is to interpret magnetic moment as arising from angular momentum ie setting $$\vec \mu=\gamma\vec L$$ with $$\gamma$$ the gyromagnetic ratio. Your configuration space is now a sphere, which if you parametrize by spherical coordinates $$\theta,\phi$$ give the corresponding canonical momenta $$p_\theta,p_\phi$$ (the phase space is therefore the direct product of a sphere and a plane). If you chose the polar axis to be along $$\vec B$$, your Hamiltonian now reads: $$H =-\gamma Bp_\phi$$

Before you apply the above formula, you’ll just need to enforce the condition $$L=L_0$$. If you want all the microstates to eigourously verify this condition, this is done by adding a Dirac delta $$\delta(L^2-L_0)$$ and remember that: $$L^2=p_\theta^2+\frac{p_\phi^2}{\sin^2\theta}$$

This way to enforce angular momentum is analogous to the microcanonical ensemble when fixing energy. You could also relax the condition to fixing the average of $$L^2$$, ie you assume the system to exchange angular momentum with the bath. This is analogous to the canonical ensemble in the energy setting and the method is the same. The Dirac delta is replaced by an additional Boltzmann factor $$e^{-\beta\omega L}$$ ($$\omega$$ the Lagrange multiplier interpreted as the statistical conjugate of $$L$$ determined from the normalizing condition).

Notice also that under this Hamiltonian, the equations of motion are the same as in the quantum case namely the Bloch equations (without damping). Furthermore, from physical motivation, you could also add an inertial term proportional to $$L^2$$.

Hope this helps and tell me if something’s not clear.