We calculate the neutron electric dipole moment within the framework of lattice QCD. In particular we
analyze configurations produced with $N_f=2+1+1$ twisted mass fermions with light quark mass which
corresponds to pion mass of 370 MeV. We do so by extracting the $CP$-odd form factor $F_3$ at the limit of
zero momentum transfer and at small values of the $\theta$ vacuum angle. The zero momentum limit is
realized via fitting the momentum dependence by a dipole fit as well as using position space methods.
The computation of $F_3$ requires the calculation of the topological charge. We measure the field
theoretical topological charge via cooling and the gradient flow using the Wilson, Symanzik tree-level
improved and Iwasaki actions. Our analysis yields a value for the neutron electric dipole moment of
−0.045(6)(1) e·fm in units of $\theta$.