gradient field code