Synchronous-to-Newtonian transformation with positive spatial perturbations (source code)

= Synchronous-to-Newtonian transformation with positive spatial perturbations
{title2=$\Phi=-\mathcal HT-T',\quad\Psi=(h-h_S)/6+\mathcal HT$}

Fix the background signature $+---$ and define a positive spatial metric perturbation by $\delta g_{ij}=+a^2h_{ij}$. Thus the synchronous line element is
$$
ds^2=a^2[d\tau^2-(\delta_{ij}-h_{ij})dx^idx^j],\qquad
h_{ij}=\frac h3\delta_{ij}+h_S(\hat k_i\hat k_j-\delta_{ij}/3).
$$
For a nonzero <Fourier mode>, take the passive displacement $\widetilde\tau=\tau+Te^{i\mathbf k\cdot\mathbf x}$ and $\widetilde x^i=x^i+i\hat k^iLe^{i\mathbf k\cdot\mathbf x}$. The transformed scalar shear is $h_S-2kL$, so setting it to zero gives $L=h_S/(2k)$. Removing the mixed metric term gives $T=L'/k=h_S'/(2k^2)$.

Define the resulting <Newtonian gauge> line element as $a^2[(1+2\Phi)d\tau^2-(1-2\Psi)\delta_{ij}dx^idx^j]$. Its potentials are
$$
\Phi=-\mathcal HT-T',\qquad
\Psi=\frac{h-h_S}{6}+\mathcal HT.
$$
These signs follow directly from the <linear metric gauge-transformation law>. Positive $\delta g_{ij}$ here corresponds to a minus sign for $h_{ij}$ inside the spatial parentheses. The <synchronous-to-Newtonian scalar Fourier transformation> uses a different explicit background/spatial-amplitude convention. Its displacement signs must be translated along with that convention. The present definitions also fix the signs in the <photon redshift identity with positive spatial perturbations>.