step2_ergoscf¶
-
libra_py.workflows.nbra.step2_ergoscf.
do_ovlp
(i, params, run)[source]¶ Compute the overlap matrix in the AO basis for two geometries, i and i+1
- Parameters
i (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 ERGOSCF executable [ default: ergo ]
- params[“md_file”] ( string ): the name of the xyz file containing the trajectory - the
file should be in the general xyz format. [default: “md.xyz”]
run (Python function) –
the function that defines the ErgoSCF input generation - the user has to define all the control parameters in it, to be able to run the ErgoSCF calculations
Example
In the example below, the outermost quotes should be tripled
Note: the function should follw the signature shown here
- def run(EXE, COORDS):
inp = “#!bin/sh
%s << EOINPUT > /dev/null spin_polarization = 0 molecule_inline %sEOF basis = “STO-3G” scf.create_mtx_file_S = 1 scf.create_mtx_files_S_and_quit = 1 XC.sparse_mode = 1 run “LDA” EOINPUT ” % (EXE, COORDS)
return inp
- Returns
(S11, S22, S12), where:
S11 - the matrices of the AO overlaps for the first geometry with itself (normal AO overlaps)
S22 - the matrices of the AO overlaps for the second geometry with itself (normal AO overlaps)
S12 - the matrices of the AO overlaps for the two geometries at the adjacent geometries (for TDM)
where A - is the size of the AO basis
- Return type
(CMATRIX(A, A), CMATRIX(A, A), CMATRIX(A, A))
-
libra_py.workflows.nbra.step2_ergoscf.
do_step
(i, params, run)[source]¶ Runs a single-point SCF calculation for a given geometry along a trajectory
- Parameters
i (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 ErgoSCF executable [ default: ergo ]
- params[“md_file”] ( string ): the name of the xyz file containing the trajectory - the
file should be in the general xyz format. [default: “md.xyz”]
- 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[“mo_indexing_convention”] ( string ): orbital indexing convention:
”rel” : relative, with respect to the HOMO position: HOMO = 0, HOMO-1 = -1, LUMO = 1, etc. [default]
”abs” : absolute, with respect to all possible MOs of the system
- params[“direct_MO”] ( int ): a flag to decide to use orbitals as read from
the ErgoSCF output: - 0 : read in the Fock matrices and diagonalize them internally - 1 : read the MOs produced by ErgoSCF, this is the option to really go
with the linear-scaling costs [ default ]
- params[“spinpolarized”] ( int ): whether the ErgoSCF calculations (and hence the
following post-processing) are done withing the restricted or unrestricted formulation: - 0 : non-spin-polarized (restricted) [ default ] - 1 : spin-polarized (unrestricted)
run (Python function) –
the function that defines the ErgoSCF input generation - the user has to define all the control parameters in it, to be able to run the ErgoSCF calculations
Example
In the example below, the outermost quotes should be tripled
Note: the function should follw the signature shown here
- def run(EXE, COORDS):
inp = “#!bin/sh
%s << EOINPUT > /dev/null spin_polarization = 0 molecule_inline %sEOF basis = “STO-3G” use_simple_starting_guess=1 scf.create_mtx_files_F = 1 scf.create_mtx_file_S = 1 XC.sparse_mode = 1 run “LDA” EOINPUT ” % (EXE, COORDS)
return inp
- Returns
(E_sub, MO_sub), where:
- E_sub ( list of 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. E_sub[0] is the alpha component (for both restricted and unrestricted calculations) E_sub[1] is the beta component (only for the unrestricted calculations)
- MO_sub ( list of 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 MO_sub[0] is the alpha component (for both restricted and unrestricted calculations) MO_sub[1] is the beta component (only for the unrestricted calculations)
- Return type
-
libra_py.workflows.nbra.step2_ergoscf.
run_step2
(params, run1, run2)[source]¶ Calculate the overlaps, transition dipole moments, and vibronic Hamiltonian matrix elements in the AO basis
- Parameters
params (dictionary) – the control parameters of the simulation
params["dt"] (*) – nuclear dynamics timestep - as encoded in the trajectory [ units: a.u., default: 41.0 ]
params["isnap"] (*) – initial frame [ default: 0 ]
params["fsnap"] (*) – final frame [ default: 1 ]
params["out_dir"] (*) – the path to the directory that will collect all the results If the directory doesn’t exist, it will be created [ default: “res” ]
params["EXE"] (*) – path to the ErgoSCF executable [ default: ergo ]
params["md_file"] (*) – the name of the xyz file containing the trajectory - the file should be in the general xyz format. [default: “md.xyz”]
params["mo_active_space"] (*) – 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["mo_indexing_convention"] (*) – orbital indexing convention: - “rel” : relative, with respect to the HOMO position: HOMO = 0, HOMO-1 = -1, LUMO = 1, etc. [default] - “abs” : absolute, with respect to all possible MOs of the system
params["direct_MO"] (*) –
a flag to decide to use orbitals as read from the ErgoSCF output: - 0 : read in the Fock matrices and diagonalize them internally - 1 : read the MOs produced by ErgoSCF, this is the option to really go
with the linear-scaling costs [ default ]
params["spinpolarized"] (*) – whether the ErgoSCF calculations (and hence the following post-processing) are done withing the restricted or unrestricted formulation: - 0 : non-spin-polarized (restricted) [ default ] - 1 : spin-polarized (unrestricted)
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