Gauge invariance and form of the vacuum polarization tensor In quantum field theory or condensed matter physics, the fermionic one-loop diagram gives rise to the polarization tensor
$$ Π^{µν} = Tr[ γ^µ G γ^ν G ] $$
If we couple the electrons to an electromagnetic field, we can integrate out the electrons again and obtain an effective action for the electromagnetic field $A^µ$ as
$$ S \propto \frac14 F^{µν}F_{µν} + A_µ Π^{µν} A_ν + \dots  $$
where the dots indicate corrections of higher order in $A$. (Apologies for my prefactors, they are probably all wrong.)
Of course, the effective action for the e.m. field has to be be gauge invariant, which poses certain restrictions on the polarization tensor $Π^{µν}$.

What is the most general form of the polarization tensor $Π^{µν}$, i.e. the form dictated by gauge invariance alone?

According to my calculations, gauge invariance imposes the restriction $Π^{µν}q_µ = 0$, but I'm not entirely sure whether this is correct.
Also, I have heard that one possible form is
$$ Π_{ij} = \tilde Π(q)(\delta_{ij} - \frac{q_iq_j}{q^2})  $$
at least for the spatial components $i,j$, but I don't think that this is the most general form.

What is the general form of the polarization tensor in a condensed matter context? Are there other restrictions aside from gauge invariance?

 A: In the case of quantum field theory:
First of all for a massless gauge field the most general form of the effective action will contain the renormalizable term
$ \mathcal{L}  = -\frac{1}{4 g^2} F^{\mu \nu} F_{\mu \nu} $.
This follows simply from Lorentz Invariance (indices must be contracted properly essentially) and Gauge Invariance. I don't want to turn this into a post concerning Gauge Invariance simply because you didn't ask about that but I just want to say that while Gauge Invariance is a 'fake' symmetry it is a symmetry of the action none-the-less for our purposes so our effective Lagrangian should respect it. I also don't want to make this a post about renormalization so I just say that in general there will be higher order terms in the field strength ($ (F^{\mu \nu} F_{\mu \nu})^2$ and so on ) in the effective action but these are irrelevant both in the formal sense of the word in field theory and in the sense that we don't care about them here since you were really only asking about the quadratic part of the action.
If you just want the term quadratic in the gauge field $A^\mu$ it will take the form:
$ A_{\mu} \Pi^{\mu \nu} A_{\nu} $
which just follows from Lorentz invariance. In momentum space the only thing we have around that has indices on it is the 4-momentum, $p^\mu$ and the metric $\eta^{\mu \nu}$ so $\Pi^{\mu \nu}$ must take the form 
$\Pi^{\mu \nu}(q^2) = \Pi (q^2) \left(\alpha  \eta^{\mu \nu} + \beta  q^\mu q^\nu \right) $. 
Now from gauge invariance we know that $A^\mu \rightarrow A^\mu + q^\mu$ must be a symmetry or
$\alpha q^\nu + \beta q^2 q^\nu = 0  $ 
hence we can take $\alpha = q^2 $ and $\beta = -1$ and the remaining overall constant can be absorbed into $\Pi (q^2)$, giving 
$\Pi^{\mu \nu}(q^2) = \Pi (q^2) \left( \eta^{\mu \nu} q^2 - q^\mu q^\nu \right) $.
For a $U(1)$ gauge field the $ A_{\mu} \Pi^{\mu \nu} A_{\nu} $ is the same things as $- \frac{1}{4 g_p^2} F^{\mu \nu} F_{\mu \nu} $ where $g_p $ is physical coupling constant. For non-abelian gauge fields there are 3 and 4 pt interactions as well in $ F^{\mu \nu} F_{\mu \nu} $ as well. So writing something like
$\mathcal{L} =- \frac{1}{4 g_p^2} F^{\mu\nu} F_{\mu \nu} + A_\mu \Pi^{\mu \nu} A_\nu $
is redundant, because $A_\mu \Pi^{\mu \nu} A_\nu$ is all already there in the $F^{\mu\nu} F_{\mu \nu}$.
For a massive vector field there is no gauge invariance and so my $\alpha$ and $\beta$ above are not constrained. In this case the effective action takes the form 
$\mathcal{L}= - \frac{1}{4 g_p^2} F^{\mu\nu} F_{\mu \nu} - \frac{1}{2}  m_p^2 A_\mu  A^\mu $
and so part of the polarization tensor is not accounted for in the $F^{\mu\nu} F_{\mu \nu}$ term (where $m_p$ is the physical mass).
For a massless gauge field the polarization tensor takes the form 
$\Pi_{ij} (q^2) = \Pi (q^2) \left( \delta_{ij}  - \frac{q_i q_j}{q^2} \right)$
if one makes the gauge choice $A_0= 0 $ and $\ q_i A_i = 0 $.
A: You are correct Greg. The restriction $\Pi_{\mu\nu}q_\nu = 0$ comes from requiring that the Lagrangian only changes by a total derivative on a gauge transformation. The only other symmetry we can generally expect in condensed matter is time reversal symmetry which adds nothing of interest. So your condition more or less exhausts the issue. 
If you happen to have $SO(3)$ rotational symmetry as well then you can greatly restrict the tensor structure. The only tensors we have to work with in that case are $\delta_{00}$, $\delta_{ij}$, $q_iq_j$ and $\epsilon_{ijk}q_k$, where $i,j$ are spatial indices and $0$ is the time index. So you can work out what combination of these will give you $\Pi_{\mu\nu}q_\nu = 0$. 
A: The most general form of the polarization tensor in systems with broken Lorentz invariance but unbroken rotational symmetry (like the electron gas at finite temperature and density) can be found in standard text books on thermal field theory, see e.g. J. Kapusta "Finite temperature field theory".
