Solution (source code)

= Solution

Use units $\hbar=c=1$, metric $g_{\mu\nu}=\operatorname{diag}(1,-1,-1,-1)$, and $p\cdot x=E_{\mathbf p}t-\mathbf p\cdot\mathbf x$. Treat the <complex scalar field> and its adjoint as independent variables when varying the <action>. Their <canonical momenta> are
$$
\boxed{\pi=\frac{\partial\mathcal L}{\partial\dot\phi}=\dot\phi^\dagger,\qquad
\pi^\dagger=\frac{\partial\mathcal L}{\partial\dot\phi^\dagger}=\dot\phi.}
$$
<Canonical quantization> in the <Heisenberg picture> imposes, at the same time $t$,
$$
[\phi(t,\mathbf x),\pi(t,\mathbf y)]=i\delta^{(3)}(\mathbf x-\mathbf y),\qquad
[\phi^\dagger(t,\mathbf x),\pi^\dagger(t,\mathbf y)]=i\delta^{(3)}(\mathbf x-\mathbf y).
$$
All other independent equal-time commutators vanish: in particular $[\phi,\phi^\dagger]=[\pi,\pi^\dagger]=[\phi,\pi^\dagger]=[\phi^\dagger,\pi]=0$, together with the same-type field and momentum commutators. The <Legendre transform> gives the <Hamiltonian density>
$$
\boxed{\mathcal H=\pi\dot\phi+\pi^\dagger\dot\phi^\dagger-\mathcal L
=\pi\pi^\dagger+\nabla\phi^\dagger\cdot\nabla\phi+m^2\phi^\dagger\phi,\qquad H=\int d^3x\,\mathcal H.}
$$
The <Euler-Lagrange equations> are $(\Box+m^2)\phi=(\Box+m^2)\phi^\dagger=0$. The positive- and negative-frequency <plane waves> form a complete basis of solutions of the <Klein-Gordon equation>. Since the field is complex, their operator coefficients are independent rather than being adjoints of each other. Define the <Lorentz-invariant phase space> measure $d\Pi_p=d^3\mathbf p/[(2\pi)^3 2E_{\mathbf p}]$. A convenient expansion is
$$
\phi(x)=\int d\Pi_p\left[a(\mathbf p)e^{-ip\cdot x}-b^\dagger(\mathbf p)e^{ip\cdot x}\right],\qquad
\phi^\dagger(x)=\int d\Pi_p\left[a^\dagger(\mathbf p)e^{ip\cdot x}-b(\mathbf p)e^{-ip\cdot x}\right].
$$
The minus sign is a phase convention: replacing $b$ by $-b$ produces the usual plus-sign expansion without changing its commutators or <number operator>. The normalization is fixed by the <canonical commutation relations>. For example,
$$
\begin{aligned}
\pi(x)&=i\int d\Pi_p\,E_{\mathbf p}\left[a^\dagger(\mathbf p)e^{ip\cdot x}+b(\mathbf p)e^{-ip\cdot x}\right],\\
[\phi(t,\mathbf x),\pi(t,\mathbf y)]
&=\frac i2\int\frac{d^3\mathbf p}{(2\pi)^3}
\left[e^{i\mathbf p\cdot(\mathbf x-\mathbf y)}+e^{-i\mathbf p\cdot(\mathbf x-\mathbf y)}\right]
=i\delta^{(3)}(\mathbf x-\mathbf y),
\end{aligned}
$$
when $[a(\mathbf p),a^\dagger(\mathbf q)]=[b(\mathbf p),b^\dagger(\mathbf q)]=(2\pi)^3 2E_{\mathbf p}\delta^{(3)}(\mathbf p-\mathbf q)$. The cross commutators vanish and the other canonical relation follows by taking adjoints with the operator order reversed. Conversely these mode commutators can be obtained by Fourier inversion of the equal-time relations. This is <canonical quantization of a complex scalar field>.

Substitution into the spatial integral for $H$ makes the diagonal terms proportional to $a^\dagger a$ and $bb^\dagger$. Terms creating or annihilating a pair have $\mathbf q=-\mathbf p$ and a coefficient $E_{\mathbf p}^2-\mathbf p^2-m^2=0$, so they cancel. The result before vacuum subtraction is
$$
H_{\rm raw}=\int d\Pi_p\,E_{\mathbf p}\left[a^\dagger(\mathbf p)a(\mathbf p)+b(\mathbf p)b^\dagger(\mathbf p)\right].
$$
Commuting $b$ past $b^\dagger$ leaves a divergent field-independent <vacuum energy>. The displayed zero-vacuum-energy form must therefore be understood as a <normal-ordered> <Hamiltonian>:
$$
\boxed{H=:H_{\rm raw}:=\int d\Pi_p\,E_{\mathbf p}(a^\dagger a+b^\dagger b)
=\int\frac{d^3\mathbf p}{(2\pi)^3}\frac12(a^\dagger a+b^\dagger b).}
$$
A regulator can be introduced before subtracting the constant. This is the <normal-ordered Hamiltonian of a free complex scalar field>; the unrenormalized <Hamiltonian> is not literally equal to this expression without that convention.

The <scalar-field vacuum> is annihilated by both <annihilation operators>. Their adjoints create two species of <spin>-zero <bosons> with the same positive energy $E_{\mathbf p}$ and <mass> $m$, because
$$
[H,a^\dagger(\mathbf p)]=E_{\mathbf p}a^\dagger(\mathbf p),\qquad
[H,b^\dagger(\mathbf p)]=E_{\mathbf p}b^\dagger(\mathbf p).
$$
Repeated <creation operators> give the bosonic <Fock space>. The negative-frequency part does not create a negative-energy physical state; it creates the <antiparticle> of positive energy. The charge distinguishes the two species.

For the global phase transformation $\delta\phi=-i\alpha\phi$, $\delta\phi^\dagger=i\alpha\phi^\dagger$, <Noether theorem> gives $j^\mu=i(\phi^\dagger\partial^\mu\phi-\partial^\mu\phi^\dagger\,\phi)$. Its divergence is
$$
\partial_\mu j^\mu=i(\phi^\dagger\Box\phi-\Box\phi^\dagger\,\phi)
=i(-m^2\phi^\dagger\phi+m^2\phi^\dagger\phi)=0.
$$
With vanishing boundary flux, the integral of $j^0$ is a <conserved charge>. Substituting the modes gives, before charge <normal ordering>, $Q_{\rm raw}=\int d\Pi_p(a^\dagger a-bb^\dagger)$. The pair terms cancel because their frequency difference is zero when their spatial momenta sum to zero. Taking the vacuum charge to vanish gives the <complex scalar charge operator>
$$
\boxed{Q=\int d\Pi_p(a^\dagger a-b^\dagger b).}
$$
The mode commutators imply $[Q,a^\dagger]=a^\dagger$ and $[Q,b^\dagger]=-b^\dagger$, so
$$
\boxed{Qa^\dagger=a^\dagger(Q+1),\qquad Qb^\dagger=b^\dagger(Q-1).}
$$
Thus the particle carries charge $+1$, the <antiparticle> carries charge $-1$, and a state with occupation numbers $n_a,n_b$ has charge $n_a-n_b$. Also $[Q,\phi]=-\phi$ and $[Q,H]=0$, agreeing with the phase transformation and charge conservation.