Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
quadpy.u3.heo_xu_39a(),
quadpy.u3.heo_xu_39b(),
]
+ [
quadpy.u3.lebedev_003a(),
quadpy.u3.lebedev_003b(),
quadpy.u3.lebedev_003c(),
quadpy.u3.lebedev_005(),
quadpy.u3.lebedev_007(),
quadpy.u3.lebedev_009(),
quadpy.u3.lebedev_011(),
quadpy.u3.lebedev_013(),
quadpy.u3.lebedev_015(),
quadpy.u3.lebedev_017(),
quadpy.u3.lebedev_019(),
]
+ [
quadpy.u3.heo_xu_27c(),
quadpy.u3.heo_xu_29(),
quadpy.u3.heo_xu_31(),
quadpy.u3.heo_xu_33(),
quadpy.u3.heo_xu_35(),
quadpy.u3.heo_xu_37(),
quadpy.u3.heo_xu_39a(),
quadpy.u3.heo_xu_39b(),
]
+ [
quadpy.u3.lebedev_003a(),
quadpy.u3.lebedev_003b(),
quadpy.u3.lebedev_003c(),
quadpy.u3.lebedev_005(),
quadpy.u3.lebedev_007(),
quadpy.u3.lebedev_009(),
quadpy.u3.lebedev_011(),
max_err = numpy.max(err)
assert k - 1 == scheme.degree, (
f"{scheme.name} -- observed: {k - 1}, expected: {scheme.degree} "
f"(max err: {max_err:.3e})"
)
@pytest.mark.parametrize("scheme", [quadpy.u3.lebedev_007()])
def test_show(scheme):
scheme.show()
plt.close()
if __name__ == "__main__":
scheme_ = quadpy.u3.Stroud("U3 5-2")
# test_scheme(scheme_)
test_scheme_spherical(scheme_, tol=1.0e-7)
# test_show(scheme_)
quadpy.u3.heo_xu_21f(),
quadpy.u3.heo_xu_23a(),
quadpy.u3.heo_xu_23b(),
quadpy.u3.heo_xu_23c(),
quadpy.u3.heo_xu_25a(),
quadpy.u3.heo_xu_25b(),
quadpy.u3.heo_xu_27a(),
quadpy.u3.heo_xu_27b(),
quadpy.u3.heo_xu_27c(),
quadpy.u3.heo_xu_29(),
quadpy.u3.heo_xu_31(),
quadpy.u3.heo_xu_33(),
quadpy.u3.heo_xu_35(),
quadpy.u3.heo_xu_37(),
quadpy.u3.heo_xu_39a(),
quadpy.u3.heo_xu_39b(),
]
quadpy.u3.stroud_u3_8_1(),
quadpy.u3.stroud_u3_9_1(),
quadpy.u3.stroud_u3_9_2(),
quadpy.u3.stroud_u3_9_3(),
quadpy.u3.stroud_u3_11_1(),
quadpy.u3.stroud_u3_11_2(),
quadpy.u3.stroud_u3_11_3(),
quadpy.u3.stroud_u3_14_1(),
],
)
def test_scheme_spherical(scheme):
print(scheme)
evaluator = orthopy.u3.EvalSpherical(scheme.theta_phi, "quantum mechanic")
k = 0
while True:
quadpy.u3.heo_xu_35(),
quadpy.u3.heo_xu_37(),
quadpy.u3.heo_xu_39a(),
quadpy.u3.heo_xu_39b(),
]
+ [
quadpy.u3.lebedev_003a(),
quadpy.u3.lebedev_003b(),
quadpy.u3.lebedev_003c(),
quadpy.u3.lebedev_005(),
quadpy.u3.lebedev_007(),
quadpy.u3.lebedev_009(),
quadpy.u3.lebedev_011(),
quadpy.u3.lebedev_013(),
quadpy.u3.lebedev_015(),
quadpy.u3.lebedev_017(),
quadpy.u3.lebedev_019(),
quadpy.u3.lebedev_011(),
quadpy.u3.lebedev_013(),
quadpy.u3.lebedev_015(),
quadpy.u3.lebedev_017(),
quadpy.u3.lebedev_019(),
]
+ [
quadpy.u3.stroud_u3_3_1(),
quadpy.u3.stroud_u3_5_1(),
quadpy.u3.stroud_u3_5_2(),
quadpy.u3.stroud_u3_5_3(),
quadpy.u3.stroud_u3_5_4(),
quadpy.u3.stroud_u3_5_5(),
quadpy.u3.stroud_u3_7_1(),
quadpy.u3.stroud_u3_7_2(),
quadpy.u3.stroud_u3_8_1(),
quadpy.u3.stroud_u3_9_1(),
quadpy.u3.lebedev_009(),
quadpy.u3.lebedev_011(),
quadpy.u3.lebedev_013(),
quadpy.u3.lebedev_015(),
quadpy.u3.lebedev_017(),
quadpy.u3.lebedev_019(),
]
+ [
quadpy.u3.stroud_u3_3_1(),
quadpy.u3.stroud_u3_5_1(),
quadpy.u3.stroud_u3_5_2(),
quadpy.u3.stroud_u3_5_3(),
quadpy.u3.stroud_u3_5_4(),
quadpy.u3.stroud_u3_5_5(),
quadpy.u3.stroud_u3_7_1(),
quadpy.u3.stroud_u3_7_2(),
quadpy.u3.stroud_u3_8_1(),
quadpy.u3.stroud_u3_11_1(),
quadpy.u3.stroud_u3_11_2(),
quadpy.u3.stroud_u3_11_3(),
quadpy.u3.stroud_u3_14_1(),
],
)
def test_scheme_spherical(scheme):
print(scheme)
evaluator = orthopy.u3.EvalSpherical(scheme.theta_phi, "quantum mechanic")
k = 0
while True:
approximate = scheme.integrate_spherical(lambda theta_phi: next(evaluator))
exact = numpy.sqrt(4 * numpy.pi) if k == 0 else 0.0
err = numpy.abs(approximate - exact)
if numpy.any(err > scheme.test_tolerance):
quadpy.u3.stroud_u3_5_2(),
quadpy.u3.stroud_u3_5_3(),
quadpy.u3.stroud_u3_5_4(),
quadpy.u3.stroud_u3_5_5(),
quadpy.u3.stroud_u3_7_1(),
quadpy.u3.stroud_u3_7_2(),
quadpy.u3.stroud_u3_8_1(),
quadpy.u3.stroud_u3_9_1(),
quadpy.u3.stroud_u3_9_2(),
quadpy.u3.stroud_u3_9_3(),
quadpy.u3.stroud_u3_11_1(),
quadpy.u3.stroud_u3_11_2(),
quadpy.u3.stroud_u3_11_3(),
quadpy.u3.stroud_u3_14_1(),
],
)
def test_scheme_spherical(scheme):