def get_wf_ws(theta): wf, e, rms = gws.gwf(azaz[0], azaz[1], azaz[2], azaz[3], nl2j[0], nl2j[1], nl2j[2], theta[0], theta[1], theta[2], theta[3], theta[4], theta[5], emin, emax) wf = wf * math.sqrt(sf) print(rms) return wf, e
def get_wf_ws(theta): wf, e, _ = gws.gwf(A, Z, a, z, nl2j[0], nl2j[1], nl2j[2], theta[0], theta[1], theta[2], theta[3], theta[4], theta[5], emin, emax) wf = wf * math.sqrt(sf) wf = wf[:50] # Fit only up to 5 fm # norm = integrate.simps(np.square(wf_out[:, 1]) * np.square(wf_out[:, 0]), wf_out[:, 0]) # print(norm) if np.isnan(e): e = -500 # print("NaN e") if np.isnan(wf).any(): # print("NaN in rad.dat") return np.full((50, 1), -500), e return wf, e
def get_wf_ws(theta): wf, e = gws.gwf(6, 3, 1, 0, 0, 1, 1, theta[0], theta[1], theta[2], theta[3], theta[4], theta[5], -10, -1) wf = wf * math.sqrt(sf) ll_wf = -0.5 * np.sum(((wf_exp - wf) / sigma_wf)**2) + 0.5 * 100 * np.log( 2 * np.pi * sigma_wf**2) ll_e = -0.5 * np.sum(( (e_exp - e) / sigma_e)**2) + 0.5 * 100 * np.log(2 * np.pi * sigma_e**2) if np.isnan(e): e = -1000 # print("NaN e") if np.isnan(wf).any(): # print("NaN in rad.dat") return np.full((100, 1), -1000), e return ll_wf + ll_e
import matplotlib.pyplot as plt # Initialize physical parameters import numpy as np A = 6 # Lithium 6 Z = 3 a = 1 # Neutron is 1,0 z = 0 nl2j = [0, 1, 1] # Desired quantum numbers theta = [-39.11, 3.30, 0.75, 4.55, 1.12, 0.88] emin = -90 emax = -1 wf, e, rms = gws.gwf(A, Z, a, z, nl2j[0], nl2j[1], nl2j[2], theta[0], theta[1], theta[2], theta[3], theta[4], theta[5], emin, emax) # Calculate root-mean-squared wf_exp_in = np.genfromtxt(r"/mnt/c/Users/noeld/OneDrive - Louisiana State University/PHYS " r"4399/6Li_7Li_overlaps_NNLOopt_Nmax12.csv", skip_header=1, delimiter=",") sf = integrate.simps(wf_exp_in[:, 3] * np.square(np.linspace(0, 10, 100)) * wf_exp_in[:, 3], np.linspace(0, 10, 100)) # make a corner plot with the posterior distribution fig1 = plt.figure(1) plt.plot(np.linspace(0, 20, 200), np.log(wf * math.sqrt(sf))) plt.errorbar(np.linspace(0, 10, 100), np.log(wf_exp_in[:, 3]), yerr=wf_exp_in[:, 4], label='SA-NCSM', ms=5, c='gray', fmt='.', zorder=1) plt.savefig(r'/mnt/c/Users/noeld/OneDrive - Louisiana State University/PHYS 4399/testplot.jpg') print(e) print(rms)
r"4399/6Li_7Li_overlaps_NNLOopt_Nmax12.csv", skip_header=1, delimiter=",") wf_exp_p1 = wf_exp_in[:, 3] wf_exp_p1_err = wf_exp_in[:, 4] wf_exp_p3 = wf_exp_in[:, 1] wf_exp_p3_err = wf_exp_in[:, 2] sf_p1 = integrate.simps( np.square(wf_exp_p1) * np.square(wf_exp_in[:, 0]), wf_exp_in[:, 0]) sf_p3 = integrate.simps( np.square(wf_exp_p3) * np.square(wf_exp_in[:, 0]), wf_exp_in[:, 0]) wf_br_p1, e_1, _ = gws.gwf(A, Z, a, z, nl2j[0], nl2j[1], 1, theta_brida_p1[0], theta_brida_p1[1], theta_brida_p1[2], theta_brida_p1[3], theta_brida_p1[4], theta_brida_p1[5], emin, emax) wf_br_p3, e_3, _ = gws.gwf(A, Z, a, z, nl2j[0], nl2j[1], 3, theta_brida_p3[0], theta_brida_p3[1], theta_brida_p3[2], theta_brida_p3[3], theta_brida_p3[4], theta_brida_p3[5], emin, emax) wf_br_p1 = wf_br_p1 * math.sqrt(sf_p1) wf_br_p3 = wf_br_p3 * math.sqrt(sf_p3) plt.plot(np.linspace(0, 10, 100), wf_br_p1, label='Brida p=1/2', c='tab:blue') plt.plot(np.linspace(0, 10, 100), wf_br_p3, label='Brida p=3/2', c='tab:orange') plt.errorbar(np.linspace(0, 10, 100),