added density invariant to gt.py