0

我正在尝试使用 mayavi 在同一轴上绘制两个 3d t2g 轨道。这是我的代码:

import numpy as np
from mayavi import mlab

x, y, z = np.ogrid[-6.5:6.5:350j, -6.5:6.5:350j, -6.5:6.5:350j]

r = np.sqrt(np.power(x, 2) + np.power(y, 2) + np.power(z, 2))

a_0 = 0.529177210903
z_eff = 4
rho = (2*z_eff*r)/3

radial_3d = 1/(9*np.sqrt(30)) * np.power(rho, 2) * np.power(z_eff, 3/2) * np.exp(-rho/2)


def angular_xy():
    return np.sqrt(15) * x * y * np.power(r, -2) * np.power(4*np.pi, -0.5)


def angular_yz():
    return np.sqrt(15) * z * y * np.power(r, -2) * np.power(4 * np.pi, -0.5)


def angular_xz():
    return np.sqrt(15) * x * z * np.power(r, -2) * np.power(4*np.pi, -0.5)


psi_yz = radial_3d * angular_yz()
psi_xz = radial_3d * angular_xz()

fig = mlab.figure(1, fgcolor=(1, 1, 1), bgcolor=(1, 1, 1))
src_yz = mlab.pipeline.scalar_field(np.abs(psi_yz))
src_yz.image_data.point_data.add_array(np.angle(psi_yz).T.ravel())
src_yz.image_data.point_data.get_array(1).name = 'angle'
src_yz.update()

src2_yz = mlab.pipeline.set_active_attribute(src_yz, point_scalars='scalar')
contour_yz = mlab.pipeline.contour(src2_yz)

contour2_yz = mlab.pipeline.set_active_attribute(contour_yz, point_scalars='angle')

mlab.pipeline.surface(contour2_yz, colormap='Set2')

src_xz = mlab.pipeline.scalar_field(np.abs(psi_xz))
src_xz.image_data.point_data.add_array(np.angle(psi_xz).T.ravel())
src_xz.image_data.point_data.get_array(1).name = 'angle'
src_xz.update()

src2_xz = mlab.pipeline.set_active_attribute(src_xz, point_scalars='scalar')
contour_xz = mlab.pipeline.contour(src2_xz)

contour2_xz = mlab.pipeline.set_active_attribute(contour_xz, point_scalars='angle')

mlab.pipeline.surface(contour2_xz, colormap='Set2')
mlab.show()

它生成的图像在这里。d_xz 轨道似乎只是卡在 d_yz 轨道的顶部,而不是它们在空间上被正确地表示。有什么方法可以为这些获得适当的空间表示?谢谢

4

0 回答 0