Gleichungen vertikal ausrichten mit der Align-Umgebung

Gleichungen vertikal ausrichten mit der Align-Umgebung

Ich schreibe gerade über Tensoren und muss die Verschmelzung zweier Zustände zu einem einzigen Tensor beschreiben. Im Moment habe ich etwas, das so aussieht: Bildbeschreibung hier eingeben mit folgendem Code:

\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}

Ein paar Dinge stören mich.

  • Die Klammern passen nicht zu den Matrizen. (Ich habe es mit \left(und versucht \right), aber das funktioniert nicht ...
  • Am schlimmsten ist, dass ich die Spalten nicht vertikal ausrichten kann (vorzugsweise zentriert).

Vielleicht so etwas: Bildbeschreibung hier eingeben

Ich habe schon alles mögliche probiert, aber ich komme einfach nicht weiter... Wenn jemand einen Vorschlag hat, bitte einen Kommentar hinterlassen!

Antwort1

Sie könnten Folgendes verwenden 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}

Bildbeschreibung hier eingeben

Antwort2

Ich schlage vor, die Texte aus der Gleichung zu ziehen, in die sie nicht gehören.

Die Ausrichtung kann mit einigen Tricks erreicht werden, basierend aufIEEEeqnarray.

\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}

Bildbeschreibung hier eingeben

Ich habe die Skalare in der letzten Reihe hinzugefügt. Entfernen Sie sie, wenn Sie es für besser halten.

Die Spaltentypen sind

  • rfür eine rechtsbündige Spalte
  • cfür eine zentrierte Spalte
  • lfür eine linksbündige Spalte
  • Cfür eine zentrierte Spalte mit einem binären Operator oder einer binären Relation

Anstatt von \mathrlap(eine Box mit der Breite Null erstellen, deren Inhalt nach rechts hervorsteht) und \mathllap(ähnlich für links) hätte ich verwenden können \IEEEeqnarraymulticol, aber das ist ganz schön viel.

verwandte Informationen