[Tex/LaTex] Simple newline in equation

equationsline-breaking

I'm trying to line-break in the middle of a series of defined matrices. The code looks like:

\begin{equation}
I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix},
X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix},
Y = \begin{pmatrix} 0 & \imath \\ -\imath & 0 \end{pmatrix}, \\ 
Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix},
H = \frac{1}{\sqrt2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix},
S = \begin{pmatrix} 1 & 0 \\ 0 & \imath \end{pmatrix}.
\end{equation}

However the matrices appear all in one line.

Best Answer

To elaborate on Argos suggestion. In this case I'd use

\begin{gather*}
I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \quad
X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \quad
Y = \begin{pmatrix} 0 & \imath \\ -\imath & 0 \end{pmatrix}, \\ 
Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}, \quad
H = \frac{1}{\sqrt2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}, \quad
S = \begin{pmatrix} 1 & 0 \\ 0 & \imath \end{pmatrix}.
\end{gather*}

no numbering and better space

Alignment and a single number

\begin{gather}
\begin{aligned}
I &= \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix},  
  & % seperation
X &= \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, 
  &
Y &= \begin{pmatrix} 0 & \imath \\ -\imath & 0 \end{pmatrix}, 
 \\ 
Z &= \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}, 
  &
H &= \frac{1}{\sqrt2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}, 
  &
S &= \begin{pmatrix} 1 & 0 \\ 0 & \imath \end{pmatrix}.
\end{aligned}
\end{gather}

Please see the amsmath manual for for details

The two examples will look like this:

enter image description here