Skip to content

Compute_temporal_propagation

Dominique Delande edited this page Feb 21, 2023 · 13 revisions

The script prop/compute_prop.py can be used to propagate in time an initial state.

I strongly recommend to use it from a directory which is not the one of the and-python repository (e.g. obtained using git).

Suppose you have created your local git repository by cloning the main one:

git clone git@github-and-python:delande/and-python.git

or created a local copy by any method you like, in the directory ~/git/and-python. Then, you copy the parameter file in a local directory:

cd your_local_directory

cp ~/git/and-python/prop/params_1d.dat .

(or params_2d.dat depending on what you want to run).

Then, the script can be simply ran using the command:

python ~/git/and-python/prop/compute_prop.py params_1d.dat

or, if you want to use MPI:

mpiexec -n NN python ~/git/and-python/prop/compute_prop.py params_1d.dat

where NN is the number of cores for the parallel computation.

Two exemples of (working?) parameter files are given. If you have the message:

Warning, no chebyshev C library found, this uses the slow Python version!

this means that you do not use the fast C versions for some computations. This will of course slow down the calculation. If you are on a LKB machine, you should probably try to load the compiler module using:

module load compiler

and rerun the script.

params_1d.dat

The script runs in less than one second on my computer. It prints (your output will be slightly different):

Python script runs on machine : meteor
Name of python script:  /home/delande/git/and-python/prop/compute_prop.py
Name of parameter file: /home/delande/git/and-python/prop/params_1d.dat

Python script started on: Mon Feb 20 17:28:44 2023

Total number of disorder realizations: 100
Number of processes: 1

Python script ended on: Mon Feb 20 17:28:45 2023
Wallclock time 0.528 seconds

CHE time             = 0.256
CHE nops             = 5.0768e+08
Max nonlinear phase  = 0.000
Max order            = 14
Expect time          = 0.229
Expect nops          = 0.0000e+00
Dummy time           = 0.035
Total number of ops  = 5.0768e+08
Total CPU time       = 0.528

It creates 9 files:

  • potential.dat, containing the (averaged) potential.
  • potential_correlation.dat, which contains the potential correlation function (a delta-peak at the origin + numerical noise).
  • dispersion.dat, which should contain something like:
