test_sphere_sph.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:orthopy 作者: nschloe 项目源码 文件源码
def test_integral0(n=4):
    polar = sympy.Symbol('theta', real=True)
    azimuthal = sympy.Symbol('phi', real=True)
    tree = numpy.concatenate(
            orthopy.sphere.sph_tree(
                n, polar, azimuthal, normalization='quantum mechanic',
                symbolic=True
                ))

    assert sympy.integrate(
        tree[0] * sympy.sin(polar), (polar, 0, pi), (azimuthal, 0, 2*pi)
        ) == 2*sqrt(pi)
    for val in tree[1:]:
        assert sympy.integrate(
            val * sympy.sin(polar), (azimuthal, 0, 2*pi), (polar, 0, pi)
            ) == 0
    return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号