Skip to content

Commit

Permalink
Merge branch 'master' into lg/aliases-deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Apr 17, 2024
2 parents 0cc0cdd + f3683d0 commit 660956b
Show file tree
Hide file tree
Showing 37 changed files with 1,648 additions and 825 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RandomExtensions = "fb686558-2515-59ef-acaa-46db3789a887"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"

[compat]
AbstractAlgebra = "0.40.6"
AbstractAlgebra = "0.40.8"
Antic_jll = "~0.201.500"
Arb_jll = "~200.2300.000"
Calcium_jll = "~0.401.100"
Expand Down
52 changes: 36 additions & 16 deletions docs/src/acb.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DocTestSetup = quote
end
```

# Fixed precisioncomplex balls
# Fixed precision complex balls

Arbitrary precision complex ball arithmetic is supplied by Arb which provides a
ball representation which tracks error bounds rigorously. Complex numbers are
Expand All @@ -17,9 +17,9 @@ constructs the parent object for the Arb complex field.
The types of complex boxes in Nemo are given in the following table, along with
the libraries that provide them and the associated types of the parent objects.

Library | Field | Element type | Parent type
---------|----------------------|---------------|--------------
Arb | $\mathbb{C}$ (boxes) | `AcbFieldElem` | `AcbField`
Library | Field | Element type | Parent type
---------|----------------------|----------------|--------------
Arb | $\mathbb{C}$ (boxes) | `AcbFieldElem` | `AcbField`

All the complex field types belong to the `Field` abstract type and the types of
elements in this field, i.e. complex boxes in this case, belong to the
Expand Down Expand Up @@ -726,19 +726,39 @@ lindep(A::Matrix{AcbFieldElem}, bits::Int)

**Examples**

```julia
CC = AcbField(128)
```jldoctest
julia> CC = AcbField(128)
Complex Field with 128 bits of precision and error bounds
julia> # These are two of the roots of x^5 + 3x + 1
julia> a = CC(1.0050669478588622428791051888364775253, -0.93725915669289182697903585868761513585)
[1.00506694785886230292248910700436681509 +/- 1.80e-40] - [0.937259156692891837181491609953809529543 +/- 7.71e-41]*im
julia> b = CC(-0.33198902958450931620250069492231652319)
-[0.331989029584509320880414406929048709571 +/- 3.62e-40]
julia> V1 = [CC(1), a, a^2, a^3, a^4, a^5]; # We recover the polynomial from one root....
julia> W = lindep(V1, 20)
6-element Vector{ZZRingElem}:
1
3
0
0
0
1
# These are two of the roots of x^5 + 3x + 1
a = CC(1.0050669478588622428791051888364775253, - 0.93725915669289182697903585868761513585)
b = CC(-0.33198902958450931620250069492231652319)
julia> V2 = [CC(1), b, b^2, b^3, b^4, b^5]; # ...or from two
# We recover the polynomial from one root....
V1 = [CC(1), a, a^2, a^3, a^4, a^5];
W = lindep(V1, 20)
julia> Vs = [transpose(V1); transpose(V2)];
# ...or from two
V2 = [CC(1), b, b^2, b^3, b^4, b^5];
Vs = [V1 V2]
X = lindep(Vs, 20)
julia> X = lindep(Vs, 20)
6-element Vector{ZZRingElem}:
1
3
0
0
0
1
```
15 changes: 8 additions & 7 deletions docs/src/algebraic.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,22 +316,23 @@ atanpi(a::QQBarFieldElem)
An algebraic number can be recovered from a numerical value:

```jldoctest
julia> RR = ArbField(53); guess(QQBar, RR("1.41421356 +/- 1e-6"), 2)
julia> RR = RealField(); guess(QQBar, RR("1.41421356 +/- 1e-6"), 2)
Root 1.41421 of x^2 - 2
```

Warning: the input should be an enclosure. If you have a floating-point
approximation, you should add an error estimate; otherwise, the only
approximation, you should add an error estimate; otherwise, at best the only
algebraic number that can be guessed is the binary floating-point number
itself.
itself, at worst no guess is possible.

```julia
julia> RR = ArbField(128);
```jldoctest
julia> RR = RealField();
julia> x = RR(0.1); # note: 53-bit binary approximation of 1//10 without radius
julia> x = RR(0.1) # note: 53-bit binary approximation of 1//10 without radius
[0.10000000000000000555 +/- 1.12e-21]
julia> guess(QQBar, x, 1)
Root 0.100000 of 36028797018963968x - 3602879701896397
ERROR: No suitable algebraic number found
julia> guess(QQBar, x + RR("+/- 1e-10"), 1)
Root 0.100000 of 10x - 1
Expand Down
Loading

0 comments on commit 660956b

Please sign in to comment.