Contour for Meijer G-function I'm having some trouble vizualising the complex contour used to define the Meijer G-function. Specifficaly, the one that runs from $-i\infty$ to $+i\infty$ separating the poles of the $\Gamma$ functions. I'm not seeing how to close this contour to use the residue theorem, for instance.
Thanks in advance.
 A: First, $\Gamma(z)$ has poles at $z \in \mathbb{Z}_{\leq 0}$.  Second, the Meijer G function requires $a_k - b_j \not\in \mathbb{Z}_{>0}$ for $j,k \in \mathbb{Z}_{>0}$.  This causes the poles of $\Gamma(b_j - s)$ (for $s \in [1,m]$) to be distinct from the poles of any of the $\Gamma(1-a_k+s)$ for $k \in [1,n]$.  In particular, there are no repeated poles in the numerator of the integrand in
$$   G_{p,q}^{m,n} \left( \begin{matrix} a_1, a_2, \dots a_p \\ b_1, b_2, \dots, b_q\end{matrix} \;\middle|\; z \right) = \frac{1}{2 \pi \mathrm{i}} \int_L\; \frac{\prod_{j=1}^m\Gamma(b_j-s)\prod_{j=1}^n\Gamma(1-a_j+s)}{\prod_{j=m+1}^q\Gamma(1-b_j+s)\prod_{j=n+1}^p\Gamma(a_j-s)} z^s \,\mathrm{d}s $$
Finally, $L$, is the path from $-\mathrm{i}\infty$ to $+\mathrm{i}\infty$ where all the poles of $\Gamma(b_j-s)$ (for $j \in [1,m]$) are to the right of the path and the poles of $\Gamma(1-a_k+s)$ (for $k \in [1,n]$) are to the left.
The poles of $\Gamma(b_j - s)$ are at $s \in \{b_j, b_j+1, b_j+2, \dots\}$.  This is an infinite sequence of points running off to the right, spaced by one unit, starting at $b_j$.
The poles of $\Gamma(1-a_j+s)$ are at $s \in \{a_j - 1, a_j - 2, a_j - 3, \dots\}$.  This is an infinite sequence of points running off to the left, spaced by one unit, starting at $a_j - 1$.
Suppose all the imaginary components of the $b_j$ are distinct from the imaginary components of the $a_k$.  Then the path can detour around the starting points of these sequences of poles as per NIST's diagram (Case (i)).

Note that it is fine for two or more $a_k$ or two or more $b_j$ to duplicate imaginary components.  In these two cases, the path bends to the right or left far enough to accommodate the multiple sequences of poles, but need make no further adjustments since all sequences of poles with that imaginary component proceed either to the left exclusive-or to the right.
This gets a little more complicated if the sets of imaginary components are not distinct.  Then for each duplicated imaginary component, the path must pass to the right of all the $a_k-1$ having that imaginary component, then, while heading left, slalom up and down to arrange for the poles from the $a_k-1$s to be below the path and the poles from the $b_j$s to be above the path.  The condition "$a_k - b_j \not\in \mathbb{Z}_{>0}$ for $j,k \in \mathbb{Z}_{>0}$" ensures there is no pole that we have to simultaneously both pass above and pass below.
The repeated imaginary components version is a giant mess by hand or computer.  I've done it (years ago) with semicircular slaloms away from a path running along the repeated abscissa.  Good luck!
A: Regarding the second question, if $|z|=1$, it may not be possible to deform the vertical line contour into either the left or the right loop and use the residue theorem. Consider
$$G_{1,1}^{1,1}\left(1 \middle| {0 \atop 0} \right) =
\frac 1 {2 \pi i} \int_{-1/2 - i \infty}^{-1/2 + i \infty}
 \Gamma(-y) \Gamma(1 + y) dy =
-\frac 1 {2\pi i} \int_{-1/2 - i \infty}^{-1/2 + i \infty}
 \pi \csc \pi y \,dy.$$
The integral exists, and the value of the G-function is $1/2$, but all residues of $\pi \csc \pi y$ are $\pm 1$.
