Analysis

We can get get the correlation functions directly from textsc{fortran}, and perform the subsequent analysis with:

# DOS correlation, fortran call
corr_DOS = tipsi.corr_DOS(sample, config)

# DOS correlation analysis
energies_DOS, DOS = tipsi.analyze_corr_DOS(config, corr_DOS)

# AC conductivity correlation, fortran call
corr_AC = tipsi.corr_AC(sample, config)

# AC conductivity correlation analysis
omegas_AC, AC = tipsi.analyze_corr_AC(config, corr_AC)

Alternatively, we can read the correlation functions from file in a separate Python script:

timestamp = "1522172330" # set to output timestamp

# read Config object
config = tipsi.read_config("sim_data/" + timestamp + "config.pkl")

# get DOS
corr_DOS = tipsi.read_corr_DOS("sim_data/" + timestamp + "corr_DOS.dat")
energies_DOS, DOS = tipsi.analyze_corr_DOS(config, corr_DOS)

Correlation function analysis

tipsi.analysis.analyze_corr_DOS(config, corr_DOS, window=<function window_Hanning>)

Function for analyzing the DOS correlation function.

Parameters:
  • config (Config object) – contains TBPM configuration parameters
  • corr_DOS (list of complex floats) – DOS correlation function
  • window (function, optional) – window function for integral; default: window_Hanning
Returns:

  • energies (list of floats) – energy values
  • DOS (list of floats) – DOS values corresponding to energies

Relevant config parameters:

config.generic['nr_time_steps']
config.generic['correct_spin']
tipsi.analysis.analyze_corr_LDOS(config, corr_LDOS, window=<function window_Hanning>)

Function for analyzing the LDOS correlation function - exactly the same as DOS analysis function.

Parameters:
  • config (Config object) – contains TBPM configuration parameters
  • corr_LDOS (list of complex floats) – LDOS correlation function
  • window (function, optional) – window function for integral; default: window_Hanning
Returns:

  • energies (list of floats) – energy values
  • LDOS (list of floats) – LDOS values corresponding to energies

Relevant config parameters:

config.generic['nr_time_steps']
config.generic['correct_spin']
tipsi.analysis.analyze_corr_AC(config, corr_AC, window=<function window_exp>)

Function for analyzing the AC conductivity correlation function.

Parameters:
  • config (Config object) – contains TBPM configuration parameters
  • corr_AC ((4,n) list of complex floats) – AC conductivity correlation function
  • window (function, optional) – window function for integral; default: window_exp
Returns:

  • omegas (list of floats) – omega values
  • AC ((4,n) list of floats) – AC conductivity values corresponding to omegas, for 4 directions (xx, xy, yx, yy, respectively)

Relevant config parameters:

config.generic['nr_time_steps']
config.generic['correct_spin']
tipsi.analysis.AC_imag(AC_real)

Get the imaginary part of the AC conductivity from the real part using the Kramers-Kronig relations (the Hilbert transform).

Parameters:AC_real (array of floats) – Re(sigma)
Returns:Im(sigma)
Return type:array of floats
tipsi.analysis.analyze_corr_DC(config, corr_DOS, corr_DC, window_DOS=<function window_Hanning>, window_DC=<function window_exp>)

Function for analyzing the DC correlation function.

Parameters:
  • config (Config object) – contains TBPM configuration parameters
  • corr_DOS ((n_t_steps) list of floats) – DOS correlation function
  • corr_DC ((2, n_energies, n_t_steps) list of floats) – DC conductivity correlation function
  • window_DOS (function, optional) – window function for DOS integral; default: window_Hanning
  • window_DC (function, optional) – window function for DC integral; default: window_exp
Returns:

  • energies (list of floats) – energy values
  • DC ((2, n_energies) list of floats) – DC conductivity values

Relevant config parameters:

config.generic['nr_time_steps']
config.generic['correct_spin']
config.DC_conductivity['energy_limits']
tipsi.analysis.analyze_corr_dyn_pol(config, corr_dyn_pol, window=<function window_exp_ten>)

Function for analyzing the dynamical polarization correlation function.

