From dbf7ece928f1d7759d4263eb38e6da82941f8ce9 Mon Sep 17 00:00:00 2001 From: sascha Date: Mon, 8 Apr 2019 21:16:57 +0200 Subject: [PATCH 1/3] 2D Gauss Beam --- include/CRT_Base_IF.h | 3 ++- raman.xml | 22 ++++++---------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/include/CRT_Base_IF.h b/include/CRT_Base_IF.h index afb977b..8ce9749 100644 --- a/include/CRT_Base_IF.h +++ b/include/CRT_Base_IF.h @@ -451,6 +451,7 @@ void CRT_Base_IF::Do_NL_Step() //tmp !! // absorption of wavefuntion at boundaries // can be commented out if necessary + /* for ( int k=0; k::Do_NL_Step() Psi[k][this->m_no_of_pts-m][0] = Psi[k][this->m_no_of_pts-m][0] * pow(sin(M_PI/2/1000*m),2); Psi[k][this->m_no_of_pts-m][1] = Psi[k][this->m_no_of_pts-m][1] * pow(sin(M_PI/2/1000*m),2); } - } + } */ } /** Solves the potential part in the presence of light fields with a numerical method diff --git a/raman.xml b/raman.xml index 3fdad6a..404bb6b 100644 --- a/raman.xml +++ b/raman.xml @@ -1,11 +1,10 @@ - 1 + 2 0.000_1.bin - 0.000_2.bin - 0.000_2.bin + 0.000_1.bin + 0.000_1.bin - - 0 + 0.000000 0 0 299792458 @@ -23,15 +22,6 @@ - 20000 - 20 - 2000 - 100 - 260000 - 40 - 260000 - 20 - 20000 - +10000 + - From 10bfb996cad6ba57137bbe3a51c42bf93033535a Mon Sep 17 00:00:00 2001 From: sascha Date: Tue, 9 Apr 2019 00:36:31 +0200 Subject: [PATCH 2/3] tmp commit --- include/CRT_Base_IF.h | 53 +++++++++++++++++++++++++++++-------------- raman.xml | 8 ++++--- 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/include/CRT_Base_IF.h b/include/CRT_Base_IF.h index 8ce9749..cca3444 100644 --- a/include/CRT_Base_IF.h +++ b/include/CRT_Base_IF.h @@ -588,15 +588,7 @@ void CRT_Base_IF::Numerical_Raman() const double dt = -m_header.dt; const double t1 = this->Get_t(); - std::array laser_k_tmp, laser_w_tmp; - const double d_02_sm = -sqrt(5.0/24.0); - const double d_03_sp = sqrt(5.0/24.0); - const double d_12_sm = sqrt(1.0/120.0); - const double d_13_sp = sqrt(1.0/120.0); - const double d_04_sm = sqrt(1.0/8.0); - const double d_05_sp = sqrt(1.0/8.0); - const double d_14_sm = -sqrt(1.0/8.0); - const double d_15_sp = sqrt(1.0/8.0); + std::array laser_k_tmp, laser_w_tmp, z_R, waist_0, z_0, GaussAmp, R, waist, gouy; vector Psi; for ( int i=0; i::Numerical_Raman() gsl_matrix_complex *evec = gsl_matrix_complex_alloc(no_int_states,no_int_states); double phi[no_int_states], re1, re2, im1, im2, eta[2]; - double tmp_cos_pos, tmp_cos_pos_cc, tmp_cos_neg, tmp_cos_neg_cc; CPoint x; std::array chirp_alpha = this->chirp_alpha; double doppler_beta = v_0/c_p + (g_0*t1)/c_p; + // Correction for chirp laser_w_tmp[0] = laser_w[0]+chirp_alpha[0]*t1; laser_k_tmp[0] = laser_w[0]/c_p; laser_w_tmp[1] = laser_w[1]+chirp_alpha[1]*t1; laser_k_tmp[1] = laser_w[1]/c_p; - - double laser_domh_tmp = laser_w_tmp[0]-laser_w_tmp[1]; - + // ------------------- + + // Gauss Beam Parameter + z_0[0] = 0; + z_0[1] = 0; + waist_0[0] = 2; + waist_0[1] = 2; + z_R[0] = laser_k_tmp[0]/2 * pow(waist_0[0],2); + z_R[1] = laser_k_tmp[1]/2 * pow(waist_0[1],2); + // ------------------- + + // Main Diagonal of Hamiltonian in Rotating Frame DeltaL[0] = laser_w_tmp[0]-omega_ig; DeltaL[1] = laser_w_tmp[1]-omega_ie; + // ------------------- #pragma omp for for ( int l=0; lm_no_of_pts; l++ ) @@ -648,29 +650,46 @@ void CRT_Base_IF::Numerical_Raman() gsl_matrix_complex_set(A,i,i, {phi[i],0}); } + // 2D Gauss Amplitude + waist[0] = waist_0[0] * sqrt( 1 + pow((x[0]-z_0[0])/z_R[0], 2) ); + waist[1] = waist_0[1] * sqrt( 1 + pow((x[0]-z_0[0])/z_R[1], 2) ); + R[0] = x[0] * ( 1 + pow(z_R[0]/(x[0]-z_0[0]),2) ); + R[1] = x[0] * ( 1 + pow(z_R[1]/(x[0]-z_0[0]),2) ); + gouy[0] = atan( (x[0]-z_0[0])/z_R[0] ); + gouy[1] = atan( (x[0]-z_0[0])/z_R[1] ); + + GaussAmp[0] = waist_0[0] / waist[0] * exp( - pow(x[1]/waist[0],2) ); + GaussAmp[1] = waist_0[1] / waist[1] * exp( - pow(x[1]/waist[1],2) ); + + //--------------------------------------------- + //Raman //--------------------------------------------- - sincos(laser_k_tmp[0] * x[0] * (doppler_beta - 1) - doppler_beta * laser_w_tmp[0] * t1 - Phi_1_sm[0], &im1, &re1 ); // For right going light - sincos(laser_k_tmp[0] * x[0] * (doppler_beta + 1) + doppler_beta * laser_w_tmp[0] * t1 - Phi_1_sm[1], &im2, &re2 ); // For left going light + sincos(laser_k_tmp[0] * (x[0] + pow(x[1],2)/(2*R[0]) ) * (doppler_beta - 1) - doppler_beta * laser_w_tmp[0] * t1 - Phi_1_sm[0], &im1, &re1 ); // For right going light + sincos(laser_k_tmp[0] * (x[0] + pow(x[1],2)/(2*R[0]) ) * (doppler_beta + 1) + doppler_beta * laser_w_tmp[0] * t1 - Phi_1_sm[1], &im2, &re2 ); // For left going light //--------------------------------------------- eta[0] = re1 * Amp_1_sm[0] + re2 * Amp_1_sm[1]; + eta[0] *= GaussAmp[0]; eta[1] = im1 * Amp_1_sm[0] + im2 * Amp_1_sm[1]; + eta[1] *= GaussAmp[0]; gsl_matrix_complex_set(A,0,2, {eta[0],eta[1]}); gsl_matrix_complex_set(A,2,0, {eta[0],-eta[1]}); //--------------------------------------------- - sincos(laser_k_tmp[1] * x[0] * (doppler_beta - 1) - doppler_beta * laser_w_tmp[1] * t1 - Phi_2_sm[0], &im1, &re1 ); - sincos(laser_k_tmp[1] * x[0] * (doppler_beta + 1) + doppler_beta * laser_w_tmp[1] * t1 - Phi_2_sm[1], &im2, &re2 ); + sincos(laser_k_tmp[1] * (x[0] + pow(x[1],2)/(2*R[1]) ) * (doppler_beta - 1) - doppler_beta * laser_w_tmp[1] * t1 - Phi_2_sm[0], &im1, &re1 ); + sincos(laser_k_tmp[1] * (x[0] + pow(x[1],2)/(2*R[1]) ) * (doppler_beta + 1) + doppler_beta * laser_w_tmp[1] * t1 - Phi_2_sm[1], &im2, &re2 ); //--------------------------------------------- eta[0] = re1 * Amp_2_sm[0] + re2 * Amp_2_sm[1]; + eta[0] *= GaussAmp[1]; eta[1] = im1 * Amp_2_sm[0] + im2 * Amp_2_sm[1]; + eta[0] *= GaussAmp[1]; gsl_matrix_complex_set(A,1,2, {eta[0],eta[1]}); gsl_matrix_complex_set(A,2,1, {eta[0],-eta[1]}); diff --git a/raman.xml b/raman.xml index 404bb6b..d2b4b72 100644 --- a/raman.xml +++ b/raman.xml @@ -1,8 +1,8 @@ 2 0.000_1.bin - 0.000_1.bin - 0.000_1.bin + 0.000_2.bin + 0.000_2.bin 0.000000 0 @@ -22,6 +22,8 @@ -10000 +10000 From 1d2aa8f57426ad94676d0292115fb583ed19ef54 Mon Sep 17 00:00:00 2001 From: sascha Date: Tue, 23 Apr 2019 01:48:10 +0200 Subject: [PATCH 3/3] Working 2D Gauss Beam implemented --- include/CRT_Base_IF.h | 31 +++++++++++++++++++++---------- raman.xml | 7 +++---- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/include/CRT_Base_IF.h b/include/CRT_Base_IF.h index cca3444..b5a6d1b 100644 --- a/include/CRT_Base_IF.h +++ b/include/CRT_Base_IF.h @@ -588,7 +588,7 @@ void CRT_Base_IF::Numerical_Raman() const double dt = -m_header.dt; const double t1 = this->Get_t(); - std::array laser_k_tmp, laser_w_tmp, z_R, waist_0, z_0, GaussAmp, R, waist, gouy; + std::array laser_k_tmp, laser_w_tmp, z_R, waist_0, z_0, GaussAmp, R_c, Phase_c, waist, gouy; vector Psi; for ( int i=0; i::Numerical_Raman() // Gauss Beam Parameter z_0[0] = 0; z_0[1] = 0; - waist_0[0] = 2; - waist_0[1] = 2; + waist_0[0] = 7; // std::numeric_limits::max() for plane waves + waist_0[1] = 7; z_R[0] = laser_k_tmp[0]/2 * pow(waist_0[0],2); z_R[1] = laser_k_tmp[1]/2 * pow(waist_0[1],2); // ------------------- @@ -650,11 +650,22 @@ void CRT_Base_IF::Numerical_Raman() gsl_matrix_complex_set(A,i,i, {phi[i],0}); } - // 2D Gauss Amplitude + // 2D Gauss Amplitude x[0] is z-axis and x[1] is y-axis also called radius waist[0] = waist_0[0] * sqrt( 1 + pow((x[0]-z_0[0])/z_R[0], 2) ); waist[1] = waist_0[1] * sqrt( 1 + pow((x[0]-z_0[0])/z_R[1], 2) ); - R[0] = x[0] * ( 1 + pow(z_R[0]/(x[0]-z_0[0]),2) ); - R[1] = x[0] * ( 1 + pow(z_R[1]/(x[0]-z_0[0]),2) ); + R_c[0] = (x[0]-z_0[0]) * ( 1 + pow(z_R[0]/(x[0]-z_0[0]),2) ); + R_c[1] = (x[0]-z_0[1]) * ( 1 + pow(z_R[1]/(x[0]-z_0[1]),2) ); + // The Radius of curvature can be infinite. This is catched here + if (R_c[0] != R_c[0]) { + R_c[0] = std::numeric_limits::max(); + } + if (R_c[1] != R_c[1]) { + R_c[1] = std::numeric_limits::max(); + } + //----------------------------------- + Phase_c[0] = pow(x[1],2)/(2*R_c[0]); + Phase_c[1] = pow(x[1],2)/(2*R_c[1]); + gouy[0] = atan( (x[0]-z_0[0])/z_R[0] ); gouy[1] = atan( (x[0]-z_0[0])/z_R[1] ); @@ -666,8 +677,8 @@ void CRT_Base_IF::Numerical_Raman() //Raman //--------------------------------------------- - sincos(laser_k_tmp[0] * (x[0] + pow(x[1],2)/(2*R[0]) ) * (doppler_beta - 1) - doppler_beta * laser_w_tmp[0] * t1 - Phi_1_sm[0], &im1, &re1 ); // For right going light - sincos(laser_k_tmp[0] * (x[0] + pow(x[1],2)/(2*R[0]) ) * (doppler_beta + 1) + doppler_beta * laser_w_tmp[0] * t1 - Phi_1_sm[1], &im2, &re2 ); // For left going light + sincos(laser_k_tmp[0] * (x[0] + Phase_c[0] ) * (doppler_beta - 1) - doppler_beta * laser_w_tmp[0] * t1 - Phi_1_sm[0] - gouy[0], &im1, &re1 ); // For right going light + sincos(laser_k_tmp[0] * (x[0] + Phase_c[0] ) * (doppler_beta + 1) + doppler_beta * laser_w_tmp[0] * t1 - Phi_1_sm[1] - gouy[0], &im2, &re2 ); // For left going light //--------------------------------------------- @@ -681,8 +692,8 @@ void CRT_Base_IF::Numerical_Raman() //--------------------------------------------- - sincos(laser_k_tmp[1] * (x[0] + pow(x[1],2)/(2*R[1]) ) * (doppler_beta - 1) - doppler_beta * laser_w_tmp[1] * t1 - Phi_2_sm[0], &im1, &re1 ); - sincos(laser_k_tmp[1] * (x[0] + pow(x[1],2)/(2*R[1]) ) * (doppler_beta + 1) + doppler_beta * laser_w_tmp[1] * t1 - Phi_2_sm[1], &im2, &re2 ); + sincos(laser_k_tmp[1] * (x[0] + Phase_c[1] ) * (doppler_beta - 1) - doppler_beta * laser_w_tmp[1] * t1 - Phi_2_sm[0] - gouy[1], &im1, &re1 ); + sincos(laser_k_tmp[1] * (x[0] + Phase_c[1] ) * (doppler_beta + 1) + doppler_beta * laser_w_tmp[1] * t1 - Phi_2_sm[1] - gouy[1], &im2, &re2 ); //--------------------------------------------- diff --git a/raman.xml b/raman.xml index d2b4b72..5dd4160 100644 --- a/raman.xml +++ b/raman.xml @@ -4,7 +4,7 @@ 0.000_2.bin 0.000_2.bin - 0.000000 + 0.000100 0 0 299792458 @@ -22,8 +22,7 @@ -10000 + 80 +