
Estoy escribiendo sobre tensores en este momento y tengo que describir la fusión de dos estados en un solo tensor. Ahora mismo tengo algo que se parece a esto:
con el siguiente código:
\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}
Un par de cosas me molestan.
- Las llaves no se ajustan a las matrices. (Lo intenté
\left(
y\right)
, pero eso no funciona... - Lo peor de todo es que no consigo que las columnas se alineen verticalmente (Preferiblemente centradas)
Ya intenté todo lo que se me ocurrió, pero simplemente no puedo lograrlo... Si alguien tiene una sugerencia, ¡por favor comente!
Respuesta1
Podrías usar un 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}
Respuesta2
Sugiero sacar los textos de la ecuación, donde no pertenecen.
La alineación se puede conseguir con algunos trucos basados enIEEEeqnarray
.
\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}
Agregué los escalares en la última fila, elimínelos si lo cree mejor.
Los tipos de columnas son
r
para una columna alineada a la derechac
para una columna centradal
para una columna alineada a la izquierdaC
para una columna centrada con un operador o relación binaria
En lugar de \mathrlap
(hacer un cuadro de ancho cero con contenido que sobresalga hacia la derecha) y \mathllap
(similar para la izquierda), podría haber usado \IEEEeqnarraymulticol
, pero eso es un bocado.