Interface with realalg#

realag is a pure Python library developed by Mark C. Bell that provides similarly to pyeantic exact computations over real embedded number fields. The source code is available at MarkCBell/realalg. This module provides conversion from and to realalg.

pyeantic.realalg_conversion.poly_string(coeffs, var)#
pyeantic.realalg_conversion.realalg_interval_to_arb(i)#
pyeantic.realalg_conversion.realalg_nf_elem_to_eantic(K, elem)#

Convert a realalg real number field element to eantic

>>> import realalg
>>> from pyeantic.realalg_conversion import realalg_nf_to_eantic, realalg_nf_elem_to_eantic
>>> R = realalg.RealNumberField([-2,0,1])
>>> K = realalg_nf_to_eantic(R)
>>> realalg_nf_elem_to_eantic(K, R([1,-1]))
(-a+1 ~ -0.41421356)
pyeantic.realalg_conversion.realalg_nf_to_eantic(K, name='a')#

Convert a realalg real number field to eantic

>>> import realalg  # random output as it prints a deprecation warning, see https://github.com/MarkCBell/realalg/pull/6
>>> from pyeantic.realalg_conversion import realalg_nf_to_eantic
>>> R = realalg.RealNumberField([-2,0,1])  # random output as it prints a deprecation warning in SageMath
>>> realalg_nf_to_eantic(R)
NumberField(a^2 - 2, [1.4142135...])
>>> R = realalg.RealNumberField([-13,3,0,0,1])
>>> realalg_nf_to_eantic(R)
NumberField(a^4 + 3*a - 13, [1.679729...])