Solution (source code)

= Solution

Write $u_k=\cosh\theta_k$, $v_k=\sinh\theta_k$, taking real even $\theta_k$. The transformation gives
$$
[b_k,b_q^\dagger]=(u_ku_q-v_kv_q)\delta_{kq}=\delta_{kq},\qquad [b_k,b_q]=(u_kv_q-v_ku_q)\delta_{k,-q}=0.
$$
The second equality uses $u_{-k}=u_k$ and $v_{-k}=v_k$, while the first uses $u_k^2-v_k^2=1$. The creation-creation <commutator> vanishes by conjugation. Therefore \b[the $b$ modes are canonical <bosons>]. In the paired basis,
$$
\binom{b_k}{b_{-k}^\dagger}=\begin{pmatrix}u_k&v_k\\v_k&u_k\end{pmatrix}\binom{a_k}{a_{-k}^\dagger}.
$$
Its <determinant> is one and its inverse reverses the signs of the off-diagonal entries. Hence $\boxed{a_k=u_kb_k-v_kb_{-k}^\dagger}$. At self-inverse momenta $k=0,\pi$ this is the corresponding one-mode squeezing transformation, still canonical for finite $\theta_k$.