Differences
This shows you the differences between two versions of the page.
Last revisionBoth sides next revision | |||
extensions:eantic [2021/07/08 00:06] – created jordan | extensions:eantic [2021/07/10 16:42] – jordan | ||
---|---|---|---|
Line 36: | Line 36: | ||
===== Examples ===== | ===== Examples ===== | ||
- | There also is a jupyter notebook file '' | + | Most of this extension' |
+ | |||
+ | For further explanations we refer to the jupyter notebook file '' | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | < | ||
+ | > $p = new UniPolynomial< | ||
+ | > $nf = new NumberField($p, | ||
+ | > print $nf; | ||
+ | NumberField(a^2 - 1*a - 1, [1.618033988749894848205 +/- 6.52e-22]) | ||
+ | </ | ||
+ | |||
+ | Equivalently, | ||
+ | |||
+ | < | ||
+ | $nf = new NumberField(" | ||
+ | </ | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | < | ||
+ | > $a = new NumberFieldElement($nf, | ||
+ | |||
+ | > $p2 = new UniPolynomial< | ||
+ | > $nfe_pol = new NumberFieldElement($nf, | ||
+ | |||
+ | > $nfe_one = new NumberFieldElement($nf, | ||
+ | |||
+ | > $r = new Rational(" | ||
+ | > $nfe_inf = new NumberFieldElement($nf, | ||
+ | |||
+ | > print join(" | ||
+ | (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 '' | ||
+ | |||
+ | Further, these '' |