To resolve gauge ambiguities upon truncation, a similar process to the previous sections is performed. First, the pure matter and the pure photonic Hamiltonians are projected, H M -→ H M and H ph -→ H ph . Then, the unitary operator, Ŵg)g ′ is properly confined in the truncated subspace. For the matter DOFs, the argument in the exponential of Ŵg)g ′ is no longer given to be linear with {r j } with the relaxation of the longwavelength approximation. Due to this, the argument of the exponential cannot be directly projected by P. Instead, Ŵg)g ′ must be represented in terms of rj = Pr j P. In this manner, the polarization field is projected in terms of {r j } such that Pg (x, {r j }) -→ Pg (x, {r j }). For the photonic DOFs, the mode truncation in this regime is done in the same fashion as in the previous section, where the vector potential is directly projected as Â(x) -→ P Â(x) P = Â(x). The gauge transformation in the properly confined in the truncated subspace can then be written as