  We compare lattice QCD determinations of topological susceptibility using a
gluonic definition from the gradient flow and a fermionic definition from the
spectral projector method. We use ensembles with dynamical light, strange and
charm flavors of maximally twisted mass fermions. For both definitions of the
susceptibility we employ ensembles at three values of the lattice spacing and
several quark masses at each spacing. The data are fitted to chiral
perturbation theory predictions with a discretization term to determine the
continuum chiral condensate in the massless limit and estimate the overall
discretization errors. We find that both approaches lead to compatible results
in the continuum limit, but the gluonic ones are much more affected by cut-off
effects. This finally yields a much smaller total error in the spectral
projector results. We show that there exists, in principle, a value of the
spectral cutoff which would completely eliminate discretization effects in the
topological susceptibility.
