To find the number of automorphisms of a solution grid, i.e. the number of ways of "scrambling" the grid back to itself, you can loop over all 648 ways of preserving a "base pattern" and make a note of which of those preserves the whole grid. For further information, see here.