4

I'm having a spacing glitch with the last of these four quantum states, and I'm wondering if there's a way to get a better output:

\documentclass[12pt,letterpaper,twoside]{book}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{tensor}
\usepackage{mathtools}
\newcommand*{\kp}[1]{\mskip+#1mu}
\newcommand*{\kn}[1]{\mskip-#1mu}

\begin{document}

\begin{subequations}
\begin{align}
    |\, 0~0 \, \rangle &= \frac{1}{\sqrt{2}} \kp1 (\kp2 |\kn1+ - \kp2 \rangle - |\kn1- + \kp2 \rangle), \\
    |\, 1~1 \, \rangle &= |\kn1+ + \kp2 \rangle, \\
    |\,1~0 \, \rangle &= \frac{1}{\sqrt{2}} \kp1 (\kp2 |\kn1+ - \kp2 \rangle + |\kn1- + \kp2 \rangle), \\
    |\, 1\!-\!1 \, \rangle &= |\kn1 - - \kp2 \rangle.
\end{align}
\end{subequations}

\end{document}

Preview of what this code is doing:

enter image description here

The last expression is ugly to my eyes, because of the minus sign. Is there a way to get something that matches the size of the other lines, like a smaller minus sign?

4
  • Use commas and be happy...
    – campa
    Mar 1 at 15:15
  • @campa, you mean $|\, 1, -1 \rangle$? It's still too large compared to others...
    – Cham
    Mar 1 at 15:20
  • 1
    amssymb has something which looks like a short minus tex.stackexchange.com/a/469724/82917
    – campa
    Mar 1 at 15:22
  • @campa, is there also a short plus?
    – Cham
    Mar 1 at 15:30

2 Answers 2

3

Perhaps not exactly what you want, but too long for a comment.

  • I suggest you use \DeclarePairedDelimiterX to keep the spacing on your ket uniform. You can write \ket00, but I recommend \ket{0}{0}.
  • You can add a phantom space to keep your kets aligned. Rather than squeezing a strange small + or - sign into your last line, I suggest you increase the spacing on the others.

enter image description here

\documentclass{article}
\usepackage{mathtools}

\DeclarePairedDelimiterX{\ket}[2]{\lvert}{\rangle}{\,{#1}\;{#2}\,}
\newcommand{\ps}{\phantom{+}}

\begin{document}

\begin{align}
    \ket{0}{\ps0} &=\frac{1}{\sqrt{2}} (\ket+- -\ket-+),\\
    \ket{1}{\ps1} &=\ket++,\\
    \ket{1}{\ps0} &=\frac{1}{\sqrt{2}} (\ket+- +\ket-+),\\
    \ket{1}{-1} &=\ket--.
\end{align}

\end{document}
1

I suggest to use a syntax such as \qs{a,b} so we can process the list. In this case, putting between any two items

\mathclose{}\;\;\mathopen{}

keeps the spacing right and -1 will be interpreted with unary minus.

\documentclass{article}
\usepackage{amsmath}

\ExplSyntaxOn
\NewDocumentCommand{\qs}{m}
 {
  \lvert
  \clist_use:nn {#1} {\mathclose{}\;\;\mathopen{}} 
  \rangle
}

\begin{document}

\begin{align}
\qs{0,0}  &= \frac{1}{\sqrt{2}}(\qs{+,-} - \qs{-,+}) \\
\qs{1,1}  &= \qs{+,+} \\
\qs{1,0}  &= \qs{+,-} - \qs{-,+} \\
\qs{1,-1} &= \qs{-,-}
\end{align}

\end{document}

enter image description here

If you prefer thin spaces at either end

\documentclass{article}
\usepackage{amsmath}

\ExplSyntaxOn
\NewDocumentCommand{\qs}{m}
 {
  \lvert\,
  \clist_use:nn {#1} {\mathclose{}\;\;\mathopen{}} 
  \,\rangle
}

\begin{document}

\begin{align}
\qs{0,0}  &= \frac{1}{\sqrt{2}}(\qs{+,-} - \qs{-,+}) \\
\qs{1,1}  &= \qs{+,+} \\
\qs{1,0}  &= \qs{+,-} - \qs{-,+} \\
\qs{1,-1} &= \qs{-,-}
\end{align}

\end{document}

enter image description here

You must log in to answer this question.

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