  We introduce a translational and rotational invariant local representation
for vector fields, which can be employed in the construction of
machine-learning energy models of solids and molecules. This allows us to
describe, on the same footing, the energy fluctuations due to the atomic
motion, the longitudinal and transverse excitations of the vector field, and
their mutual interplay. The formalism can then be applied to physical systems
where the total energy is determined by a vector density, as in the case of
magnetism. Our representation is constructed over the power spectrum of the
combined angular momentum describing the local atomic positions and the vector
field, and can be used in conjunction with different machine-learning schemes
and data taken from accurate ab initio electronic structure theories. We
demonstrate the descriptive power of our representation for a range of
classical spin Hamiltonian and machine-learning algorithms. In particular, we
construct energy models based on both linear Ridge regression, as in
conventional spectral neighbour analysis potentials, and gaussian
approximation. These are both built to represent a Heisenberg-type Hamiltonian
including a longitudinal energy term and spin-lattice coupling.
