extensions:eantic

This is an old revision of the document!


polyeantic

This extension serves as a wrapper for E-ANTIC, a software library for performing operations in real embedded number fields with arbitrary precision.

A new Scalar type, NumberFieldElement, is introduced which can take advantage of polymake's existing features. This allows for many possibilities to combine algebraic and geometric properties.

TODO: distribution

This requires an installation of polymake, version TODO, E-ANTIC, version 1.0.1, and its dependencies.

Start up polymake and run:

polytope > import_extension("/path/to/extension","--with-antic=/path/to/antic","--with-arb=/path/to/arb","--with-eantic=/path/to/eantic");

The optional –with-package arguments can be omitted if the respective package is installed at a standard location.

For Linux, polyeantic has a script file called install_deps.sh in its main directory which installs any requirements (besides polymake) to a sub-directory.

$ cd /path/to/extension/
$ bash install_deps.sh

Then you start polymake's interactive session and do:

polytope > $path = "/path/to/extension";
polytope > $depspath = "$path/build/deps/install";
polytope > import_extension($path,"--with-antic=$depspath","--with-arb=$depspath","--with-eantic=$depspath");

Do not forget to use an absolute path! Afterwards you are good to run the code. This import needs to be performed only once. The reference to the extension is permanently stored in $HOME/.polymake/settings. For more details there is a guide to polymake's extension system.

Most of this extension's capabilities reside within the application common; only the client regular_n_gon is part of the application polytope.

For further explanations we refer to the jupyter notebook file demo/introduction.ipynb which is covering the basic usage of this extension. This example is taken from there.

We create the number field $\mathbb{Q}\left[\phi\right]$ generated by the golden ratio $\phi$, positive root of $a^2 - a - 1$. Therefore we make use of the constructor NumberField(UniPolynomial p, double m, double r) where p is the defining polynomial and the interval is described by a combination of the midpoint m and the radius r.

> $p = new UniPolynomial<Rational,Int>("x^2 - x - 1");
> $nf = new NumberField($p, 1.61803, .00001);
> print $nf;
NumberField(a^2 - 1*a - 1, [1.618033988749894848205 +/- 6.52e-22])

Equivalently, the polynomial can be given by a combination of two `String`s, one of which is the pretty string representation and the other one specifies the variable name:

$nf = new NumberField("a^2 - a - 1", "a", 1.61803, .00001);

An element of a number field can be constructed by stating its parent number field together with its value. This value can either trivially be given as another Scalar type, e.g. `Int`, or as a polynomial over the generator of the number field. This polynomial can either be given as an UniPolynomial<Rational,Int> or a pretty String.

> $a = new NumberFieldElement($nf, "a");

> $p2 = new UniPolynomial<Rational,Int>("1 - x");
> $nfe_pol = new NumberFieldElement($nf, $p2);

> $nfe_one = new NumberFieldElement($nf, 1);

> $r = new Rational("inf");
> $nfe_inf = new NumberFieldElement($nf, $r);

> print join("\n", $a, $nfe_pol, $nfe_one, $nfe_inf);
(a ~ 1.6180340)
(-a+1 ~ -0.61803399)
1
inf

The output of printing values dependent on the generator of the number field (which is displayed as a) is split by a ~ into two representations, the exact algebraic polynomial over a and an approximate float.

Further, these NumberFieldElements can be handled intuitively using operators for arithmetic and comparison.

  • extensions/eantic.1625935337.txt.gz
  • Last modified: 2021/07/10 16:42
  • by jordan