[Tex/LaTex] Problems with centering a border matrix

bordermatrixhorizontal alignment

I have the following code:

\begin{figure}[h!]
\centering
 \bordermatrix{~& \ket{\Phi_{0}} & \ket{S} & \ket{D} & \ket{T} & \ket{Q} & \dots \cr
 \bra{\Phi_{0}} & E_{0} & \textbf{0} & \dirint{\Phi_{0}}{\hat{H}}{D} & \textbf{0} & \textbf{0} & \dots \cr
 \bra{S} &  & \dirint{S}{\hat{H}}{S} & \dirint{S}{\hat{H}}{D} & \dirint{S}{\hat{H}}{T} & \textbf{0} & \dots \cr
 \bra{D} &  &  & \dirint{D}{\hat{H}}{D} & \dirint{D}{\hat{H}}{T} & \dirint{D}{\hat{H}}{Q} & \dots \cr
 \bra{T} &  &  &  & \dirint{T}{\hat{H}}{T} & \dirint{T}{\hat{H}}{Q} & \dots \cr
 \bra{Q} &  &  &  &  & \dirint{Q}{\hat{H}}{Q} & \dots \cr
 \vdots  &  &  &  &  &  & \ddots \cr}
\caption{Structure of the full-CI matrix. The matrix is hermitian, therefore, only the
upper triangle is shown. The multitudes of singly, doubly, triply, etc. excited determinants 
are denoted as \ket{S}, \ket{D}, \ket{T}, etc.}
\label{fig:FCI_mat}
\end{figure}

It compiles, but the matrix is not centered. Actually, removing \centering does not change the position of the matrix – it remains left aligned. Does anyone know how to put it in the centre?

Thanks!

Best Answer

Put \bordermatrix inside

\[
\]

and make it a display equation.

\documentclass{article}
\usepackage{amsmath,braket}
\newcommand{\dirint}{\int}    %% just for compiling, change it in your file
\begin{document}
  \begin{figure}[h!]
\[
 \bordermatrix{~& \ket{\Phi_{0}} & \ket{S} & \ket{D} & \ket{T} & \ket{Q} & \dots \cr
 \bra{\Phi_{0}} & E_{0} & \textbf{0} & \dirint{\Phi_{0}}{\hat{H}}{D} & \textbf{0} & \textbf{0} & \dots \cr
 \bra{S} &  & \dirint{S}{\hat{H}}{S} & \dirint{S}{\hat{H}}{D} & \dirint{S}{\hat{H}}{T} & \textbf{0} & \dots \cr
 \bra{D} &  &  & \dirint{D}{\hat{H}}{D} & \dirint{D}{\hat{H}}{T} & \dirint{D}{\hat{H}}{Q} & \dots \cr
 \bra{T} &  &  &  & \dirint{T}{\hat{H}}{T} & \dirint{T}{\hat{H}}{Q} & \dots \cr
 \bra{Q} &  &  &  &  & \dirint{Q}{\hat{H}}{Q} & \dots \cr
 \vdots  &  &  &  &  &  & \ddots \cr}
 \]
\caption{Structure of the full-CI matrix. The matrix is hermitian, therefore, only the
upper triangle is shown. The multitudes of singly, doubly, triply, etc. excited determinants
are denoted as $\ket{S}$, $\ket{D}$, $\ket{T}$, etc.}
\label{fig:FCI_mat}
\end{figure}
\end{document}

enter image description here

Related Question