Parameters:
  • config (Config object) – contains TBPM configuration parameters
  • corr_dyn_pol ((n_q_points, n_t_steps) list of floats) – dynamical polarization correlation function
  • window (function, optional) – window function for integral; default: window_exp_ten
Returns:

  • q_points (list of floats) – q-point values
  • omegas (list of floats) – omega values
  • dyn_pol ((n_q_points, n_omegas) list of complex floats) – dynamical polarization values corresponding to q-points and omegas

Relevant config parameters:

config.generic['nr_time_steps']
config.generic['correct_spin']
config.dyn_pol['q_points']
tipsi.analysis.get_dielectric_function(config, dyn_pol)

Function for analyzing the DOS correlation function.

Parameters:
  • sample (Sample object) – contains sample information
  • config (Config object) – contains TBPM configuration parameters
  • dyn_pol ((n_q_points, n_t_steps) list of complex floats) – dynamical polarization values
Returns:

epsilon – dielectric function

Return type:

(n_q_points, n_omegas) list of complex floats

Relevant config parameters:

config.generic['nr_time_steps']
config.dyn_pol['coulomb_constant']
config.dyn_pol['q_points']

Reading from file

tipsi.input.read_config(filename)

Read Config object from file

Parameters:filename (string) – read Config object from this file
Returns:
Return type:Config object
tipsi.input.read_sample(filename, lattice=None, bc_func=<function bc_default>, nr_processes=1)

Read Sample object from file

Parameters:
  • filename (string) – read Sample object from this file
  • lattice (Lattice object) – lattice corresponding to the sample; default: None
  • bc_func (function) – boundary conditions function; default: bc_default
  • nr_processes (integer) – number of processes to use for numerically expensive Sample methods; default: 1
Returns:

Return type:

Sample object

tipsi.input.read_corr_DOS(filename)

Read DOS correlation from file

Parameters:filename (string) – read correlation values from this file
Returns:corr_DOS – the DOS correlation function
Return type:(n_timesteps) list of complex floats
tipsi.input.read_corr_LDOS(filename)

Read LDOS correlation from file

Parameters:filename (string) – read correlation values from this file
Returns:corr_LDOS – the LDOS correlation function
Return type:(n_timesteps) list of complex floats
tipsi.input.read_corr_AC(filename)

Read AC correlation from file

Parameters:filename (string) – read correlation values from this file
Returns:corr_AC – the AC correlation function
Return type:(4, n_timesteps) list of complex floats
tipsi.input.read_corr_DC(filename)

Read DC conductivity correlation from file

Parameters:filename (string) – read DC conductivity correlation values from this file
Returns:corr_DC – the dynamical polarization correlation function
Return type:(2, n_energies, n_t_steps) list of complex floats
tipsi.input.read_corr_dyn_pol(filename)

Read dynamical polarization correlation from file

Parameters:filename (string) – read correlation values from this file
Returns:corr_dyn_pol – the dynamical polarization correlation function
Return type:(n_q_points, n_timesteps) list of complex floats

Window functions

tipsi.analysis.window_Hanning(i, N)

Hanning window.

Parameters:
  • i (integer) – summation index
  • N (integer) – total length of summation
Returns:

Hanning window value

Return type:

float

tipsi.analysis.window_exp(i, N)

Exponential window.

Parameters:
  • i (integer) – summation index
  • N (integer) – total length of summation
Returns:

exponential window value

Return type:

float

tipsi.analysis.window_exp_ten(i, N)

Window function given by exponential of 10.

Parameters:
  • i (integer) – summation index
  • N (integer) – total length of summation
Returns:

exponential window value

Return type:

float

Output

tipsi.output.plot_wf(wfsq, sample, filename, site_size=5, fig_dpi=300, colorbar=False)

Plot wavefunction

Parameters:
  • wfsq (list of positive real numbers) – wave function squared
  • sample (Sample object) – geometric information of the sample
  • filename (string) – image file name
  • site_size (float) – site size; default 5
  • fig_dpi (float) – dpi of output figure; default 300
  • colorbar (bool) – add colorbar to figure; default False