Skip to content

Commit

Permalink
Update doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Apr 25, 2024
1 parent a139a12 commit a6e92a4
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 74 deletions.
22 changes: 11 additions & 11 deletions docs/src/direct_sum.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ julia> m2 = F(BigInt[9, 7, -2, 2, -4])
(9, 7, -2, 2, -4)
julia> S1, f1 = sub(F, [m1, m2])
(Submodule over Integers with 2 generators and no relations, Hom: submodule over Integers with 2 generators and no relations -> free module of rank 5 over integers)
(Submodule over integers with 2 generators and no relations, Hom: submodule over integers with 2 generators and no relations -> free module of rank 5 over integers)
julia> m1 = F(BigInt[3, 1, 7, 7, -7])
(3, 1, 7, 7, -7)
Expand All @@ -54,7 +54,7 @@ julia> m2 = F(BigInt[-8, 6, 10, -1, 1])
(-8, 6, 10, -1, 1)
julia> S2, f2 = sub(F, [m1, m2])
(Submodule over Integers with 2 generators and no relations, Hom: submodule over Integers with 2 generators and no relations -> free module of rank 5 over integers)
(Submodule over integers with 2 generators and no relations, Hom: submodule over integers with 2 generators and no relations -> free module of rank 5 over integers)
julia> m1 = F(BigInt[2, 4, 2, -3, -10])
(2, 4, 2, -3, -10)
Expand All @@ -63,10 +63,10 @@ julia> m2 = F(BigInt[5, 7, -6, 9, -5])
(5, 7, -6, 9, -5)
julia> S3, f3 = sub(F, [m1, m2])
(Submodule over Integers with 2 generators and no relations, Hom: submodule over Integers with 2 generators and no relations -> free module of rank 5 over integers)
(Submodule over integers with 2 generators and no relations, Hom: submodule over integers with 2 generators and no relations -> free module of rank 5 over integers)
julia> D, f = direct_sum(S1, S2, S3)
(DirectSumModule over integers, AbstractAlgebra.Generic.ModuleHomomorphism{BigInt}[Hom: submodule over Integers with 2 generators and no relations -> DirectSumModule over integers, Hom: submodule over Integers with 2 generators and no relations -> DirectSumModule over integers, Hom: submodule over Integers with 2 generators and no relations -> DirectSumModule over integers], AbstractAlgebra.Generic.ModuleHomomorphism{BigInt}[Hom: DirectSumModule over integers -> submodule over Integers with 2 generators and no relations, Hom: DirectSumModule over integers -> submodule over Integers with 2 generators and no relations, Hom: DirectSumModule over integers -> submodule over Integers with 2 generators and no relations])
(DirectSumModule over integers, AbstractAlgebra.Generic.ModuleHomomorphism{BigInt}[Hom: submodule over integers with 2 generators and no relations -> DirectSumModule over integers, Hom: submodule over integers with 2 generators and no relations -> DirectSumModule over integers, Hom: submodule over integers with 2 generators and no relations -> DirectSumModule over integers], AbstractAlgebra.Generic.ModuleHomomorphism{BigInt}[Hom: DirectSumModule over integers -> submodule over integers with 2 generators and no relations, Hom: DirectSumModule over integers -> submodule over integers with 2 generators and no relations, Hom: DirectSumModule over integers -> submodule over integers with 2 generators and no relations])
```

## Functionality for direct sums
Expand All @@ -93,7 +93,7 @@ julia> m2 = F(BigInt[9, 7, -2, 2, -4])
(9, 7, -2, 2, -4)
julia> S1, f1 = sub(F, [m1, m2])
(Submodule over Integers with 2 generators and no relations, Hom: submodule over Integers with 2 generators and no relations -> free module of rank 5 over integers)
(Submodule over integers with 2 generators and no relations, Hom: submodule over integers with 2 generators and no relations -> free module of rank 5 over integers)
julia> m1 = F(BigInt[3, 1, 7, 7, -7])
(3, 1, 7, 7, -7)
Expand All @@ -102,7 +102,7 @@ julia> m2 = F(BigInt[-8, 6, 10, -1, 1])
(-8, 6, 10, -1, 1)
julia> S2, f2 = sub(F, [m1, m2])
(Submodule over Integers with 2 generators and no relations, Hom: submodule over Integers with 2 generators and no relations -> free module of rank 5 over integers)
(Submodule over integers with 2 generators and no relations, Hom: submodule over integers with 2 generators and no relations -> free module of rank 5 over integers)
julia> m1 = F(BigInt[2, 4, 2, -3, -10])
(2, 4, 2, -3, -10)
Expand All @@ -111,16 +111,16 @@ julia> m2 = F(BigInt[5, 7, -6, 9, -5])
(5, 7, -6, 9, -5)
julia> S3, f3 = sub(F, [m1, m2])
(Submodule over Integers with 2 generators and no relations, Hom: submodule over Integers with 2 generators and no relations -> free module of rank 5 over integers)
(Submodule over integers with 2 generators and no relations, Hom: submodule over integers with 2 generators and no relations -> free module of rank 5 over integers)
julia> D, f = direct_sum(S1, S2, S3)
(DirectSumModule over integers, AbstractAlgebra.Generic.ModuleHomomorphism{BigInt}[Hom: submodule over Integers with 2 generators and no relations -> DirectSumModule over integers, Hom: submodule over Integers with 2 generators and no relations -> DirectSumModule over integers, Hom: submodule over Integers with 2 generators and no relations -> DirectSumModule over integers], AbstractAlgebra.Generic.ModuleHomomorphism{BigInt}[Hom: DirectSumModule over integers -> submodule over Integers with 2 generators and no relations, Hom: DirectSumModule over integers -> submodule over Integers with 2 generators and no relations, Hom: DirectSumModule over integers -> submodule over Integers with 2 generators and no relations])
(DirectSumModule over integers, AbstractAlgebra.Generic.ModuleHomomorphism{BigInt}[Hom: submodule over integers with 2 generators and no relations -> DirectSumModule over integers, Hom: submodule over integers with 2 generators and no relations -> DirectSumModule over integers, Hom: submodule over integers with 2 generators and no relations -> DirectSumModule over integers], AbstractAlgebra.Generic.ModuleHomomorphism{BigInt}[Hom: DirectSumModule over integers -> submodule over integers with 2 generators and no relations, Hom: DirectSumModule over integers -> submodule over integers with 2 generators and no relations, Hom: DirectSumModule over integers -> submodule over integers with 2 generators and no relations])
julia> summands(D)
3-element Vector{AbstractAlgebra.Generic.Submodule{BigInt}}:
Submodule over Integers with 2 generators and no relations
Submodule over Integers with 2 generators and no relations
Submodule over Integers with 2 generators and no relations
Submodule over integers with 2 generators and no relations
Submodule over integers with 2 generators and no relations
Submodule over integers with 2 generators and no relations
```