# Script ran by delande on machine meteor
# Name of python script:  /home/delande/git/and-python/prop/compute_prop.py
# Name of parameter file: /home/delande/git/and-python/prop/params_1d.dat
# Single processor version
# 
# Calculation started on: Mon Feb 20 18:05:18 2023
# Calculation   ended on: Mon Feb 20 18:05:19 2023
# 
# Dimension                               = 1
# Size_1                                  = 200.0
# delta_1                                 = 1.0
# N_1                                     = 200
# Boundary_Condition_1                    = periodic
# Volume                                  = 200.0
# 1/mass                                  = 1.0
# Disorder type                           = anderson_gaussian
# randomize disorder for each config      = True
# Use reproducible randomness             = True
# Custom seed for random number generator = 0
# use MKL random number generator         = True
# use MKL FFT                             = True
# V0                                      = 1.0
# g                                       = 0.0
# g_over_volume                           = 0.0
# Number of disorder realizations         = 100
# Number of processes                     = 1
# Number of realizations per process      = 100
# Initial state                           = plane_wave
# k_0_1                                   = 0.0
# Integration Method                      = che
# accuracy                                = 1e-06
# accurate spectrum bounds                = False
# use ctypes implementation               = True
# use specific full Chebyshev routine     = True
# use specific Chebyshev step routine     = True
# use specific H|psi> routine             = True
# maximum Chebyshev order                 = 14
# maximum non-linear phase                = 0.0
# data layout                             = real
# time step                               = 1.0
# total time                              = 100.0
# time step for dispersion measurement    = 2.0
# time step for density measurement       = 20.0
# remove hot pixel in momentum density    = False
# 
# Column 1: Time
# Column 2: Total energy
# Column 3: Nonlinear energy
# 
0.000000000000000000e+00 1.685284812549830806e-03 0.000000000000000000e+00
2.000000000000000000e+00 1.685214924258969038e-03 0.000000000000000000e+00
4.000000000000000000e+00 1.685145035411553770e-03 0.000000000000000000e+00
6.000000000000000000e+00 1.685075146007581313e-03 0.000000000000000000e+00
8.000000000000000000e+00 1.685005256047056223e-03 0.000000000000000000e+00
1.000000000000000000e+01 1.684935365529971561e-03 0.000000000000000000e+00
1.200000000000000000e+01 1.684865474456340119e-03 0.000000000000000000e+00
1.400000000000000000e+01 1.684795582826159512e-03 0.000000000000000000e+00
1.600000000000000000e+01 1.684725690639434729e-03 0.000000000000000000e+00
1.800000000000000000e+01 1.684655797896161215e-03 0.000000000000000000e+00
2.000000000000000000e+01 1.684585904596361521e-03 0.000000000000000000e+00
2.200000000000000000e+01 1.684516010740019819e-03 0.000000000000000000e+00
2.400000000000000000e+01 1.684446116327145866e-03 0.000000000000000000e+00
2.600000000000000000e+01 1.684376221357739012e-03 0.000000000000000000e+00
2.800000000000000000e+01 1.684306325831799256e-03 0.000000000000000000e+00
3.000000000000000000e+01 1.684236429749337224e-03 0.000000000000000000e+00
3.200000000000000000e+01 1.684166533110359205e-03 0.000000000000000000e+00
3.400000000000000000e+01 1.684096635914846766e-03 0.000000000000000000e+00
3.600000000000000000e+01 1.684026738162814870e-03 0.000000000000000000e+00
3.800000000000000000e+01 1.683956839854277394e-03 0.000000000000000000e+00
4.000000000000000000e+01 1.683886940989223497e-03 0.000000000000000000e+00
4.200000000000000000e+01 1.683817041567659467e-03 0.000000000000000000e+00
4.400000000000000000e+01 1.683747141589580967e-03 0.000000000000000000e+00
4.600000000000000000e+01 1.683677241054997104e-03 0.000000000000000000e+00
4.800000000000000000e+01 1.683607339963910481e-03 0.000000000000000000e+00
5.000000000000000000e+01 1.683537438316321747e-03 0.000000000000000000e+00
5.200000000000000000e+01 1.683467536112235241e-03 0.000000000000000000e+00
5.400000000000000000e+01 1.683397633351662020e-03 0.000000000000000000e+00
5.600000000000000000e+01 1.683327730034587773e-03 0.000000000000000000e+00
5.800000000000000000e+01 1.683257826161025077e-03 0.000000000000000000e+00
6.000000000000000000e+01 1.683187921730977619e-03 0.000000000000000000e+00
6.200000000000000000e+01 1.683118016744449301e-03 0.000000000000000000e+00
6.400000000000000000e+01 1.683048111201426245e-03 0.000000000000000000e+00
6.600000000000000000e+01 1.682978205101933822e-03 0.000000000000000000e+00
6.800000000000000000e+01 1.682908298445953601e-03 0.000000000000000000e+00
7.000000000000000000e+01 1.682838391233505530e-03 0.000000000000000000e+00
7.200000000000000000e+01 1.682768483464580720e-03 0.000000000000000000e+00
7.400000000000000000e+01 1.682698575139192397e-03 0.000000000000000000e+00
7.600000000000000000e+01 1.682628666257331672e-03 0.000000000000000000e+00
7.800000000000000000e+01 1.682558756819005049e-03 0.000000000000000000e+00
8.000000000000000000e+01 1.682488846824223370e-03 0.000000000000000000e+00
8.200000000000000000e+01 1.682418936272974709e-03 0.000000000000000000e+00
8.400000000000000000e+01 1.682349025165279233e-03 0.000000000000000000e+00
8.600000000000000000e+01 1.682279113501116124e-03 0.000000000000000000e+00
8.800000000000000000e+01 1.682209201280516825e-03 0.000000000000000000e+00
9.000000000000000000e+01 1.682139288503466373e-03 0.000000000000000000e+00
9.200000000000000000e+01 1.682069375169957179e-03 0.000000000000000000e+00
9.400000000000000000e+01 1.681999461280017649e-03 0.000000000000000000e+00
9.600000000000000000e+01 1.681929546833624799e-03 0.000000000000000000e+00
9.800000000000000000e+01 1.681859631830805949e-03 0.000000000000000000e+00
1.000000000000000000e+02 1.681789716271545054e-03 0.000000000000000000e+00

