  The nonlinear dynamics of preheating after early-Universe inflation is often
studied with lattice simulations. In this work I present a new lattice code
HLATTICE. It differs from previous public available codes in the following
three aspects: (i) A much higher accuracy is achieved with a modified
sixth-order symplectic integrator; (ii) scalar, vector, and tensor metric
perturbations in synchronous gauge and their feedback to the dynamics of scalar
fields are all included; (iii) the code uses a projector that completely
removes the scalar and vector components defined by the discrete spatial
derivatives. Such a generic code can have wide range of applications. As an
example, gravity waves from preheating after inflation are calculated with a
better accuracy.

Cosmology and Nongalactic Astrophysics;General Relativity and Quantum Cosmology;High Energy Physics - Phenomenology;High Energy Physics - Theory