Within the theory of quantum gates, a common pair of single-qubit phase gates are the $P(\pi/2)=S$ and $P(\pi/4)=T$ gates, with
$$S= \begin{bmatrix} 1 & 0 \\ 0 & i \end{bmatrix},\:T = \begin{bmatrix} 1 & 0 \\ 0 & e^{i \frac{\pi}{4}} \end{bmatrix}.$$
We have, for example, $T^4=S^2=Z$.
Within the theory of presentations of $\mathrm{PSL}(2, \mathbb Z)$ (the modular group), we have the two generators, $S$ and $T$, with:
$$S : z\mapsto -\frac1z,\:T : z\mapsto z+1.$$
We have, for example, $S^2=(ST)^3=I$. But, in matrix form, these generators do not look like those above:
$$S = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}, \: T = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix}.$$
Are the $S$ and $T$ labels used in quantum computation just coincidentally the same as those used to describe generators of the modular group? Or is there some deeper relation that I'm not immediately seeing? What is the origin of $S$ and $T$ gates used in quantum computation?