which shows little, except energy conservation.

  • 6 files g1_intermediate_n.dat (with n=0,1,2,3,4,5) which contain the g1 function at increasing times. It is flat at n=0, and more or exponentially shaped around the origin at longer times.

params_2d.dat

This is an example in dimension 2, for the Konstanz potential with V0=0.5. which runs in 2 seconds on my computer. It produces:

  • potential.dat
  • potential_correlation.dat, which is not a delta-peak, but a Gaussian around the origin because this is a Regensburg type of disorder.
  • dispersion.dat, again showing energy conservation.
  • g1_intermediate_n.dat. For n=0, it oscillates in space because of the non-zero initial momentum. For n=1, it is more or less isotropic with a structure of rings.
  • density_intermediate_n.dat. For n=0, it is flat, as expected. For n=1, it displays fluctuations in space, which become smaller if you increase the number of disorder realisations.

params_2d_with_spectral_function.dat

This is the same as the previous one, but where the spectral function is additionally computed in spectral_function_intermediate_n.dat. The CPU is slightly longer (3.3s on my computer). As expected, the spectral function does not depend on time (no interaction).

params_2d_with_spectral_function_and_interaction.dat

This is similar to the previous one, but with interaction g/V=0.01 and a total time 10 times longer. One can see the relaxation of the spectral function towards the thermal equilibrium. CPU time is significantly longer, 37s on my machine:

Python script runs on machine : meteor
Name of python script:  /home/delande/git/and-python/prop/compute_prop.py
Name of parameter file: /home/delande/git/and-python/prop/params_2d_with_spectral_function_and_interaction.dat

Python script started on: Tue Feb 21 09:52:28 2023

Total number of disorder realizations: 64
Number of processes: 1

Python script ended on: Tue Feb 21 09:53:06 2023
Wallclock time 37.781 seconds

CHE time             = 32.428
CHE nops             = 1.3021e+11
Max nonlinear phase  = 0.111
Max order            = 10
Expect time          = 0.106
Expect nops          = 0.0000e+00
KPM time             = 2.925
KPM nops             = 2.6752e+09
SPECTRUM time        = 1.335
SPECTRUM nops        = 2.4665e+09
Dummy time           = 0.039
Total number of ops  = 1.3535e+11
Total CPU time       = 37.781

When ran with MPI on 8 processes:

mpiexec -n 8 python compute_prop.py params_2d_with_spectral_function_and_interaction.dat

one obtains the same results (!) and:

Python script runs on machine : meteor
Name of python script:  /home/delande/git/and-python/prop/compute_prop.py
Name of parameter file: /home/delande/git/and-python/prop/params_2d_with_spectral_function_and_interaction.dat

Python script started on: Tue Feb 21 09:54:49 2023

Total number of disorder realizations: 64
Number of processes: 8

Python script ended on: Tue Feb 21 09:54:56 2023
Wallclock time 7.099 seconds

CHE time             = 47.852
CHE nops             = 1.3021e+11
Max nonlinear phase  = 0.111
Max order            = 10
Expect time          = 0.165
Expect nops          = 0.0000e+00
KPM time             = 4.339
KPM nops             = 2.6752e+09
SPECTRUM time        = 2.038
SPECTRUM nops        = 2.4665e+09
MPI time             = 1.031
Dummy time           = 0.057
Total number of ops  = 1.3535e+11
Total CPU time       = 56.781

Clone this wiki locally