  We construct and analytically compute entanglement and the R\'enyi entropies
of Dirac fermions on a 2 dimensional torus in the presence of background
chemical potential, current source and Wilson loop, by employing correlation
functions of the electromagnetic vertex operators of $\mathbb{Z}_n$ orbifold
theory. The entropies reveal numerous novelties. They probe the energy levels
of compact fermions through the chemical potential, demonstrate interference
phenomena with the current source being `beat frequency,' and experience
topological phase transitions by dialing the Wilson loop, in the low
temperature limit. In the large radius limit, they depend only on the Wilson
loop via topological transitions, which are tightly linked to conformal
dimension of the electromagnetic operators.
