# Tutorial:full DMRG

## Contents

### The one dimensional Heisenberg chain

The first example in the parameter file dmrg/parms sets up a spin-1/2 Heisenberg chain with 10 sites, and open boundary conditions:

LATTICE="open chain lattice" SWEEPS=4 MAXSTATES=100 CONSERVED_QUANTUMNUMBERS="N,Sz" { MODEL="spin", L=10, Sz_total=0 J=1, h=3.0 NUMBER_EIGENVALUES=2 MEASURE_AVERAGE[Magnetization]=Sz MEASURE_AVERAGE[Exchange]=exchange MEASURE_LOCAL[Local magnetization]=Sz MEASURE_CORRELATIONS[Diagonal spin correlations]=Sz MEASURE_CORRELATIONS[Offdiagonal spin correlations]="Splus:Sminus" }

Using the following sequence of commands you can first convert the input parameters to XML and then run the application dmrg:

parameter2xml parm1 dmrg parm1.in.xml

The outputfiles parm1.task1.out.xml contain all the computed quantities and can be viewed with a standard internet browser.

DMRG will perform four sweeps, (four half-sweps from left to right and four half-sweeps from right to left) growing the basis in steps of MAXSTATES/(2*SWEEPS) until reaching the MAXSTATES=100 value we have declared. This is a convenient default option, but the number of states can be customized, as we show in the hardcore boson example below.

We have requested 2 eigenvalues, corresponding to the ground state, and first excited state with Sz_total = 0. We have added a magnetic field (Zeeman term) of magnitude h=3.0 for demonstration purposes, although this term will have no effect in this subspace. We invite the reader to relax the constrain in the Sz quantum number by removing "Sz_total=0" from the parameters list. Running increasing values of the magnetic field h in the grand canonical ensemble should show dicrete jumps in the magnetization as the system moves through different subspaces. An easy way to implement this calculation in a single file is by using the following parameter list:

LATTICE="open chain lattice" SWEEPS=4 MAXSTATES=100 CONSERVED_QUANTUMNUMBERS="Sz" MODEL="spin", L=10 J=1 MEASURE_AVERAGE[Magnetization]=Sz { h=0.0 } { h=0.5 } { h=1.0 } { h=1.5 } { h=2.0 } { h=2.5 } { h=3.0 } { h=3.5 } { h=4.0 } { h=4.5 }

Using the following sequence of commands you can first convert the input parameters to XML and then run the application dmrg for all these values of the field h:

parameter2xml parm2 dmrg parm2.in.xml

### The S=1 Heisenberg chain

The second example included in parms corresponds to a spin-1 Heisenberg chain of length 10. It can be seen, comparing to the previous example, that the only difference is the addition of a new line "local_S=1".

{ MODEL="spin", L=10, Sz_total=0 J=1, h=0.0 local_S=1 NUMBER_EIGENVALUES=2 MEASURE_AVERAGE[Magnetization]=Sz MEASURE_AVERAGE[Exchange]=exchange MEASURE_LOCAL[Local magnetization]=Sz MEASURE_CORRELATIONS[Diagonal spin correlations]=Sz MEASURE_CORRELATIONS[Offdiagonal spin correlations]="Splus:Sminus" }

Using the following sequence of commands you can first convert the input parameters to XML and then run the application dmrg:

parameter2xml parm3 dmrg parm3.in.xml

The first excited state of an open chain will correspond to edge excitations and will not give the actual Haldane gap. In order to calculate the singlet-triplet gap, a second simulation in the Sz_total=1 sector is needed. This is left as an exercise for the reader.

### The S=1/2 Heisenberg ladder

The third example included in parms corresponds to a spin-1/2 Heisenberg ladder of length 10.

{ MODEL="spin" LATTICE="open ladder" local_S=1/2 Sz_total=0 L=10 J0=1 J1=1 h=0 MEASURE_AVERAGE[Magnetization]=Sz MEASURE_AVERAGE[Exchange]=exchange MEASURE_LOCAL[Local magnetization]=Sz MEASURE_CORRELATIONS[Diagonal spin correlations]=Sz MEASURE_CORRELATIONS[Offdiagonal spin correlations]="Splus:Sminus" }

J and J' denotes the coupling strength along the legs and on the rungs of the ladder respectively.

Again, using the following sequence of commands you can first convert the input parameters to XML and then run the application dmrg:

parameter2xml parm4 dmrg parm4.in.xml

### Hardcore bosons in 1d

The fourth example will calculate the ground state of a model of interacting hardcore bosons on a 1d chain of length L=10.

{ MODEL="hardcore boson", L=10, N_total=2 SWEEPS=5 STATES="20,20,40,40,60,60,80,80,100,100" V=1.3 mu=0.4 }

Since the total number of sweeps was set to SWEEPS=5, DMRG will perform 5 half sweps from left to right, and 5 half-sweeps from right to left. The list of 10 values in STATES specifies the number of states used for each DMRG half-sweep.

The result will be lowest energy eigenstate in the N_total=2 sector, with interaction V=1.3, and chemical potential mu=0.4. Since we are working in a subspace with a well defined number of particles, the chemical potential will have no effect. This is identical to the Heisenberg chain example. If we want to work in the grand canonical ensemble, we need to remove "N_total=2" from the list of parameters.

Again, using the following sequence of commands you can first convert the input parameters to XML and then run the application dmrg:

parameter2xml parm5 dmrg parm5.in.xml