# The question about quantization of free EM field

Let's have the free EM field theory with Coulomb gauge: $$\partial^{2}A_{\mu} = 0, \quad A_{0} = 0, \quad (\nabla \cdot \mathbf A ) = 0.$$ One of the ways of quantizing the field is the following. The expression for energy $$\tag 1 W = \frac{1}{2}\int (\mathbf E^{2} + \mathbf B^{2})d^{3}\mathbf r$$ with a given solution $$\mathbf A = \int (\mathbf a (\mathbf k) e^{-ikx} + \mathbf a^{*} (\mathbf k ) e^{ikx} ) \frac{d^{3}\mathbf k}{\sqrt{(2 \pi )^{3}}}, \quad \omega_{\mathbf k} = |\mathbf k|$$ is rewritten in a form $$\tag 2 W = \frac{1}{2}\int \left(\omega^{2}_{\mathbf k}\mathbf Q^{2}(\mathbf k) + \mathbf P^{2}(\mathbf k)\right)d^{3}\mathbf k ,$$ where $$\mathbf Q = \mathbf a + \mathbf a^{*}, \quad \mathbf P = -i\omega_{\mathbf k}(\mathbf a(\mathbf k) - \mathbf a^{*} (\mathbf k )).$$ So, the question: why do we quantize $(2)$, not $(1)$? I.e., why do we postulate $$[Q_{i}(\mathbf k ) , P_{j} (\mathbf l ) ] = \delta_{ij}\delta (\mathbf k - \mathbf l ),$$ not $$[E_{i}(\mathbf x ) , B_{j} (\mathbf x ' ) ] = \delta_{ij}\delta (\mathbf x - \mathbf x' )?$$

Because the $\textbf{E}$ and $\textbf{B}$ fields are not canonical variables -- it's the $A_\mu$ that appear in the Lagrangian/Hamiltonian. Hence, those are the variables that can have canonical commutator relations. You can only have the commutator relation $[\hat{A}, \hat{B}] = i \hbar$ if $\hat{A}$ and $\hat{B}$ are canonically conjugate.