# How to break a matrix up

I wish to reproduce the following matrix If I wanted to just produce one quadrent, I would do the following:

$$H_{SOC} = \left[ \begin{array}{ccc|cc} 0 & -i & i & \sqrt{3} & -1 \\ i & 0 & -1 & -i\sqrt{3} & -i \\ -i & -1 & 0 & 0 & -2i \\ \hline \sqrt{3} & i\sqrt{3} & 0 & 0 & 0 \\ -1 & i & 2i & 0 & 0 \end{array} \right]$$


How would I generalize this to achieve the above matrix?

• Welcome to TeX.SE! Commented Aug 5 at 20:46
• You can find several examples of partitioned matrix here. Commented Aug 5 at 21:09

This would just be a large matrix (array) with 2 sub-matrices (also arrays).

\documentclass{article}

\begin{document}

$$A = \left( \begin{array}{ c | c } % Upper left matrix \begin{array}{ c c c | c c } 0 & -i & i & \sqrt{3} & -1 \\ i & 0 & -1 & -i\sqrt{3} & -i \\ -i & -1 & 0 & 0 & -2i \\ \hline \sqrt{3} & i\sqrt{3} & 0 & 0 & 0 \\ -1 & i & 2i & 0 & 0 \end{array} & % Upper right matrix 0 \\ \hline % Lower left matrix 0 & % Lower right matrix \begin{array}{ c c c | c c } 0 & i & i & -\sqrt{3} & 1 \\ -i & 0 & 1 & -i\sqrt{3} & -i \\ -i & 1 & 0 & 0 & 2i \\ \hline -\sqrt{3} & i\sqrt{3} & 0 & 0 & 0 \\ 1 & i & -2i & 0 & 0 \end{array} \end{array} \right)$$

\end{document}


Since an array necessarily has a centred vertical anchor point, the singular matrices 0 (top right and bottom left) all align vertically centred.

• Wow I never knew you could put an array inside of an array. Thank you. Commented Aug 6 at 0:35
• +1. :-) The only thing I'd consider modifying is replacing \begin{array}{ c | c } with \begin{array}{ @{} c | c @{} } and replacing both instances of \begin{array}{ c c c | c c } with \begin{array}{ @{} c c c | c c @{} }. Doing so would save quite a bit of horizontal whitespace and would make the overall expression look more compact. For sure, though, this is a purely aesthetic point.
– Mico
Commented Aug 6 at 5:43