Find the number of unequivalent number of configuration on a square lattice Say I have a $4 \times 4$ lattice on which I want to pick say 5 sites. Let's say for instance that I want to put 5 one's inside of the following zero matrix :
$$ \left[ \array{ 0 \, 0 \, | \, 0 \, 0 \\ 0 \, 0 \, | \, 0 \, 0 \\ \hline 0  \, 0 \,|\, 0 \, 0 \\ 0 \, 0 \, | \, 0 \, 0 } \right]$$
On the matrix, the horizontal and vertical lines in the middle are supposed to be "mirror symmetry axes" of the system. That is the following configurations are all considered to be equivalent :
$$ \left[ \array{ 0 \, 0 \, | \, 1 \, 0 \\ 0 \, 0 \, | \, 0 \, 0 \\ \hline 0  \, 0 \,|\, 0 \, 0 \\ 0 \, 0 \, | \, 0 \, 0 } \right]$$
$$ \left[ \array{ 0 \, 1 \, | \, 0 \, 0 \\ 0 \, 0 \, | \, 0 \, 0 \\ \hline 0  \, 0 \,|\, 0 \, 0 \\ 0 \, 0 \, | \, 0 \, 0 } \right]$$
$$ \left[ \array{ 0 \, 0 \, | \, 0 \, 0 \\ 0 \, 0 \, | \, 0 \, 0 \\ \hline 0  \, 0 \,|\, 0 \, 0 \\ 0 \, 0 \, | \, 1 \, 0 } \right]$$
$$ \left[ \array{ 0 \, 0 \, | \, 0 \, 0 \\ 0 \, 0 \, | \, 0 \, 0 \\ \hline 0  \, 0 \,|\, 0 \, 0 \\ 0 \, 1 \, | \, 0 \, 0 } \right]$$
By mirror symmetry axes, I mean that I don't impose the configuration to be symmetric (especially with 5 sites !) but simply that they belong to the same equivalence class of configurations.
How many distinct configurations (i.e. equivalence classes) can I expect to find ?
Is there a way to generalize the solution to any $ n \times n$ lattice and $m$ sites ?
 A: Alright.  Your group of symmetries is of size 4.  Which means that any equivalence class (=orbit) of a configuration has to have size which is a factor of 4 -- 1, 2, or 4.
So let's count equivalence classes of each size separately.
For your case -- $n = 4$, $m = 5$, all orbits are of size 4 (not too difficult to see), so there are $\frac{1}{4} \binom{4^2}{5} = 1092$ distinct configurations.
Likewise, if $n$ is even, and $m$ is odd, all orbits are of size 4 and we have $\frac{1}{4} \binom{n^2}{m}$ distinct configurations.
Now let's break out the other cases.
$n$ even, $m$ even, not divisible by 4.  There are 3 distinct subgroups of symmetries of size 2 (mirror reflection about each line, and 180-degree rotation).  Any configuration with $m$ not divisible by 4 can be symmetric under at most one of these.  Each symmetry subgroup will contribute $\frac{1}{2}\binom{n^2/2}{m/2}$ distinct configurations (orbit size is 2, which gives us the $\frac{1}{2}$). How many non-symmetric configurations are there?  Well, there are $\binom{n^2}{m}$ configurations in total, so $\binom{n^2}{m} - 3\binom{n^2/2}{m/2}$ are non-symmetric and lie in orbits of size 4.
Total distinct configurations: $\frac{1}{4} \binom{n^2}{m} + \frac{3}{4}\binom{n^2/2}{m/2}$.  (Check this against n=2, m=2 -- two distinct "domino" configurations, one "diagonal" configuration, $3 = 1/4 * 6 + 3/4 * 2$.)
n even, m divisible by 4.  Now a configuration could be symmetric under one of the 3 subgroups, under the full symmetry group, or not symmetric. Fully symmetric configurations: $\binom{n^2/4}{m/4}$, in orbits of size 1. For each subgroup, we now have $\binom{n^2/2}{m/2} - \binom{n^2/4}{m/4}$ configurations that are not symmetric under the full group, in orbits of size 2. And for non-symmetric configurations, we have $\binom{n^2}{m} - 3\binom{n^2/2}{m/2} + 2\binom{n^2/4}{m/4}$, in orbits of size 4 (check that the total number of configurations is correct).
Total distinct configurations: $A + 3\frac{1}{2}B + \frac{1}{4}C = \frac{1}{4} \binom{n^2}{m} + \frac{3}{4}\binom{n^2/2}{m/2}$ again. (Check $n=2, m=4$: only one configuration, the full board, and $1 = 1/4 \binom{4}{4} + 3/4 \binom{2}{2}$.)
Now we move on to $n$ odd. Here the sites in the lattice are not all equivalent -- the central site has an orbit of size 1.
If $m$ is $3\pmod{4}$ or $2\pmod{4}$, we have (like the $2\pmod{4}$ case above) configurations that are symmetric under subgroups but none under the full group -- odd $m$ must include the central site. Each subgroup therefore contributes $\frac{1}{2}\binom{(n^2-1)/2}{\lfloor m/2\rfloor}$ distinct configurations and the total number of distinct configurations is $\frac{1}{4}\binom{n^2}{m} + \frac{3}{4}\binom{(n^2-1)/2}{\lfloor m/2 \rfloor}$.
If $m$ is $0\pmod{4}$ or $1\pmod{4}$, we are in a situation similar to the "m divisible by 4" case above.  Again, odd $m$ means that symmetric configurations must include the center site. But we have the same number as before: $\frac{1}{4}\binom{n^2}{m} + \frac{3}{4}\binom{(n^2-1)/2}{\lfloor m/2 \rfloor}$ distinct configurations.
