  It is well-known that the formation of discrete electron levels strongly
influences the pairing in metallic nanograins. Here we focus on another effect
of quantum confinement in superconducting grains that was not studied
previously, i.e., spatially nonuniform pairing. This effect is very significant
when single-electron levels form bunches and/or a kind of shell structure: in
highly symmetric grains the order parameter can exhibit variations with
position by an order of magnitude. Nonuniform pairing is closely related to a
quantum-confinement induced modification of the pairing-interaction matrix
elements and size-dependent pinning of the chemical potential to groups of
degenerate or nearly degenerate levels. For illustration we consider spherical
metallic nanograins. We show that the relevant matrix elements are as a rule
enhanced in the presence of quantum confinement, which favors spatial
variations of the order parameter, compensating the corresponding energy cost.
The size-dependent pinning of the chemical potential further increases the
spatial variation of the pair condensate. The role of nonuniform pairing is
smaller in less symmetric confining geometries and/or in the presence of
disorder. However, it always remains of importance when the energy spacing
between discrete electron levels $\delta$ is approaching the scale of the bulk
gap $\Delta_B$, i.e., $\delta > 0.1$-$0.2\,\Delta_B$.
