joselado / dmrgpy

DMRGPy is a Python library to compute quasi-one-dimensional spin chains and fermionic systems using matrix product states with DMRG as implemented in ITensor. Most of the computations can be performed both with DMRG and exact diagonalization for small systems, which allows one to benchmark the results.
GNU General Public License v3.0
87 stars 20 forks source link

Spin model #17

Closed gaoyl16 closed 1 year ago

gaoyl16 commented 1 year ago

Hello,

I am working on Heisenberg spin chain, I am wondering if there is a way to get the spectrum in a particular total spin sector, i.e. (select from the full spectrum where the corresponding eigenstates give a particular total spin)? Another question I have how to calculate expectation value of an operator in excited states using "sc.vev"? Thank you.

joselado commented 1 year ago

Dear gaoyl16,

thanks for the message. The code does not have number conservation (namely, it works all the time in the full space), but you could get the states in each sector by applying a Lagrange multiplier to the Hamiltonian as a magnetic field.

You can compute any expectation value for any state just by writing

wf.dot(A*wf)

where wf is the wavefunction and A is the operator

Best regards, Jose

gaoyl16 commented 1 year ago

Hello,

I am wondering if you could specify how the Lagrange multiplier term in the Hamiltonian looks like (For example, in the Heisenberg model)? Also, I would like to get the wave function of an excited states. For example, es,ws=sc.get_excited_states(mode="DMRG", n=8), how could I get the wave function for 2nd excited state, is it just ws[:,2]?

joselado commented 1 year ago

Dear gaoyl16,

you can add the Lagrange multiplier as an external magnetic field, for example as

H = H0 + B*sum(sc.Sz)

where H0 is your original Hamiltonian and B is the value of the multiplier. Adding this term to the Hamiltonian shifts the energies of different sectors, so you can access the lowest states for Sz=0, Sz=1.. for different values of B.

For the excites states calculations you mentioned es,ws=sc.get_excited_states(mode="DMRG", n=8)

ws[0] would be the ground state, ws[1] the first excited, ws[2] the second excited (and as many as were requested).

Best regards, Jose