diff options
Diffstat (limited to 'useful_functions.m')
-rw-r--r-- | useful_functions.m | 11 |
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 |