Let $\Gamma$ be the modular group and $\mathcal M_n$ the set of all primitive matrices with determinant $n\geq1$. Recall that a primitive matrix has relatively prime entries.

The modular group $\Gamma$ acts on the set $\mathcal M _n$ from the left. The representatives of the orbits of this action can be chosen as

$$S(n)=\bigg \lbrace \begin{pmatrix}r &s\\0&t\end{pmatrix}:r>0,rt=n,(r,s,t)=1,0\leq s<t\bigg\rbrace.$$

One encounters this, for example, when studying the modular equation $\Phi_n(X,X)$. Cf. Zagier, p. 68.

Now consider a generalization of $S(n)$, namely

$$\mathcal{S}\left(n,d\right)=\bigg\lbrace \begin{pmatrix}r &s\\0&t\end{pmatrix}: r>0,rt=n,(r,t,s)=1,d \mid s, 0 \leq s < dt\bigg\rbrace.$$

These sets arise from the study of modular functions for certain subgroups of $\Gamma$ and their transformation equations.

**My question is this: is there some set of matrices $\mathcal M_{n,d}$ and a subgroup $\Gamma_{n,d}\subset\Gamma$ such that $S(n,d)$ is a set of representatives for the orbits of the left action $\Gamma_{n,d}\backslash\mathcal M_n$?**