海森堡自旋交换图与 Tikz

海森堡自旋交换图与 Tikz

我想用 Tikz 构建一个类似于此的图形: 在此处输入图片描述

我正在寻找示例,但找不到任何我尝试制作但结果却一团糟。那么:我怎样才能让点旋转?以及如何将它们放在表格中,同时仍然是 tikz 图形?感谢您的宝贵帮助

答案1

使用表格环境和 tikz\newcommand您可以执行以下操作:

\documentclass[border=2mm]{standalone}
\usepackage{ifthen}
\usepackage{tikz}

\newcommand{\level}[3]% up (1)/down (0), up (1)/down (0), labels (y/n)
{
  \begin{tikzpicture}
    \useasboundingbox (0,-0.25) rectangle (2,1.25);
    \draw[blue,thick,-latex] (0,1-#1) -- (0,#1);
    \draw[red ,thick,-latex] (2,1-#2) -- (2,#2);
    \draw[dashed] (0,0.5)  -- (2,0.5);
    \fill (0,0.5) circle (2pt);
    \fill (2,0.5) circle (2pt);
    \ifthenelse
      {\equal{#3}{y}}
      {%
         \node at (0,0)   [below] {$S_i$};
         \node at (2,0)   [below] {$S_j$};
         \node at (1,0.5) [above] {$J_{ij}$};
      }
      {}
   \end{tikzpicture}
}

\renewcommand{\arraystretch}{2}
\begin{document}
\begin{tabular}{|c|c|}\cline{1-2}
\bfseries State 1 & \bfseries State 2 \\\hline
\level{1}{1}{y}   & \level{1}{0}{n}   \\\hline
\bfseries State 3 & \bfseries State 4 \\\hline
\level{0}{1}{n}   & \level{0}{0}{n}   \\\hline
\multicolumn{2}{|c|}{$\displaystyle J_{ij}=\frac{E_1+E_4-E_3-E_2}{4|S_iS_j|}$}\\[2mm]\hline
\end{tabular}
\end{document}
[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/XGc5e.png

答案2

在此处输入图片描述

\documentclass{article}
\usepackage{array}
\usepackage{makecell}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{positioning, arrows.meta}

\tikzset{node distance = 1cm, baseline={(0,0)}}

\newcommand{\spinup}[1][]{
    \draw[-Triangle , draw=#1, very thick] (0,0ex) -- (0ex,2em) node (up) {};
    \draw[fill=black, draw=#1, draw=black] (0ex,1em) circle (0.5ex);
} % inspired by https://tex.stackexchange.com/a/314648/134144

\newcommand{\spindown}[1][]{
    \draw[Triangle-, draw=#1, very thick] (0,0ex) -- (0ex,2em)node (down) {};
    \draw[fill=black, draw=#1, draw=black] (0ex,1em) circle (0.5ex);
}

\newcommand{\energylevel}{\draw [dotted] (0,0.9em) -- (1cm, 0.9em);}

\setcellgapes{3pt}
\begin{document}

\makegapedcells
\begin{tabular}{|wc{2cm}|wc{2cm}|}
\hline
State 1 & State 2 \\
\hline
\begin{tikzpicture}
  \energylevel;
  \node at (0.5cm,2em) {$J_{ij}$};
  \spinup[blue];
  \node[below of = up]{$S_i$};
  \spinup[red, right of= up]
  \node[below of = up]{$S_j$};
\end{tikzpicture}
& 
\begin{tikzpicture}
  \spinup[blue];
  \spindown[red, right of= up];
  \energylevel
\end{tikzpicture}
\\
\hline
State 3 & State 4 \\
\hline
\begin{tikzpicture}
  \energylevel;
  \spindown[blue];
  \spinup[red, right of= down]
\end{tikzpicture}
& 
\begin{tikzpicture}
  \spindown[blue];
  \spindown[red, right of= down];
  \energylevel
\end{tikzpicture}
\\
\hline
\multicolumn{2}{|c|}{\(\displaystyle J_{ij} = \frac{E_1 + E_4 - E_3 - E_2}{4 | S_i S_j |} \)}\\
\hline
\end{tabular}

\end{document}

答案3

也许你可以在通常的表中使用如下构造来做到这一点,而不用 tikz:

\documentclass{article}
\def\qeq{\mathrel{%
    \mathchoice{\QEQ}{\QEQ}{\scriptsize\QEQ}{\tiny\QEQ}%
}}
\def\QEQ{{%
    \setbox0\hbox{\textbullet}%
    \rlap{\hbox to \wd0{\hss$\uparrow$\hss}}\box0
}}

\begin{document}

 $\qeq$ \textbullet \, \textbullet \, \textbullet

\end{document}

在此处输入图片描述

相关内容