summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--useful_functions.m45
1 files changed, 22 insertions, 23 deletions
diff --git a/useful_functions.m b/useful_functions.m
index 8adbf86..bd8294c 100644
--- a/useful_functions.m
+++ b/useful_functions.m
@@ -132,33 +132,32 @@ function L=Liouville_operator_matrix( ...
w_l=w_jk-w_mn;
% lets search this frequency in the list of available frequencies
% but since we not guaranteed to find it lets assign temporary 0 to Liouville matrix element
- for w3i=1:Nfreq
+ w3i=(w_l == modulation_freq);
+ if (any(w3i))
+ % yey, requested modulation frequency exist
+ % lets do L sub matrix filling
% at most we should have only one matching frequency
w_iner=modulation_freq(w3i);
- if ((w_iner == w_l))
- % yey, requested modulation frequency exist
- % lets do L sub matrix filling
- %such frequency exist in the list of modulation frequencies
- if ((w_iner == 0))
- % calculate unperturbed part (Hamiltonian without EM field)
- L(p0:p0+rho_size-1,s0:s0+rho_size-1)=L0m;
- else
- % calculate perturbed part (Hamiltonian with EM field)
- % in other word interactive part of Hamiltonian
- L(p0:p0+rho_size-1,s0:s0+rho_size-1)= ...
- -im_one/hbar*polarizability_m.linear * E_field.linear(w3i) ...
- -im_one/hbar*polarizability_m.left * E_field.left(w3i) ...
- -im_one/hbar*polarizability_m.right * E_field.right(w3i) ...
- ;
- endif
- % diagonal elements are self modulated
- % due to rotating wave approximation
- if ((p0 == s0))
- L(p0:p0+rho_size-1,s0:s0+rho_size-1)+= -im_one*w_jk*eye(rho_size);
- endif
+ %such frequency exist in the list of modulation frequencies
+ if ((w_iner == 0))
+ % calculate unperturbed part (Hamiltonian without EM field)
+ L(p0:p0+rho_size-1,s0:s0+rho_size-1)=L0m;
+ else
+ % calculate perturbed part (Hamiltonian with EM field)
+ % in other word interactive part of Hamiltonian
+ L(p0:p0+rho_size-1,s0:s0+rho_size-1)= ...
+ -im_one/hbar*polarizability_m.linear * E_field.linear(w3i) ...
+ -im_one/hbar*polarizability_m.left * E_field.left(w3i) ...
+ -im_one/hbar*polarizability_m.right * E_field.right(w3i) ...
+ ;
endif
- endfor
+ % diagonal elements are self modulated
+ % due to rotating wave approximation
+ if ((p0 == s0))
+ L(p0:p0+rho_size-1,s0:s0+rho_size-1)+= -im_one*w_jk*eye(rho_size);
+ endif
+ endif
endfor
endfor
endfunction