The trace anomaly and the energy momentum tensor in lattice gauge theories