Skip to content

Parameter_file

Dominique Delande edited this page Apr 29, 2022 · 12 revisions

When running a simulation, parameters are usually read from a parameter file. Note that you have the freedom to define also parameters in your Python script, but this requires to know the internal organization of the data; this should be done only in special circumstances, at your own risks.

The parameter file is an ASCII file containing several sections and, in each section, a list of parameters, one parameter per line. There are few mandatory sections and parameters. There are also optional sections and parameters. Many optional parameters have default values, so that they can be omitted and the script can still work. There are also sections/parameters which are irrelevant for some numerical simulations, and are ignored. Basically, it means that you can keep the same parameter file to run various scripts. Lines starting with # are ignored; this can be used to comment out some parameters, rather than deleting them.

At the moment, the list of mandatory sections and parameters is too large. This will be reduced in a near future.

Example

[System]
dimension = 1
# System size in natural units
size_1 = 1000.
size_2 = 60.
size_3 = 5.
size_4 = 1.
# Spatial discretization
delta_1 = 0.5
delta_2 = 0.5
delta_3 = 0.25
delta_4 = 0.25
one_over_mass = 1.0
# either periodic or open
boundary_condition_1 = periodic
boundary_condition_2 = periodic
boundary_condition_3 = periodic
boundary_condition_4 = periodic
use_mkl_fft = True

[Disorder]
#  Various disorder types can be used
#type = anderson_uniform
type = anderson_gaussian
#type = regensburg
#type = konstanz
# type = singapore
# type = speckle
use_mkl_random = True
# Correlation length of disorder
sigma = 1.0
# Disorder strength
V0 = 0.2

[Nonlinearity]
# g is the nonlinear interaction
g = 0.
g_over_volume = 0.1

[Wavefunction]
# Either plane_wave or gaussian_wave_packet
initial_state = plane_wave
#initial_state = gaussian_wave_packet
#initial_state = point
# make sure that k_0_over_2_pi_i*size_i is an integer
k_0_over_2_pi_1 = 0.1
k_0_over_2_pi_2 = 0.0
# Size of Gaussian wavepacket
sigma_0_1 = 5.0
sigma_0_2 = 10.0

[Propagation]
# Propagation method can be either 'ode' or 'che' (for Chebyshev)
method = che
data_layout = real
#data_layout = complex
# Total duration of the propagation
t_max = 1200.0
# Elementary time step
delta_t = 5.0

[Averaging]
n_config = 64

[Measurement]
delta_t_dispersion = 5.0
delta_t_density = 10.
delta_t_spectral_function = 100.
#density = True
#density_momentum = True
dispersion_position = True
dispersion_position2 = True
#dispersion_momentum = True
#dispersion_energy = True
#dispersion_variance = True
#wavefunction = True
#wavefunction_momentum = True
#autocorrelation = True
spectral_function = False

[Spectral]
# To specifiy the energy interval where the spectral function or the density of states is computed
# You may either use the pair [e_min,e_max]
# or the range variable, in which case the interval is [-range/2,range/2]
# [e_min,e_max] has precedence over range if both are specified
range = 100.0
resolution = 0.01
e_min= -1.
e_max= 10.
# Multiplicative factor for the interaction coefficient
multiplicative_factor_for_interaction = 0.0

When ran with: python compute_spectral_function.py params_minimal.dat it should produce an output file named spectral_function.dat (and +temporal_autocorrelation.dat_ that you should ingore) containing something like:

