4

enter image description here

How do I draw this one-dimensional spin-chain above in TikZ (Latex/Overleaf)? I drew the blue arcs myself, but preferably this should be in a similar style to the original image below:

enter image description here

Here is my attempt:

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{tikz}
\usetikzlibrary{calc}


\begin{document}
\begin{tikzpicture}[scale=1.5, every node/.style={scale=1.5}]

% Define nodes
\foreach \i in {0, 1, 2, 3, 4, 5, 6} {
    \node[draw, circle, fill=blue, minimum size=8pt, inner sep=0pt] (n\i) at (\i, 0) {};
}

% Draw arrows
\foreach \i/\angle in {0/90, 1/45, 2/-45, 3/45, 4/-45, 5/-90, 6/-90} {
    \draw[->, thick, red] (n\i) -- ++(\angle:0.7);
}

% Draw J1 and J2 labels
\draw[dotted] (n0) -- (n1);
\draw[dotted] (n1) -- (n2);
\draw[dotted] (n2) -- (n3);
\draw[dotted] (n3) -- (n4);
\draw[dotted] (n4) -- (n5);
\draw[dotted] (n5) -- (n6);

\path[->, thick, dotted, blue] (n0) edge[bend left=30] (n2);
\path[->, thick, dotted, blue] (n1) edge[bend left=30] (n3);
\path[->, thick, dotted, blue] (n2) edge[bend left=30] (n4);
\path[->, thick, dotted, blue] (n3) edge[bend left=30] (n5);
\path[->, thick, dotted, blue] (n4) edge[bend left=30] (n6);

% Add labels
\node at (1.5, 0.5) {$J_1 < 0$};
\node at (1, 1.2) {$J_2 > 0$};
\node at (2.5, 0.8) {$J_3 > 0$};

\end{tikzpicture}
\end{document}

But the arrows do not look similar and the positions are not in the right place of the arcs and labels, so I am not sure how to clean this up. The J2 and J1 arcs should also go up while J3 goes down like in the first image.

3
  • 1
    On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help. Commented Jun 25 at 10:47
  • 1
    I added my attempt
    – user46792
    Commented Jun 25 at 10:54
  • 2
    Thanks! Much better question now! Commented Jun 25 at 10:55

2 Answers 2

3

You can make a pic that contains the blue circle and the red arrow. Then the dotted line and all the pics can be drawn with a single \draw command (with a foreach option) to set the position of each pic relative to the entire path.

enter image description here

In the following code, the pics have a name prefix called -o (you could call is -bluedot or anything you want starting with -. Then you can refer to the blue dot outside the pic like you would a node.

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{arrows.meta}

\tikzset{
    my dots/.style={densely dotted, thick, #1, text=black},
    spin/.pic={     
        \draw[solid, red, line width=3pt, -{Triangle[width=6pt, length=6pt]}]
            (0,0)node[draw=blue, thin, fill=blue, circle, inner sep=0pt, minimum size=8pt](-o){}--(90:9mm);
    }
}

\begin{document}

\begin{tikzpicture}
\draw[my dots=black](0,0)--(7,0) foreach \t in {0,...,7}{pic[pos=\t/7, rotate=-180/7*\t](A\t){spin}};
\draw[my dots=blue](A1-o)to[bend right]node[below]{$J_3>0$}(A4-o);
\draw[my dots=blue](A4-o)to[bend left]node[above]{$J_2>0$}(A6-o);
\draw[my dots=blue](A6-o)to[bend left]node[above]{$J_1<0$}(A7-o);
\end{tikzpicture}

\end{document}
4

enter image description here

There was a node missing in your code. Moreover I modified the code slightly so that the arrows be defined in a more coherent way.

The labels should be nodes for the edges and not be defined independently.

The code

\documentclass[border=10pt]{standalone}
% \usepackage{graphicx} % Required for inserting images
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{arrows.meta}

\begin{document}
\begin{tikzpicture}[scale=1.5, every node/.style={scale=.8}]

% Define nodes
\foreach \i in {0, 1, ..., 7} {
  \node[draw, circle, blue, fill=blue, minimum size=.4cm, inner sep=0pt]
  (n\i) at (\i, 0) {\i};
}

\draw[very thick, dotted, blue] (n0) -- (n7);

% Draw arrows
\foreach \i in {0, 1, ..., 7} {
  \draw[red, ultra thick,
  arrows={-Latex[red, length=8pt]}] (n\i) -- ++(90 -180/7*\i:.65);
}

\begin{scope}[arrows={->[width=4pt, length=4pt]},
  shorten <=1pt, shorten >=1pt, very thick, dotted, blue]
  \path (n1) edge[bend right=45] node[below] {$J_3 > 0$} (n4);
  \path (n4) edge[bend left=45] node[above] {$J_2 > 0$} (n6);
  \path (n6) edge[bend left=45] node[above] {$J_1 > 0$} (n7);
\end{scope}

\end{tikzpicture}
\end{document}

You must log in to answer this question.

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