  The statistics of gap ratios between consecutive energy levels is a widely
used tool, in particular in the context of many-body physics, to distinguish
between chaotic and integrable systems, described respectively by Gaussian
ensembles of random matrices and Poisson statistics. In this work we extend the
study of the gap ratio distribution P(r) to the case where discrete symmetries
are present. This is important, since in certain situations it may be very
impractical, or impossible, to split the model into symmetry sectors, let alone
in cases where the symmetry is not known in the first place. Starting from the
known expressions for surmises in the Gaussian ensembles, we derive analytical
surmises for random matrices comprised of several independent blocks. We check
our formulae against simulations from large random matrices, showing excellent
agreement. We then present a large set of applications in many-body physics,
ranging from quantum clock models and anyonic chains to periodically-driven
spin systems. In all these models the existence of a (sometimes hidden)
symmetry can be diagnosed through the study of the spectral gap ratios, and our
approach furnishes an efficient way to characterize the number and size of
independent symmetry subspaces. We finally discuss the relevance of our
analysis for existing results in the literature, as well as its practical
usefulness, and point out possible future applications and extensions.
