A random variable X with distribution PG(n,z) is generated by $$X \sim 2.0 \sum{k=1}^\infty G(n,1) / ( (k-1/2)^2 4.0 \pi^2 + z^2).$$
The density for X may be derived from Z and PG(n,0) as
$$p(x|n,z) \propto \exp(-z^2/2 x) p(x|n,0).$$
Thus PG(n,z) is an exponentially tilted PG(n,0).
Two different methods for generating this random variable are
implemented. In general, you may use rpg.gamma to generate an
approximation of PG(n,z) using the sum of Gammas representation
above. When n is a natural number you may use rpg.devroye to
sample PG(n,z). The later method is fast.