我正在写下面的方程,但我遇到一个问题,即同一方程的不同步骤的方程编号正在出现。
MWE 如下,
\documentclass{article}
\usepackage{mathtools, nccmath}
\usepackage{array}
\begin{document}
\begin{fleqn}
\begin{align}
& L_{B_{1} A_{1}} L_{B_{0} A_{0}}\left(\left|I_{1}\right\rangle\right) =L_{B_{1} A_{1}} L_{B_{0} A_{0}}\left(\frac{1}{2^{m}} \sum_{b=0}^{2^{m}-1} \sum_{a=0}^{2^{m}-1}\left|P_{b a}\right\rangle\left|b^{\prime}\right\rangle\left|a^{\prime}\right\rangle\right)\\
& =\frac{1}{2^{m}}\Biggl(\underset{b a \neq B_{0} A_{0}, B_{1} A_{1}}{\displaystyle\sum_{b=0}^{2^{m}-1} \sum_{a=0}^{2^{m}-1}}\left|P_{ba}\right\rangle\left|b^{\prime}\right\rangle\left|a^{\prime}\right\rangle \begin{aligned}[t] & +U_{B A}\left(\left|P_{B_{0} A_{0}}\right|\right)\left|B_{0} A_{0}\right\rangle\\
& +U_{B A}\left(\left|P_{B_{1} A_{1}}\right\rangle\right)\left|B_{1} A_{1}\right\rangle\Biggr)
\end{aligned}\\
& =\frac{1}{2^{m}}
\Biggl( \underset{b a \neq B_{0} A_{0}, B_{1} A_{1}}{\sum_{b=0}^{2^{m}-1} \sum_{a=0}^{2^{m}-1}}\hspace*{-0.5em}\left|P_{b a}\right\rangle\left|b^{\prime}\right\rangle\left|a^{\prime}\right\rangle
\begin{aligned}[t] &+\left|p_{B_{0} A_{0}}^{2} p_{B_{0} A_{0}}^{3^{\prime}} \cdots p_{B_{0} A_{0}}^{0^{\prime}} p_{B_{0} A_{0}}^{1^{\prime}}\right\rangle\left|B_{0} A_{0}\right\rangle \\
&+\left|p_{B_{1} A_{1}}^{2^{\prime}} p_{B_{1} A_{1}}^{3^{\prime}} \cdots p_{B_{1} A_{1}}^{0^{\prime}} p_{B_{1} A_{1}}^{1^{\prime}}\right\rangle\left|B_{1} A_{1}\right\rangle\Biggr)
\end{aligned}
\label{lb1a1}
\end{align}
\end{fleqn}
\end{document}
请有人帮我删除步骤中不必要的编号 (1) 和 (2)。
答案1
由于您希望获得单个方程编号,我建议您align
用一对嵌套的equation
和aligned
环境替换环境。我还希望\ket
尽快采用 -type 符号。
\documentclass{article}
\usepackage{mathtools} % for '\DeclarePairedDelimiter' macro
\DeclarePairedDelimiter\abs\lvert\rvert
\DeclarePairedDelimiter\ket\lvert\rangle
\begin{document}
\begin{equation}\label{lb1a1}
\begin{aligned}[b]
& L_{B_1 A_1} L_{B_0 A_0} (\ket{1})
=L_{B_1 A_1} L_{B_0 A_0}
\biggl( \frac{1}{2^m}
\sum_{b=0}^{2^m\mkern-2mu-1}
\sum_{a=0}^{2^m\mkern-2mu-1}
\ket{P_{b a}} \ket{b'} \ket{a'} \biggr)\\
&=
\begin{multlined}[t]
\frac{1}{2^m} \biggl(\,
\smash[b]{\underset{\mathclap{ba\neq B_0A_0, B_1A_1}}{
\sum_{b=0}^{2^m\mkern-2mu-1}
\sum_{a=0}^{2^m\mkern-2mu-1}}}
\ket{P_{ba}} \ket{b'} \ket{a'}
+U_{B A}(\abs{P_{B_0 A_0}})\ket{B_0 A_0}\\
+U_{B A}(\ket{P_{B_1 A_1}})\ket{B_1 A_1} \smash{\biggr)}
\end{multlined}\\
&=
\begin{multlined}[t]
\frac{1}{2^m} \biggl( \,
\smash[b]{\underset{\mathclap{ba\neq B_0A_0, B_1A_1}}{
\sum_{b=0}^{2^m\mkern-2mu-1}
\sum_{a=0}^{2^m\mkern-2mu-1}}}
\ket{P_{b a}} \ket{b'} \ket{a'}
+\ket[\big]{p_{B_0 A_0}^{2} p_{B_0 A_0}^{3'} \dots p_{B_0 A_0}^{0'} p_{B_0 A_0}^{1'}}
\ket[\big]{B_0 A_0} \\
+\ket[\big]{p_{B_1 A_1}^{2'} p_{B_1 A_1}^{3'} \dots p_{B_1 A_1}^{0'} p_{B_1 A_1}^{1'}}
\ket[\big]{B_1 A_1} \smash[t]{\biggr)}
\end{multlined}
\end{aligned}
\end{equation}
\end{document}
答案2
艰难的调整。
我会让第一行的宽度为零,这样我们就可以利用下一行的对称性并在符号=
和+
符号处对齐。
\documentclass{article}
\usepackage[tbtags]{mathtools}
\DeclarePairedDelimiter{\KET}{\lvert}{\rangle}
\NewDocumentCommand{\ket}{som}{%
\mathinner{%
\IfBooleanTF{#1}
{\KET*{#3}}
{\IfNoValueTF{#2}{\KET{#3}}{\KET[#2]{#3}}}%
}%
}
\begin{document}
\begin{alignat}{2}
& \lefteqn{
L_{B_{1} A_{1}} L_{B_{0} A_{0}}(\ket{I_{1}})
=L_{B_{1} A_{1}} L_{B_{0} A_{0}}\biggl(
\frac{1}{2^{m}}
\sum_{b=0}^{2^{m}-1}
\sum_{a=0}^{2^{m}-1}\ket{P_{b a}}\ket{b'}\ket{a'}
\biggr)
}
\notag
\\
&= \frac{1}{2^{m}}\biggl(
\smash[b]{
\underset{b a \neq B_{0} A_{0}, B_{1} A_{1}}{
\displaystyle\sum_{b=0}^{2^{m}-1} \sum_{a=0}^{2^{m}-1}
}
}
\hspace{-0.5em}
\ket{P_{ba}}\ket{b'}\ket{a'}
&&+ U_{B A}(\ket{P_{B_{0} A_{0}}})\ket{B_{0} A_{0}}
\notag
\\
& &&+ U_{B A}(\ket{P_{B_{1} A_{1}}})\ket{B_{1} A_{1}}
\biggr)
\notag
\\
&= \frac{1}{2^{m}}
\biggl(
\smash[b]{
\underset{b a \neq B_{0} A_{0}, B_{1} A_{1}}{
\displaystyle\sum_{b=0}^{2^{m}-1} \sum_{a=0}^{2^{m}-1}
}
}
\hspace{-0.5em}
\ket{P_{b a}}\ket{b'}\ket{a'}
&&+ \ket[\big]{
p_{B_{0} A_{0}}^{2} p_{B_{0} A_{0}}^{3'}
\cdots
p_{B_{0} A_{0}}^{0'} p_{B_{0} A_{0}}^{1'}
}
\ket{B_{0} A_{0}}
\notag
\\
& && +\ket[\big]{
p_{B_{1} A_{1}}^{2'} p_{B_{1} A_{1}}^{3'}
\cdots p_{B_{1} A_{1}}^{0'}
p_{B_{1} A_{1}}^{1'}
}
\ket{B_{1} A_{1}}
\biggr)
\label{lb1a1}
\end{alignat}
\end{document}
我定义了一个\ket
命令来避免\left
和的笨拙组合\right
。使用\mathinner
可确保两个 kets 之间有一点水平间距。
答案3
我\nonumber
在行尾插入,希望 LaTeX 在编号时跳过这些行。因此,您可以通过放置\nonumber
在第一行和第二行上来仅选择第三行进行编号。
\documentclass{article}
\usepackage{mathtools, nccmath}
\usepackage{array}
\begin{document}
\begin{fleqn}
\begin{align}
& L_{B_{1} A_{1}} L_{B_{0} A_{0}}\left(\left|I_{1}\right\rangle\right) =L_{B_{1} A_{1}} L_{B_{0} A_{0}}\left(\frac{1}{2^{m}} \sum_{b=0}^{2^{m}-1} \sum_{a=0}^{2^{m}-1}\left|P_{b a}\right\rangle\left|b^{\prime}\right\rangle\left|a^{\prime}\right\rangle\right) \nonumber\\
& =\frac{1}{2^{m}}\Biggl(\underset{b a \neq B_{0} A_{0}, B_{1} A_{1}}{\displaystyle\sum_{b=0}^{2^{m}-1} \sum_{a=0}^{2^{m}-1}}\left|P_{ba}\right\rangle\left|b^{\prime}\right\rangle\left|a^{\prime}\right\rangle \begin{aligned}[t] & +U_{B A}\left(\left|P_{B_{0} A_{0}}\right|\right)\left|B_{0} A_{0}\right\rangle\\
& +U_{B A}\left(\left|P_{B_{1} A_{1}}\right\rangle\right)\left|B_{1} A_{1}\right\rangle\Biggr)
\end{aligned} \nonumber \\
& =\frac{1}{2^{m}}
\Biggl( \underset{b a \neq B_{0} A_{0}, B_{1} A_{1}}{\sum_{b=0}^{2^{m}-1} \sum_{a=0}^{2^{m}-1}}\hspace*{-0.5em}\left|P_{b a}\right\rangle\left|b^{\prime}\right\rangle\left|a^{\prime}\right\rangle
\begin{aligned}[t] &+\left|p_{B_{0} A_{0}}^{2} p_{B_{0} A_{0}}^{3^{\prime}} \cdots p_{B_{0} A_{0}}^{0^{\prime}} p_{B_{0} A_{0}}^{1^{\prime}}\right\rangle\left|B_{0} A_{0}\right\rangle \\
&+\left|p_{B_{1} A_{1}}^{2^{\prime}} p_{B_{1} A_{1}}^{3^{\prime}} \cdots p_{B_{1} A_{1}}^{0^{\prime}} p_{B_{1} A_{1}}^{1^{\prime}}\right\rangle\left|B_{1} A_{1}\right\rangle\Biggr)
\end{aligned}
\label{lb1a1}
\end{align}
\end{fleqn}
\end{document}