OperatorToMatrix
M = OperatorToMatrix(H, …), takes operator H and returns a matrix representation of this operator M. Possible options are
-
M = OperatorToMatrix(H)
-
M = OperatorToMatrix(H,rho)
-
M = OperatorToMatrix(H,psi)
-
M = OperatorToMatrix(H,{psi_1,…,psi_n})
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 Mi,j=⟨ψi|H|ψj⟩. In this case the dimension of M is n with n the length of the table of states.