step2_dftb¶
-
libra_py.workflows.nbra.step2_dftb.
do_ovlp
(snap, params)[source]¶ Compute the overlap matrix in the AO basis for two geometries, i and i+1
- Parameters
snap (int) – index of the time step to be used from the trajectory file
params (dictionary) –
the control parameters of the simulation
params[“EXE”] ( string ): path to the DFTB+ executable [ default: dftb+ ]
- params[“md_file”] ( string ): the name of the xyz file containing the trajectory - the
file should be in the xyz format produced by the DFTB+ program. [default: “md.xyz”]
- params[“ovlp_gen_file”] ( string ): the name of the .gen file that is listed in the
DFTB+ input file and contains the geometry of the system at two time steps (the content of this file will be updated for every i value). [default: “x2.gen” ]
- params[“syst_spec”] ( string ): the string that is a part of the DFTB+ .gen file and defines
whether the system is a non-periodic/cluster (“C”) or periodic (“S”). [default: “C”]
- params[“ovlp_in_file”] ( string ): the name of the file containing the template for running
calculations that construct H and S matrices and print them out by the DFTB+ calculations.
It should use the geometry file defined by params[“ovlp_gen_file”].
It should have the section: “WriteHS = Yes” to initialize the writing of the H and S matrices
[default: “dftb_in_overlaps.hsd”]
- Returns
the matrix of the AO overlaps for two geometries, where A - is the size of the AO basis
- Return type
CMATRIX(A, A)
-
libra_py.workflows.nbra.step2_dftb.
do_step
(snap, params)[source]¶ Runs a single-point SCF calculation for a given geometry along a trajectory
- Parameters
snap (int) – index of the time step to be used from the trajectory file
params (dictionary) –
the control parameters of the simulation
params[“EXE”] ( string ): path to the DFTB+ executable [ default: dftb+ ]
- params[“mo_active_space”] ( list of ints or None ): indices of the MOs we care about
The indexing starts from 0, not 1! If set to None - all MOs will be returned. [default: None]
- params[“md_file”] ( string ): the name of the xyz file containing the trajectory - the
file should be in the xyz format produced by the DFTB+ program. [default: “md.xyz”]
- params[“sp_gen_file”] ( string ): the name of the .gen file that is listed in the
DFTB+ input file and contains the geometry of the system (the content of this file will be updated for every i value). [default: “x1.gen” ]
- params[“syst_spec”] ( string ): the string that is a part of the DFTB+ .gen file and defines
whether the system is a non-periodic/cluster (“C”) or periodic (“S”). [default: “C”]
- params[“scf_in_file”] ( string ): the name of the file containing the template for running regular
SCF calculations for a single-point DFTB+ calculations.
It should use the geometry file defined by params[“sp_gen_file”].
[default: “dftb_in_ham1.hsd”]
- params[“hs_in_file”] ( string ): the name of the file containing the template for running
calculations that construct H and S matrices and print them out by the DFTB+ calculations.
It should use the geometry file defined by params[“sp_gen_file”].
It should have the section: “ReadInitialCharges = Yes” to use the previously-converged charge density
It should have the section: “WriteHS = Yes” to initialize the writing of the H and S matrices
[default: “dftb_in_ham2.hsd”]
- params[“do_tddftb”] ( bool ): the parameter to control the type of energies to use in the
calculations. The DFTB+ input files should be setup accordingly
- Truecompute and read TD-DFTB energies. In this case, only the first entry of the returned
results ( energies ) is meaningful. Other properties are just None for now
False : compute and read only the single-prticle energies [ default ]
- Returns
(Ei, MOi, Hi, Si), where:
- Ei ( CMATRIX(M, M) ), the matrix of the converged Hamiltonian eigenvalues (at given geometry)
Here, M = len(params[“mo_active_space”]) - we output only the MO energies that are of interest to us
- MOi ( CMATRIX(A, M) ), the matrix of the converged Hamiltonian eigenvalues (at given geometry)
Here, M = len(params[“mo_active_space”]) - we output only the MO energies that are of interest to us. A - is the number of AOs in this calculation
Hi (list of CMATRIX(A, A) ): the Hamiltonian matrices in the AO basis, for each k-point
Si (list of CMATRIX(A, A) ): the overlap matrices in the AO basis, for each k-point
- Return type
-
libra_py.workflows.nbra.step2_dftb.
run_step2
(params)[source]¶ Calculate the overlaps, transition dipole moments, and vibronic Hamiltonian matrix elements in the AO basis
- Currently under development 1/30/2020 - This function is currently not compatable with the parameters
“get_midpoint_energy” or “do_tddftb”.
- Parameters
params (dictionary) –
the control parameters of the simulation
params[“dt”] ( double ): nuclear dynamics timestep - as encoded in the trajectory [ units: a.u., default: 41.0 ]
params[“isnap”] ( int ): initial frame [ default: 0 ]
params[“fsnap”] ( int ): final frame [ default: 1 ]
- params[“out_dir”] ( string ): the path to the directory that will collect all the results
If the directory doesn’t exist, it will be created [ default: “res” ]
SeeAlso: the description of the parameters in
`do_ovlp(i, params)`
and in`do_step(i, params)`
- Returns
but generates the files (S, St, and hvib) indexed in the range [isnap, fsnap), for instance, if isnap = 0, fsnap = 3, we will have files hvib_0, hvib_1, hvib_2
- Return type
-
libra_py.workflows.nbra.step2_dftb.
run_step2_lz
(params)[source]¶ Calculate the diagonal vibronic Hamiltonian matrix elements (energies) in the AO basis and (optionally) the TD-DFTB energies
- Parameters
params (dictionary) –
the control parameters of the simulation
params[“dt”] ( double ): nuclear dynamics timestep - as encoded in the trajectory [ units: a.u., default: 41.0 ]
params[“isnap”] ( int ): initial frame [ default: 0 ]
params[“fsnap”] ( int ): final frame [ default: 1 ]
- params[“out_dir”] ( string ): the path to the directory that will collect all the results
If the directory doesn’t exist, it will be created [ default: “res” ]
- params[“get_midpoint_energy”] ( bool ): if True, compute and read energies as Hvib = 0.5*(E_prev + E_curr) (As is done in Pyxaid NBRA)
if False, compute and read energies at everytime timestep Hvib = E_curr
SeeAlso: the description of the parameters in
`do_step(i, params)`
- Returns
but generates the files (hvib) indexed in the range [isnap, fsnap), for instance, if isnap = 0, fsnap = 3, we will have files hvib_0, hvib_1, hvib_2. Only diagonal elements of the matrix are populated.
- Return type