[Tex/LaTex] draw a nice connecting homomorphism arrow

tikz-pgf

\begin{tikzpicture}[scale=1.5]

\node (A) at (0,0) {$0$};
\node (B) at (1,0) {$H^0(G,P)$};
\node (C) at (2,0) {$H^0(G,M)$};
\node (D) at (3,0) {$H^0(G,N)$};
\node (E) at (1,-1) {$H^1(G,P)$};
\node (F) at (2,-1) {$H^1(G,M)$};
\node (G) at (3,-1) {$H^1(G,N)$};
\path[->,font=\scriptsize,>=angle 90]
(A) edge node[above]{} (B)
(B) edge node[above]{$\phi$} (C)
(C) edge node[above]{$\psi$} (D)
(D) edge node[above]{} (E)
(E) edge node[above]{} (F)
(F) edge node[above]{} (G);

\end{tikzpicture}

So I've got this that I want to try and draw a 'nice' connecting homomorphism which I'll try my best to describe: It starts from the end of the last element in the first row and ends at the beginning of the first element in the second row.

Maybe it's better to do it in tikzcd but I don't know how to do that either.

Best Answer

With TikZ only

Code

\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix,quotes}
\begin{document}
\begin{tikzpicture}[scale=2]
\matrix(m)[matrix of math nodes,column sep=15pt,row sep=15pt]{
  0 & H^0(G,P) & H^0(G,M) & H^0(G,N) \\
    & H^1(G,P) & H^1(G,M) & H^1(G,N) \\
};
\draw[->,font=\scriptsize,every node/.style={above},rounded corners]
  (m-1-1) edge (m-1-2) 
  (m-1-2) edge["$\phi$"] (m-1-3)
  (m-1-3) edge["$\psi$"] (m-1-4)
  (m-1-4.east) --+(5pt,0)|-+(0,-7.5pt)-|([xshift=-5pt]m-2-2.west)--(m-2-2.west)
  (m-2-2) edge (m-2-3)
  (m-2-3) edge (m-2-4)
;
\end{tikzpicture}
\end{document}

Output

enter image description here