Stage_1 module

class Stage_1.Stage_1(locpot_vec, E0, sigma, z_original=None, Max_z_iterations=10, Noriginal=None, allmin=None, To_plot=False, allmax=None)[source]

Bases: object

This class aimed to create the initial wavefunction in its most general form, when it is initialized within the range of one of the materials in the system.

__init__(locpot_vec, E0, sigma, z_original=None, Max_z_iterations=10, Noriginal=None, allmin=None, To_plot=False, allmax=None)[source]
Parameters
  • locpot_vec (numpy.ndarray, (N,2)) – This is a 2 column matrix. The first colmn is z, the spatial coordinates vector and second is v, the local potential vector.

  • E0 (float) – The initial energy of the wave-function. Accounted to the total energy of an electron at the bottom of the cunduction band (CBM).

  • sigma (float) – The standard deviation of the guassian electron wave-pocket.

  • z_original (np.array, array_like, optional, default: None) – The original, initial spatial coordinates vector.

  • Max_z_iterations (int, optional, default: 10) – The maximum number of the iterations that the loop will be going through until convergence of the drid density.

  • Noriginal (int, optional, default: None) – The initial/ original number of spatial steps, the number of dx’s in the spatial coordinates vector. If not supplied, it will take the value of len(z_original)

  • allmin (numpy.ndarray, (N,2), default: None) – This is a matrix with 2 columns. The first column holds the minimum points position, and the second column holds the minimum points height. If not supplied it will take the matrix the resultd from find_peaks_minima(self.locpot_vec[:, 0], self.locpot_vec[:, 1]).

  • To_plot (bool, optional, defulat: False) – A flag to determine whether to plot or not.

  • allmax (numpy.ndarray, (N,2), default: None) – This is a matrix with 2 columns. The first column holds the maximum points position, and the second column holds the maximum points height. If not supplied it will take the matrix the resultd from find_peaks_maxima(self.locpot_vec[:, 0], self.locpot_vec[:, 1]).

initial_wavefunc_energies(N=None, Multi=5)[source]

Class method of Stage1. Calculate the initial Wavefunction

Parameters
  • N (int/float, optional, default: None) – It can be delivered in order the determine the number of the samples that the wavefunction will be constructed based on it.

  • Multi (int/float, optional, default: 5) – If the initial unit is too small, you can choose how many times to mulyiply it in order to produce the initial wavefucntion matched the larger unit cell.

Returns

np.array, np.array, np.array, np.array, np.array, int – zz - the new coords divided into N segments. vv - the new potential vector divided into N segments. psi0 - the initial wave function. (N,) T0 - initial kinteic energy. Float v0 - potential expectation value. Float. N - The number of the partition.

calculate_E0(zz, vv, psi0, N=None)[source]

Class method of Stage1. Calculating E0 per each N partition of space(z)

Parameters
  • zz (np.array) – Vector of the spatial grid. (spatial coordinates)

  • vv (np.array) – Vector of the local potential.

  • psi0 (np.array) – The wave-function vector.

  • N (int, optional, default: None) – The number of spatial steps, the number of dx’s.

converge_main_axis_grid(tol=0.001)[source]

Converges the spatial grid of the system according to total energy difference of the tol parameter supplied as an input. The difference relates to two consecutive iterations. It also demands that the spatial spacing not be less than tol*sigma.

Parameters

tol (float, optional, default: 0.001) – It refers to tolerance. And it can make the condition for convergence more or less strict.

Returns

  • zz_convg (np.array) – The converged spatial grid vector.

  • vv_convg (np.array) – The converged local potential vector.

  • psi0_convg (np.array) – The converged wave function values vector.

  • grid_density (float) – The converged spatial grid density. It is defined as the number of the spatial points divided by the system length.

  • psi0_dic (dict) – It holds all the necessary parameters that relate to the converged system and the convereged wave-function. psi0_dic = {‘k0’ : , ‘sigma’: , ‘E0’: ,’zz’: zz_convg, ‘vv’:vv_convg,’N’: N_convg,’psi0’:psi0_convg}

get_psi_dic()[source]
Returns

dict – It retruns a initial wave function parameters in a dictionary for the next stage.

set_To_plot(To_plot)[source]

A class method to set the To_plot attribute.

Parameters
  • To_plot (bool) – It gets True or False whether to plot or not.

  • or (This is a class method that enables to turn on plotting options) –

  • on (to turn them off. True = for turning) –

  • off. (False = for turning) –

Stage_1.main()[source]