Skip to content

Commit

Permalink
Added new dynamics control parameter assum_always_consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvakimov committed Apr 19, 2023
1 parent 83f0ca1 commit aaf2599
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/dyn/Dynamics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,8 @@ void propagate_electronic(dyn_variables& dyn_var, nHamiltonian* Ham, nHamiltonia
FullPivLU_inverse(P, T_new);
T_new = orthogonalized_T( T_new );


if(prms.assume_always_consistent){ T_new.identity(); }


if(rep==0){ // diabatic
CMATRIX Hvib(ham->ndia, ham->ndia);
Expand Down
3 changes: 3 additions & 0 deletions src/dyn/dyn_control_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ dyn_control_params::dyn_control_params(){
dt = 41.0;
num_electronic_substeps = 1;
electronic_integrator = 0;
assume_always_consistent = 0;
}


Expand Down Expand Up @@ -169,6 +170,7 @@ dyn_control_params::dyn_control_params(const dyn_control_params& x){
dt = x.dt;
num_electronic_substeps = x.num_electronic_substeps;
electronic_integrator = x.electronic_integrator;
assume_always_consistent = x. assume_always_consistent;

decoherence_rates = new MATRIX(x.decoherence_rates->n_rows, x.decoherence_rates->n_cols);
*decoherence_rates = *x.decoherence_rates;
Expand Down Expand Up @@ -353,6 +355,7 @@ void dyn_control_params::set_parameters(bp::dict params){
else if(key=="dt") { dt = bp::extract<double>(params.values()[i]); }
else if(key=="num_electronic_substeps") { num_electronic_substeps = bp::extract<int>(params.values()[i]); }
else if(key=="electronic_integrator"){ electronic_integrator = bp::extract<int>(params.values()[i]); }
else if(key=="assume_always_consistent"){ assume_always_consistent = bp::extract<int>(params.values()[i]); }

}// for i

Expand Down
15 changes: 11 additions & 4 deletions src/dyn/dyn_control_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ class dyn_control_params{
/**
the method for electronic TD-SE integration:
tdse_rep = 0 (diabatic): 1** - with NBRA
rep_tdse = 0 (diabatic): 1** - with NBRA
-1 - No propagation
Expand All @@ -626,7 +626,7 @@ class dyn_control_params{
2 - based on modified QTAG propagator (Z at two times)
3 - non-Hermitian integrator with 2-point Hvib_dia
tdse_rep = 1 (adiabatic): 1** - with NBRA
rep_tdse = 1 (adiabatic): 1** - with NBRA
-1 - No propagation
Expand All @@ -646,11 +646,18 @@ class dyn_control_params{
15 - same as 5, but with rotations
*/
int electronic_integrator;



/**
If set to True (1), we will force the reprojection matrix T_new to be the identity matrix. This effectively
removes basis-reprojection (local diabatization) approach and turns on the "naive" approach where
no trivial crossings exist.
Default: No (0) - we do want to use the LD approaches by default.
If Yes (1), one may need to turn on additional state tracking and phase correction methods
*/
int assume_always_consistent;



Expand Down
3 changes: 2 additions & 1 deletion src/dyn/libdyn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ void export_dyn_control_params_objects(){
.def_readwrite("constrained_dofs", &dyn_control_params::constrained_dofs)
.def_readwrite("dt", &dyn_control_params::dt)
.def_readwrite("num_electronic_substeps", &dyn_control_params::num_electronic_substeps)

.def_readwrite("electronic_integrator", &dyn_control_params::electronic_integrator)
.def_readwrite("assume_always_consistent", &dyn_control_params::assume_always_consistent)

.def("sanity_check", expt_sanity_check_v1)
.def("set_parameters", expt_set_parameters_v1)
Expand Down

0 comments on commit aaf2599

Please sign in to comment.