Put in fast energy calculator for 3D toric code