支架环境中的加/减有何不同?

支架环境中的加/减有何不同?

我正在使用 brackett 符号编写物理报告(使用 brackett 包)。在 ket 或 bra 中写加号和减号看起来非常丑陋(bra 是 < | 而 ket 是 | > )有什么想法可以让它看起来更好?有这样的一行:

|1,-1>=<--|1, -1>|-->+<-+|1, -1>|-+>+<+-|1, -1>|+ -> etc

在 pdf 中很难读懂,因为括号符号内部和外部的加号/减号无法区分。这个想法是,更小或更小的仅在括号符号内使用更粗的加号/减号会使其更具可读性,但我不知道是否存在这样的符号。我必须手动创建它吗?我想避免这种情况,因为它会严重降低我的打字速度,即使使用快捷方式也是如此。

答案1

我不太确定内部的+和要使用什么字体-,所以我只使用了\hbox{\texttt{+}}。在 TeX 中,每个字符都有一个\mathcode,描述其在数学中的行为。除了特殊的数学代码,它们都位于和之间"0000"7FFF十六进制),这使得字符表现得像一个活动字符。在和定义的"8000组中,我得到和处于活动状态并扩展为和。\bra\ket\braket+-\braket@inner@minus\braket@inner@plus

\documentclass{article}
\usepackage{braket}

\makeatletter
\newcommand{\braket@inner@minus}{\hbox{\texttt{-}}}
\newcommand{\braket@inner@plus}{\hbox{\texttt{+}}}
\begingroup
\catcode`\-=13\relax %active
\catcode`\+=13\relax %active
\@firstofone{\endgroup %end the local changes to catcodes.
  \newcommand\braket@inner@defs{%
    \edef\restore@mathcode{%
      \mathcode`\noexpand +=\the\mathcode`+%
      \mathcode`\noexpand -=\the\mathcode`-%
    }%
    \mathcode`\+="8000\relax
    \mathcode`\-="8000\relax
    \def+{\begingroup\restore@mathcode\braket@inner@plus\endgroup}%
    \def-{\begingroup\restore@mathcode\braket@inner@minus\endgroup}%
  }%
}
% old definition:
% \newcommand{\bra}[1]{\mathinner {\langle {#1}|}}
% new definition:
\renewcommand{\bra}[1]{\mathinner {\langle \braket@inner@defs {#1}|}}
\renewcommand{\ket}[1]{\mathinner {|\braket@inner@defs{#1}\rangle }}
\renewcommand{\braket}[1]{\mathinner {\langle \braket@inner@defs {#1}\rangle }}
\makeatother

\begin{document}
\[
\bra{++--}A^\dag A\ket{-+-+} = \braket{++--|A^\dag A|-+-+} = \cdots
\]
However, 
\[
\bra{++}(A+B)\ket{--} \neq \braket{++|(A+B)|--}
\]
\end{document}

答案2

假设我理解了 dingo_d 所说的内容:

$$
  \def\bra#1{\left\langle\raise.3ex\hbox{$\scriptscriptstyle#1$}\right|}
  \def\ket#1{\left|\raise.3ex\hbox{$\scriptscriptstyle#1$}\right\rangle}
  \left|1,-1\right\rangle = \bra{--}1,-1\rangle\ket{--} +
    \bra{-+}1,-1\rangle\ket{-+} +
    \bra{+-}1,-1\rangle\ket{+-}
$$
\bye

在此处输入图片描述

我的眼睛很痛... :-(
我把 .3ex 从帽子上扔了下来。如果有帮助的话,那是一顶很漂亮的帽子。

答案3

当我想在 QM 中用括号表示法写一些东西时,我会使用 \langle 和 \rangle,看起来很好,你可以将它与简单的 | 符号结合起来。

呼呼^^

相关内容