Skip to content

Commit abb2572

Browse files
committed
fixes some Nemo quirks in doctests
1 parent cf0bae3 commit abb2572

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

src/algorithms/groebner-bases.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ At the moment the underlying algorithm is based on variants of Faugère's F4 Alg
2727
julia> using AlgebraicSolving
2828
2929
julia> R, (x,y,z) = PolynomialRing(GF(101),["x","y","z"], ordering=:degrevlex)
30-
(Multivariate Polynomial Ring in x, y, z over Galois field with characteristic 101, Nemo.gfp_mpoly[x, y, z])
30+
(Multivariate polynomial ring in x, y, z over GF(101), Nemo.fpMPolyRingElem[x, y, z])
3131
3232
julia> I = Ideal([x+2*y+2*z-1, x^2+2*y^2+2*z^2-x, 2*x*y+2*y*z-y])
33-
Nemo.gfp_mpoly[x + 2*y + 2*z + 100, x^2 + 2*y^2 + 2*z^2 + 100*x, 2*x*y + 2*y*z + 100*y]
33+
Nemo.fpMPolyRingElem[x + 2*y + 2*z + 100, x^2 + 2*y^2 + 2*z^2 + 100*x, 2*x*y + 2*y*z + 100*y]
3434
3535
julia> eliminate(I, 2)
36-
1-element Vector{Nemo.gfp_mpoly}:
36+
1-element Vector{Nemo.fpMPolyRingElem}:
3737
z^4 + 38*z^3 + 95*z^2 + 95*z
3838
```
3939
"""
@@ -81,20 +81,20 @@ At the moment the underlying algorithm is based on variants of Faugère's F4 Alg
8181
julia> using AlgebraicSolving
8282
8383
julia> R, (x,y,z) = PolynomialRing(GF(101),["x","y","z"], ordering=:degrevlex)
84-
(Multivariate Polynomial Ring in x, y, z over Galois field with characteristic 101, Nemo.gfp_mpoly[x, y, z])
84+
(Multivariate polynomial ring in x, y, z over GF(101), Nemo.fpMPolyRingElem[x, y, z])
8585
8686
julia> I = Ideal([x+2*y+2*z-1, x^2+2*y^2+2*z^2-x, 2*x*y+2*y*z-y])
87-
Nemo.gfp_mpoly[x + 2*y + 2*z + 100, x^2 + 2*y^2 + 2*z^2 + 100*x, 2*x*y + 2*y*z + 100*y]
87+
emo.fpMPolyRingElem[x + 2*y + 2*z + 100, x^2 + 2*y^2 + 2*z^2 + 100*x, 2*x*y + 2*y*z + 100*y]
8888
8989
julia> groebner_basis(I)
90-
4-element Vector{Nemo.gfp_mpoly}:
90+
4-element Vector{emo.fpMPolyRingElem}:
9191
x + 2*y + 2*z + 100
9292
y*z + 82*z^2 + 10*y + 40*z
9393
y^2 + 60*z^2 + 20*y + 81*z
9494
z^3 + 28*z^2 + 64*y + 13*z
9595
9696
julia> groebner_basis(I, eliminate=2)
97-
1-element Vector{Nemo.gfp_mpoly}:
97+
1-element Vector{emo.fpMPolyRingElem}:
9898
z^4 + 38*z^3 + 95*z^2 + 95*z
9999
```
100100
"""

src/algorithms/solvers.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,13 @@ is greater then zero an empty array is returned.
216216
julia> using AlgebraicSolving
217217
218218
julia> R,(x1,x2,x3) = PolynomialRing(QQ, ["x1","x2","x3"])
219-
(Multivariate Polynomial Ring in x1, x2, x3 over Rational Field, Nemo.fmpq_mpoly[x1, x2, x3])
219+
(Multivariate polynomial ring in x1, x2, x3 over QQ, Nemo.QQMPolyRingElem[x1, x2, x3])
220220
221221
julia> I = Ideal([x1+2*x2+2*x3-1, x1^2+2*x2^2+2*x3^2-x1, 2*x1*x2+2*x2*x3-x2])
222-
Nemo.fmpq_mpoly[x1 + 2*x2 + 2*x3 - 1, x1^2 - x1 + 2*x2^2 + 2*x3^2, 2*x1*x2 + 2*x2*x3 - x2]
222+
Nemo.QQMPolyRingElem[x1 + 2*x2 + 2*x3 - 1, x1^2 - x1 + 2*x2^2 + 2*x3^2, 2*x1*x2 + 2*x2*x3 - x2]
223223
224224
julia> rational_parametrization(I)
225-
AlgebraicSolving.RationalParametrization([:x1, :x2, :x3], fmpz[], 84*x^4 - 40*x^3 + x^2 + x, 336*x^3 - 120*x^2 + 2*x + 1, AbstractAlgebra.PolyElem[184*x^3 - 80*x^2 + 4*x + 1, 36*x^3 - 18*x^2 + 2*x])
225+
AlgebraicSolving.RationalParametrization([:x1, :x2, :x3], Nemo.ZZRingElem[], 84*x^4 - 40*x^3 + x^2 + x, 336*x^3 - 120*x^2 + 2*x + 1, AbstractAlgebra.PolyRingElem[184*x^3 - 80*x^2 + 4*x + 1, 36*x^3 - 18*x^2 + 2*x])
226226
```
227227
"""
228228
function rational_parametrization(
@@ -269,18 +269,18 @@ the rational roots of the ideal.
269269
julia> using AlgebraicSolving
270270
271271
julia> R,(x1,x2,x3) = PolynomialRing(QQ, ["x1","x2","x3"])
272-
(Multivariate Polynomial Ring in x1, x2, x3 over Rational Field, Nemo.fmpq_mpoly[x1, x2, x3])
272+
(Multivariate polynomial ring in x1, x2, x3 over QQ, Nemo.QQMPolyRingElem[[x1, x2, x3])
273273
274274
julia> I = Ideal([x1+2*x2+2*x3-1, x1^2+2*x2^2+2*x3^2-x1, 2*x1*x2+2*x2*x3-x2])
275-
Nemo.fmpq_mpoly[x1 + 2*x2 + 2*x3 - 1, x1^2 - x1 + 2*x2^2 + 2*x3^2, 2*x1*x2 + 2*x2*x3 - x2]
275+
Nemo.QQMPolyRingElem[[x1 + 2*x2 + 2*x3 - 1, x1^2 - x1 + 2*x2^2 + 2*x3^2, 2*x1*x2 + 2*x2*x3 - x2]
276276
277277
julia> rat_sols = rational_solutions(I)
278-
2-element Vector{Vector{fmpq}}:
278+
2-element Vector{Vector{Nemo.QQFieldElem}}:
279279
[1, 0, 0]
280280
[1//3, 0, 1//3]
281281
282282
julia> map(r->map(p->evaluate(p, r), I.gens), rat_sols)
283-
2-element Vector{Vector{fmpq}}:
283+
2-element Vector{Vector{Nemo.QQFieldElem}}:
284284
[0, 0, 0]
285285
[0, 0, 0]
286286
```

src/examples/katsura.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Also note that indices have been shifted to start from 1.
2525
julia> using AlgebraicSolving
2626
2727
julia> katsura(2)
28-
Nemo.fmpq_mpoly[x1 + 2*x2 + 2*x3 - 1, x1^2 + 2*x2^2 + 2*x3^2 - x1, 2*x1*x2 + 2*x2*x3 - x2]
28+
Nemo.QQMPolyRingElem[x1 + 2*x2 + 2*x3 - 1, x1^2 + 2*x2^2 + 2*x3^2 - x1, 2*x1*x2 + 2*x2*x3 - x2]
2929
```
3030
"""
3131
function katsura(log_solutions::Int, characteristic::Int=0)
@@ -50,10 +50,10 @@ Returns the Katsura ideal in the given polynomial ring `R`.
5050
julia> using AlgebraicSolving
5151
5252
julia> R, _ = QQ["x", "y", "z"]
53-
(Multivariate Polynomial Ring in x, y, z over Rational Field, Nemo.fmpq_mpoly[x, y, z])
53+
(Multivariate polynomial ring in x, y, z over Rational Field, Nemo.QQMPolyRingElem[x, y, z])
5454
5555
julia> katsura(R)
56-
Nemo.fmpq_mpoly[x + 2*y + 2*z - 1, x^2 - x + 2*y^2 + 2*z^2, 2*x*y + 2*y*z - y]
56+
Nemo.QQMPolyRingElem[x + 2*y + 2*z - 1, x^2 - x + 2*y^2 + 2*z^2, 2*x*y + 2*y*z - y]
5757
```
5858
"""
5959
function katsura(R::MPolyRing)

src/imports.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ import Nemo:
4646
prime_field,
4747
primorial,
4848
QQ,
49+
QQFieldElem,
50+
QQMPolyRingElem,
4951
rising_factorial,
5052
root,
5153
unit,
5254
vars,
53-
ZZ
55+
ZZ,
56+
ZZRingElem

0 commit comments

Comments
 (0)