+1 vote
asked by (170 points)

i am trying to calculate the ground state energy of a two leg ladder model by DMRG method using ITensor(Julia), but i have some doubts regarding this. the questions are as follows.

a)How to introduce the electron density parameter in the code ? For example : At Half filling of 1D Hubbard model(Spin-1/2 electrons) the electron density is 1/2. ( I know one can calculate total no. of electrons from electron density ,put it in the initial state of the code and keep the filling quantum number fixed, but i am asking can i put the electron density parameter directly in the code?)

b) Is there anyway to calculate the expectation values("Sz" or "Ntot" or anyother ) after each sweep rather then after all sweeps?

Sorry if i have asked very basic questions.



1 Answer

+1 vote
answered by (70.1k points)

Hi Paban,
Thanks for the good questions.

a) for the filling you have two options: the main one is to use our quantum number (QN) conservation system, which works as you guessed: if you use site indices (calling the siteinds function) with the conserve_qns=true, then when you prepare the initial state for DMRG, the number of particles in that initial state will remain unchanged by our DMRG code.

If you turn off or do not conserve particle number, then you would have to add a chemical potential term to your Hamiltonian or otherwise tune your Hamiltonian to get the density that you want.

b) for making custom measurements or other behaviors during a DMRG calculation, we have a very powerful system called the "Observer System" where you define a custom type and a function called measure! for it that will be called throughout the DMRG code (if you pass your observer type to the dmrg function). Then in your measure! function you can put any code you want, such as measuring local observables, calling the expect function to measure every site (I would do this only once per sweep, since it's a global measurement), write data to files, and anything else. Please let us know if you have any questions about how to use it.

Best regards,

Welcome to ITensor Support Q&A, where you can ask questions and receive answers from other members of the community.

Formatting Tips:
  • To format code, indent by four spaces
  • To format inline LaTeX, surround it by @@ on both sides
  • To format LaTeX on its own line, surround it by $$ above and below
  • For LaTeX, it may be necessary to backslash-escape underscore characters to obtain proper formatting. So for example writing \sum\_i to represent a sum over i.
If you cannot register due to firewall issues (e.g. you cannot see the capcha box) please email Miles Stoudenmire to ask for an account.

To report ITensor bugs, please use the issue tracker.