  Ab initio study of magnetic superstructures (e.g., magnetic skyrmion) is
indispensable to the research of novel materials but bottlenecked by its
formidable computational cost. For solving the bottleneck problem, we develop a
deep equivariant neural network method (named xDeepH) to represent density
functional theory Hamiltonian $H_\text{DFT}$ as a function of atomic and
magnetic structures and apply neural networks for efficient electronic
structure calculation. Intelligence of neural networks is optimized by
incorporating a priori knowledge about the important locality and symmetry
properties into the method. Particularly, we design a neural-network
architecture fully preserving all equivalent requirements on $H_\text{DFT}$ by
the Euclidean and time-reversal symmetries ($E(3) \times \{I, T\}$), which is
essential to improve method performance. High accuracy (sub-meV error) and good
transferability of xDeepH are shown by systematic experiments on nanotube,
spin-spiral, and Moir\'{e} magnets, and the capability of studying magnetic
skyrmion is also demonstrated. The method could find promising applications in
magnetic materials research and inspire development of deep-learning ab initio
methods.
