summaryrefslogtreecommitdiff
path: root/useful_functions.m
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2009-12-18 23:28:15 +0000
committerEugeniy Mikhailov <evgmik@gmail.com>2009-12-18 23:28:15 +0000
commitfd6ae2a580d48aa3c0720d093c5d1e87d6748daf (patch)
tree92d0eaaf1144fc0836152b5ca741dab3cd750243 /useful_functions.m
parenta0b6189c556b53b4a74a8d4ef2f36e0ecf9a3ffd (diff)
downloadmulti_mode_eit-fd6ae2a580d48aa3c0720d093c5d1e87d6748daf.tar.gz
multi_mode_eit-fd6ae2a580d48aa3c0720d093c5d1e87d6748daf.zip
inner loop if replaced with vector comparison
Diffstat (limited to 'useful_functions.m')
-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