3

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

\begin{equation}
    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]
\end{equation}

How would I generalize this to achieve the above matrix?

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

1 Answer 1

8

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

enter image description here

\documentclass{article}

\begin{document}

\begin{equation}
  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{equation}

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

2
  • Wow I never knew you could put an array inside of an array. Thank you.
    – WaterDrop
    Commented Aug 6 at 0:35
  • 2
    +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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .