Divisibility by 2 of invariants forms on reductive Lie algebras and anomaly cancellation for gauge theories Let $G$ be a connected reductive group over $\mathbb C$ and let $\rho:G\to \operatorname{Sp}(2n,\mathbb C)$ be a homomorphism. You can think about $\rho$ as a linear symplectic representation of $G$ of dimension $2n$. I would like to know if conditions 1 and 2 below are equivalent.
1: It is well-known that $\pi_4(\operatorname{Sp}(2n,\mathbb C))=\mathbb Z_2$. The condition is that $\rho$ induces the $0$ map on $\pi_4$.
2: Let $\kappa$ be the invariant bilinear form on the Lie algebra $\mathfrak g$ of $G$ given by
$\kappa(X,Y)=\operatorname{Tr}(\rho(X)\cdot \rho(Y))$. Then $\kappa$ is integral and even, which means the following. Let $H$ be a Cartan subgroup of $G$ with Lie algebra $\mathfrak h$. Any coweight $\lambda:\mathbb C^{\times}\to H$ defines naturally an element in $\mathfrak h$ (image of 1 under the differential of $\lambda$) which we shall also denote by $\lambda$. Then for any two coweights $\lambda$ and $\mu$ we have $\kappa(\lambda, \mu)\in \mathbb Z$ and $\kappa(\lambda,\lambda)\in 2\mathbb Z$. Then condition 2 says that $\kappa/2$ is again integral and even.
Note that that manifestly condition 2 is some kind of $\mathbb Z_2$-condition".  Since $\pi_4(\operatorname{Sp}(2n,\mathbb C))=\mathbb Z_2$, condition 1 is also of similar sort.
Here is some background: according to a paper of Witten from 1982 condition 1 is the "anomaly cancellation condition" needed for the existence of 4d gauge theory with gauge group (the compact form of) $G$ and matter given by the representation $\rho$. The 2nd condition is more algebraic. I expect them to be equivalent but can't prove it at the moment.
 A: $\DeclareMathOperator\Sp{Sp}\DeclareMathOperator\SU{SU}\DeclareMathOperator\Spin{Spin}\DeclareMathOperator\End{End}$These conditions are not equivalent as stated, but are in the simply connected case.
First, when $G$ is a torus, condition 2 is generally nontrivial (pick any $G$ for which it is nontrivial, and restrict to the maximal torus), but condition 1 is trivial (because $G = K(\mathbb{Z}^\text{rank}, 1)$). Second, if you pull back $\rho$ along the universal cover $G^\text{sc} \to G$, then you have not changed whether condition 1 holds, but condition 2 could fail for $G$ while holding for $G^\text{sc}$.
On the other hand, assume that $G$ is simply connected. In terms of classifying spaces, condition 1 asks about the value of $\rho : BG \to B{\Sp}$ on $\pi_5$. Condition 2 is manifestly a question about the map that $\rho$ induces on $\mathrm{H}^4$, and in the simply connected case Hurewicz translates it into a question about the value of $\rho$ on $\pi_4$. Since $G$ factors as a product of simple simply connected groups, and since homotopy groups of products are products of homotopy groups, we might as well take the case when $G$ is simple, in which case condition 2 is about the parity of the map $\kappa: \mathbb{Z} = \pi_4 BG \to \pi_4 B{\Sp} = \mathbb{Z}$.
Write $\tau_k X$ for the homotopy $k$-type of $X$. For example, $\tau_5 B{\Sp}$ has only two homotopy groups: $\pi_4 = \mathbb{Z}$ and $\pi_5 = \mathbb{Z}_2$. To tell you the whole space, I just need to tell you the Postnikov k-invariant in $\mathrm{H}^6(K(\pi_4,4); \pi_5)$. In the case of $B{\Sp}$, the k-invariant is $\operatorname{Sq}^2 \circ {\pmod2}$ (and writing a stable k-invariant is justified because we are in the stable regime). One way to see this is by using Bott periodicity to identify it with the (stable) k-invariant connecting $\pi_0 KO$ and $\pi_1 KO$.
In other words, $K(\mathbb{Z},4) = \tau_4 BG \to \tau_4 B{\Sp} = K(\mathbb{Z},4)$ lifts along $\tau_5 B{\Sp} \to \tau_4 B{\Sp}$ if and only if $\operatorname{Sq}^2(\kappa \pmod2) = 0 \in \mathrm{H}^6(K(\mathbb{Z},4); \mathbb{Z}/2)$, which I think happens if and only if $\kappa$ is even. ($\kappa$ even is obviously sufficient. That it is also necessary can be seen, for example, by pulling back along the nontrivial map $K(\mathbb{Z}/2, 3) \to K(\mathbb{Z}, 4)$.)
In particular, if $\kappa$ is odd, then $\tau_5 BG \to \tau_4 BG$ cannot be an isomorphism: its fibre (which is a $K(\pi_5 BG, 5)$) must contain something to map onto $\pi_5 B{\Sp}$. So I think that condition 2 failing implies condition 1 fails.
What about the converse: can condition 2 holding imply condition 1 holds? Again we might as well assume that $G$ is simple and simply connected. When could condition 1 fail, i.e. when is $\pi_5 BG \neq 0$? It vanishes for the exceptional groups (see e.g. Mimura - The Homotopy groups of Lie groups of low rank and Kachi - Homotopy Groups of Compact Lie Groups $E_6$, $E_7$ and $E_8$) and for the $\SU$ and $\Spin$ groups of high rank (by Bott); the low-rank cases are exceptionally isomorphic to $\Sp$ groups. So really the only time that 1 could fail is $G = \Sp(m)$.
Let $X = \tau_5 B{\Sp(m)}$. We can work out the group of base-point-preserving self-maps of $X$. It fits into a LES
$$ \dotsb \to \mathrm{H}^5(X, \mathbb{Z}/2) \to \End(X) \to \mathrm{H}^4(X, \mathbb{Z})  \to \dotsb.$$
The map $\End(X) \to \mathrm{H}^4(X, \mathbb{Z}) = \mathbb{Z}$ is a surjection. On the other hand, $\mathrm{H}^5(X, \mathbb{Z}/2) = \mathrm{H}^5(B{\Sp}, \mathbb{Z}/2) = 0$. So you find that $\End(X) = \mathbb{Z}$, and I think from this you see that conditions 1 and 2 are equivalent.
Note that to show $1 \Rightarrow 2$, I do need a bit of case-by-case analysis. A priori there could have been a group $G$ with $\pi_5 BG$ nontrivial but trivially-attached to $\pi_4 BG$, and then I wouldn't have a low-homotopy-group way to prevent it from mapping nontrivially to $\pi_5 B{\Sp}$ even though the map on $\pi_4$ was even.
