  We introduce a new class of machine learning interatomic potentials - fast
General Two- and Three-body Potential (GTTP), which is as fast as conventional
empirical potentials and require computational time that remains constant with
increasing fitting flexibility. GTTP does not contain any assumptions about the
functional form of two- and three-body interactions. These interactions can be
modeled arbitrarily accurately, potentially by thousands of parameters not
affecting resulting computational cost. Time complexity is O(1) per every
considered pair or triple of atoms. The fitting procedure is reduced to simple
linear regression on ab initio calculated energies and forces and leads to
effective two- and three-body potential, reproducing quantum many-body
interactions as accurately as possible. Our potential can be made continuously
differentiable any number of times at the expense of increased computational
time. We made a number of performance tests on one-, two- and three-component
systems. The flexibility of the introduced approach makes the potential
transferable in terms of size and type of atomic systems. We show that trained
on randomly generated structures with just 8 atoms in the unit cell, it
significantly outperforms common empirical interatomic potentials in the study
of large systems, such as grain boundaries in polycrystalline materials.
