本文整理汇总了Python中sage.rings.all.ComplexField.parent方法的典型用法代码示例。如果您正苦于以下问题:Python ComplexField.parent方法的具体用法?Python ComplexField.parent怎么用?Python ComplexField.parent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.rings.all.ComplexField
的用法示例。
在下文中一共展示了ComplexField.parent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: zeta_symmetric
# 需要导入模块: from sage.rings.all import ComplexField [as 别名]
# 或者: from sage.rings.all.ComplexField import parent [as 别名]
def zeta_symmetric(s):
r"""
Completed function `\xi(s)` that satisfies
`\xi(s) = \xi(1-s)` and has zeros at the same points as the
Riemann zeta function.
INPUT:
- ``s`` - real or complex number
If s is a real number the computation is done using the MPFR
library. When the input is not real, the computation is done using
the PARI C library.
More precisely,
.. math::
xi(s) = \gamma(s/2 + 1) * (s-1) * \pi^{-s/2} * \zeta(s).
EXAMPLES::
sage: zeta_symmetric(0.7)
0.497580414651127
sage: zeta_symmetric(1-0.7)
0.497580414651127
sage: RR = RealField(200)
sage: zeta_symmetric(RR(0.7))
0.49758041465112690357779107525638385212657443284080589766062
sage: C.<i> = ComplexField()
sage: zeta_symmetric(0.5 + i*14.0)
0.000201294444235258 + 1.49077798716757e-19*I
sage: zeta_symmetric(0.5 + i*14.1)
0.0000489893483255687 + 4.40457132572236e-20*I
sage: zeta_symmetric(0.5 + i*14.2)
-0.0000868931282620101 + 7.11507675693612e-20*I
REFERENCE:
- I copied the definition of xi from
http://web.viu.ca/pughg/RiemannZeta/RiemannZetaLong.html
"""
if not (is_ComplexNumber(s) or is_RealNumber(s)):
s = ComplexField()(s)
R = s.parent()
if s == 1: # deal with poles, hopefully
return R(0.5)
return (s / 2 + 1).gamma() * (s - 1) * (R.pi() ** (-s / 2)) * s.zeta()