@@ -1295,6 +1295,9 @@ void compute_dynamics(dyn_variables& dyn_var, bp::dict dyn_params,
12951295 // Recompute diabatic/adiabatic states, time-overlaps, NAC, Hvib, etc. in response to change of q
12961296 update_Hamiltonian_variables (prms, dyn_var, ham, ham_aux, py_funct, params, 0 );
12971297
1298+ // Copy diabatic-to-adiabatic basis transformation to the dynamical variable
1299+ dyn_var.update_basis_transform (ham);
1300+
12981301 // Recompute the orthogonalized reprojection matrices, stored in dyn_var.proj_adi
12991302 // this calculaitons used ham.children[i].time_overlap matrix, updated in the previous step
13001303 update_proj_adi (prms, dyn_var, ham);
@@ -1326,15 +1329,20 @@ void compute_dynamics(dyn_variables& dyn_var, bp::dict dyn_params,
13261329 }
13271330
13281331 // Recompute density matrices in response to the updated amplitudes
1329- dyn_var.update_amplitudes (prms, ham);
1330- dyn_var.update_density_matrix (prms, ham, 1 );
1332+ // dyn_var.update_amplitudes(prms, ham);
1333+ dyn_var.update_amplitudes (prms);
1334+ // dyn_var.update_density_matrix(prms, ham, 1);
1335+ dyn_var.update_density_matrix (prms);
13311336
13321337 vector<int > old_states ( dyn_var.act_states );
13331338
13341339 // In the interval [t, t + dt], we may have experienced the basis reordering, so we need to
13351340 // change the active adiabatic state
1336- if (prms.tsh_method != 3 && prms.tsh_method != 4 ){ // Don't update states based on amplitudes, in the LZ method
1337- dyn_var.update_active_states (1 , 0 ); // 1 - forward; 0 - only active state
1341+ if (prms.tsh_method == 3 or prms.tsh_method == 4 ){
1342+ // Don't update states based on amplitudes, in the LZ method
1343+ ;;
1344+ }
1345+ else { dyn_var.update_active_states (1 , 0 ); // 1 - forward; 0 - only active state
13381346 }
13391347
13401348 // For now, this function also accounts for the kinetic energy adjustments to reflect the adiabatic evolution
@@ -1406,6 +1414,10 @@ void compute_dynamics(dyn_variables& dyn_var, bp::dict dyn_params,
14061414 decoherence_rates = schwartz_2 (prms, ham, *prms.schwartz_decoherence_inv_alpha );
14071415 }
14081416
1417+ else if (prms.decoherence_times_type ==4 ){
1418+ decoherence_rates = schwartz_1 (prms, *dyn_var.ampl_adi , *dyn_var.p , ham, *prms.schwartz_interaction_width );
1419+ }
1420+
14091421 // /== Optionally, apply the dephasing-informed correction ==
14101422 if (prms.dephasing_informed ==1 ){
14111423 Eadi = get_Eadi (ham);
@@ -1438,7 +1450,7 @@ void compute_dynamics(dyn_variables& dyn_var, bp::dict dyn_params,
14381450 if (prms.rep_tdse ==1 ){
14391451 p = *dyn_var.p ;
14401452 // cout<<"p before mfsd\n"; dyn_var.p->show_matrix();
1441- *dyn_var.ampl_adi = mfsd (p, *dyn_var.ampl_adi , *dyn_var.iM , prms.dt , decoherence_rates, ham, rnd, prms.isNBRA );
1453+ *dyn_var.ampl_adi = mfsd (p, *dyn_var.ampl_adi , *dyn_var.iM , prms.dt , dyn_var. act_states , decoherence_rates, ham, rnd, prms.isNBRA );
14421454 *dyn_var.p = p;
14431455 // cout<<"p after mfsd\n"; dyn_var.p->show_matrix();
14441456
@@ -1464,25 +1476,28 @@ void compute_dynamics(dyn_variables& dyn_var, bp::dict dyn_params,
14641476
14651477
14661478 // Update amplitudes and density matrices in response to decoherence corrections
1467- dyn_var.update_amplitudes (prms, ham);
1468- dyn_var.update_density_matrix (prms, ham, 1 );
1479+ // dyn_var.update_amplitudes(prms, ham);
1480+ dyn_var.update_amplitudes (prms);
1481+ // dyn_var.update_density_matrix(prms, ham, 1);
1482+ dyn_var.update_density_matrix (prms);
14691483
14701484
14711485 // ************************************ TSH options ****************************************
14721486 // Adiabatic dynamics
14731487 if (prms.tsh_method ==-1 ){ ;; }
14741488
1475- // FSSH, GFSH, MSSH, LZ, ZN, DISH, MASH, FSSH2
1489+ // FSSH, GFSH, MSSH, LZ, ZN, DISH, MASH, FSSH2, FSSH3
14761490 else if (prms.tsh_method == 0 || prms.tsh_method == 1 || prms.tsh_method == 2 || prms.tsh_method == 3
1477- || prms.tsh_method == 4 || prms.tsh_method == 5 || prms.tsh_method == 6 || prms.tsh_method == 7 ){
1491+ || prms.tsh_method == 4 || prms.tsh_method == 5 || prms.tsh_method == 6 || prms.tsh_method == 7
1492+ || prms.tsh_method == 8 ){
14781493
14791494
14801495 vector<int > old_states (dyn_var.act_states );
14811496 // ========================== Hop proposal and acceptance ================================
14821497
1483- // FSSH (0), GFSH (1), MSSH (2), LZ(3), ZN (4), MASH(6), FSSH2(7)
1498+ // FSSH (0), GFSH (1), MSSH (2), LZ(3), ZN (4), MASH(6), FSSH2(7), FSSH3(8)
14841499 if (prms.tsh_method == 0 || prms.tsh_method == 1 || prms.tsh_method == 2 || prms.tsh_method == 3
1485- || prms.tsh_method == 4 || prms.tsh_method == 6 || prms.tsh_method == 7 ){
1500+ || prms.tsh_method == 4 || prms.tsh_method == 6 || prms.tsh_method == 7 || prms. tsh_method == 8 ){
14861501
14871502 // / Compute hop proposal probabilities from the active state of each trajectory to all other states
14881503 // / of that trajectory
@@ -1549,15 +1564,17 @@ void compute_dynamics(dyn_variables& dyn_var, bp::dict dyn_params,
15491564 // Update vib Hamiltonian to reflect the change of the momentum
15501565 update_Hamiltonian_variables (prms, dyn_var, ham, ham_aux, py_funct, params, 1 );
15511566
1552- }// tsh_method == 0, 1, 2, 3, 4, 5
1567+ }// tsh_method == 0, 1, 2, 3, 4, 5, 6, 7, 8
15531568
15541569 else { cout<<" tsh_method == " <<prms.tsh_method <<" is undefined.\n Exiting...\n " ; exit (0 ); }
15551570
15561571
15571572 // Update the amplitudes and DM, in response to state hopping and other changes in the TSH part
15581573 // so that we have them consistent in the output
1559- dyn_var.update_amplitudes (prms, ham);
1560- dyn_var.update_density_matrix (prms, ham, 1 );
1574+ // dyn_var.update_amplitudes(prms, ham);
1575+ dyn_var.update_amplitudes (prms);
1576+ // dyn_var.update_density_matrix(prms, ham, 1);
1577+ dyn_var.update_density_matrix (prms);
15611578
15621579
15631580 // Saves the current density matrix into the previous - needed for FSSH2
0 commit comments