# calculating rotational kinetic energy of a diatomic molecule

The classical rotational kinetic energy of a system is calculated as:

$KE=\frac{1}{2}I\omega^2=\frac{1}{2}L\omega=\frac{L^2}{2I}$

where: $I=$ moment of inertia tensor, $\omega=$ angular velocity vector, and $L=$ angular momentum vector.

In matrix form, this is:

$KE=\frac{1}{2}(I\omega)\cdot\omega=\frac{1}{2}L\cdot\omega=\frac{1}{2}(I^{-1}L)\cdot L$

I'm interested in calculating this rotational kinetic energy for a diatomic molecule on which I'm performing molecular dynamics in a 3-dimensional box. Since the molecule is linear, the $I$ tensor is of order 2, and is hence non-invertible. Of course, I can diagonalize the $I$ tensor by calculating the eigenvalues and eigenfunctions, and I would then obtain $I=PI_DP^{-1}$, where $I_D$ is a diagonal matrix containing the 2 principal moments of inertia (with the $_{33}$ element being 0) and $P$ are the two eigenfunctions and a column of 0s.

I'm unsure how to finish the calculation of $KE$. If I simply change the 3X3 $I_D$ matrix to a 2X2 matrix by removing the 3rd row and column (all 0), how do I multiply it by $L$, which remains a 1X3 vector? I know I have to somehow put the $L$ matrix into the $P$ basis set, but I'm struggling with how to formally do this. Any help or pointers to tutorials on this?

The reality is that the molecule isn't quite linear. They have a very small moment of inertia on the long axis, but rotations about the long axis are, effectively, rotations of the nucleus. That means that such rotations are frozen out because of the higher energy needed to get $\hbar$ of angular momentum.