Gaussian_methods

libra_py.Gaussian_methods.cube_generator_gaussian(project_name, time_step, min_band, max_band, nprocs, sample_cube_file, isUKS)[source]

This function generates the cube files by first forming the ‘fchk’ file from ‘chk’ file. Then it will generate the cube files from min_band to max_band the same as CP2K naming. This will helps us to use the read_cube and integrate_cube functions easier.

Parameters
  • project_name (string) – The project_name.

  • time_step (integer) – The time step.

  • min_band (integer) – The minimum state number.

  • max_band (integer) – The maximum state number.

  • nprocs (integer) – The number of processors used to generate the cubes using ‘cubegen’.

  • sample_cube_file (str) – The path to a sample cube file. This file is used to generate the cube files according the mesh of this file. Therefore the integration will be plausible.

  • isUKS (integer) – The unrestricted spin calculation flag. 1 is for spin unrestricted calculations. Other numbers are for spin restricted calculations

Returns

None

libra_py.Gaussian_methods.gaussian_distribute(istep, fstep, nsteps_this_job, trajectory_xyz_file, gaussian_input, curr_job_number)[source]

Distributes Gaussian jobs for trivial parallelization

Make sure that your Gaussian input file has absolute paths to the following input parameters:

This parameters should be set in the input template chk file —> e.g. %chk=/home/username/gaussian_calculations/check_file.chk rwf file —> e.g. %rwf=/home/username/gaussian_calculations/check_file.rwf

Parameters
  • istep (integer) – The initial time step in the trajectory xyz file.

  • fstep (integer) – The final time step in the trajectory xyz file.

  • nsteps_this_job (integer) – The number of steps for this job.

  • trajectory_xyz_file (string) – The full path to trajectory xyz file.

  • gaussian_input (string) – The sample Gaussian input template.

  • curr_job_number (integer) – The current job number.

Returns

None

libra_py.Gaussian_methods.gaussian_input(project_name, time_step, sample_input, trajectory_xyz_file_name)[source]

This function creates a Gaussian input file for the time_step geometry using an input template.

Parameters
  • project_name (string) – The project name.

  • time_step (integer) – The time step.

  • sample_input (string) – The Gaussian sample input.

  • trajectory_xyz_file_name (string) – The trajectory xyz file name.

Returns

None

libra_py.Gaussian_methods.read_energies_from_gaussian_log_file(params)[source]

This function read the energies from Gaussian log file and returns the Kohn-Sham and total_energies.

Parameters

params (dictionary) –

The dictionary containing the input parameters.

logfile_name (string): The log file name.

min_band (integer): The minimum state number.

max_band (integer): The maximum state number.

spin (integer): The spin component. 1 is for alpha and 2 is for beta spin.

Returns

The Kohn-Sham energies.

total_energy (float): The total energy of the system.

Return type

ks_energies (1D numpy array)

libra_py.Gaussian_methods.read_gaussian_tddft_log_file(params)[source]

This function read Gaussian output file and extracts the excitation analysis results.

Parameters

params (dictionary) –

The dictionary containing the input parameters.

logfile_name (string): The log file name.

tolerance (float): The tolerance factor for choosing the excited states of the excitation analysis.

number_of_states (integer): The number of excited states to be considered in the excitation analysis.

isUKS (integer): This parameter is the flag for restricted or unrestricted spin calculations. If it is

set to 1 the unrestricted spin calculations will be considered.

Returns

The excitation energies.

ci_basis (list): The list containnig the CI basis of the excitation analysis.

ci_coefficients (list): The list containing the ci_coefficients for each excitation.

spin_components (list): The list containing the spin components for each excitation.

Return type

excitation_energies (1D numpy arra)

libra_py.Gaussian_methods.read_trajectory_xyz_file_gaussian(trajectory_xyz_file_name: str, time_step: int)[source]

This function reads the trajectory of a molecular dynamics .xyz file and extract the ‘time_step’ th step then returns it in form of a numpy array.

Parameters
  • trajectory_xyz_file_name (string) – The trajectory .xyz file name.

  • time_step (integer) – The desired time to extract its .xyz coordinates which starts from zero.

Returns

The numpy array containing the coordinates of the time_step.

Return type

coordinates (2D numpy array)