''' # Parameters l = 1 j = 1.5 x_peak = 0.17 y_peak = -0.07 basis_state_count = 30 k_max = 30 problem = Helium5() quantum_numbers = QuantumNumbers(l, j) # Bases and contours mom_contour = gauss_contour([0, k_max], basis_state_count) berg_contour = triangle_contour(x_peak, y_peak, k_max, basis_state_count, 5) mom = MomentumBasis(mom_contour) berg = MomentumBasis(berg_contour) bas = [mom, berg] # Solve, print and plot for each basis r = sp.linspace(0, 30, 100) for basis in bas: states = solve(problem, quantum_numbers, basis) ground_state = states[0] print basis.name print "Ground state energy", ground_state.energy, problem.energy_units plt.plot(r, absq(ground_state.wavefunction(r) * r), label=basis.name) # plot(ground_state.wavefunction) #pseudo-code plt.show()
from nhqm.helpers.timing import progress # This example plots the resonance pole as the potential well # gets more and more shallow. The pole is first a bound state on # the imaginary axis, then gets less bound and finally moves into the # fourth quadrant and becomes a resonance. # Setup - try experimenting with the numbers! quantum_numbers = QuantumNumbers(l=1, j=1.5) basis_state_count = 20 triangle_state_count = 16 peak_x = 0.17 peak_y = -0.07 k_max = 2.5 contour = triangle_contour(peak_x, peak_y, k_max, triangle_state_count, basis_state_count - triangle_state_count) momentum_basis = MomentumBasis(contour) # Parameters for the potential strength variation start_V0 = -55 #MeV end_V0 = -47 #Mev steps = 20 V0s = sp.linspace(start_V0, end_V0, steps) ks = sp.empty(steps, complex) def positive_if_imaginary(k): """ Hack to fix rounding errors that make bound states appear on the negative imaginary axis.