  Studies of $CP$ violation and anomalous couplings of the Higgs boson to
vector bosons and fermions are presented. The data were acquired by the CMS
experiment at the LHC and correspond to an integrated luminosity of 137
fb$^{-1}$ at a proton-proton collision energy of 13 TeV. The kinematic effects
in the Higgs boson's four-lepton decay H $\to$ 4$\ell$ and its production in
association with two jets, a vector boson, or top quarks are analyzed, using a
full detector simulation and matrix element techniques to identify the
production mechanisms and to increase sensitivity to the Higgs boson tensor
structure of the interactions. A simultaneous measurement is performed of up to
five Higgs boson couplings to electroweak vector bosons (HVV), two couplings to
gluons (Hgg), and two couplings to top quarks (Htt). The $CP$ measurement in
the Htt interaction is combined with the recent measurement in the H
$\to\gamma\gamma$ channel. The results are presented in the framework of
anomalous couplings and are also interpreted in the framework of effective
field theory, including the first study of $CP$ properties of the Htt and
effective Hgg couplings from a simultaneous analysis of the gluon fusion and
top-associated processes. The results are consistent with the standard model of
particle physics.
