def test_additionWF(self): n1, l1 = 1, 5 n2, l2 = 2, 3 dr = 0.001 r = np.arange(dr, 6 + dr, dr) f1 = self._phiWF(n1, l1, r) / np.exp(0.5 * r**2) f2 = self._phiWF(n2, l2, r) / np.exp(0.5 * r**2) f1f2 = f1 * f2 Integrals_ = _RadialTwoBodyDecoupled() aux = 0.0 * r print("\nSeries of B(n{} l{},n{} l{}, p)::".format(n1, l1, n2, l2)) for p in range(0, n1 + n2 + 1): Bp = Integrals_._B_coeff(n1, l1, n2, l2, p) print(" B(nl(1){},{} nl(2){},{}, p{})={}".format( n1, l1, n2, l2, p, Bp)) aux += Bp * (r**(2 * p + l1 + l2)) aux /= np.exp(r**2) import matplotlib.pyplot as plt plt.plot(r, f1, 'r--', label='f1({})'.format((n1, l1))) plt.plot(r, f2, 'b--', label='f2({})'.format((n2, l2))) plt.plot(r, f1f2, label='Analytical f1*f2') plt.plot(r, aux, label='f1*f2 from sum') plt.title("Checking the product of two radial wave functions [{}, {}]". format(shellSHO_Notation(n1, l1), shellSHO_Notation(n2, l2))) plt.xlabel("r") plt.legend() plt.show() diff = sum((aux - f1f2)) * dr self.assertAlmostEqual(diff, 0.0, msg="Not equal", delta=1e-8)
def valenceSpaceShellNames(valence_space, l_ge_10=False): """ Join the SHO major shells defining the valence space (without sense care). Arg: :valence_space Quantum numbers array (Antoine format) :l_ge_10 <bool> [default=False] format for l>10. """ _space = [] states_accepted = 0 for shell, qqnn_shell in valenceSpacesDict_l_ge10.items(): aux = [(sp, shellSHO_Notation(*readAntoine(sp, True))) for sp in qqnn_shell] aux = [(sho_st, sp in valence_space) for sp, sho_st in aux] aux = dict(aux) if not False in aux.values(): _space.append(shell) states_accepted += len(aux) elif True in aux.values(): aux = dict(filter(lambda x: x[1], aux.items())).keys() _space.append('({}: {})'.format(shell, list(aux))) states_accepted += len(aux) if states_accepted == len(valence_space): break return list(set(_space))
def shellState(self): return shellSHO_Notation(self.n, self.l)
dr = 0.001 b_length = 1.2 N_min = 6 N_max = 7 NZ_states = getStatesAndOccupationUpToLastOccupied(N_max, N_min) NZ_states = getStatesAndOccupationOfFullNucleus(N_min + 2, N_max, N_min) A = 0 A_prev = max(1, 2*N_min + 1) Z = 0 r = np.arange(0, 6, dr) rOb = r / b_length for spss, z, n in NZ_states: spss = shellSHO_Notation(*spss) Z += z A = A_prev + z + n for a_ in range(A_prev, A + 1): #A += 2*a aux = _RadialDensityDependentFermi() den = aux._FermiDensity(a_, rOb, z) # den = aux._auxFunction(rOb, 6, A, 1/3) den /= np.exp(rOb**2) # den /= np.exp((7/3) * rOb**2) print(a_,'(', spss, ') integral=', b_length**(-3) * sum(den* np.power(r, 2))*dr) ## 4pi factor cancels with the normalization of the density ## but _FermiDensity dont have factor 1/(4pi * b^3)