from sympy.physics.hydrogen import R_nl
from sympy import var
from sympy import Matrix
import sympy as sp
sp.init_printing(use_latex="mathjax")
r1,Z=var("r1 Z")
r2,Z=var("r2,Z")
O=sp.zeros(3)
k=0
for i in range(1,3,1):
for j in range(0,i,1):
print("n=",i,"l=",j, ":")
O[k]= R_nl(i,j,r1,Z)
display(O[k])
print("------------------------------------")
k=k+1
In the above code I have stored the in built functions R_nl (it is radial part of hydrogen atom wave functions) in an one dimensional array. I want that to be stored in two dimensional array. The in built R_nl functions has to positive integer parameters n and l, so it would be nice if I could store it in two dimensional array. Can someone help me in storing this in two dimensional array ?? If I try to store this in two dimensional array, it throws the following error message
TypeError Traceback (most recent call last)
<ipython-input-22-6bcaaf0f91e4> in <module>
19
20 print("n=",i,"l=",j, ":")
---> 21 O[k][s]= R_nl(i,j,r1,Z)
22 display(O[k][s])
23 print("------------------------------------")
TypeError: 'Zero' object does not support item assignment