Skip to content

v5.1.1.1 - Fix DMRG_MEASURE <Sz> <SiSj> - #1

Open
ricardojclopes wants to merge 1 commit into
mainfrom
iFix_MEAS_Sz_SiSj
Open

v5.1.1.1 - Fix DMRG_MEASURE <Sz> <SiSj>#1
ricardojclopes wants to merge 1 commit into
mainfrom
iFix_MEAS_Sz_SiSj

Conversation

@ricardojclopes

Copy link
Copy Markdown
Collaborator

Branch created to fix the MEASURE process for the spin problem.

  • Problem observed in all cases. Infinite OBC (solved)
    Infinite PBC (still under analysis)
    Finite OBC (still under analysis)
    Finite PBC (still under analysis)

FIX FOR THE INFINITE OBC CASE

ERROR REPORTED:
At line 384 of file $LIB_DIR/nssDMRG/src/DMRG_MEASURE.f90 Fortran runtime error: Index '#' of dimension 1 of array 'b2gmap' above upper bound of (#-1)

Important: This array reappear around line 500


FIX:

  • Line 384:
    i=b2gMap(pos) ; if(pos>L)i=b2gMap(N+1-pos)

This error appear in the Measure process for and because the 'b2gMap' array is allocated with size equal to Ldmrg.
However, the 'pos' integer variable goes from 1 to 2*Ldmrg.

So, the previous construction can exceed the index for 'b2gMap' before the IF case. As a simple solution, I simply added a new integer variable, called 'pos_aux', and used the IF case to properly define the value of 'pos_aux' and use it as the index for 'b2gMap' The changes are as follow:

INTEGER:: pos_aux
!(...)
pos_aux=pos
if(pos>L)pos_aux=N+1-pos
i=b2gMap(pos_aux)


FIX FOR THE INFINITE PBC CASE

ERROR REPORTED:
Note: The following floating-point exceptions are signalling: IEEE_DIVIDE_BY_ZERO IEEE_UNDERFLOW_FLAG IEEE_DENORMAL
get_op_operators_list error: key not found15

This error prevents the calculation of .


FIX:



FIX FOR THE FINITE OBC CASE

ERROR REPORTED:
At line 387 of file $LIB_DIR/nssDMRG/src/DMRG_MEASURE.f90 Fortran runtime error: Index '17' of dimension 1 of array 'b2gmap' above upper bound of 16

This error, although it seems similar to the first case, is slightly different. It arises because in the finite case, when the system growth ends, let's say of size L, the library adds an extra dot, that is, a dot L+1, causing the b2gMap array always to be 1 site smaller than the actual size of the lattice in the finite case.

To fix this, there are 2 possibilities.

(i) Redefine the size of the b2gMap array to L+1 for the finite algorithm, taking into account the implications of this change in the operator's recovery during the measurement process.

(ii) End the growth of the finite algorithm with 1 site less (L-1), so that the extra step of adding a site to perform the finite algorithm corresponds to the actual exact size of b2gMap.


FIX:



FIX FOR THE FINITE PBC CASE

ERROR REPORTED:


FIX:

Branch created to fix the MEASURE process for the spin problem.

- Problem observed in all cases.
Infinite OBC (solved)
Infinite PBC (still under analysis)
Finite OBC (still under analysis)
Finite PBC (still under analysis)

---------------------------------------
FIX FOR THE INFINITE OBC CASE
---------------------------------------
ERROR REPORTED:
At line 384 of file $LIB_DIR/nssDMRG/src/DMRG_MEASURE.f90
Fortran runtime error: Index '#' of dimension 1 of array 'b2gmap' above upper bound of (#-1)

Important: This array reappear around line 500

---------------------------------------
FIX:
- Line 384:
	i=b2gMap(pos)    ; if(pos>L)i=b2gMap(N+1-pos)

This error appear in the Measure process for <Sz> and <SiSj> because the 'b2gMap' array is
allocated with size equal to Ldmrg.
However, the 'pos' integer variable goes from 1 to 2*Ldmrg.

So, the previous construction can exceed the index for 'b2gMap' before the IF case.
As a simple solution, I simply added a new integer variable, called 'pos_aux', and used the IF
case to properly define the value of 'pos_aux' and use it as the index for 'b2gMap'
The changes are as follow:

	INTEGER:: pos_aux
	!(...)
	pos_aux=pos
	if(pos>L)pos_aux=N+1-pos
	i=b2gMap(pos_aux)

---------------------------------------
---------------------------------------
FIX FOR THE INFINITE PBC CASE
---------------------------------------
ERROR REPORTED:
Note: The following floating-point exceptions are signalling: IEEE_DIVIDE_BY_ZERO IEEE_UNDERFLOW_FLAG IEEE_DENORMAL
 get_op_operators_list error: key not found15

This error prevents the calculation of <SiSj>.

---------------------------------------
FIX:

---------------------------------------
---------------------------------------
FIX FOR THE FINITE OBC CASE
---------------------------------------
ERROR REPORTED:
At line 387 of file $LIB_DIR/nssDMRG/src/DMRG_MEASURE.f90
Fortran runtime error: Index '17' of dimension 1 of array 'b2gmap' above upper bound of 16

This error, although it seems similar to the first case, is slightly different.
It arises because in the finite case, when the system growth ends, let's say of size L, the library adds an extra dot, that is, a dot L+1, causing the b2gMap array always to be 1 site smaller than the actual size of the lattice in the finite case.

To fix this, there are 2 possibilities.

(i) Redefine the size of the b2gMap array to L+1 for the finite algorithm, taking into account the implications of this change in the operator's recovery during the measurement process.

(ii) End the growth of the finite algorithm with 1 site less (L-1), so that the extra step of adding a site to perform the finite algorithm corresponds to the actual exact size of b2gMap.

---------------------------------------
FIX:

---------------------------------------
---------------------------------------
FIX FOR THE FINITE PBC CASE
---------------------------------------
ERROR REPORTED:

---------------------------------------
FIX:
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant