  We study the entanglement Hamiltonian for the ground state of one-dimensional
free fermions in the presence of an inhomogeneous chemical potential. In
particular, we consider a lattice with a linear, as well as a continuum system
with a quadratic potential. It is shown that, for both models, conformal field
theory predicts a Bisognano-Wichmann form for the entangement Hamiltonian of a
half-infinite system. Furthermore, despite being nonrelativistic, this result
is inherited by our models in the form of operators that commute exactly with
the entanglement Hamiltonian. After appropriate rescaling, they also yield an
excellent approximation of the entanglement spectra, which becomes
asymptotically exact in the bulk of the trapped Fermi gas. For the gradient
chain, however, the conformal result is recovered only after taking a proper
continuum limit.
