加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

量子场论中的收缩算符在latex中的表示

(2009-12-24 17:36:21)
标签:

收缩算符

latex

量子场论

dan

schroeder

教育

 量子场论中的收缩算符在LATEX中可通过以下的宏表示,非常感谢原作者Dan Schroeder,只是推广。乱码是简单的使用说明;原因是采用编码UTF8,在latex中用\begin{CJK}{UTF8}{gbsn}就可以解决了。

% Macros for "contractions", by Dan Schroeder
% These are a total kludge--use at your own risk!

\newif\ifContLineOne
\newif\ifContLineTwo
\newif\ifContLineThree

% Macro to draw horizontal lines, continuing all contractions in progress.
% Parameter is the symbols to go underneath.  Lines have width .4pt and
% are separated by 3.2pt of space.  Bottom of lowest line is 14pt above baseline.
\def\conC#1{\vbox{\ialign{##\crcr
  \ifContLineThree\hrulefill\else\vphantom{\hrulefill}\fi\crcr
  \noalign{\kern3.2pt\nointerlineskip}
  \ifContLineTwo\hrulefill\else\vphantom{\hrulefill}\fi\crcr
  \noalign{\kern3.2pt\nointerlineskip}
  \ifContLineOne\hrulefill\else\vphantom{\hrulefill}\fi\crcr
  \noalign{\nointerlineskip}
  $\hfil\textstyle{\vbox to 14pt{}#1}\hfil$\crcr}}}

% Internal macro to draw vertical legs.  dimen2 is height of
% bottom of leg.  The initial value of dimen3+(#2*dimen4) is height
% of top of leg, and must be adjusted if these macros are used under
% different vertical spacing conditions.
\def\DrawLeg#1#2{
  \kern-.2pt              % back up half width of leg
  \dimen2 =#1             % =height of whatever is underneath leg
  \advance\dimen2 by 2pt  % 2pt space below bottom of leg
  \dimen3 = 10.6pt        % base value of height of top of leg
  \dimen4 =3.6pt          % add this much time 1 2 or 3 to base value
  \advance\dimen3 by -\dimen2
  \multiply\dimen4 by #2
  \advance\dimen3 by \dimen4
  \raise\dimen2 \hbox{\vrule height\dimen3 width .4pt} % draw it
  \kern-.2pt}             % and back up half width of line

% Macro to begin a new contraction.  First parameter is height or level
% (1, 2, or 3); second parameter is the symbol(s) to go underneath
\def\begC#1#2{\setbox0 =\hbox{$\textstyle{#2}$}
  \dimen0=.5\wd0 \dimen1=\ht0
  \conC{\hskip\dimen0}
  \count255=#1
  \ifnum\count255 =1 \ContLineOnetrue\else
  \ifnum\count255 =2 \ContLineTwotrue\else
  \ifnum\count255 =3 \ContLineThreetrue\fi\fi\fi
  \DrawLeg{\dimen1}{\count255}
  \conC{\hskip\dimen0}
  \kern-\dimen0\kern-\dimen0 \box0}

% Macro to end a contraction; same parameters as \begC.
\def\endC#1#2{\setbox0 =\hbox{$\textstyle{#2}$}
  \dimen0=.5\wd0 \dimen1=\ht0
  \conC{\hskip\dimen0}
  \count255=#1
  \ifnum\count255 =1 \ContLineOnefalse\else
  \ifnum\count255 =2 \ContLineTwofalse\else
  \ifnum\count255 =3 \ContLineThreefalse\fi\fi\fi
  \DrawLeg{\dimen1}{\count255}
  \conC{\hskip\dimen0}
  \kern-\dimen0\kern-\dimen0 \box0}

\def\backskip{\vskip -3.6pt}  % useful for eating up extra space
% when an equation has only first- or second-level contractions
\def\bbackskip{\vskip -7.2pt}

% Examples
Here's a simple contraction using only the first (lowest) level:
\bbackskip
$$
\begC1{\phi_1}\conC{\phi_2\phi_3}\endC1{\phi_4}
$$

And here's a complicated example using all three levels:
$$
\langle0|\, \begC2{\phi(x)}\begC3{\phi(y)}\conC{\,{1\over3!}
  \bigl({-i\lambda\over4!}\bigr)^3\int\!d^4z\,}\endC2{\phi}\begC1{\phi}
  \endC1\phi\begC1\phi\conC{\,\int\!d^4w\,}\endC1\phi\begC2\phi
  \begC1\phi\endC3\phi\conC{\,\int\!d^4u\,}\endC1\phi\endC2\phi
  \begC1\phi\endC1\phi\,|0\rangle
$$

%\bye

鏀剁缉绠楃鐢ㄦ硶锛?\backslash begC*\{\} $鍜?$\backslash endC*\{\}$鏍囩ず鏀剁缉鐨勭畻绗︾殑涓ょ锛屼腑闂寸殑閮ㄥ垎濡傛灉涓嶅寘鎷湪浠绘剰涓€涓敹缂╃畻绗︾殑鎷彿涓紝闇€瑕佺敤\conC{}鎷捣鏉ワ紝鍚﹀垯鏀剁缉绠楃妯嚎鍑虹幇闂存柇銆傛瘮杈

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有