  Strain represents an ubiquitous feature in semiconductor heterostructures,
and can be engineered by different means in order to improve the properties of
various devices, including advanced MOSFETs and spin-based qubits. However, its
treatment within the envelope function framework is well established only for
the homogeneous case, thanks to the theory of Bir and Pikus. Here, we
generalize such theory to the case of inhomogeneous strain. By fully accounting
for the relativistic effects and metric aspects of the problem, we derive a
complete envelope-function Hamiltonian, including the terms that depend on
first and second spatial derivatives of the strain tensor.
