For instance, consider a system with $p_x$ and $p_z$ orbitals at the vertices of a square (on xy-plane). A square by itself would have $D_4$ symmetry. However, because of the $p_x$ orbital; the $90^\circ$ rotation ($C_4$) and $270^\circ$ rotation ($C_4^{-1}$) are no longer symmetry operations. Now the rest of the $D_4$ members do preserve the symmetry, but do not form a group since the subset is not closed.
How does one go about formulating a symmetry group for cases like these?