from __future__ import division import scipy as sp from nhqm.bases import mom_space as mom from nhqm.problems import He5 from nhqm.bases.contours import gauss_contour from nhqm.QM_helpers import energies, absq from numpy.linalg import norm from collections import namedtuple 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)
from numpy.linalg import norm from collections import namedtuple import matplotlib.pyplot as plt 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)
gaussian.V0 = -1140 gaussian.r0 = 1 SDI.V0 = 2800 SDI.r0 = 2 peak_x = 0.2 peak_y = 0.1 k_max = 2.5 complex_contour = True J = 2 js = [1.5] if complex_contour: contour = triangle_contour_explicit(peak_x, peak_y, k_max, points_on_triangle, basis_size - points_on_triangle) else: contour = gauss_contour([0, k_max], basis_size) points, _ = contour print mb_scheme.name, sp_basis.name print "\tBasis size:", basis_size if sp_basis == mom: print "\t",("Complex contour" if complex_contour else "Real contour") print "\t\tk_max:", k_max print two_body.name, "interaction" print "\tV0:", two_body.V0 print "\tr0:", two_body.r0 # Construct sp states. spQ = namedtuple('qnums', 'l j') SP = namedtuple('sp', "id l j E eigvec contour basis")
peak_x = 0.2 peak_y = 0.2 sierp_x = 0.17 sierp_y = -0.1j sierpa = 0.5*sierp_x sierpb = 2*sierp_y sierpc = 0.99*sierp_x + 2*sierp_y sierpd = 0.51*sierp_x + sierp_y sierpe = 1.49*sierp_x + sierp_y sierpf = 1.01*sierp_x + 2*sierp_y sierpg = 2*sierp_x + 2*sierp_y sierph = 1.5*sierp_x 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)
def un_weight(eigvec): eigvec_prim = eigvec / sp.sqrt(weights) return eigvec_prim / norm(eigvec_prim) def un_point(eigvec): eigvec_prim = eigvec / points return eigvec_prim / norm(eigvec_prim) def un_symm(eigvec): eigvec_prim = eigvec / sp.sqrt(weights) / points return eigvec_prim / norm(eigvec_prim) contours = [gauss_contour((0, 0.2 -0.2j, 0.4, k_max), [order/6, order/6, order*2/3]), \ gauss_contour((0, k_max), order)] data = [] for j,contour in enumerate(contours): points, weights = contour momenta = sp.real(points) H = mom.hamiltonian(contour, problem, Q) eigvals, eigvecs = energies(H) result = [momenta] print "res:", res_index(eigvecs), "beware of off-by-one" for i in xrange(num_wfs):
from __future__ import division import scipy as sp from nhqm.bases import mom_space as mom from nhqm.problems import He5 from nhqm.bases.contours import gauss_contour from nhqm.QM_helpers import energies, absq from numpy.linalg import norm from collections import namedtuple import matplotlib.pyplot as plt problem = He5 order=15 contour = gauss_contour((0, 0.2 -0.1j,0.4, 2.5), [order/3,order/3,order/3]) momenta, _ = contour QNums = namedtuple('qnums', 'l j k') Q = QNums(l=1, j=1.5, k=momenta) problem.V0 = -47 H = mom.hamiltonian(contour, problem, Q) eigvals, eigvecs = energies(H) def momentum_res(energy): return sp.sqrt(2 * problem.mass * energy) rmax = 100 r_order = 200 r = sp.linspace(1e-1, rmax, r_order) def sqrd_wf(eigvec):