ru-ccmt / eDMFT

Haule's Repository for combination of Density Functional Theory and Embedded Dynamical Mean Field Theory implementation (Python3 version)
Other
16 stars 1 forks source link

Maxent fails in MnO tutorial #4

Open EarlHummocks opened 1 month ago

EarlHummocks commented 1 month ago

Hi!

I am trying the MnO tutorial, but I get the following error when trying to run maxent. Has anyone experienced this?

nb= 2 nz= 0
beta= 38.680000000000206
df= -4.121082513703822e-19
beta= 38.680000000000206
normalization= 1.000000000000616
Model normalization= 1.000000000000616
Aw normalization= 1.0000000000006164
0 Restarting maxent with rfac= 1.0 alpha= 1000
Traceback (most recent call last):
  File "/apps/eDMFT/3EDMFTF/bin/maxent_run.py", line 55, in <module>
    (Aw, omega) = MaximumEntropy(params, tau, Gt)
  File "/apps/eDMFT/3EDMFTF/bin/maxentropy.py", line 126, in MaximumEntropy
    me.maxent(Aw,rfac,alpha,temp,Ker,sxt,Gt,model,dom,p['Asteps'],iseed)
OverflowError: Python int too large to convert to C int
RayAmini commented 1 month ago

It means that an integer value is too large to handle for the parts of the code written in C. Probably it is p['Asteps'], or iseed.

Please print these numbers by putting print(p['Asteps'], iseed)

before the line

me.maxent(Aw,rfac,alpha,temp,Ker,sxt,Gt,model,dom,p['Asteps'],iseed)

in the maxentropy.py file, in order to identify which it is.

EarlHummocks commented 1 month ago

Thank you very much for a quick reply.

p['Asteps'] = 4000 and iseed = 3435014071

RayAmini commented 1 month ago

Within the maxent subroutine (maxent_routines.f90), iseed is declared as INTEGER

INTEGER, intent(in) :: nt, nw, steps, iseed

which means that it expects a 32-bit integer.

But iseed=3435014071, which is outside of the range -2^31, ..., 2^31-1 for signed 32-bit integers.

The value is generated in maxentropy.py by any of the python commands:

iseed = random.randint(0,2**32-1) or iseed = random.randint(0,maxint)

If we set

iseed = random.randint(0,2**31-1)

in all places, we will always get a a number that is within the allowed range.