Expand Down
2 changes: 1 addition & 1 deletion docs/src/free_associative_algebra.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ julia> R, (x, y, z) = free_associative_algebra(ZZ, ["x", "y", "z"])
(Free associative algebra on 3 indeterminates over integers, AbstractAlgebra.Generic.FreeAssAlgElem{BigInt}[x, y, z])
julia> B = MPolyBuildCtx(R)
Builder for an element of Free associative algebra on 3 indeterminates over integers
Builder for an element of free associative algebra
julia> push_term!(B, ZZ(1), [1,2,3,1]); push_term!(B, ZZ(2), [3,3,1]); finish(B)
x*y*z*x + 2*z^2*x
Expand Down
10 changes: 5 additions & 5 deletions docs/src/function_field.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ julia> f = (x1^2 + 1)//(x1 + 1)*z1^3 + 4*z1 + 1//(x1 + 1)
(x1^2 + 1)//(x1 + 1)*z1^3 + 4*z1 + 1//(x1 + 1)
julia> S1, y1 = function_field(f, "y1")
(Function Field over Rationals with defining polynomial (x1^2 + 1)*y1^3 + (4*x1 + 4)*y1 + 1, y1)
(Function Field over rationals with defining polynomial (x1^2 + 1)*y1^3 + (4*x1 + 4)*y1 + 1, y1)
julia> a = S1()
0
Expand All @@ -263,7 +263,7 @@ julia> g = z2^2 + 3z2 + 1
z2^2 + 3*z2 + 1
julia> S2, y2 = function_field(g, "y2")
(Function Field over Finite field F_23 with defining polynomial y2^2 + 3*y2 + 1, y2)
(Function Field over finite field F_23 with defining polynomial y2^2 + 3*y2 + 1, y2)
julia> d = S2(R2(5))
5
Expand Down Expand Up @@ -291,7 +291,7 @@ julia> g = z^2 + 3z + 1
z^2 + 3*z + 1
julia> S, y = function_field(g, "y")
(Function Field over Finite field F_23 with defining polynomial y^2 + 3*y + 1, y)
(Function Field over finite field F_23 with defining polynomial y^2 + 3*y + 1, y)
julia> f = (x + 1)*y + 1
(x + 1)*y + 1
Expand Down Expand Up @@ -367,7 +367,7 @@ julia> g = z^2 + 3*(x + 1)//(x + 2)*z + 1
z^2 + (3*x + 3)//(x + 2)*z + 1
julia> S, y = function_field(g, "y")
(Function Field over Rationals with defining polynomial (x + 2)*y^2 + (3*x + 3)*y + x + 2, y)
(Function Field over rationals with defining polynomial (x + 2)*y^2 + (3*x + 3)*y + x + 2, y)
julia> base_field(S)
Rational function field
Expand Down Expand Up @@ -430,7 +430,7 @@ julia> g = z^2 + 3*(x + 1)//(x + 2)*z + 1
z^2 + (3*x + 3)//(x + 2)*z + 1
julia> S, y = function_field(g, "y")
(Function Field over Rationals with defining polynomial (x + 2)*y^2 + (3*x + 3)*y + x + 2, y)
(Function Field over rationals with defining polynomial (x + 2)*y^2 + (3*x + 3)*y + x + 2, y)
julia> f = (-3*x - 5//3)//(x - 2)*y + (x^3 + 1//9*x^2 + 5)//(x - 2)
((-3*x - 5//3)*y + x^3 + 1//9*x^2 + 5)//(x - 2)
Expand Down
12 changes: 6 additions & 6 deletions docs/src/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ julia> m2 = rand(M, -10:10)
(4, 4, -7)
julia> S, f = sub(M, [m1, m2])
(Submodule over Integers with 2 generators and no relations, Hom: submodule over Integers with 2 generators and no relations -> free module of rank 3 over integers)
(Submodule over integers with 2 generators and no relations, Hom: submodule over integers with 2 generators and no relations -> free module of rank 3 over integers)
julia> I, g = image(f)
(Submodule over Integers with 2 generators and no relations, Hom: submodule over Integers with 2 generators and no relations -> free module of rank 3 over integers)
(Submodule over integers with 2 generators and no relations, Hom: submodule over integers with 2 generators and no relations -> free module of rank 3 over integers)
julia> is_isomorphic(S, I)
true
Expand Down Expand Up @@ -261,15 +261,15 @@ julia> m2 = rand(M, -10:10)
(4, 4, -7)
julia> S, f = sub(M, [m1, m2])
(Submodule over Integers with 2 generators and no relations, Hom: submodule over Integers with 2 generators and no relations -> free module of rank 3 over integers)
(Submodule over integers with 2 generators and no relations, Hom: submodule over integers with 2 generators and no relations -> free module of rank 3 over integers)
julia> Q, g = quo(M, S)
(Quotient module over Integers with 2 generators and relations:
[16 -21], Hom: free module of rank 3 over integers -> quotient module over Integers with 2 generators and relations:
(Quotient module over integers with 2 generators and relations:
[16 -21], Hom: free module of rank 3 over integers -> quotient module over integers with 2 generators and relations:
[16 -21])
julia> I, f = snf(Q)
(Invariant factor decomposed module over Integers with invariant factors BigInt[0], Hom: invariant factor decomposed module over Integers with invariant factors BigInt[0] -> quotient module over Integers with 2 generators and relations:
(Invariant factor decomposed module over integers with invariant factors BigInt[0], Hom: invariant factor decomposed module over integers with invariant factors BigInt[0] -> quotient module over integers with 2 generators and relations:
[16 -21])
julia> invs = invariant_factors(Q)
Expand Down
6 changes: 3 additions & 3 deletions docs/src/module_homomorphism.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ julia> m = M([ZZ(1), ZZ(2), ZZ(3)])
(1, 2, 3)
julia> S, f = sub(M, [m])
(Submodule over Integers with 1 generator and no relations, Hom: submodule over Integers with 1 generator and no relations -> free module of rank 3 over integers)
(Submodule over integers with 1 generator and no relations, Hom: submodule over integers with 1 generator and no relations -> free module of rank 3 over integers)
julia> Q, g = quo(M, S)
(Quotient module over Integers with 2 generators and no relations, Hom: free module of rank 3 over integers -> quotient module over Integers with 2 generators and no relations)
(Quotient module over integers with 2 generators and no relations, Hom: free module of rank 3 over integers -> quotient module over integers with 2 generators and no relations)
julia> kernel(g)
(Submodule over Integers with 1 generator and no relations, Hom: submodule over Integers with 1 generator and no relations -> free module of rank 3 over integers)
(Submodule over integers with 1 generator and no relations, Hom: submodule over integers with 1 generator and no relations -> free module of rank 3 over integers)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/src/mpolynomial.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ julia> R, (x, y) = polynomial_ring(ZZ, ["x", "y"])
(Multivariate polynomial ring in 2 variables over integers, AbstractAlgebra.Generic.MPoly{BigInt}[x, y])
julia> C = MPolyBuildCtx(R)
Builder for an element of Multivariate polynomial ring in 2 variables over integers
Builder for an element of multivariate polynomial ring
julia> push_term!(C, ZZ(3), [1, 2]);
Expand Down
40 changes: 20 additions & 20 deletions docs/src/ncpolynomial.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ Matrix ring of degree 2
over integers
julia> S, x = polynomial_ring(R, "x")
(Univariate polynomial ring in x over matrix ring of degree 2 over integers, x)
(Univariate polynomial ring in x over matrix ring, x)
julia> T, y = polynomial_ring(S, "y")
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring of degree 2 over integers, y)
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring, y)
julia> U, z = R["z"]
(Univariate polynomial ring in z over matrix ring of degree 2 over integers, z)
(Univariate polynomial ring in z over matrix ring, z)
julia> f = S()
0
Expand Down Expand Up @@ -123,10 +123,10 @@ Matrix ring of degree 2
over integers
julia> S, x = polynomial_ring(R, "x")
(Univariate polynomial ring in x over matrix ring of degree 2 over integers, x)
(Univariate polynomial ring in x over matrix ring, x)
julia> T, y = polynomial_ring(S, "y")
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring of degree 2 over integers, y)
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring, y)
julia> f = x^3 + 3x + 21
x^3 + [3 0; 0 3]*x + [21 0; 0 21]
Expand All @@ -150,16 +150,16 @@ julia> n = length(g)
3
julia> U = base_ring(T)
Univariate polynomial ring in x over matrix ring of degree 2 over integers
Univariate polynomial ring in x over matrix ring
julia> V = base_ring(y + 1)
Univariate polynomial ring in x over matrix ring of degree 2 over integers
Univariate polynomial ring in x over matrix ring
julia> v = var(T)
:y
julia> U = parent(y + 1)
Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring of degree 2 over integers
Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring
julia> g == deepcopy(g)
true
Expand Down Expand Up @@ -210,10 +210,10 @@ Matrix ring of degree 2
over integers
julia> S, x = polynomial_ring(R, "x")
(Univariate polynomial ring in x over matrix ring of degree 2 over integers, x)
(Univariate polynomial ring in x over matrix ring, x)
julia> T, y = polynomial_ring(S, "y")
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring of degree 2 over integers, y)
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring, y)
julia> a = zero(T)
0
Expand Down Expand Up @@ -268,10 +268,10 @@ Matrix ring of degree 2
over integers
julia> S, x = polynomial_ring(R, "x")
(Univariate polynomial ring in x over matrix ring of degree 2 over integers, x)
(Univariate polynomial ring in x over matrix ring, x)
julia> T, y = polynomial_ring(S, "y")
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring of degree 2 over integers, y)
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring, y)
julia> f = x*y^2 + (x + 1)*y + 3
x*y^2 + (x + 1)*y + [3 0; 0 3]
Expand Down Expand Up @@ -302,10 +302,10 @@ Matrix ring of degree 2
over integers
julia> S, x = polynomial_ring(R, "x")
(Univariate polynomial ring in x over matrix ring of degree 2 over integers, x)
(Univariate polynomial ring in x over matrix ring, x)
julia> T, y = polynomial_ring(S, "y")
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring of degree 2 over integers, y)
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring, y)
julia> f = x*y^2 + (x + 1)*y + 3
x*y^2 + (x + 1)*y + [3 0; 0 3]
Expand Down Expand Up @@ -336,10 +336,10 @@ Matrix ring of degree 2
over integers
julia> S, x = polynomial_ring(R, "x")
(Univariate polynomial ring in x over matrix ring of degree 2 over integers, x)
(Univariate polynomial ring in x over matrix ring, x)
julia> T, y = polynomial_ring(S, "y")
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring of degree 2 over integers, y)
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring, y)
julia> f = x*y^2 + (x + 1)*y + 3
x*y^2 + (x + 1)*y + [3 0; 0 3]
Expand Down Expand Up @@ -370,10 +370,10 @@ Matrix ring of degree 2
over integers
julia> S, x = polynomial_ring(R, "x")
(Univariate polynomial ring in x over matrix ring of degree 2 over integers, x)
(Univariate polynomial ring in x over matrix ring, x)
julia> T, y = polynomial_ring(S, "y")
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring of degree 2 over integers, y)
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring, y)
julia> f = x*y^2 + (x + 1)*y + 3
Expand Down Expand Up @@ -404,10 +404,10 @@ Matrix ring of degree 2
over integers
julia> S, x = polynomial_ring(R, "x")
(Univariate polynomial ring in x over matrix ring of degree 2 over integers, x)
(Univariate polynomial ring in x over matrix ring, x)
julia> T, y = polynomial_ring(S, "y")
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring of degree 2 over integers, y)
(Univariate polynomial ring in y over univariate polynomial ring in x over matrix ring, y)
julia> f = x*y^2 + (x + 1)*y + 3
x*y^2 + (x + 1)*y + [3 0; 0 3]
Expand Down
Loading

0 comments on commit a6e92a4

Please sign in to comment.