-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_potentials.py
More file actions
43 lines (25 loc) · 1.23 KB
/
test_potentials.py
File metadata and controls
43 lines (25 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#Here we test the objects and functions of class potentials inside Numerov library
import Numerov as nu
f=open("test_results/potentials_test.txt","w")
coulomb=nu.potentials.Coulomb(2.)
f.write(f"The coulomb potential at r=2 is {coulomb}\n")
well=nu.potentials.square_well(1.5,1,2,3)
f.write(f"The square_well potential at r=1.5 is {well}\n")
well=nu.potentials.radial_well(1.5,5,3)
f.write(f"Radial well at 1.5 is {well}\n")
angular=nu.potentials.angular_potential(1)
f.write(f"angular part of the potential at r=1 with l=0 and m=1 grid is {angular}\n")
#We can even obtain a vector-like object for the potential
grid=nu.spatial_objects.uniform_grid(1,10,10)
f.write(f"The grid is {grid}\n")
coulomb=nu.potentials.Coulomb(grid)
f.write(f"Coulomb potential along the grid is {coulomb}\n")
well=nu.potentials.square_well(grid,5,6,3)
f.write(f"Square well along grid is {well}\n")
well=nu.potentials.radial_well(grid,5,3)
f.write(f"Radial well along grid is {well}\n")
angular=nu.potentials.angular_potential(grid)
f.write(f"angular part of the potential with l=0 and m=1 along grid is {angular}\n")
angular=nu.potentials.angular_potential(grid,l=1)
f.write(f"angular part of the potential with l=1 and m=1 along grid is {angular}\n")
f.close()