
私は今テンソルについて書いていて、2 つの状態を 1 つのテンソルにマージする方法について記述する必要があります。現在、次のようなものがあります。
次のコードを使用します:
\begin{align}
& r \begin{bmatrix} 1 \\ 0 \end{bmatrix} \otimes \begin{bmatrix} 1 \\ 0 \end{bmatrix} + & s \begin{bmatrix} 1 \\ 0 \end{bmatrix} \otimes \begin{bmatrix} 0 \\ 1 \end{bmatrix} + & t \begin{bmatrix} 0 \\ 1 \end{bmatrix} \otimes \begin{bmatrix} 1 \\ 0 \end{bmatrix} + & u \begin{bmatrix} 0 \\ 1 \end{bmatrix} \otimes \begin{bmatrix} 0 \\ 1 \end{bmatrix} \\
\text{with the basis} & \biggr(\begin{bmatrix} 1 \\ 0 \end{bmatrix} \otimes \begin{bmatrix} 1 \\ 0 \end{bmatrix}, & \begin{bmatrix} 1 \\ 0 \end{bmatrix} \otimes \begin{bmatrix} 0 \\ 1 \end{bmatrix}, & \begin{bmatrix} 0 \\ 1 \end{bmatrix} \otimes \begin{bmatrix} 1 \\ 0 \end{bmatrix}, & \begin{bmatrix} 0 \\ 1 \end{bmatrix} \otimes \begin{bmatrix} 0 \\ 1 \end{bmatrix}\biggr) \\
\text{can be written as} & \Biggr(\begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix}, & \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix}, & \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix}, & \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \end{bmatrix}\Biggr)
\end{align}
いくつか気になることがあります。
- 中括弧が行列に適合しません。(
\left(
とを試しましたが\right)
、うまくいきませんでした...) - 最悪なのは、列を垂直に揃えることができないことです(できれば中央揃えに)。
考えられる限りのことはすべて試しましたが、どうしてもそこに到達できません... 何か提案があれば、コメントしてください!
答え1
次を使用できますarray
:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\setlength{\arraycolsep}{0pt}
\begin{array}{ r c c c c c c c l }
r &
\begin{bmatrix} 1 \\ 0 \end{bmatrix} \otimes \begin{bmatrix} 1 \\ 0 \end{bmatrix} &
{} + s &
\begin{bmatrix} 1 \\ 0 \end{bmatrix} \otimes \begin{bmatrix} 0 \\ 1 \end{bmatrix} &
{} + t &
\begin{bmatrix} 0 \\ 1 \end{bmatrix} \otimes \begin{bmatrix} 1 \\ 0 \end{bmatrix} &
{} + u &
\begin{bmatrix} 0 \\ 1 \end{bmatrix} \otimes \begin{bmatrix} 0 \\ 1 \end{bmatrix} &
\\[10pt]
\text{with the basis}\:\biggr( &
\begin{bmatrix} 1 \\ 0 \end{bmatrix} \otimes \begin{bmatrix} 1 \\ 0 \end{bmatrix} &
, &
\begin{bmatrix} 1 \\ 0 \end{bmatrix} \otimes \begin{bmatrix} 0 \\ 1 \end{bmatrix} &
, &
\begin{bmatrix} 0 \\ 1 \end{bmatrix} \otimes \begin{bmatrix} 1 \\ 0 \end{bmatrix} &
, &
\begin{bmatrix} 0 \\ 1 \end{bmatrix} \otimes \begin{bmatrix} 0 \\ 1 \end{bmatrix} &
\biggr) \\[10pt]
\text{can be written as}\:\Biggr( &
\begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} &
, &
\begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix} &
, &
\begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix} &
, &
\begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \end{bmatrix} &
\Biggr)
\end{array}
\]
\end{document}
答え2
方程式に含まれていないテキストを方程式から削除することをお勧めします。
アライメントは、いくつかのトリックに基づいて取得できます。IEEEeqnarray
。
\documentclass{article}
\usepackage{mathtools}
\usepackage{IEEEtrantools}
\newcommand{\colv}[1]{\begin{bmatrix}#1\end{bmatrix}}
\begin{document}
The tensor
\begin{IEEEeqnarray}{rcCrcCrcCrcl}
r & \colv{1 \\ 0} \otimes \colv{1 \\ 0} & + &
s & \colv{1 \\ 0} \otimes \colv{0 \\ 1} & + &
t & \colv{0 \\ 1} \otimes \colv{1 \\ 0} & + &
u & \colv{0 \\ 1} \otimes \colv{0 \\ 1}
\\
\noalign{\vspace{2\jot}}
\noalign{\noindent with the basis}
\noalign{\vspace{4\jot}}
\biggr( &
\colv{1 \\ 0} \otimes \colv{1 \\ 0}\mathrlap{,} &&&
\colv{1 \\ 0} \otimes \colv{0 \\ 1}\mathrlap{,} &&&
\colv{0 \\ 1} \otimes \colv{1 \\ 0}\mathrlap{,} &&&
\colv{0 \\ 1} \otimes \colv{0 \\ 1} &
\biggr)
\\
\noalign{\vspace{2\jot}}
\noalign{\noindent can be written as}
\noalign{\vspace{4\jot}}
\left(\vphantom{\colv{0\\0\\0\\0}}\right.\kern-\nulldelimiterspace &
\mathllap{r}
\colv{1 \\ 0 \\ 0 \\ 0}\mathrlap{,} &&&
\mathllap{s}
\colv{0 \\ 1 \\ 0 \\ 0}\mathrlap{,} &&&
\mathllap{t}
\colv{0 \\ 0 \\ 1 \\ 0}\mathrlap{,} &&&
\mathllap{u}
\colv{0 \\ 0 \\ 0 \\ 1} &
\left)\vphantom{\colv{0\\0\\0\\0}}\right.\kern-\nulldelimiterspace
\end{IEEEeqnarray}
\end{document}
最後の行にスカラーを追加しました。削除したほうがよいと思われる場合は削除してください。
列の種類は
r
右揃えの列の場合c
中央揃えの列の場合l
左揃えの列の場合C
バイナリ演算子または関係を持つ中央揃えの列の場合
\mathrlap
(コンテンツが右に突き出た幅ゼロのボックスを作成する) と(左にも同様) の代わり\mathllap
に を使用することもできました\IEEEeqnarraymulticol
が、それは長いです。