N_\phi} \Theta_{ijk} e^{-2\pi \sqrt{-1}jm/N_\phi},$$ and similarly for ${\cal G}$ and $\sigma$. Then, Equation can be cast into a more compact form $$\label{eq:gpot_by_discrete_green_fft}
  \Theta^m_{ik} = \sum_{i'=0}^{N_R+1}\sum_{k'=0}^{N_z+1}{\cal G}^m_{i,i',k-k'} \sigma^m_{i'k'}{\cal V}_{i'}.$$ Since $\sigma$ is nonzero only at the ghost cells and we need to evaluate $\Theta$ also only at the ghost cells, we do not have to perform full double summations for all $m,i,k$ indices in Equation . By collecting the individual contributions of the surface charges, Equation yields the Fourier-transformed potentials at the four boundaries $$\begin{aligned}
\label{eq:Theta_top}
  \Theta^m_i({\rm top}) &= \sum_{i'=1}^{N_R} {\cal G}^m_{i,i'}({\rm top\to top}) \sigma^m_{i'}({\rm top}){\cal V}_{i'} + \sum_{i'=1}^{N_R} {\cal G}^m_{i,i'}({\rm bot\to top}) \sigma^m_{i'}({\rm bot}){\cal V}_{i'}\nonumber\\
                        &+ \sum_{k'=1}^{N_z} {\cal G}^m_{i,k'}({\rm inn\to top}) \sigma^m_{k'}({\rm inn}){\cal V}_{0} + \sum_{k'=1}^{N_z} {\cal G}^m_{i,k'}({\rm out\to top}) \sigma^m_{k'}({\rm out}){\cal V}_{N_R+1},\end{aligned}$$ $$\begin{aligned}
\label{eq:Theta_bot}
  \Theta^m_i({\rm bot}) &= \sum_{i'=1}^{N_R} {\cal G}^m_{i,i'}({\rm top\to bot}) \sigma^m_{i'}({\rm top}){\cal V}_{i'} + \sum_{i'=1}^{N_R} {\cal G}^m_{i,i'}({\rm bot\to bot}) \sigma^m_{i'}({\rm bot}){\cal V}_{i'}\nonumber\\
                        &+ \sum_{k'=1}^{N_z} {\cal G}^m_{i,k'}({\rm inn\to bot}) \sigma^m_{k'}({\rm inn}){\cal V}_{0} + \sum_{k'=1}^{N_z} {\cal G}^m_{i,k'}({\rm out\to bot}) \sigma^m_{k'}({\rm out}){\cal V}_{N_R+1},\end{aligned}$$ $$\begin{aligned}
\label{eq:Theta_inn}
  \Theta^m_k({\rm inn}) &= \sum_{i'=1}^{N_R} {\cal G}^m_{k,i'}({\rm top\to inn}) \sigma^m_{i'}({\rm top}){\cal V}_{i'} + \sum_{i'=1}^{N_R} {\cal G}^m_{k,i'}({\rm bot\to inn}) \sigma^m_{i'}({\rm bot}){\cal V}_{i'}\nonumber\\
                        &+ \sum_{k'=1}^{N_z} {\cal G}^m_{k-k'}({\rm inn\to inn}) \sigma^m_{k'}({\rm inn}){\cal V}_{0} + \sum_{k'=1}^{N_z} {\cal G}^m_{k-k'}({