We study the implications of modular invariance on 2d CFT partition functions
with abelian or non-abelian currents when chemical potentials for the charges
are turned on, i.e. when the partition functions are "flavored". We begin with
a new proof of the transformation law for the modular transformation of such
partition functions. Then we proceed to apply modular bootstrap techniques to
constrain the spectrum of charged states in the theory. We improve previous
upper bounds on the state with the greatest "mass-to-charge" ratio in such
theories, as well as upper bounds on the weight of the lightest charged state
and the charge of the weakest charged state in the theory. We apply the
extremal functional method to theories that saturate such bounds, and in
several cases we find the resulting prediction for the occupation numbers are
precisely integers. Because such theories sometimes do not saturate a bound on
the full space of states but do saturate a bound in the neutral sector of
states, we find that adding flavor allows the extremal functional method to
solve for some partition functions that would not be accessible to it
otherwise.Comment: 45 pages, 16 Figures v3: typos corrected, expanded appendix on
numeric implementatio