# Script ran by delande on machine meteor
# Name of python script:  /home/delande/git/and-python/spectral_function/compute_spectral_function.py
# Name of parameter file: /home/delande/git/and-python/spectral_function/params_minimal.dat
# Single processor version
# 
# Calculation started on: Fri Apr 29 09:35:54 2022
# Calculation   ended on: Fri Apr 29 09:35:54 2022
# 
# Dimension                              = 1
# Size_1                                 = 1000.0
# delta_1                                = 0.5
# N_1                                    = 2000
# Boundary_Condition_1                   = periodic
# Volume                                 = 1000.0
# 1/mass                                 = 1.0
# Disorder type                          = anderson_gaussian
# randomize disorder for each config     = True
# use MKL random number generator        = True
# use MKL FFT                            = True
# V0                                     = 0.2
# g                                      = 0.0
# g_over_volume                          = 0.0
# Number of disorder realizations        = 64
# Number of processes                    = 1
# Number of realizations per proc        = 64
# Initial state                          = plane_wave
# k_0_1                                  = 0.6283185307179586
# 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                = 16
# maximum non-linear phase               = 0.0
# data layout                            = complex
# time step                              = 1.2319971190548207
# total time                             = 30.799927976370515
# time step for dispersion measurement   = 1.2319971190548207
# time step for density measurement      = 30.799927976370515
# time step for spectral function        = 30.799927976370515
# remove hot pixel in momentum density   = False
# minimum energy for spectral function   = -1.0
# maximum energy for spectral function   = 4.0
# energy resolution                      = 0.1
# multiplicative factor for interaction  = 0.0
# 
# Spectral function
# Column 1: Energy
# Column 2: Spectral function
# 
-1.000000000000000444e+00 -1.809482327544541941e-02
-9.000000000000003553e-01 2.051635034269328264e-02
-8.000000000000002665e-01 -2.175134101683667137e-02
-7.000000000000006217e-01 2.503067839854754978e-02
-6.000000000000005329e-01 -2.757283070882659767e-02
-5.000000000000004441e-01 3.254804884486671435e-02
-4.000000000000003553e-01 -3.768717116863327943e-02
-3.000000000000002665e-01 5.229298745737036291e-02
-2.000000000000003997e-01 2.518924409746415086e-02
-1.000000000000003109e-01 4.642071598399862276e-01
-2.220446049250313081e-16 5.993805338828437357e-01
9.999999999999964473e-02 2.439386585744398594e+00
1.999999999999997335e-01 4.560411652016835404e+00
2.999999999999998224e-01 1.158650501232124874e+00
3.999999999999996891e-01 3.411274283454134859e-01
4.999999999999997780e-01 1.032142034674398134e-01
5.999999999999998668e-01 1.010981902455802689e-01
6.999999999999998446e-01 1.841736336090190121e-02
7.999999999999998224e-01 5.417877538347284222e-02
8.999999999999999112e-01 -8.320647952827182415e-04
9.999999999999998890e-01 3.406700673333418194e-02
1.099999999999999867e+00 -7.013003716215042427e-03
1.199999999999999956e+00 2.630753095573496597e-02
1.300000000000000044e+00 -8.810743422863800620e-03
1.399999999999999911e+00 2.099176322439938805e-02
1.500000000000000000e+00 -9.364622332145002004e-03
1.600000000000000089e+00 1.786596802534418799e-02
1.699999999999999956e+00 -9.497157386155931011e-03
1.800000000000000044e+00 1.577681566093976431e-02
1.900000000000000133e+00 -9.540201372490253809e-03
2.000000000000000000e+00 1.453186761470457410e-02
2.100000000000000089e+00 -9.572332188446055004e-03
2.200000000000000178e+00 1.352190127887510640e-02
2.300000000000000266e+00 -9.588706440505894574e-03
2.400000000000000355e+00 1.309021052402187420e-02
2.500000000000000000e+00 -9.756635809106932108e-03
2.600000000000000533e+00 1.276423791021510760e-02
2.700000000000000178e+00 -9.931364318773373834e-03
2.800000000000000266e+00 1.282462561697462512e-02
2.900000000000000355e+00 -1.009513680721034305e-02
3.000000000000000000e+00 1.280666182051660301e-02
3.100000000000000533e+00 -1.101044436264670377e-02
3.200000000000000178e+00 1.285744712375901273e-02
3.300000000000000266e+00 -1.176311458150400453e-02
3.400000000000000355e+00 1.342381047230783303e-02
3.500000000000000444e+00 -1.266882938278641318e-02
3.600000000000000533e+00 1.433775140612468003e-02
3.700000000000000622e+00 -1.390962260333629408e-02
3.800000000000000266e+00 1.566863740361483515e-02
3.900000000000000355e+00 -1.566182134403972664e-02
4.000000000000000000e+00 1.763602860244334325e-02

Sections

Here is a list of sections. The full list of parameters follows below.

Parameters

Clone this wiki locally