Noncentrality parameter Repeated-Measures ANOVA - formula vs. G*Power I am trying to figure out the correct expression for the noncentrality parameter $\lambda_{ws}$ for the within-subjects effect in a one-way Repeated-Measures ANOVA with $k$ trials/groups. Comparing the calculation of $\lambda_{ws}$ from G*Power with my own attempts (based on the literature) I noticed an inconsistency. I'm not sure where things are going wrong, so I was hoping someone here could shed some light.
I started from a paper by Potvin and Schutz (2000, p. 348), who provided the following formula:
$$\lambda_{ws} = n\frac{\sum_{j = 1}^k (\mu_j-\mu)^2}{\sigma_{wg}^2(1-\bar{\rho})},$$
where $\mu_j$ is the mean for trial/group $j$, $\bar{\rho}$ is the average correlation between scores in the trials/groups, and $\sigma_{wg}^2$ is the within-trial (within-group) variance (assumed to be constant across trials/groups). Thus, $\lambda_{ws}$ is comparable to $\lambda$ from a 'regular' (between-subjects) one-way ANOVA, but it is just multiplied by a factor $c = \frac{1}{1-\bar{\rho}}$:
$$\lambda = nf^² = n\frac{\eta^2}{1-\eta^2} =  n\frac{\sum_{j = 1}^k (\mu_j-\mu)^2}{\sigma_{wg}^2}= \frac{1}{c}\lambda_{ws} = (1-\bar{\rho})\lambda_{ws} \Rightarrow \lambda_{ws}=\frac{\lambda}{(1-\bar{\rho})}.$$
However, when I tried to calculate $\lambda_{ws}$ using G*Power, it seemed to be using a different formula. I couldn't find that formula anywhere in the official manual, but I came across this tutorial document. On page 34, it notes that:
$$\lambda_{gpower} = \frac{knf^2}{(1-\bar{\rho})} = k\lambda_{ws},$$
so the two are off by a factor $k$. My question therefore is: which one is correct? My hunch is that the G*Power formula is off: it appears to 'double-count' the 'treatment' sums of squares in the numerator (first it sums over the groups, and then it multiplies the result by $k$ again). This would have made sense to me if there were a within-between-interaction, and if $k$ represented the number of levels of the between-subjects factor, but that's not the case here.
I'm just not sure, though.
EDIT
Thanks to @dipetkov's answer below I was able to see for myself that the G*Power and Potvin & Schutz formulas are identical (I will maintain $k$ to denote the number of trials; @dipetkov used $q$):
$$\lambda_{gpower}= \frac{Nkf^2}{1-\bar{\rho}}= \frac{npkf^2}{(1-\bar{\rho})} = \frac{nkf^2}{(1-\bar{\rho})}$$
$$=\frac{nk}{(1-\bar{\rho})}\frac{\eta^2}{(1-\eta^2)}$$
$$= \frac{nk}{(1-\bar{\rho})}\frac{\sum_{j = 1}^k n_j(\mu_j-\mu)^2}{\sum_{j = 1}^k \sum_{i=1}^n (y_{ij}-\mu_j)^2}$$
$$= \frac{nk}{(1-\bar{\rho})}\frac{\sum_{j = 1}^k n_j(\mu_j-\mu)^2}{\sum_{j = 1}^k n_j\sigma_{wg(j)}^2}$$
$$= \frac{nk}{(1-\bar{\rho})}\frac{n\sum_{j = 1}^k (\mu_j-\mu)^2}{kn\sigma_{wg}^2}$$
$$= \frac{n}{(1-\bar{\rho})}\frac{\sum_{j = 1}^k (\mu_j-\mu)^2}{\sigma_{wg}^2}$$
$$= \lambda_{ws}$$
 A: TL;DR The G*Power formula is correct and the (Potvin and Schutz, 2000) formula is also correct. The missing step is how to adapt a formula for two-way ANOVA to the one-way layout.

You seem to mix the notation used by two different sources and the power formulas for one- and two-way repeated measures ANOVAs.
In the (Potvin and Schutz, 2000) paper [1], $n$ is the group sample size (number of subjects in each group) in a balanced design. In the G*Power tutorial [2], $N$ is the total sample size (total number of subjects). The relationship between the group sample size and the total size is simple: $N = pn$ where $p$ in the number of levels of the between-subjects factor A.
Note: (Potvin and Schutz, 2000) denote the number of A levels by $p$; the G*Power tutorial denotes it by $a$ and you denote it by $k$. I'll use the notation in the paper.
On pages 32—36 the G*Power tutorial presents results for a two-way $A_p \times B_q$ repeated measures (RM) ANOVA. You seem to ignore this fact as you are interested in a one-way repeated measures design. To an extent, you sweep the difference between the between-subjects and within-subject factors by referring to "the mean for trial/group $j$", implying that groups and trials are interchangeable.
In your question you reference the formula for the within-subject effect B. Let's show that the G*Power formula is equivalent to the (Potvin and Schutz, 2000) formula.
$$
\begin{aligned}
\eta_{\text{G*Power}}
= \frac{Nqf^2}{1-\rho}
= \frac{npq\sum_{j=1}^q(\mu_j-\mu)^2/(q\sigma^2)}{1-\rho}
= \frac{np\sum_{j=1}^q(\mu_j-\mu)^2}{\sigma^2(1-\rho)}
= \lambda_B
\end{aligned}
$$
For completeness, let's also look at the formula for the between-subjects effect A. Aside: In the tutorial there is a typo: the effect size $f^2$ should be in the numerator, not the denominator.
$$
\begin{aligned}
\eta_{\text{G*Power}}
= \frac{Nqf^2}{1-(1-q)\rho}
= \frac{npq\sum_{i=1}^p(\mu_i-\mu)^2/(p\sigma^2)}{1-(1-q)\rho}
= \frac{nq\sum_{i=1}^p(\mu_i-\mu)^2}{\sigma^2(1-(1-q)\rho)}
= \lambda_A
\end{aligned}
$$
So can you use G*Power to calculate sample size for a one-way repeated measures ANOVA? Yes: It corresponds to a two-way layout with one level for the A factor, ie, $p=1$. The noncentrality parameter is $\lambda = nqf^2/(1-\rho)$ just as given in your question.
[1] P. Potvin and R. Schutz. Statistical power for the two-factor repeated measures ANOVA. Behavior Research Methods, 32:347–356, 2012. 
[2] G*Power tutorial by StatPower. Available online. 
