@@ -25,7 +25,7 @@ def run_morse_potential(energy, index, num_samples=10000, run_sim=True):
2525 mean_free_path_model = "LIQUID"
2626 interaction_potential = [[{{"MORSE"={{D=5.4971E-20, r0=2.782E-10, alpha=1.4198E10}}}}]]
2727 scattering_integral = [["GAUSS_LEGENDRE"]]
28- root_finder = [[{{"CPR"={{n0=2 , nmax=100, epsilon=1E-9, complex_threshold=1E-3 , truncation_threshold=1E-9, far_from_zero=1E9, interval_limit=1E-12 , derivative_free=true}}}}]]
28+ root_finder = [[{{"CPR"={{n0=3 , nmax=100, epsilon=1E-9, complex_threshold=1E-9 , truncation_threshold=1E-9, far_from_zero=1E9, interval_limit=1E-13 , derivative_free=true}}}}]]
2929 num_threads = 4
3030 num_chunks = 10
3131
@@ -87,9 +87,9 @@ def run_krc_morse_potential(energy, index, num_samples=10000, run_sim=True):
8787 mean_free_path_model = "LIQUID"
8888 interaction_potential = [[{{"KRC_MORSE"={{D=5.4971E-20, r0=2.782E-10, alpha=1.4198E10, k=7E10, x0=0.75E-10}}}}]]
8989 scattering_integral = [["GAUSS_LEGENDRE"]]
90- root_finder = [[{{"CPR"={{n0=2, nmax=100 , epsilon=1E-9, complex_threshold=1E-3 , truncation_threshold=1E-9, far_from_zero=1E9, interval_limit=1E-12 , derivative_free=true}}}}]]
91- num_threads = 4
92- num_chunks = 10
90+ root_finder = [[{{"CPR"={{n0=2, nmax=200 , epsilon=1E-9, complex_threshold=1E-9 , truncation_threshold=1E-9, far_from_zero=1E9, interval_limit=1E-13 , derivative_free=true}}}}]]
91+ num_threads = 6
92+ num_chunks = 1
9393
9494 [particle_parameters]
9595 length_unit = "ANGSTROM"
@@ -173,15 +173,30 @@ def run_krc_morse_potential(energy, index, num_samples=10000, run_sim=True):
173173num_energies = 15
174174energies = np .logspace (- 1 , 4 , num_energies )
175175run_sim = True
176- num_samples = 10000
176+ num_samples = 100
177177R_N = np .zeros (num_energies )
178178R_E = np .zeros (num_energies )
179179R_N_2 = np .zeros (num_energies )
180180R_E_2 = np .zeros (num_energies )
181181
182182for index , energy in enumerate (energies ):
183- R_N [index ], R_E [index ] = run_krc_morse_potential (energy , index , num_samples = num_samples , run_sim = True )
184- R_N_2 [index ], R_E_2 [index ] = run_morse_potential (energy , index , num_samples = num_samples , run_sim = True )
183+ R_N [index ], R_E [index ] = run_krc_morse_potential (energy , index , num_samples = num_samples , run_sim = run_sim )
184+ R_N_2 [index ], R_E_2 [index ] = run_morse_potential (energy , index , num_samples = num_samples , run_sim = run_sim )
185+
186+ R_N_test = [
187+ 0.00 , 0.01 , 0.28 , 0.60 , 0.90 ,
188+ 0.95 , 0.88 , 0.81 , 0.70 , 0.49 ,
189+ 0.30 , 0.24 , 0.17 , 0.11 , 0.10
190+ ]
191+
192+ R_N_2_test = [
193+ 0.00 , 0.01 , 0.28 , 0.60 , 0.90 ,
194+ 0.95 , 0.88 , 0.81 , 0.74 , 0.60 ,
195+ 0.46 , 0.23 , 0.05 , 0.00 , 0.00
196+ ]
197+
198+ np .testing .assert_allclose (R_N , R_N_test )
199+ np .testing .assert_allclose (R_N_2 , R_N_2_test )
185200
186201plt .semilogx (energies , R_N , label = 'R_N Morse-Kr-C H-Ni, Es=1.5eV' , color = 'purple' )
187202plt .semilogx (energies , R_N_2 , label = 'R_N Morse H-Ni, Es=1.5eV' , color = 'green' )
0 commit comments