  The diffusion Monte Carlo method with symmetry-based state selection is used
to calculate the quantum energy states of H$_2^+$ confined into potential
barriers of atomic dimensions (a model for these ions in solids). Special
solutions are employed permitting one to obtain satisfactory results with
rather simple native code. As a test case, $^2\Pi_u$ and $^2\Pi_g$ states of
H$_2^+$ ions under spherical confinement are considered. The results are
interpreted using the correlation of H$_2^+$ states to atomic orbitals of H
atoms lying on the confining surface and perturbation calculations. The method
is straightforwardly applied to cavities of any shape and different hydrogen
plasma species (at least one-electron ones, including H) for future studies
with real crystal symmetries.
