  A test of $CP$ invariance in Higgs boson production via vector-boson fusion
has been performed in the $H\rightarrow\gamma\gamma$ channel using 139
fb$^{-1}$ of proton-proton collision data at $\sqrt{s}=13\,\mathrm{TeV}$
collected by the ATLAS detector at the LHC. The Optimal Observable method is
used to probe the $CP$ structure of interactions between the Higgs boson and
electroweak gauge bosons, as described by an effective field theory. No sign of
$CP$ violation is observed in data. Constraints are set on the parameters
describing the strength of the $CP$-odd component in the coupling between the
Higgs boson and the electroweak gauge bosons in two effective field theory
bases: $\tilde{d}$ in the HISZ basis and $c_{H\tilde{W}}$ in the Warsaw basis.
The results presented are the most stringent constraints on $CP$ violation in
the coupling between Higgs and weak bosons. The 95% CL constraint on
$\tilde{d}$ is derived for the first time and the 95% CL constraint on
$c_{H\tilde{W}}$ has been improved by a factor of 5 compared to the previous
measurement.
