  Qubits encoded in the spin state of heavy holes confined in Si- and Ge-based
semiconductor quantum dots are currently leading the efforts toward spin-based
quantum information processing. The virtual absence of spinful nuclei in
purified samples yields long qubit coherence times and the intricate coupling
between spin and momentum in the valence band can provide very fast
spin-orbit-based qubit control, e.g., via electrically induced modulations of
the heavy-hole $g$-tensor. A thorough understanding of all aspects of the
interplay between spin-orbit coupling, the confining potentials, and applied
magnetic fields is thus quintessential for the development of the optimal
hole-spin-based qubit platform. Here we theoretically investigate the
manifestation of the effective $g$-tensor and effective mass of heavy holes in
two-dimensional hole gases as well as in lateral quantum dots. We include the
effects of the anisotropy of the effective Luttinger Hamiltonian (particularly
relevant for Si-based systems) and we focus on the detailed role of the
orientation of the transverse confining potential. We derive most general
analytic expressions for the anisotropic $g$-tensor and we present a general
and straightforward way to calculate corrections to this $g$-tensor for
localized holes due to various types of spin-orbit interaction, exemplifying
the approach by including a simple linear Rashba-like term. Our results thus
contribute to the understanding needed to find optimal points in parameter
space for hole-spin qubits, where confinement is effective and
spin-orbit-mediated electric control over the spin states is efficient.
