OperatorToMatrix

M = OperatorToMatrix(H, …), takes operator $H$ and returns a matrix representation of this operator $M$. Possible options are

with rho a density matrix and psi a wave-function.

For the case there is no density matrix or state given the operator returned is given by the one particle part of $H$. The dimension of $M$ is $H.NF$.

For the case there is a density matrix given as second input the matrix $M$ is given by a mean-field approximated version of $H$. The dimension of $M$ is $H.NF$ and $H.NF$ must be equal to $psi.NF$.

For the case there is a single state $psi$ given as second input the matrix $M$ is given as an operator on the single Slater determinant basis used for $psi$. The dimension of $M$ is $psi.N$.

For the case there is a table of states given as second input the matrix $M$ is given by the elements $M_{i,j} = \langle \psi_i | H | \psi_j \rangle$. In this case the dimension of $M$ is $n$ with $n$ the length of the table of states.

Table of contents