begin
θ = collect(0:0.1:2π+0.1)
ϕ = collect(0:0.05:π+0.05)
x = zeros(64, 64)
y = zeros(64, 64)
z = zeros(64, 64)
f = zeros(64, 64)
for i = 1:64
for j = 1:64
Y = computeYlm(θ[i],ϕ[j],lmax=1)
f[i, j] = abs(Y[(1,0)])
r = f[i, j]
x[i, j] = r*sin(ϕ[i])*cos(θ[j])
y[i, j] = r*sin(ϕ[i])*sin(θ[j])
z[i, j] = r*cos(ϕ[i])
end
end
end
It yields the following plot:
compare it with equivalent scipy sph_harm plot,
theta = np.linspace(0,2*np.pi,100)
phi = np.linspace(0,np.pi,100)
x = np.zeros((100,100))
y = np.zeros((100,100))
z = np.zeros((100,100))
f = np.zeros((100,100))
for i in range(100):
for j in range(100):
Y10 = sph_harm(0,1,theta[j],phi[i])
f[i,j] = np.abs(Y10)
r = f[i,j]
x[i,j] = r*np.sin(phi[i])*np.cos(theta[j])
y[i,j] = r*np.sin(phi[i])*np.sin(theta[j])
z[i,j] = r*np.cos(phi[i])
Consider the following attempt to plot $Y_{1,0}$
It yields the following plot:
compare it with equivalent scipy
sph_harm
plot,What I am doing wrong here?