In Atiyah and Segal's Twisted K-Theory, they twice state the isomorphism $Aut(P) \cong H^2(X;\mathbb Z)$, where $P \to X$ is a principal $PU(\mathcal H)$-bundle.
I'm trying to prove this myself. It's clear when $P$ is the trivial bundle: automorphisms of the trivial bundle correspond with maps $X \to PU(\mathcal H) \simeq K(\mathbb Z,2)$.
For general $P$, the best I have is $Aut(P) \cong Map(P, PU(\mathcal H))^{PU(\mathcal H)}$, where the right side of this equation denotes $PU(\mathcal H)$-equivariant maps with $PU(\mathcal H)$ acting on itself via conjugation. This doesn't seem isomorphic to $Map(X, PU(\mathcal H))$.
One strategy might be to show that $Aut(P)$ is isomorphic to the group of self-homotopies of the classifying map $X \to BPU(\mathcal H)$. From here, I'm still not sure how to get from these self homotopies to maps $X \to PU(\mathcal H)$.
Can someone help me get there? Thanks in advance.
As Ben pointed out in a comment, Atiyah and Segal actually have this result in the paper as Proposition 2.2. Their proof is quite terse, so I thought I would at least fill in the details here. The quotes I give in the proof come from the linked paper.
I'll write $U := U(\mathcal H)$ and $PU := PU(\mathcal H)$.
Theorem: Let $P \to X$ be a principal $PU$-bundle. The connected components of the group of automorphisms of $P$ are in bijection with $H^2(X;\mathbb Z)$.
Proof:
Let $\operatorname{Ad}(P) := P \times_{PU} PU$ be the bundle with fiber $PU$ coming from the action of $PU$ on itself via conjugation. That is, $\operatorname{Ad}(P)$ is the quotient of $P \times PU$ under the relation $(p \cdot u, A) \sim (p, uAu^{-1})$, where $u \in PU$. This is the bundle they refer to: automorphisms of $P$ are in bijection with sections of $\operatorname{Ad}(P)$.
Automorphisms of $U$ induce automorphisms of $PU$ by passing to the quotient. Hence, a bundle with fiber $U$ induces a bundle with fiber $PU$. One way to think about it is that you turn the $\operatorname{Aut}(U)$-valued transition functions into $\operatorname{Aut}(PU)$-valued transition functions by composing with $\operatorname{Aut}(U) \to \operatorname{Aut}(PU)$.
$\operatorname{Ad}(P)$ is induced from $P$ via the map $PU \to \operatorname{Aut}(PU)$ that sends an element to its corresponding inner automorphism. This map factors through $PU \to \operatorname{Aut}(U)$, since $PU$ also acts on $U$ via conjugation. This means that $\operatorname{Ad}(P)$ is induced by a bundle with fibers $U$; specifically, the bundle is $P \times_{PU} U$, where $PU$ acts on $U$ by inner automorphisms.
$U$ is contractible, and so any bundle with fiber $U$ is necessarily trivial. Thus $\operatorname{Ad}(P)$ is induced from a trivial bundle and is itself trivial.
$\operatorname{Ad}(P)$ is a trivial $PU$-bundle, and so its sections can be identified with maps $X \to PU$.
To summarise and conclude: $$ \pi_0(\operatorname{Aut}(P)) \cong \pi_0\Gamma(X, \operatorname{Ad}(P)) \cong \pi_0 \Gamma(X, X \times PU) \cong [X, PU] \cong [X, K(\mathbb Z,2)] \cong H^2(X;\mathbb Z). $$