Partition function of Hamiltonian without momentum dependence

Considering an ideal gas of $$N$$ diatomic molecules with dipole momenta $$\vec{p}$$. Given the Hamiltonian of one molecule $$H = -\vec{p} \cdot \vec{E} = -pE\cos(\theta)$$ when calculating the partition function we "ignore" the p-dependence by not integrating over the momentum space, but is this really right? How is this justified? Do we just "ignore" every variable, which the Hamiltonian is not dependent on? This is what I would have done:

\begin{align} Z & = \frac{1}{h^3} \int \mathrm{d}^3q\ e^{\beta p E \cos(\theta)} \\ & = \frac{1}{h^3} \int_0^R \mathrm{d}r \int_{-\pi}^\pi \mathrm{d}\varphi \int_0^\pi \mathrm{d}\theta\ r^2 \sin(\theta) e^{\beta p E \cos(\theta)} \\ & = \frac{4\pi R^3}{e\beta h^3 p E} \sinh(\beta p E) \end{align}

When using spherical coordinates to compute the partition function of the given Hamiltonian, do we (as a consequence) not integrate over the radius $$R$$ and $$\varphi$$?

EDIT: added my calculation

• $\mathbf{p}$ is the dipole moment, not momentum. The idea of the calculation is that the magnitude $p$ of the dipole moment is fixed, while the angle of the dipoles is variable – d_b Jun 22 at 19:37
• yes i know, that's why I wrote $\textbf{without}$ momentum dependence. – samox Jun 22 at 19:38
• It is not clear what you mean by "ignore the p-dependence by not integrating over the momentum space". Whatever is your doubt, dipole moment and momentum in the Hamiltonian are independent objects. – GiorgioP Jun 22 at 23:34
• Oh i see what you mean, sorry. I mean why do we ignore the momentum dependence, when calculating the partition function? I updated my question with my calculation. – samox Jun 23 at 9:22
• If the diatomic molecules in question are free to move translationally, then that is not the full Hamiltonian. What you have written would correspond to a fixed dipole; a gas of dipoles would need a kinetic energy term. – J. Murray Jun 25 at 14:18

Yes, we cannot ignore the momentum dependence of the system and must integrate over all of state space. However as @d_b pointed out, this is not the momentum, it is the dipole moment. So, this is not the same $$\theta$$ associated with the position of the centre of mass of the diatomic molecule but rather the angle between the dipole moment and the electric field.
In the partition function, we have to sum over all possible states of the system. In the above Hamiltonian, there is no dependence on momentum. Perhaps, this is a special case of a sort of lattice. We can add a momentum dependence to the Hamiltonian(a $$\frac{\vec{p}^2}{2m}$$ term.
Since there is no coupling between the momentum and the dipole moment, the partition function for a diatomic molecule will separate into 3 parts: $$z = z_{dipole} \times z_{momentum} \times z_{position}$$ First we can find the dipole part that is: $$z_{dipole} = \int_0^\pi Exp(-\beta \; H(\theta))\;g(\theta) \; d\theta$$ Here $$g(\theta)$$ is the degeneracy of the diatomic molecule. If we assume that this degeneracy is constant g then we can simplify the partition function by evaluating the integral.