0

I want to create the diagram in the pic below enter image description here

and I have the code for the upper part of it, but I have hard time to finish the rest, any help appreciated.

my code:-

\documentclass[11pt, oneside]{article}      % use "amsart" instead of "article" for AMSLaTeX format
\usepackage{geometry}                       % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}                          % ... or a4paper or a5paper or ... 
\usepackage{graphicx}
\usepackage{tikz-cd}
\usetikzlibrary{decorations.markings}
\tikzset{middleArrowHead/.style={decoration={markings, mark= at position #1 with \arrow{>}}, postaction=decorate}}
\usepackage{braket} % defines \ket and \bra
\begin{document}
\begin{tikzcd}[every arrow/.append style={bend left, dash, middleArrowHead=1}] % change the last value until the arrow position pleases you.
\mathcal{B}^{'}
\arrow[start anchor={[yshift=1.5pt]east},end anchor={[yshift=2.5pt]west}]{r}{U^{-1}AU^{-1}} 
& \mathcal{C}^{'}
\arrow[start anchor={[yshift=-1.5pt]west},end anchor={[yshift=-2.5pt]east}]{l}{U^{-1}A^{-1}U}
\end{tikzcd}

\end{document}
2
  • So someone made the top half for you, and now you want someone to do the rest? Commented Apr 22, 2016 at 2:30
  • @henry if you're satisfied with either of the other solutions, be sure to mark the one you choose as "accepted". Commented Apr 24, 2016 at 14:00

2 Answers 2

4

I'm feeling kind tonight, so here's a complete solution. Usually we try to have you do most of the work and get as close as you can to the solution, because that is the best way to learn a new skill, trying it our yourself. Here's the code:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\tikzset{>={Straight Barb[length=4pt]}}

\begin{document}

\begin{tikzpicture}[scale=3]
% Nodes
\node (b0) at (0,0) {$\mathcal B$};
\node (c0) at (1,0) {$\mathcal C$};
\node (b1) at (0,1) {$\mathcal B'$};
\node (c1) at (1,1) {$\mathcal C'$};
% Arrows
\draw[->] (b1) to [out=40,in=140] node[above] {$U^{-1}AU$} (c1);
\draw[->] (c1) to [out=-140,in=-40] node[below] {$UA^{-1}U$} (b1);
\draw[->,dashed,red] (b0) to node[left,black] {$U^{-1}$?} (b1);
\draw[->,dashed,red] (c0) to node[right,black] {$U$?} (c1);
\end{tikzpicture}

\end{document}

And here's the result:

enter image description here

I'm not a big fan of the tikz-cd environment, I like tikzpicture better, since it's more versatile for general diagrams. Maybe someone else has a better answer in tikz-cd.

1
  • Thanks, I am very new to drawing pic with tikz, and usually I use exist one and make modification based on my need. again thanks for been kind “tonight”.
    – henry
    Commented Apr 22, 2016 at 2:52
4

Here is a code with tikz-cd. I added a solution with pstricks:

\documentclass{article}
\usepackage{pst-node}
\usepackage{auto-pst-pdf} \usepackage{tikz-cd}

\begin{document}
%
\[ \psset{arrows=->, arrowinset=0.12, linewidth=0.5pt, arcangle = 40, , nodesep=3pt, rowsep=1.2cm, colsep = 1.5cm, shortput =tablr}
  \everypsbox{\scriptstyle}
  \begin{psmatrix}
    \mathcal B' & \mathcal C'\\%
    \mathcal{B} & \mathcal{C} %
%%%%%% arrows%
 {\psset{nodesepA=2pt, nodesepB=1pt, labelsep=-2pt}
      \ncarc{1,1}{1,2}^{U^{-1}AU} \ncarc{1,2}{1,1}_{UA^{-1}U}}
    \psset{linestyle=dashed, dash=3pt 2pt, labelsep=2pt, linecolor=red}
    \ncline{2,2}{1,2}>[l]{u?}
    \ncline{2,1}{1,1}<[r]{u^{-1}?}
  \end{psmatrix}
\]

\[ \begin{tikzcd}[row sep=1.2cm, column sep=1.2cm, inner sep=10ex]
  \mathcal B' \rar[bend left, "U^{-1}AU"] & \mathcal C'\lar[bend left, "UA^{-1}U"] \\%
  \mathcal{B}\uar[dashed, draw=red, "u^{-1}?"] & \mathcal{C}\uar[dashed, draw=red, swap, "u?"] \end{tikzcd}
\]
\end{document} 

enter image description here

1
  • @egreg: I'm not sure at all. I forgot my editor displays more readable (but uncompilable) code. Thanks for pointing it! It's corrected now.
    – Bernard
    Commented Apr 22, 2016 at 10:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .