  The contextuality of quantum mechanics, i.e. the measurement outcome
dependence upon previously made measurements, can be shown by the violation of
inequalities based on measurements of well chosen observables. An important
property of such observables is that their expectation value can be expressed
in terms of probabilities of obtaining two exclusive outcomes. In order to
satisfy this, inequalities have been constructed using either observables with
a dichotomic spectrum or using periodic functions obtained from displacement
operators in phase space. Here we identify the general conditions on the
spectral decomposition of observables demonstrating state independent
contextuality of quantum mechanics. As a consequence, our results not only
unify existing strategies for maximal violation of state independent
non-contextual inequalities but also lead to new scenarii enabling such
violation. Among the consequences of our results is the impossibility of having
a state independent maximal violation of non-contextuality in the Peres-Mermin
scenario with discrete observables of odd dimensions.
