  We develop a sparse hierarchical $hp$-finite element method ($hp$-FEM) for
the Helmholtz equation with rotationally invariant variable coefficients posed
on a two-dimensional disk or annulus. The mesh is an inner disk cell (omitted
if on an annulus domain) and concentric annuli cells. The discretization
preserves the Fourier mode decoupling of rotationally invariant operators, such
as the Laplacian, which manifests as block diagonal mass and stiffness
matrices. Moreover, the matrices have a sparsity pattern independent of the
order of the discretization and admit an optimal complexity factorization. The
sparse $hp$-FEM can handle radial discontinuities in the right-hand side and in
rotationally invariant Helmholtz coefficients. We consider examples such as a
high-frequency Helmholtz equation with radial discontinuities, the
time-dependent Schr\"odinger equation, and an extension to a three-dimensional
cylinder domain, with a quasi-optimal solve, via the Alternating Direction
Implicit (ADI) algorithm.
