Skip to content

Commit 7428ccf

Browse files
committed
Enabled population-based FSSH-3, as well as a different initializtion of the current-based FSSH-3
1 parent ba0ee6c commit 7428ccf

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/dyn/dyn_hop_proposal_fssh3.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,12 @@ vector<double> hopping_probabilities_fssh3(dyn_control_params& prms, CMATRIX& de
152152
//====== Testing options =========
153153

154154
int size_option = 0; // not used here, = prms.fssh3_size_option; // 0 - N elements, only populations; 1 - N^2 elements - also coherences
155-
int approach_option = 1; // = prms.fssh3_approach_option; // 0 - master equation (J contains hopping probabilities); 1 - kinetic approach (J contains fluxes)
155+
int approach_option = prms.fssh3_approach_option;
156+
// 0 - master equation (J contains hopping probabilities);
157+
// 1 - kinetic approach (J contains fluxes), initialize J to be all zeroes
158+
// 2 - kinetic approach (J contains fluxes), initialize J to J_{i,i+1} = 1.0 and J_{i-1,i} = -1.0, and 0.0 otherwise
159+
160+
156161
int decomp_option = 0; // not used here, = prms.fssh3_decomp_option; // in this version, it selects the
157162

158163
//=========================== Step 1: definition of vectorized densities ==================================

src/opt/grad_descent.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,20 @@ MATRIX run_opt(MATRIX& x, MATRIX& y, double dt, double nsteps, double err_tol, i
249249
int n = x.n_rows;
250250
MATRIX A(n,n); A = 0.0;
251251
if(approach_option==0){ A.identity(); }
252-
else if(approach_option==1 or approach_option==2){
252+
else if(approach_option==1){
253253
for(i=0;i<n;i++){
254254
for(j=0;j<n;j++){ A.set(i,j, 0.0 ); }
255255
}
256256
}
257+
else if(approach_option==2){
258+
for(i=0;i<n;i++){
259+
for(j=0;j<n;j++){
260+
if(j-i==1){ A.set(i,j, 1.0); }
261+
else if(j-i==-1){ A.set(i,j, -1.0); }
262+
else{ A.set(i,j, 0.0 ); }
263+
}
264+
}
265+
}
257266

258267
double Lag, L0, L1, L2, L3;
259268
double L = 1.0;

0 commit comments

Comments
 (0)