summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-11-17 10:31:56 -0500
committerEugeniy E. Mikhailov <evgmik@gmail.com>2020-09-21 16:29:52 -0400
commitbbb2889bbaccf3605a72765d27dfe3ea6937e7cf (patch)
tree6329bdff9aea99ad6f6533a671387899c26554f8
parent6dfec52c928250eaf0cc45e383b90a1ba86b5b5b (diff)
downloadmulti_mode_eit-bbb2889bbaccf3605a72765d27dfe3ea6937e7cf.tar.gz
multi_mode_eit-bbb2889bbaccf3605a72765d27dfe3ea6937e7cf.zip
converted matrices to sparse form to save disk space
-rw-r--r--useful_functions.m11
1 files changed, 6 insertions, 5 deletions
diff --git a/useful_functions.m b/useful_functions.m
index eb3e880..b9668b0 100644
--- a/useful_functions.m
+++ b/useful_functions.m
@@ -61,13 +61,14 @@ function [L0m, polarizability_m]=L0_and_polarization_submatrices( ...
kron_delta_m=eye(Nlevels);
% note that L0 and decay parts depend only on combination of indexes
% jk,mn but repeats itself for every frequency
- L0m=zeros(rho_size); % (Nlevels^2)x(Nlevels^2) matrix
- decay_part_m=zeros(rho_size); % (NxN)x(NxN) matrix
+ % Matrices will be very sparse so lets create them in sparse representation
+ L0m=sparse(zeros(rho_size)); % (Nlevels^2)x(Nlevels^2) matrix
+ decay_part_m=sparse(zeros(rho_size)); % (NxN)x(NxN) matrix
% polarization matrix will be multiplied by field amplitude letter
% polarization is part of perturbation part of Hamiltonian
- polarizability_m.linear = zeros(rho_size); % (NxN)x(NxN) matrix
- polarizability_m.left = zeros(rho_size); % (NxN)x(NxN) matrix
- polarizability_m.right = zeros(rho_size); % (NxN)x(NxN) matrix
+ polarizability_m.linear = sparse(zeros(rho_size)); % (NxN)x(NxN) matrix
+ polarizability_m.left = sparse(zeros(rho_size)); % (NxN)x(NxN) matrix
+ polarizability_m.right = sparse(zeros(rho_size)); % (NxN)x(NxN) matrix
for p=1:rho_size
% p= j*Nlevels+k
% this might speed up stuff since less matrix passed back and force