import matplotlib.pyplot as plt problem = He5 k_max = 3 order = 100 std = 26 contour = gauss_contour((0, k_max), order) ks, _ = contour QNums = namedtuple("qnums", "l j k") Q = QNums(l=1, j=1.5, k=ks) problem.V0 = -70 H = mom.hamiltonian(contour, problem, Q) eigvals_1, eigvecs_1 = energies(H) # problem.V0=-60 # H = mom.hamiltonian(contour, problem, Q) # eigvals_2, eigvecs_2 = energies(H) problem.V0 = -52 H = mom.hamiltonian(contour, problem, Q) eigvals_3, eigvecs_3 = energies(H) problem.V0 = -47 H = mom.hamiltonian(contour, problem, Q) eigvals_4, eigvecs_4 = energies(H) problem.V0 = -40 H = mom.hamiltonian(contour, problem, Q)
plot = False problem = He5 k_max = 3 order = 100 num_wfs = 10 QNums = namedtuple('qnums', 'l j') Q = QNums(l=1, j=1.5) problem.V0=-50 contour = gauss_contour((0, 0.2 -0.2j, k_max), [order/2,order/2]) points, weights = contour H = mom.hamiltonian(contour, problem, Q) eigvals_real, eigvecs_real = energies(H) contour = gauss_contour((0, k_max), order) points, weights = contour H = mom.hamiltonian(contour, problem, Q) eigvals_comp, eigvecs_comp = energies(H) rmax = 100 r_order = 500 r = sp.linspace(1e-1, rmax, r_order) def sqrd_wf(eigvec): wf = mom.gen_wavefunction(eigvec, Q, contour) return r_order / rmax * r**2 * absq(wf(r))*10/ norm(r*wf(r))**2
r0list=sp.hstack([sp.linspace(a,b,100),sp.linspace(b,c,100)]) omegalist=[] for r in r0list: omegalist.append(1/(problem.mass*r**2)) basis_size=50 k_max=3 contour = gauss_contour([0, k_max], basis_size) points, _ = contour QNums = namedtuple('qnums', 'l j') Q = QNums(l=1, j=1.5) res_osc = [] truncation = 5 for i,omega in enumerate(omegalist): print (i+1),":",omega problem.HO_omega=omega H = osc.hamiltonian(basis_size, problem, Q) eigvals, _ = energies(H) res_osc.append(eigvals[0:20]) clipped_res = sp.clip(res_osc, -sp.inf, truncation) # plt.plot(r0list,clipped_res,'.') # plt.show() script_dir = os.path.dirname(os.path.realpath(__file__)) + "/" sp.savetxt(script_dir + "E(r0).data", sp.array([r0list]+zip(*clipped_res)).T)
while rand == -1 or rand == res or rand in states: rand = random.sample(range(int(seg*basis_size/3),int((seg+1)*basis_size/3)),1)[0] return rand n_rounds=100 resonance_i=18 n_p_segs=1 results=[] for i in range(n_rounds): states = [] for i in range(3*n_p_segs): states.append(sp_states[get_rand(i%3,resonance_i,states)]) states.append(sp_states[resonance_i]) for i,sp in enumerate(states): states[i] = SP(i,l=sp.l,j=sp.j,E=sp.E,eigvec=sp.eigvec,contour=sp.contour,basis=sp.basis) interaction = two_body.gen_interaction(states, J, problem=problem) mb_H = coupled.hamiltonian(states, interaction, J) mb_eigvals, mb_eigvecs = energies(mb_H) results.append(mb_eigvals) ks=[] for ev in results: for e in ev: ks.append(scipy.sqrt(2*problem.mass*e)) # plt.plot(scipy.real(ks),scipy.imag(ks),'*') # plt.show() kdata = scipy.array([scipy.real(ks), scipy.imag(ks)]) print scipy.shape(kdata) script_dir = os.path.dirname(os.path.realpath(__file__)) + "/" scipy.savetxt(script_dir + "he6mcarloJ2.data", kdata.T)
sierpinski = gauss_contour([0, sierpa, sierpb, sierpg, sierph, k_max], [ 9,19,39,19, 200]) contours = [triangle_contour(peak_x, peak_y, k_max, order/3), gauss_contour([0, 0 -peak_y*1j, 2*peak_x -peak_y*1j, 2*peak_x, k_max], [order/4,order/4,order/4,order/4])] V0 = -47 k_res = [] for m, contour in enumerate(contours): problem.V0=V0 k_res.append(sp.empty(len(contour[0]), 'complex')) QNums = namedtuple('qnums', 'l j k') Q = QNums(l=1, j=1.5, k=len(contour[0])) H = mom.hamiltonian(contour, problem, Q) eigvals, eigvecs = energies(H) print res_index(eigvecs) for i in xrange(len(eigvals)): k_res[m][i] = sp.sqrt(2*problem.mass*eigvals[i]) if sp.real(k_res[m][i])<10 ** -6: k_res[m][i] = abs(k_res[m][i]) * 1j if sp.imag(k_res[m][i]) > 0: k_res[m][i] = sp.conj(k_res[m][i]) print find_closest(k_res[m]) print "::::"