From c08a23d098e4ea230bfff47ff6218e28a4a7d111 Mon Sep 17 00:00:00 2001 From: antonydellavecchia Date: Tue, 5 Mar 2024 10:03:35 +0100 Subject: [PATCH 01/30] Fix load polymake regression (#3481) * fixes loading polymake simplicial complex and other types * adds test case * removing unnecessary else * fix test (cherry picked from commit dcd39526edbd010f3fc1b28267dd72de49ec227c) --- src/Serialization/polymake.jl | 16 +- test/Serialization/polymake/runtests.jl | 50 ++-- .../Serialization/polymake/simplicial.complex | 251 ++++++++++++++++++ 3 files changed, 287 insertions(+), 30 deletions(-) create mode 100644 test/Serialization/polymake/simplicial.complex diff --git a/src/Serialization/polymake.jl b/src/Serialization/polymake.jl index 4b876581d5e3..f41ffef9f67b 100644 --- a/src/Serialization/polymake.jl +++ b/src/Serialization/polymake.jl @@ -36,16 +36,16 @@ function load_from_polymake(::Type{T}, jsondict::Dict{Symbol, Any}) where { T<:Union{Cone{<:scalar_types}, Polyhedron{<:scalar_types}, PolyhedralFan{<:scalar_types}, PolyhedralComplex{<:scalar_types}, SubdivisionOfPoints{<:scalar_types}, SimplicialComplex}} inner_object = Polymake.call_function(:common, :deserialize_json_string, json(jsondict)) - if T <: PolyhedralObject{QQFieldElem} - return T(inner_object) - elseif T <: PolyhedralObject{Float64} - return T(inner_object, AbstractAlgebra.Floats{Float64}()) - else - error("Unsupported object type $T for loading polymake object") - end + if T <: PolyhedralObject{Float64} + return T(inner_object, AbstractAlgebra.Floats{Float64}()) + end + try + return T(inner_object) + catch e + error("Unsupported object type $T for loading polymake object") + end end - # Distinguish between the various polymake datatypes. function load_from_polymake(jsondict::Dict{Symbol, Any}) typename = jsondict[:_type] diff --git a/test/Serialization/polymake/runtests.jl b/test/Serialization/polymake/runtests.jl index 8a2136b36ecb..2398563cf272 100644 --- a/test/Serialization/polymake/runtests.jl +++ b/test/Serialization/polymake/runtests.jl @@ -1,28 +1,34 @@ @testset "polymake" begin - - @testset "loading polymake objects" begin - s = load(joinpath(@__DIR__, "square.poly")) - @test s isa Polyhedron{QQFieldElem} - @test n_vertices(s) == 4 - @test n_facets(s) == 4 + + @testset "loading polymake objects" begin + s = load(joinpath(@__DIR__, "square.poly")) + @test s isa Polyhedron{QQFieldElem} + @test n_vertices(s) == 4 + @test n_facets(s) == 4 - nf = load(joinpath(@__DIR__, "nf_square.fan")) - @test nf isa PolyhedralFan{QQFieldElem} - @test n_rays(nf) == 4 - @test number_of_maximal_cones(nf) == 4 + nf = load(joinpath(@__DIR__, "nf_square.fan")) + @test nf isa PolyhedralFan{QQFieldElem} + @test n_rays(nf) == 4 + @test number_of_maximal_cones(nf) == 4 - g = load(joinpath(@__DIR__, "square_graph.graph")) - @test g isa Graph{Undirected} - @test n_edges(g) == 4 + g = load(joinpath(@__DIR__, "square_graph.graph")) + @test g isa Graph{Undirected} + @test n_edges(g) == 4 - um = nothing - @test_logs (:warn, r"No function for converting the deserialized Polymake type to Oscar") um = load(joinpath(@__DIR__, "um5.mat")) - @test um isa Polymake.PropertyValueAllocated + um = nothing + @test_logs (:warn, r"No function for converting the deserialized Polymake type to Oscar") um = load(joinpath(@__DIR__, "um5.mat")) + @test um isa Polymake.PropertyValueAllocated - i = load(joinpath(@__DIR__, "ideal.mv")) - @test i isa Oscar.Ideal - @test map(collect, map(coefficients, gens(i))) == [[1, 1], [1, -4]] - @test map(collect, map(exponents, gens(i))) == - [[[2, 0], [0, 1]], [[3, 0], [0, 1]]] - end + i = load(joinpath(@__DIR__, "ideal.mv")) + @test i isa Oscar.Ideal + @test map(collect, map(coefficients, gens(i))) == [[1, 1], [1, -4]] + @test map(collect, map(exponents, gens(i))) == + [[[2, 0], [0, 1]], [[3, 0], [0, 1]]] + + s = load(joinpath(@__DIR__, "simplicial.complex")) + @test s isa SimplicialComplex + @test n_vertices(s) == 4 + @test length(facets(s)) == 3 + + end end diff --git a/test/Serialization/polymake/simplicial.complex b/test/Serialization/polymake/simplicial.complex new file mode 100644 index 000000000000..737e4cfce1f8 --- /dev/null +++ b/test/Serialization/polymake/simplicial.complex @@ -0,0 +1,251 @@ +{ + "DIM": 2, + "_ns": { + "polymake": [ + "https://polymake.org", + "4.11" + ] + }, + "VERTEX_INDICES": [ + 1, + 2, + 3, + 4 + ], + "_id": "44.pm", + "FACETS": [ + [ + 0, + 1, + 2 + ], + [ + 0, + 1, + 3 + ], + [ + 2, + 3 + ] + ], + "PURE": false, + "HASSE_DIAGRAM": { + "TOP_NODE": 0, + "ADJACENCY": [ + [], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 1, + 2 + ], + [ + 1 + ], + [ + 1 + ], + [ + 2 + ], + [ + 2 + ], + [ + 3, + 5, + 6 + ], + [ + 3, + 7, + 8 + ], + [ + 4, + 5, + 7 + ], + [ + 4, + 6, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + "INVERSE_RANK_MAP": [ + { + "0": [ + 13 + ], + "1": [ + 9, + 10, + 11, + 12 + ], + "2": [ + 3, + 4, + 5, + 6, + 7, + 8 + ], + "3": [ + 1, + 2 + ], + "4": [ + 0 + ] + } + ], + "DECORATION": [ + [ + [ + -1 + ], + 4 + ], + [ + [ + 0, + 1, + 2 + ], + 3 + ], + [ + [ + 0, + 1, + 3 + ], + 3 + ], + [ + [ + 2, + 3 + ], + 2 + ], + [ + [ + 0, + 1 + ], + 2 + ], + [ + [ + 0, + 2 + ], + 2 + ], + [ + [ + 1, + 2 + ], + 2 + ], + [ + [ + 0, + 3 + ], + 2 + ], + [ + [ + 1, + 3 + ], + 2 + ], + [ + [ + 2 + ], + 1 + ], + [ + [ + 3 + ], + 1 + ], + [ + [ + 0 + ], + 1 + ], + [ + [ + 1 + ], + 1 + ], + [ + [], + 0 + ] + ], + "BOTTOM_NODE": 13 + }, + "INPUT_FACES": [ + [ + 1, + 2, + 3 + ], + [ + 1, + 2, + 4 + ], + [ + 1, + 2 + ], + [ + 1, + 3 + ], + [ + 1, + 4 + ], + [ + 2, + 3 + ], + [ + 2, + 4 + ], + [ + 3, + 4 + ] + ], + "_type": "topaz::SimplicialComplex", + "N_VERTICES": 4 +} From 3af6207aae8204ee2a312c5843f8e2c579b75329 Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Tue, 12 Mar 2024 15:51:03 +0100 Subject: [PATCH 02/30] Serialization: fix save/load of Int matrices/vectors in polymake numberfield objects (#3508) * Serialization: fix save/load of Int matrices/vectors in polymake numberfield objects * Update test/Serialization/PolyhedralGeometry.jl * fix for macos (cherry picked from commit 5acd5c5867e63cd4ca5de5b5f39a7195028b2cdd) --- src/Serialization/polymake.jl | 2 ++ test/Serialization/PolyhedralGeometry.jl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Serialization/polymake.jl b/src/Serialization/polymake.jl index f41ffef9f67b..51524c0e2029 100644 --- a/src/Serialization/polymake.jl +++ b/src/Serialization/polymake.jl @@ -82,12 +82,14 @@ _pmdata_for_oscar(im::IncidenceMatrix, coeff::Field) = im _pmdata_for_oscar(g::Polymake.Graph{T}, coeff::Field) where T = Graph{T}(g) _pmdata_for_oscar(m::Polymake.Matrix, coeff::Field) = matrix(coeff, m) +_pmdata_for_oscar(m::Polymake.Matrix{Polymake.to_cxx_type(Int)}, coeff::Field) = Matrix{Int}(m) _pmdata_for_oscar(m::Polymake.Matrix{<:Polymake.Integer}, coeff::Field) = matrix(ZZ, m) _pmdata_for_oscar(m::Polymake.Matrix{<:Polymake.Rational}, coeff::Field) = matrix(QQ, m) _pmdata_for_oscar(m::Polymake.SparseMatrix, coeff::Field) = _pmdata_for_oscar(Polymake.common.dense(m), coeff) _pmdata_for_oscar(v::Polymake.Vector, coeff::Field) = collect(elem_type(coeff), map(coeff, v)) +_pmdata_for_oscar(v::Polymake.Vector{Polymake.to_cxx_type(Int)}, coeff::Field) = Vector{Int}(v) _pmdata_for_oscar(v::Polymake.Vector{<:Polymake.Integer}, coeff::Field) = collect(ZZRingElem, map(ZZ, v)) _pmdata_for_oscar(v::Polymake.Vector{<:Polymake.Rational}, coeff::Field) = collect(QQFieldElem, map(QQ, v)) diff --git a/test/Serialization/PolyhedralGeometry.jl b/test/Serialization/PolyhedralGeometry.jl index 2b80ea0de0e6..98296490769d 100644 --- a/test/Serialization/PolyhedralGeometry.jl +++ b/test/Serialization/PolyhedralGeometry.jl @@ -80,6 +80,8 @@ using Oscar: _integer_variables end nfdodecahedron = normal_fan(dodecahedron()) + # add some extra properties to check save / load + Polymake.give(Oscar.pm_object(nfdodecahedron), :MAXIMAL_CONES_FACETS) test_save_load_roundtrip(path, nfdodecahedron) do loaded @test n_rays(nfdodecahedron) == n_rays(loaded) @test number_of_maximal_cones(nfdodecahedron) == number_of_maximal_cones(loaded) From afefacd21daa84d8cb844049a06d51ae08a59b1d Mon Sep 17 00:00:00 2001 From: Johannes Schmitt Date: Wed, 20 Mar 2024 08:19:06 +0100 Subject: [PATCH 03/30] Provide links for some documentation references (#3503) (cherry picked from commit 5ea63d166bd0c43f190e3c8d9c2f0e594da57026) --- .../AlgebraicGeometry/ToricVarieties/AlgebraicCycles.md | 4 ++-- .../CommutativeAlgebra/GroebnerBases/groebner_bases.md | 6 +++--- .../GroebnerBases/groebner_bases_integers.md | 2 +- docs/src/CommutativeAlgebra/GroebnerBases/orderings.md | 4 ++-- .../CommutativeAlgebra/Miscellaneous/binomial_ideals.md | 2 +- .../ModulesOverMultivariateRings/free_modules.md | 2 +- .../ModulesOverMultivariateRings/intro.md | 6 +++--- .../ModulesOverMultivariateRings/subquotients.md | 2 +- docs/src/CommutativeAlgebra/affine_algebras.md | 8 ++++---- docs/src/CommutativeAlgebra/intro.md | 4 ++-- docs/src/CommutativeAlgebra/localizations.md | 2 +- docs/src/CommutativeAlgebra/rings.md | 9 +++++---- docs/src/DeveloperDocumentation/new_developers.md | 4 ++-- docs/src/Fields/intro.md | 2 +- docs/src/InvariantTheory/finite_groups.md | 2 +- docs/src/InvariantTheory/intro.md | 2 +- docs/src/InvariantTheory/reductive_groups.md | 2 +- docs/src/InvariantTheory/tori.md | 2 +- docs/src/LinearAlgebra/intro.md | 2 +- docs/src/NoncommutativeAlgebra/PBWAlgebras/intro.md | 2 +- docs/src/NoncommutativeAlgebra/PBWAlgebras/quotients.md | 2 +- docs/src/NumberTheory/intro.md | 2 +- docs/src/Rings/intro.md | 2 +- 23 files changed, 38 insertions(+), 37 deletions(-) diff --git a/docs/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles.md b/docs/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles.md index 2dfbdf620426..f8816d400e42 100644 --- a/docs/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles.md +++ b/docs/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles.md @@ -61,7 +61,7 @@ rational_equivalence_class(v::NormalToricVarietyType, p::MPolyQuoRingElem) rational_equivalence_class(v::NormalToricVarietyType, coefficients::Vector{T}) where {T <: IntegerUnion} ``` -### Special constructors +### [Special constructors](@id toric_special_constructors) ```@docs rational_equivalence_class(d::ToricDivisor) @@ -95,7 +95,7 @@ An algebraic cycle can be intersected `n`- with itself via `^n`, where `n` can be an integer of of type `ZZRingElem`. A closed subvarieties defines in a natural way a rational equivalence -class (cf. section on special constructors above). This allows to +class (cf. [Special constructors](@ref toric_special_constructors)). This allows to compute intersection products among closed subvarieties and rational equivalence classes in the Chow ring. diff --git a/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases.md b/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases.md index 66c6c874d101..515ad80fabbb 100644 --- a/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases.md +++ b/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases.md @@ -5,7 +5,7 @@ DocTestSetup = quote end ``` -# Gröbner/Standard Bases Over Fields +# [Gröbner/Standard Bases Over Fields](@id gb_fields) We fix our notation in the context of standard (Gröbner) bases and present relevant OSCAR functions. @@ -77,7 +77,7 @@ julia> default_ordering(S) wdegrevlex([x, y, z], [1, 2, 3]) ``` -## Monomials, Terms, and More +## [Monomials, Terms, and More](@id monomials_terms_more) Here are examples which indicate how to recover monomials, terms, and more from a given polynomial. @@ -400,7 +400,7 @@ normal_form(g::T, I::MPolyIdeal; ordering::MonomialOrdering = default_ordering(b ## Syzygies -We refer to the section on modules for more on syzygies. +We refer to the section on [modules](@ref modules_multivariate) for more on syzygies. ```@docs syzygy_generators(G::Vector{<:MPolyRingElem}) diff --git a/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases_integers.md b/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases_integers.md index 6572c0491a59..7813d8c012ce 100644 --- a/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases_integers.md +++ b/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases_integers.md @@ -33,7 +33,7 @@ julia> reduce(6*x, [5*x, 2*x]) 0 ``` -The notion of *leading ideals* as formulated in the previous section and the definitions of +The notion of *leading ideals* as formulated in [the previous section](@ref gb_fields) and the definitions of standard bases (Gröbner bases) carry over: A *standard basis* for an ideal $I\subset K[x]_>$ with respect to $>$ is a finite subset $G$ of $I$ such that $\text{L}_>(G) = \text{L}_>(I)$ (a standard basis with respect to a global monomial ordering is also called a *Gröbner basis*). diff --git a/docs/src/CommutativeAlgebra/GroebnerBases/orderings.md b/docs/src/CommutativeAlgebra/GroebnerBases/orderings.md index 7fd4a9ec1619..84ec1552768f 100644 --- a/docs/src/CommutativeAlgebra/GroebnerBases/orderings.md +++ b/docs/src/CommutativeAlgebra/GroebnerBases/orderings.md @@ -5,7 +5,7 @@ DocTestSetup = quote end ``` -# Monomial Orderings +# [Monomial Orderings](@id monomial_orderings) Given a coefficient ring $C$ as in the previous section, let $C[x]=C[x_1, \ldots, x_n]$ be the polynomial ring over $C$ in the set of variables $x=\{x_1, \ldots, x_n\}$. Monomials @@ -37,7 +37,7 @@ A monomial ordering $>$ on $\text{Mon}_n(x)$ is called !!! note The lexicograpical monomial ordering specifies the default way of storing and displaying multivariate polynomials in OSCAR (terms are sorted in descending order). The other orderings which can be attached to a multivariate polynomial ring are the degree lexicographical ordering and the degree reverse lexicographical - ordering. Independently of the attached orderings, Gröbner bases can be computed with respect to any monomial ordering. See the section on Gröbner bases. + ordering. Independently of the attached orderings, Gröbner bases can be computed with respect to any monomial ordering. See the section on [Gröbner bases](@ref gb_fields). In this section, we show how to create monomial orderings in OSCAR. diff --git a/docs/src/CommutativeAlgebra/Miscellaneous/binomial_ideals.md b/docs/src/CommutativeAlgebra/Miscellaneous/binomial_ideals.md index 5290168d5c05..1248eaf3b342 100644 --- a/docs/src/CommutativeAlgebra/Miscellaneous/binomial_ideals.md +++ b/docs/src/CommutativeAlgebra/Miscellaneous/binomial_ideals.md @@ -31,7 +31,7 @@ While the first step can be performed over any ground field for which Gröbner b !!! note A *pure difference binomial* is a binomial which is the difference of two monomials. A *unital binomial ideal* is an ideal which can be generated by pure difference binomials and monomials. Note that cellular components of unital binomial ideals are unital as well. For unital binomial ideals in $\mathbb Q[x_1, \dots, x_n]$, binomial primary decompositions exist already over cyclotomic extensions of $\mathbb Q$. In particular, any such ideal can be decomposed over the abelian closure $\mathbb Q^{\text{ab}}$ of $\mathbb Q$. While OSCAR offers functionality for doing this, computing binomial primary decompositions in other cases is not yet supported. - See the number theory chapter for how to deal with $\mathbb Q^{\text{ab}}$. + See the [number theory](@ref number_theory) chapter for how to deal with $\mathbb Q^{\text{ab}}$. !!! note Binomial primary decompositions computed with OSCAR are not necessarily minimal. diff --git a/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/free_modules.md b/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/free_modules.md index 439dbb94c7ab..98a41428845a 100644 --- a/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/free_modules.md +++ b/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/free_modules.md @@ -5,7 +5,7 @@ DocTestSetup = quote end ``` -# Free Modules +# [Free Modules](@id free_modules) In this section, the expression *free module* refers to a free module of finite rank over a ring of type `MPolyRing`, `MPolyQuoRing`, `MPolyLocRing`, or `MPolyQuoLocRing`. diff --git a/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/intro.md b/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/intro.md index e7acfc2ca6eb..db378ca797b5 100644 --- a/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/intro.md +++ b/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/intro.md @@ -2,7 +2,7 @@ CurrentModule = Oscar ``` -# Introduction +# [Introduction](@id modules_multivariate) Our focus in this section is on finitely presented modules over rings from the following list: - multivariate polynomial rings (OSCAR type `MPolyRing`), @@ -17,8 +17,8 @@ modules which naturally includes both submodules and quotients of free modules. !!! note Most functions in this section rely on Gröbner (standard) bases techniques. Thus, the functions - should not be applied to modules over rings other than those from the list above. See the Linear - Algebra chapter for module types which are designed to handle modules over Euclidean + should not be applied to modules over rings other than those from the list above. See the [Linear + Algebra](@ref linear_algebra) chapter for module types which are designed to handle modules over Euclidean domains. !!! note diff --git a/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/subquotients.md b/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/subquotients.md index b2db2eca6355..c28b21a850b2 100644 --- a/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/subquotients.md +++ b/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/subquotients.md @@ -34,7 +34,7 @@ Finally, we refer to and regard $M$ as a submodule of that ambient module, embedded in the natural way. !!! note - Recall from the section on free modules that by a free $R$-module we mean a free + Recall from the section on [free modules](@ref free_modules) that by a free $R$-module we mean a free module of type $R^p$ , where we think of $R^p$ as a free module with a given basis, namely the basis of standard unit vectors. Accordingly, elements of free modules are represented by coordinate vectors, and homomorphisms between free modules by diff --git a/docs/src/CommutativeAlgebra/affine_algebras.md b/docs/src/CommutativeAlgebra/affine_algebras.md index d468b7da81e0..8bbfc3d19f09 100644 --- a/docs/src/CommutativeAlgebra/affine_algebras.md +++ b/docs/src/CommutativeAlgebra/affine_algebras.md @@ -5,7 +5,7 @@ DocTestSetup = quote end ``` -# Affine Algebras and Their Ideals +# [Affine Algebras and Their Ideals](@id affine_algebras) With regard to notation, we use *affine algebra* as a synonym for *quotient of a multivariate polynomial ring by an ideal*. More specifically, if $R$ is a multivariate polynomial ring with coefficient ring $C$, and $A=R/I$ is the quotient of $R$ @@ -14,14 +14,14 @@ discuss functionality for handling such algebras in OSCAR. !!! note To emphasize this point: In this section, we view $R/I$ together with its ring structure. Realizing $R/I$ as an - $R$-module means to implement it as the quotient of a free $R$-module of rank 1. See the section on modules. + $R$-module means to implement it as the quotient of a free $R$-module of rank 1. See the section on [modules](@ref modules_multivariate). !!! note Most functions discussed here rely on Gröbner basis techniques. In particular, they typically make use of a Gröbner basis for the modulus of the quotient. Nevertheless, the construction of quotients is lazy in the sense that the computation of such a Gröbner basis is delayed until the user performs an operation that indeed requires it (the Gröbner basis is then computed with respect to the monomial ordering entered by the user when creating the quotient; if no such ordering is entered, OSCAR will use the - `default_ordering` on the underlying polynomial ring; see the section on Gröbner/Standard Bases for default orderings in OSCAR). + `default_ordering` on the underlying polynomial ring; see the section on [Gröbner/Standard Bases](@ref gb_fields) for default orderings in OSCAR). Once computed, the Gröbner basis is cached for later reuse. !!! note @@ -31,7 +31,7 @@ discuss functionality for handling such algebras in OSCAR. !!! note In OSCAR, elements of a quotient $A = R/I$ are not necessarily represented by polynomials which are reduced with regard to $I$. That is, if $f\in R$ is the internal polynomial representative of an element of $A$, then $f$ may not be the normal form mod $I$ - with respect to the default ordering on $R$ (see the section on *Gröbner/Standard Bases* for normal forms). Operations involving + with respect to the default ordering on $R$ (see the section on [Gröbner/Standard Bases](@ref gb_fields) for normal forms). Operations involving Gröbner basis computations may lead to (partial) reductions. The function `simplify` discussed in this section computes fully reduced representatives. diff --git a/docs/src/CommutativeAlgebra/intro.md b/docs/src/CommutativeAlgebra/intro.md index bac1afe4b32d..04a15106d85e 100644 --- a/docs/src/CommutativeAlgebra/intro.md +++ b/docs/src/CommutativeAlgebra/intro.md @@ -2,7 +2,7 @@ CurrentModule = Oscar ``` -# Introduction +# [Introduction](@id commutative_algebra) The commutative algebra part of OSCAR provides functionality for dealing with @@ -15,7 +15,7 @@ We use *affine algebra* as a synonym for *quotient of a multivariate polynomial Fundamental to computational commutative algebra is the concept of *standard bases*. Each such basis is defined relative to a *monomial ordering*. If this ordering is a well-ordering, a standard basis is also called -a *Gröbner basis*. We refer to the corresponding section in this chapter for details. +a *Gröbner basis*. We refer to the corresponding [section](@ref gb_fields) in this chapter for details. !!! note Each multivariate polynomial ring in OSCAR comes equipped with a monomial ordering according to which the diff --git a/docs/src/CommutativeAlgebra/localizations.md b/docs/src/CommutativeAlgebra/localizations.md index ee4fa9be7251..5092672e83c5 100644 --- a/docs/src/CommutativeAlgebra/localizations.md +++ b/docs/src/CommutativeAlgebra/localizations.md @@ -23,7 +23,7 @@ Mimicking the standard arithmetic for fractions, ``R[U^{-1}]`` can be made into \iota : R\to R[U^{-1}],\; r \mapsto \frac{r}{1}. ``` Given an ``R``-module ``M``, the analogous construction yields an ``R[U^{-1}]``-module ``M[U^{-1}]`` which is -called the *localization of ``M`` at ``U``*. See the section on modules. +called the *localization of ``M`` at ``U``*. See the section on [modules](@ref modules_multivariate). Our focus in this section is on localizing multivariate polynomial rings and their quotients. The starting point for this is to provide functionality for handling (several types of) multiplicatively closed subsets of multivariate diff --git a/docs/src/CommutativeAlgebra/rings.md b/docs/src/CommutativeAlgebra/rings.md index 1b1b6aacbe52..aa09ec1d811b 100644 --- a/docs/src/CommutativeAlgebra/rings.md +++ b/docs/src/CommutativeAlgebra/rings.md @@ -7,8 +7,9 @@ end # Creating Multivariate Rings -In this section, for the convenience of the reader, we recall from the chapters on rings and fields -how to create multivariate polynomial rings and their elements, adding illustrating examples. +In this section, for the convenience of the reader, we recall from the chapters on +[rings](@ref rings) and [fields](@ref fields) how to create multivariate polynomial +rings and their elements, adding illustrating examples. At the same time, we introduce and illustrate a ring type for modelling multivariate polynomial rings with gradings. @@ -432,7 +433,7 @@ Given an element `f` of a multivariate polynomial ring `R` or a graded version o the notion of total degree ignores the weights given to the variables in the graded case. For iterators which allow one to recover the monomials (terms, $\dots$) of `f` we refer to the -subsection *Monomials, Terms, and More* of the section on *Gröbner/Standard Bases*. +subsection [Monomials, Terms, and More](@ref monomials_terms_more) of the section on [Gröbner/Standard Bases](@ref gb_fields). ###### Examples @@ -502,5 +503,5 @@ refer to `R` and `S`, respectively. !!! note The OSCAR homomorphism type `AffAlgHom` models ring homomorphisms `R` $\to$ `S` such that the type of both `R` and `S` is a subtype of `Union{MPolyRing{T}, MPolyQuoRing{U}}`, where `T <: FieldElem` and - `U <: MPolyRingElem{T}`. Functionality for these homomorphism is discussed in the section on affine algebras. + `U <: MPolyRingElem{T}`. Functionality for these homomorphism is discussed in the section on [affine algebras](@ref affine_algebras). diff --git a/docs/src/DeveloperDocumentation/new_developers.md b/docs/src/DeveloperDocumentation/new_developers.md index f12a8168f35d..7f57447784c9 100644 --- a/docs/src/DeveloperDocumentation/new_developers.md +++ b/docs/src/DeveloperDocumentation/new_developers.md @@ -75,7 +75,7 @@ in Julia. This will create a directory `~/.julia/dev/Oscar`. This directory is a git clone of the central OSCAR repository. You can develop your code here, however you will still have to fork OSCAR, as you have no rights to push to the central repository. You can then add your fork as another remote, have a look -at the section on rebasing below for hints. +at the section on [rebasing](@ref rebasing) below for hints. ## The edit process @@ -160,7 +160,7 @@ naming conventions, code formatting, etc. To build and test the documentation, please have a look at [Documenting OSCAR code](@ref). -### Rebasing +### [Rebasing](@id rebasing) One way to stay up to date with the current master is rebasing. In order to do this, add the main Oscar.jl repository as a remote, fetch, and then rebase. ``` diff --git a/docs/src/Fields/intro.md b/docs/src/Fields/intro.md index 1e83349c33fb..df5748c28ac8 100644 --- a/docs/src/Fields/intro.md +++ b/docs/src/Fields/intro.md @@ -5,7 +5,7 @@ DocTestSetup = quote end ``` -# Introduction +# [Introduction](@id fields) The fields part of OSCAR provides functionality for handling various kinds of fields: diff --git a/docs/src/InvariantTheory/finite_groups.md b/docs/src/InvariantTheory/finite_groups.md index 04e67f731cf2..f1c16a497929 100644 --- a/docs/src/InvariantTheory/finite_groups.md +++ b/docs/src/InvariantTheory/finite_groups.md @@ -5,7 +5,7 @@ DocTestSetup = Oscar.doctestsetup() # Invariants of Finite Groups -In this section, with notation as in the introduction to this chapter, $G$ will be a *finite* group. +In this section, with notation as in the [introduction](@ref invariant_theory) to this chapter, $G$ will be a *finite* group. !!! note The ssumption that $G$ is finite implies: diff --git a/docs/src/InvariantTheory/intro.md b/docs/src/InvariantTheory/intro.md index 87610955214e..837b32c46b65 100644 --- a/docs/src/InvariantTheory/intro.md +++ b/docs/src/InvariantTheory/intro.md @@ -2,7 +2,7 @@ CurrentModule = Oscar ``` -# Introduction +# [Introduction](@id invariant_theory) The invariant theory part of OSCAR provides functionality for computing polynomial invariants of group actions, focusing on finite and linearly reductive groups, respectively. diff --git a/docs/src/InvariantTheory/reductive_groups.md b/docs/src/InvariantTheory/reductive_groups.md index cc42ff60bbb9..29b202f190af 100644 --- a/docs/src/InvariantTheory/reductive_groups.md +++ b/docs/src/InvariantTheory/reductive_groups.md @@ -4,7 +4,7 @@ CurrentModule = Oscar # Invariants of Linearly Reductive Groups -In this section, with notation as in the introduction to this chapter, +In this section, with notation as in the [introduction](@ref invariant_theory) to this chapter, $G$ will be a *linearly algebraic group* over an algebraically closed field $K$, $\rho: G \to \text{GL}(V)\cong \text{GL}_n(K)$ will be a *rational* representation of $G$, and diff --git a/docs/src/InvariantTheory/tori.md b/docs/src/InvariantTheory/tori.md index ef9fbdbfc939..7508fd66f8cd 100644 --- a/docs/src/InvariantTheory/tori.md +++ b/docs/src/InvariantTheory/tori.md @@ -3,7 +3,7 @@ CurrentModule = Oscar ``` # Invariants of Tori -In this section, with notation as in the introduction to this chapter, $T =(K^{\ast})^m$ will be a torus of rank $m$ +In this section, with notation as in the [introduction](@ref invariant_theory) to this chapter, $T =(K^{\ast})^m$ will be a torus of rank $m$ over a field $K$. To compute invariants of diagonal torus actions, OSCAR makes use of Algorithm 4.3.1 in [DK15](@cite) which, in particular, relies on algorithmic means from polyhedral geometry. diff --git a/docs/src/LinearAlgebra/intro.md b/docs/src/LinearAlgebra/intro.md index d78f123022f4..3892e8ed6dc2 100644 --- a/docs/src/LinearAlgebra/intro.md +++ b/docs/src/LinearAlgebra/intro.md @@ -5,7 +5,7 @@ DocTestSetup = quote end ``` -# Introduction +# [Introduction](@id linear_algebra) The linear algebra part of OSCAR provides functionality for handling - vectors and matrices diff --git a/docs/src/NoncommutativeAlgebra/PBWAlgebras/intro.md b/docs/src/NoncommutativeAlgebra/PBWAlgebras/intro.md index c1c8dcb23e38..7d748f80ba87 100644 --- a/docs/src/NoncommutativeAlgebra/PBWAlgebras/intro.md +++ b/docs/src/NoncommutativeAlgebra/PBWAlgebras/intro.md @@ -29,7 +29,7 @@ x_jx_i = c_{ij}x_ix_j+d_{ij}. ``` Working with Gröbner bases requires that we take monomial orderings into account (see the section -on Gröbner bases in the commutative algebra chapter for monomial orderings). In our context here, we use the following notation. +on [Gröbner bases](@ref monomial_orderings) in the [commutative algebra](@ref commutative_algebra) chapter for monomial orderings). In our context here, we use the following notation. A *standard monomial* in $K \langle x \rangle$ is a word of type $x^\alpha=x_{1}^{\alpha_{1}}\cdots x_{n}^{\alpha_{n}},$ where $\alpha=(\alpha_1,\dots,\alpha_n)\in\mathbb N^n$. A *standard polynomial* in $K \langle x \rangle$ is a $K$-linear combination of standard monomials. Each global monomial ordering $>$ on $K[x]$ gives rise to diff --git a/docs/src/NoncommutativeAlgebra/PBWAlgebras/quotients.md b/docs/src/NoncommutativeAlgebra/PBWAlgebras/quotients.md index 5cd23e827d74..fce9de8db379 100644 --- a/docs/src/NoncommutativeAlgebra/PBWAlgebras/quotients.md +++ b/docs/src/NoncommutativeAlgebra/PBWAlgebras/quotients.md @@ -7,7 +7,7 @@ end # GR-Algebras: Quotients of PBW-Algebras -In analogy to the affine algebras section in the commutative algebra chapter, we describe OSCAR +In analogy to the [affine algebras](@ref affine_algebras) section in the [commutative algebra](@ref commutative_algebra) chapter, we describe OSCAR functionality for dealing with quotients of PBW-algebras modulo two-sided ideals. !!! note diff --git a/docs/src/NumberTheory/intro.md b/docs/src/NumberTheory/intro.md index 8bd43e861e4c..0dccdf1c8230 100644 --- a/docs/src/NumberTheory/intro.md +++ b/docs/src/NumberTheory/intro.md @@ -2,7 +2,7 @@ CurrentModule = Oscar ``` -# Introduction +# [Introduction](@id number_theory) The number theory part of OSCAR provides functionality for algebraic number theory. diff --git a/docs/src/Rings/intro.md b/docs/src/Rings/intro.md index 22e79b5eb70c..21f6ea3c7e9b 100644 --- a/docs/src/Rings/intro.md +++ b/docs/src/Rings/intro.md @@ -5,7 +5,7 @@ DocTestSetup = quote end ``` -# Introduction +# [Introduction](@id rings) The rings part of OSCAR provides functionality for handling various kinds of rings: From fe11edcabc8532172044479604654f747ee0c30a Mon Sep 17 00:00:00 2001 From: antonydellavecchia Date: Wed, 20 Mar 2024 17:03:05 +0100 Subject: [PATCH 04/30] Fixes bug with loading vector of Fields (#3534) (cherry picked from commit 31228f5b41f9b4364948b62f8e2ba8b72f35523d) --- src/Serialization/containers.jl | 8 ++++++-- test/Serialization/Fields.jl | 27 ++++++++++++++++++--------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/Serialization/containers.jl b/src/Serialization/containers.jl index 705623614bed..ba1042531bda 100644 --- a/src/Serialization/containers.jl +++ b/src/Serialization/containers.jl @@ -51,7 +51,9 @@ end function load_object(s::DeserializerState, ::Type{<: Vector}, params::Type) load_node(s) do v if serialize_with_id(params) - loaded_v = params[load_ref(s, x) for x in v] + loaded_v::Vector{params} = load_array_node(s) do _ + load_ref(s) + end else loaded_v = params[] for (i, entry) in enumerate(v) @@ -65,7 +67,9 @@ end function load_object(s::DeserializerState, ::Type{<: Vector{params}}) where params load_node(s) do v if serialize_with_id(params) - loaded_v = params[load_ref(s, x) for x in v] + loaded_v::Vector{params} = load_array_node(s) do _ + load_ref(s) + end else loaded_v = params[] for (i, entry) in enumerate(v) diff --git a/test/Serialization/Fields.jl b/test/Serialization/Fields.jl index 458c82607252..0d11ec0d275c 100644 --- a/test/Serialization/Fields.jl +++ b/test/Serialization/Fields.jl @@ -1,15 +1,17 @@ @testset "Fields" begin mktempdir() do path + Qx, x = QQ["x"] + K1, _ = number_field(x^2 + 5) + K2, _ = number_field([x^2 + 5, x^2 + 7]) + K3, _ = number_field(x^2 + 7) + Kt, t = polynomial_ring(K1, cached = false) + L1, = number_field(t^2 + 2) + L2, = number_field([t^2 + 2, t^2 + 3]) + Kt, t = polynomial_ring(K2, cached = false) + L3, = number_field(t^2 + 2) + L4, = number_field([t^2 + 2, t^2 + 3]) + @testset "Field Embeddings" begin - Qx, x = QQ["x"] - K1, _ = number_field(x^2 + 5) - K2, _ = number_field([x^2 + 5, x^2 + 7]) - Kt, t = polynomial_ring(K1, cached = false) - L1, = number_field(t^2 + 2) - L2, = number_field([t^2 + 2, t^2 + 3]) - Kt, t = polynomial_ring(K2, cached = false) - L3, = number_field(t^2 + 2) - L4, = number_field([t^2 + 2, t^2 + 3]) for K in (K1, K2, L1, L2, L3, L4) for E in complex_embeddings(K) test_save_load_roundtrip(path, E) do loaded @@ -24,5 +26,12 @@ end end end + + @testset "Vector of Fields" begin + v = [K1, K3] + test_save_load_roundtrip(path, v) do loaded + @test loaded == v + end + end end end From 9ccec92fb1a485500d1e6215192b06f3c4ac3ee7 Mon Sep 17 00:00:00 2001 From: Tommy Hofmann Date: Sat, 30 Mar 2024 20:48:58 +0100 Subject: [PATCH 05/30] fix: remove some (broken) leftover from surface serialization (#3545) (cherry picked from commit 8667f84b4220fc6269f81ae61c5e640aa4f62d26) --- src/AlgebraicGeometry/Surfaces/SurfacesP4.jl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/AlgebraicGeometry/Surfaces/SurfacesP4.jl b/src/AlgebraicGeometry/Surfaces/SurfacesP4.jl index 0a7d98221c02..dd9516594874 100644 --- a/src/AlgebraicGeometry/Surfaces/SurfacesP4.jl +++ b/src/AlgebraicGeometry/Surfaces/SurfacesP4.jl @@ -86,10 +86,6 @@ Return a smooth abelian surface in $\mathbb P^4$ with degree `15` and sectional The returned surface is defined over a prime field of characteristic 31991. """ abelian_d15_pi21_quintic_1() = surface("abelian_d15_pi21_quintic_1") - F = GF(31991) - R, (x,y,z,u,v) = graded_polynomial_ring(F, ["x", "y", "z", "u", "v"]) - return proj(R, ideal([F(5)/8*x^3*y^3+2992*x^4*y*z-F(121)/98*x*y^2*z^3-F(96)/29*x^2*z^4+F(121)/89*x*y^3*z*u-4353*x^2*y*z^2*u+F(1)/2*z^5*u-F(8)/99*x^2*y^2*u^2-1983*x^3*z*u^2-117*y*z^3*u^2+F(6)/35*y^2*z*u^3-F(2)/5*x*z^2*u^3-1983*x*y*u^4+2992*x*y^4*v+F(96)/79*x^2*y^2*z*v+F(1)/2*x^3*z^2*v-F(5)/8*y*z^4*v+F(121)/89*x^3*y*u*v+F(19)/62*y^2*z^2*u*v-6369*x*z^3*u*v-1983*y^3*u^2*v-F(17)/42*x*y*z*u^2*v+F(6)/35*x^2*u^3*v-F(23)/11*z*u^4*v+F(1)/2*y^3*z*v^2+F(79)/60*x*y*z^2*v^2-4353*x*y^2*u*v^2+F(19)/62*x^2*z*u*v^2+14197*z^2*u^2*v^2-F(2)/5*y*u^3*v^2-F(121)/98*x^2*y*v^3+F(120)/29*z^3*v^3-6369*y*z*u*v^3-117*x*u^2*v^3-F(96)/29*y^2*v^4-F(5)/8*x*z*v^4+F(1)/2*u*v^5,F(1)/2*y^5*z-117*x*y^3*z^2+F(6)/35*x^2*y*z^3-F(5)/8*x*y^4*u+F(19)/62*x^2*y^2*z*u-1983*x^3*z^2*u-F(23)/11*y*z^4*u+F(1)/2*x^3*y*u^2+14197*y^2*z^2*u^2-F(2)/5*x*z^3*u^2+F(120)/29*y^3*u^3-6369*x*y*z*u^3-F(96)/29*x^2*u^4+F(1)/2*z*u^5-F(121)/98*x^2*y^3*v+F(121)/89*x^3*y*z*v-F(2)/5*y^2*z^3*v-1983*x*z^4*v+2992*x^4*u*v-6369*y^3*z*u*v-F(17)/42*x*y*z^2*u*v+F(79)/60*x*y^2*u^2*v-4353*x^2*z*u^2*v-117*z^2*u^3*v-F(5)/8*y*u^4*v-F(96)/29*y^4*v^2-4353*x*y^2*z*v^2-F(8)/99*x^2*z^2*v^2+F(96)/79*x^2*y*u*v^2+F(6)/35*z^3*u*v^2+F(19)/62*y*z*u^2*v^2-F(121)/98*x*u^3*v^2+F(5)/8*x^3*v^3-1983*y*z^2*v^3+F(1)/2*y^2*u*v^3+F(121)/89*x*z*u*v^3+2992*x*y*v^4,-x^2*y^3*z+1611*x^3*y*z^2+F(65)/99*y^2*z^4-F(21)/121*x*z^5+F(5)/4*x^3*y^2*u-F(19)/31*x^4*z*u-F(21)/121*y^3*z^2*u-10148*x*y*z^3*u-F(46)/11*x*y^2*z*u^2+3471*x^2*z^2*u^2-F(16)/99*x^2*y*u^3+F(97)/93*z^3*u^3+F(12)/35*y*z*u^4-F(21)/121*x*u^5-x^4*y*v-F(52)/99*y^4*z*v+F(122)/99*x*y^2*z^2*v-F(16)/99*x^2*z^3*v+F(13)/59*x*y^3*u*v+F(124)/101*x^2*y*z*u*v+F(12)/35*z^4*u*v+1611*x^3*u^2*v+9919*y*z^2*u^2*v+F(3)/7*y^2*u^3*v-10148*x*z*u^3*v+234*x^2*y^2*v^2+F(5)/4*x^3*z*v^2+F(3)/7*y*z^3*v^2+F(11)/4*y^2*z*u*v^2-F(46)/11*x*z^2*u*v^2+F(122)/99*x*y*u^2*v^2+F(65)/99*u^4*v^2-F(12)/35*y^3*v^3+F(13)/59*x*y*z*v^3-x^2*u*v^3-F(21)/121*z*u^2*v^3-F(52)/99*y*u*v^4,y^4*z^2-234*x*y^2*z^3+F(12)/35*x^2*z^4-F(90)/121*x*y^3*z*u+57*x^2*y*z^2*u-F(46)/11*z^5*u-F(99)/52*x^2*y^2*u^2-650*x^3*z*u^2-F(109)/4*y*z^3*u^2-2683*y^2*z*u^3-4373*x*z^2*u^3+F(16)/65*x*y*u^4+1611*u^6-F(72)/49*x^2*y^2*z*v+10613*x^3*z^2*v+6526*y*z^4*v-F(90)/121*x^3*y*u*v-3237*y^2*z^2*u*v-7261*x*z^3*u*v-650*y^3*u^2*v-F(4)/103*x*y*z*u^2*v-2683*x^2*u^3*v+F(11)/126*z*u^4*v+x^4*v^2+10613*y^3*z*v^2+3249*x*y*z^2*v^2+57*x*y^2*u*v^2-3237*x^2*z*u*v^2-F(70)/57*z^2*u^2*v^2-4373*y*u^3*v^2-234*x^2*y*v^3+9744*z^3*v^3-7261*y*z*u*v^3-F(109)/4*x*u^2*v^3+F(12)/35*y^2*v^4+6526*x*z*v^4-F(46)/11*u*v^5,-F(4)/5*y^6-F(113)/79*x*y^4*z-11797*x^2*y^2*z^2+F(96)/29*x^3*z^3+13879*x^2*y^3*u-15044*x^3*y*z*u-12643*y^2*z^3*u-F(1)/2*x*z^4*u+F(21)/121*x^4*u^2-F(121)/23*y^3*z*u^2+F(17)/38*x*y*z^2*u^2+3639*x*y^2*u^3+5300*x^2*z*u^3-F(5)/8*z^2*u^4+F(93)/109*y*u^5-12643*x^3*y^2*v-F(1)/2*x^4*z*v+13879*y^3*z^2*v-15044*x*y*z^3*v-F(69)/31*y^4*u*v-9826*x*y^2*z*u*v-F(22)/29*x^2*z^2*u*v-F(100)/23*x^2*y*u^2*v+9933*z^3*u^2*v-F(7)/80*y*z*u^3*v+3908*x*u^4*v-F(121)/23*x*y^3*v^2+F(17)/38*x^2*y*z*v^2+F(21)/121*z^4*v^2+9933*x^3*u*v^2-F(100)/23*y*z^2*u*v^2+F(49)/53*y^2*u^2*v^2+2111*x*z*u^2*v^2+3639*y^2*z*v^3+5300*x*z^2*v^3-F(7)/80*x*y*u*v^3-12076*u^3*v^3-F(5)/8*x^2*v^4+3908*z*u*v^4+F(93)/109*y*v^5,-F(5)/8*x^2*y^4+9933*x^3*y^2*z+F(21)/121*x^4*z^2-12076*y^3*z^3+3908*x*y*z^4-F(1)/2*x^4*y*u+3908*y^4*z*u+2111*x*y^2*z^2*u+5300*x^2*z^3*u+5300*x*y^3*u^2-F(22)/29*x^2*y*z*u^2-F(5)/8*z^4*u^2+F(96)/29*x^3*u^3+9933*y*z^2*u^3+F(21)/121*y^2*u^4-F(1)/2*x*z*u^4+F(93)/109*y^5*v-F(7)/80*x*y^3*z*v-F(100)/23*x^2*y*z^2*v+F(93)/109*z^5*v+F(17)/38*x^2*y^2*u*v-15044*x^3*z*u*v-F(7)/80*y*z^3*u*v-F(100)/23*y^2*z*u^2*v+F(17)/38*x*z^2*u^2*v-15044*x*y*u^3*v-12643*x^3*y*v^2+F(49)/53*y^2*z^2*v^2+3639*x*z^3*v^2+3639*y^3*u*v^2-9826*x*y*z*u*v^2-11797*x^2*u^2*v^2-12643*z*u^3*v^2-F(121)/23*x*y^2*v^3+13879*x^2*z*v^3-F(121)/23*z^2*u*v^3+13879*y*u^2*v^3-F(69)/31*y*z*v^4-F(113)/79*x*u*v^4-F(4)/5*v^6,F(33)/122*x^3*y^2*z+4022*x^4*z^2+F(52)/99*y^3*z^3-F(122)/117*x*y*z^4-F(52)/99*x^4*y*u-F(122)/117*y^4*z*u+F(83)/26*x*y^2*z^2*u+F(89)/58*x^2*z^3*u+F(89)/58*x*y^3*u^2+F(99)/70*x^2*y*z*u^2-F(12)/35*x^3*u^3+F(33)/122*y*z^2*u^3+4022*y^2*u^4-F(52)/99*x*z*u^4-F(89)/58*y^5*v-F(100)/71*x*y^3*z*v+F(78)/101*x^2*y*z^2*v-F(89)/58*z^5*v+F(63)/94*x^2*y^2*u*v-F(17)/31*x^3*z*u*v-F(100)/71*y*z^3*u*v+F(78)/101*y^2*z*u^2*v+F(63)/94*x*z^2*u^2*v-F(17)/31*x*y*u^3*v-2602*x^3*y*v^2+11793*y^2*z^2*v^2+8051*x*z^3*v^2+8051*y^3*u*v^2+12945*x*y*z*u*v^2+F(108)/109*x^2*u^2*v^2-2602*z*u^3*v^2-2520*x*y^2*v^3-F(95)/52*x^2*z*v^3-2520*z^2*u*v^3-F(95)/52*y*u^2*v^3+8051*y*z*v^4-F(65)/83*x*u*v^4-F(89)/58*v^6,-F(89)/58*y^6-F(65)/83*x*y^4*z+F(108)/109*x^2*y^2*z^2-F(12)/35*x^3*z^3-F(95)/52*x^2*y^3*u-F(17)/31*x^3*y*z*u-2602*y^2*z^3*u-F(52)/99*x*z^4*u+4022*x^4*u^2-2520*y^3*z*u^2+F(63)/94*x*y*z^2*u^2+8051*x*y^2*u^3+F(89)/58*x^2*z*u^3-F(89)/58*y*u^5-2602*x^3*y^2*v-F(52)/99*x^4*z*v-F(95)/52*y^3*z^2*v-F(17)/31*x*y*z^3*v+8051*y^4*u*v+12945*x*y^2*z*u*v+F(99)/70*x^2*z^2*u*v+F(78)/101*x^2*y*u^2*v+F(33)/122*z^3*u^2*v-F(100)/71*y*z*u^3*v-F(122)/117*x*u^4*v-2520*x*y^3*v^2+F(63)/94*x^2*y*z*v^2+4022*z^4*v^2+F(33)/122*x^3*u*v^2+F(78)/101*y*z^2*u*v^2+11793*y^2*u^2*v^2+F(83)/26*x*z*u^2*v^2+8051*y^2*z*v^3+F(89)/58*x*z^2*v^3-F(100)/71*x*y*u*v^3+F(52)/99*u^3*v^3-F(122)/117*z*u*v^4-F(89)/58*y*v^5,x^4*y^2+1611*y^5*z-F(77)/60*x*y^3*z^2+F(76)/69*x^2*y*z^3+1611*z^6-F(4)/5*x*y^4*u-15475*x^2*y^2*z*u+F(86)/19*x^3*z^2*u-F(77)/60*y*z^4*u-11038*x^3*y*u^2+F(58)/25*y^2*z^2*u^2+F(112)/43*x*z^3*u^2-F(21)/121*y^3*u^3-11234*x*y*z*u^3+1611*z*u^5-1611*x^2*y^3*v+F(55)/73*x^3*y*z*v+F(112)/43*y^2*z^3*v-11235*x*z^4*v+F(21)/121*x^4*u*v-11234*y^3*z*u*v-F(43)/2*x*y*z^2*u*v-12177*x*y^2*u^2*v+F(18)/107*x^2*z*u^2*v-F(77)/60*z^2*u^3*v-F(4)/5*y*u^4*v+F(18)/107*x*y^2*z*v^2+10973*x^2*z^2*v^2+2311*x^2*y*u*v^2+F(76)/69*z^3*u*v^2-15475*y*z*u^2*v^2-1611*x*u^3*v^2-F(65)/99*x^3*v^3+F(86)/19*y*z^2*v^3-11038*y^2*u*v^3+F(55)/73*x*z*u*v^3+F(21)/121*x*y*v^4+u^2*v^4,-x*y^5+234*x^2*y^3*z-F(12)/35*x^3*y*z^2+F(4)/5*x^3*y^2*u+F(21)/121*x^4*z*u+F(121)/49*y^3*z^2*u+F(25)/123*x*y*z^3*u+11038*y^4*u^2+8706*x*y^2*z*u^2+F(16)/99*x^2*z^2*u^2+F(21)/121*x^2*y*u^3-F(5)/4*z^3*u^3-5984*y*z*u^4+F(46)/11*x^4*y*v+F(5)/4*y^4*z*v-F(19)/31*x*y^2*z^2*v+F(21)/121*x^2*z^3*v+F(91)/108*x*y^3*u*v+F(17)/21*x^2*y*z*u*v-5984*z^4*u*v-F(12)/35*x^3*u^2*v+12551*y*z^2*u^2*v-y^2*u^3*v+F(25)/123*x*z*u^3*v+3597*x^2*y^2*v^2+F(4)/5*x^3*z*v^2-y*z^3*v^2-F(79)/30*y^2*z*u*v^2+8706*x*z^2*u*v^2-F(19)/31*x*y*u^2*v^2+2198*y^3*v^3+F(91)/108*x*y*z*v^3+234*x^2*u*v^3+F(121)/49*z*u^2*v^3+11038*z^2*v^4+F(5)/4*y*u*v^4-x*v^5,-x^5-y^5+7884*x*y^3*z-F(99)/23*x^2*y*z^2-z^5-3570*x^2*y^2*u+F(3)/100*x^3*z*u+7884*y*z^3*u-F(99)/23*y^2*z*u^2-3570*x*z^2*u^2+F(3)/100*x*y*u^3-u^5+7884*x^3*y*v-3570*y^2*z^2*v+F(3)/100*x*z^3*v+F(3)/100*y^3*u*v+F(125)/81*x*y*z*u*v-F(99)/23*x^2*u^2*v+7884*z*u^3*v-F(99)/23*x*y^2*v^2-3570*x^2*z*v^2-F(99)/23*z^2*u*v^2-3570*y*u^2*v^2+F(3)/100*y*z*v^3+7884*x*u*v^3-v^5])) - @doc raw""" From 1aaa1853eee29c1dbca0b0294735b2098e678689 Mon Sep 17 00:00:00 2001 From: YueRen Date: Wed, 3 Apr 2024 08:28:33 +0100 Subject: [PATCH 06/30] TropicalGeometry: fixed typo in documentation (#3552) (cherry picked from commit 1ed53224423c6f81c8c72d860f593d4f3a609b68) --- src/TropicalGeometry/variety.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TropicalGeometry/variety.jl b/src/TropicalGeometry/variety.jl index 9bf08072344b..844360b5d1fa 100644 --- a/src/TropicalGeometry/variety.jl +++ b/src/TropicalGeometry/variety.jl @@ -143,8 +143,8 @@ If `skip_saturation==true`, will not saturate `I` with respect to the product of If `skip_primary_decomposition==true`, will not decompose `I`. !!! warning - `tropical_variety` is currently under development and only works for ideal that decompose into - primary ideals, linear ideals, and binomial ideals. + `tropical_variety` is currently under development and only works for ideals that primary decompose into + principal, linear, and binomial ideals. # Examples ```jldoctest From a1224cc0681571ea046f92d8ed1d9dbdaef091f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Fri, 5 Apr 2024 16:44:17 +0200 Subject: [PATCH 07/30] Fix precompilation issue (#3565) (cherry picked from commit f16acc96f041b78fa36628367ed845615a138793) --- Project.toml | 2 +- src/Rings/mpoly-affine-algebras.jl | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 7c348f992ca8..44b37c73a918 100644 --- a/Project.toml +++ b/Project.toml @@ -26,7 +26,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" cohomCalg_jll = "5558cf25-a90e-53b0-b813-cadaa3ae7ade" [compat] -AbstractAlgebra = "0.40.1" +AbstractAlgebra = "0.40.6" AlgebraicSolving = "0.4.11" Distributed = "1.6" DocStringExtensions = "0.8, 0.9" diff --git a/src/Rings/mpoly-affine-algebras.jl b/src/Rings/mpoly-affine-algebras.jl index 422ea04136cb..7ffe15aad2f2 100644 --- a/src/Rings/mpoly-affine-algebras.jl +++ b/src/Rings/mpoly-affine-algebras.jl @@ -238,7 +238,6 @@ end # TODO: The method below is missing. It should be made better and put to the correct place (AA). number_of_generators(S::AbstractAlgebra.Generic.LaurentPolyWrapRing) = 1 -number_of_generators(P::PolyRing) = 1 @doc raw""" From a9acdc1163becb174bc56b8b35a6ff813807459e Mon Sep 17 00:00:00 2001 From: Morgan Rodgers Date: Fri, 1 Mar 2024 14:27:05 +0100 Subject: [PATCH 08/30] Add `is_conjugate*` to `docs/src/Groups/action.md` (cherry picked from commit 5765d5c3cc18d9df9c8bd65400c9208bd6d98b7c) --- docs/src/Groups/action.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/src/Groups/action.md b/docs/src/Groups/action.md index 4d026caaa7ff..4d332084cc82 100644 --- a/docs/src/Groups/action.md +++ b/docs/src/Groups/action.md @@ -61,6 +61,8 @@ permutation acting_group(Omega::GSetByElements) action_function(Omega::GSetByElements) action_homomorphism(Omega::GSetByElements{T}) where T<:GAPGroup +is_conjugate(G::GAPGroup, x::GAPGroupElem, y::GAPGroupElem) +is_conjugate_with_data(G::GAPGroup, x::GAPGroupElem, y::GAPGroupElem) orbit(Omega::GSetByElements{<:GAPGroup}, omega::T) where T orbit(G::PermGroup, omega) orbits(Omega::T) where T <: GSetByElements{TG} where TG <: GAPGroup From ad5d131dd46755a7367b7fb80b2faf91031a4ed9 Mon Sep 17 00:00:00 2001 From: Morgan Rodgers Date: Fri, 1 Mar 2024 14:57:41 +0100 Subject: [PATCH 09/30] oops used wrong signatures, fixed now (cherry picked from commit aead20811f0139c0f3b13a053d985dd122e1dbd8) --- docs/src/Groups/action.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/Groups/action.md b/docs/src/Groups/action.md index 4d332084cc82..a8f6f957fcde 100644 --- a/docs/src/Groups/action.md +++ b/docs/src/Groups/action.md @@ -61,8 +61,8 @@ permutation acting_group(Omega::GSetByElements) action_function(Omega::GSetByElements) action_homomorphism(Omega::GSetByElements{T}) where T<:GAPGroup -is_conjugate(G::GAPGroup, x::GAPGroupElem, y::GAPGroupElem) -is_conjugate_with_data(G::GAPGroup, x::GAPGroupElem, y::GAPGroupElem) +is_conjugate(Omega::GSet, omega1, omega2) +is_conjugate_with_data(Omega::GSet, omega1, omega2) orbit(Omega::GSetByElements{<:GAPGroup}, omega::T) where T orbit(G::PermGroup, omega) orbits(Omega::T) where T <: GSetByElements{TG} where TG <: GAPGroup From 54cd2dd63fe31df44f8669b4e0b0d72566cf73f4 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 10 Apr 2024 16:05:15 +0200 Subject: [PATCH 10/30] README.md: fix OSCAR book title (#3579) Co-authored-by: Johannes Schmitt (cherry picked from commit 8be19fa63c6349aed5ae33bf77e4eed5ac0a7e9e) --- CITATION.cff | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 6a435398b003..eb5db594e2ea 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -31,6 +31,6 @@ preferred-citation: given-names: "Max" - family-names: "Joswig" given-names: "Michael" - title: The OSCAR book + title: The Computer Algebra System OSCAR. Algorithms and Examples year: 2024 diff --git a/README.md b/README.md index f0b03addb5ac..db2476bc8d4c 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ If you have used OSCAR in the preparation of a paper please cite it as described [OSCAR] OSCAR -- Open Source Computer Algebra Research system, Version 1.0.0, The OSCAR Team, 2024. (https://www.oscar-system.org) [OSCAR-book] - Wolfram Decker, Christian Eder, Claus Fieker, Max Horn, Michael Joswig, The OSCAR book, 2024. + Wolfram Decker, Christian Eder, Claus Fieker, Max Horn, Michael Joswig, The Computer Algebra System OSCAR. Algorithms and Examples, 2024. If you are using BibTeX, you can use the following BibTeX entries: @@ -137,7 +137,7 @@ If you are using BibTeX, you can use the following BibTeX entries: @Book{OSCAR-book, editor = {Decker, Wolfram and Eder, Christian and Fieker, Claus and Horn, Max and Joswig, Michael}, - title = {The OSCAR book}, + title = {{The Computer Algebra System OSCAR. Algorithms and Examples}}, year = {2024}, } From 89c074c35dee84e285ba89dc1688562d9bfa9340 Mon Sep 17 00:00:00 2001 From: Johannes Schmitt Date: Wed, 10 Apr 2024 13:50:40 +0200 Subject: [PATCH 11/30] Fix a `vcat` (cherry picked from commit 837d22c9b0408220fd40cab9e401c5308eb95922) --- src/Modules/mpolyquo-localizations.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Modules/mpolyquo-localizations.jl b/src/Modules/mpolyquo-localizations.jl index 5f4c3bf3fac3..7497195c0019 100644 --- a/src/Modules/mpolyquo-localizations.jl +++ b/src/Modules/mpolyquo-localizations.jl @@ -56,7 +56,7 @@ function has_solution(A::MatrixType, b::MatrixType) where {T<:MPolyQuoLocRingEle R = base_ring(S) S === base_ring(b) || error("matrices must be defined over the same ring") nrows(b) == 1 || error("only matrices with one row are allowed!") - Aext = vcat(A, modulus_matrix(S, ncols(A))) + Aext = vcat(A, change_base_ring(S, modulus_matrix(S, ncols(A)))) B, D = clear_denominators(Aext) c, u = clear_denominators(b) (success, y, v) = has_solution(B, c, inverted_set(S)) From c7c6702971187534591d875aaca4c26f2b35ed88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Wed, 10 Apr 2024 11:36:19 +0200 Subject: [PATCH 12/30] Add paragraph about `number_of_` to the styleguide. (#3305) (cherry picked from commit 5413e7a6c62bb374382a263d0cc96d4926482e7c) --- docs/src/DeveloperDocumentation/styleguide.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/src/DeveloperDocumentation/styleguide.md b/docs/src/DeveloperDocumentation/styleguide.md index cb07c88d8bba..62f556d4e968 100644 --- a/docs/src/DeveloperDocumentation/styleguide.md +++ b/docs/src/DeveloperDocumentation/styleguide.md @@ -59,7 +59,13 @@ Here is a summary of the naming convention followed in OSCAR: also being consistent. For compatibility with standard Julia, while staying consistent internally, we also provide aliases (using `AbstractAlgebra.@alias`) for various standard - Julia functions, e.g. `is_one` as alias for `isone` + Julia functions, e.g. `is_one` as alias for `isone`. +- A function returning the number of some things should be named `number_of_things`, + alternatively it can be named `n_things` with an alias to `number_of_things`. + The preferred style should be consistent throughout the corresponding part. + For some very common things, like the number of generators, we additionally + provide a shorter alias, e.g. `ngens` for `number_of_generators`. These aliases should be + very short and without underscores. - For generic concepts choose generic names, based on general algebraic concepts, preferably not special names from your area of speciality. - **Avoid direct access to members of our objects.** This means, do not use From ec3aa0b20d9f84a0583188121710e6442771da6f Mon Sep 17 00:00:00 2001 From: Johannes Schmitt Date: Thu, 11 Apr 2024 18:04:04 +0200 Subject: [PATCH 13/30] Add information on how to cite OSCAR to doc (#3587) (cherry picked from commit 442485572bbfc08d55705df5d919a9a966e13fc2) --- docs/src/General/faq.md | 6 ++++++ docs/src/index.md | 2 ++ 2 files changed, 8 insertions(+) diff --git a/docs/src/General/faq.md b/docs/src/General/faq.md index e77b37c54b2a..089c9291e51f 100644 --- a/docs/src/General/faq.md +++ b/docs/src/General/faq.md @@ -137,6 +137,12 @@ Many of the algorithms implemented in OSCAR have a very high complexity. Even if not calling one of these algorithms directly, you may be using it in the background. Please read our page on [Complex Algorithms in OSCAR]. +--- + +**Q: How do I cite OSCAR?** + +Please see [here](https://github.com/oscar-system/Oscar.jl?tab=readme-ov-file#citing-oscar). + --- ## Windows specific diff --git a/docs/src/index.md b/docs/src/index.md index 5111ba59add2..f86948deb860 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -16,3 +16,5 @@ and [Github](https://github.com/oscar-system/Oscar.jl). If you are a new developer or interested in developing OSCAR, have a look at our [Introduction for new developers](@ref). + +If you have used OSCAR in the preparation of a paper, please cite it as described [here](https://github.com/oscar-system/Oscar.jl?tab=readme-ov-file#citing-oscar). From fa045499e09542214df6a5637afe72ce5efd4fe3 Mon Sep 17 00:00:00 2001 From: Lars Kastner Date: Thu, 11 Apr 2024 22:32:19 +0200 Subject: [PATCH 14/30] Hide Oscar.jl banner, when used in other module (#3541) Hide Oscar banner, when used in other module (cherry picked from commit 6894701cf957aef1c0b1ad8f9731dad9cdd984fd) --- Project.toml | 2 +- src/Oscar.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 44b37c73a918..6a1a2424860b 100644 --- a/Project.toml +++ b/Project.toml @@ -26,7 +26,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" cohomCalg_jll = "5558cf25-a90e-53b0-b813-cadaa3ae7ade" [compat] -AbstractAlgebra = "0.40.6" +AbstractAlgebra = "0.40.8" AlgebraicSolving = "0.4.11" Distributed = "1.6" DocStringExtensions = "0.8, 0.9" diff --git a/src/Oscar.jl b/src/Oscar.jl index 4ee5ec1f943e..fbe15081fb40 100644 --- a/src/Oscar.jl +++ b/src/Oscar.jl @@ -59,7 +59,7 @@ function __init__() # initialize random seed set_seed!(rand(UInt32)) - if isinteractive() && Base.JLOptions().banner != 0 + if AbstractAlgebra.should_show_banner() _print_banner() end From f845fb296771091bb4d3e0fc6499b26d5746d9f3 Mon Sep 17 00:00:00 2001 From: Lars Kastner Date: Wed, 13 Mar 2024 14:02:10 +0100 Subject: [PATCH 15/30] Test: Basic testing for book examples --- .../alexander-surface.jlcon | 57 ++++++ .../algebraic-geometry/canonicalimage.jlcon | 104 ++++++++++ .../algebraic-geometry/char3-surface-1.jlcon | 16 ++ .../algebraic-geometry/char3-surface-2.jlcon | 79 +++++++ .../algebraic-geometry/circlepar.jlcon | 25 +++ .../algebraic-geometry/default.jlcon | 4 + .../algebraic-geometry/deformation.jlcon | 46 +++++ .../algebraic-geometry/delta.jlcon | 10 + .../dual_curve_function.jlcon | 28 +++ .../algebraic-geometry/dualcurve.jlcon | 22 ++ .../algebraic-geometry/ex-dim.jlcon | 11 + .../algebraic-geometry/ex-primdec.jlcon | 22 ++ .../algebraic-geometry/ex11.jlcon | 11 + .../algebraic-geometry/ex11dist.jlcon | 2 + .../algebraic-geometry/ex21.jlcon | 11 + .../algebraic-geometry/ex21a.jlcon | 12 ++ .../algebraic-geometry/ex21b.jlcon | 5 + .../algebraic-geometry/ex23.jlcon | 31 +++ .../algebraic-geometry/ex23a.jlcon | 39 ++++ .../algebraic-geometry/ex314.jlcon | 125 ++++++++++++ .../algebraic-geometry/ex32.jlcon | 23 +++ .../algebraic-geometry/exres.jlcon | 44 ++++ .../algebraic-geometry/exres2.jlcon | 17 ++ .../hilbert-polynomial.jlcon | 17 ++ .../algebraic-geometry/monodromy.jlcon | 56 +++++ .../algebraic-geometry/param.jlcon | 56 +++++ .../algebraic-geometry/twocusps.jlcon | 30 +++ .../algebraic-geometry/zariski.jlcon | 28 +++ test/book/cornerstones/groups/actions.jlcon | 85 ++++++++ test/book/cornerstones/groups/chars.jlcon | 48 +++++ .../book/cornerstones/groups/cohomology.jlcon | 13 ++ test/book/cornerstones/groups/explSL25.jlcon | 72 +++++++ .../book/cornerstones/groups/extensions.jlcon | 46 +++++ test/book/cornerstones/groups/genchar.jlcon | 64 ++++++ test/book/cornerstones/groups/intro.jlcon | 145 +++++++++++++ test/book/cornerstones/groups/reps.jlcon | 78 +++++++ .../number-theory/cohenlenstra.jlcon | 49 +++++ .../number-theory/embeddings.jlcon | 19 ++ .../number-theory/galoismod.jlcon | 91 +++++++++ .../number-theory/galoismod_1.jlcon | 16 ++ .../number-theory/galoismod_2.jlcon | 16 ++ .../cornerstones/number-theory/general.jlcon | 48 +++++ .../cornerstones/number-theory/intro.jlcon | 86 ++++++++ .../cornerstones/number-theory/intro4.jlcon | 6 + .../number-theory/intro_plot_lattice.jlcon | 12 ++ .../book/cornerstones/number-theory/sym.jlcon | 72 +++++++ .../cornerstones/number-theory/sym_1.jlcon | 9 + .../number-theory/unit_log_plot.jlcon | 10 + .../number-theory/unit_plot.jlcon | 12 ++ .../polyhedral-geometry/D222Computation.jlcon | 12 ++ .../polyhedral-geometry/Explosion.jlcon | 7 + .../polyhedral-geometry/GKZ_orbits.jlcon | 22 ++ .../polyhedral-geometry/GT_character.jlcon | 5 + .../GelfandTsetlinEx.jlcon | 20 ++ .../SecondaryPolytope.jlcon | 41 ++++ .../polyhedral-geometry/ch-benchmark.jlcon | 24 +++ .../polyhedral-geometry/dodecahedron.jlcon | 8 + .../g-vector-example.jlcon | 9 + .../g-vectors-upper-bound.jlcon | 45 ++++ .../polyhedral-geometry/g-vectors.jl | 17 ++ .../generalized_gelfand_tsetlin.jlcon | 11 + .../hyperdeterminant.jlcon | 24 +++ .../polyhedral-geometry/johnson-orbits.jl | 7 + .../polyhedral-geometry/johnson-orbits.jlcon | 16 ++ .../cornerstones/polyhedral-geometry/lp.jlcon | 17 ++ .../polyhedral-geometry/not-pointed.jlcon | 9 + .../polyhedral-geometry/pentagon.jlcon | 30 +++ .../polyhedral-geometry/perm3.jlcon | 8 + .../polyhedral-geometry/platonic.jlcon | 7 + .../simple_polyhedral_fan.jlcon | 6 + .../polyhedral-geometry/tetrahedron.jlcon | 9 + .../introduction/introduction/julia-jit.jlcon | 5 + .../introduction/introduction/julia.jlcon | 102 +++++++++ .../introduction/introduction/julia2.jlcon | 67 ++++++ .../introduction/introduction/julia3.jlcon | 21 ++ test/book/introduction/julia-jit.jlcon | 5 + test/book/introduction/julia.jlcon | 102 +++++++++ test/book/introduction/julia2.jlcon | 67 ++++++ test/book/introduction/julia3.jlcon | 21 ++ test/book/ordered_examples.json | 1 + .../Caterpillar3.jlcon | 20 ++ .../graphname.jlcon | 9 + .../chow_ring.jlcon | 20 ++ .../bies-kastner-toric-geometry/cube.jlcon | 5 + .../bies-kastner-toric-geometry/cyclic.jlcon | 15 ++ .../bies-kastner-toric-geometry/glsm.jlcon | 8 + .../normal_fan_square.jlcon | 12 ++ .../p1xp1_cohomologies.jlcon | 8 + .../p1xp1_vanishing_sets.jlcon | 24 +++ .../bies-kastner-toric-geometry/p2.jlcon | 12 ++ .../polyhedral_fan.jlcon | 23 +++ .../starsubdivision.jlcon | 41 ++++ .../SU5-2.jlcon | 28 +++ .../SU5.jlcon | 89 ++++++++ .../boehm-breuer-git-fans/explG25_1.jlcon | 32 +++ .../boehm-breuer-git-fans/explG25_2.jlcon | 18 ++ .../boehm-breuer-git-fans/explG25_2A.jlcon | 17 ++ .../boehm-breuer-git-fans/explG25_3.jlcon | 9 + .../boehm-breuer-git-fans/explG25_3A.jlcon | 6 + .../boehm-breuer-git-fans/explG25_4.jlcon | 10 + .../boehm-breuer-git-fans/explG25_5.jlcon | 34 +++ .../boehm-breuer-git-fans/explG25_6.jlcon | 2 + .../boehm-breuer-git-fans/explG25_7.jlcon | 14 ++ .../boehm-breuer-git-fans/explG25_8.jlcon | 11 + .../vinberg_1.jlcon | 94 +++++++++ .../vinberg_2.jlcon | 193 ++++++++++++++++++ .../vinberg_3.jlcon | 84 ++++++++ .../expl_G23_info.jlcon | 44 ++++ .../expl_G23_tbl.jlcon | 32 +++ .../expl_ev.jlcon | 7 + .../expl_nongalois.jlcon | 26 +++ .../expl_od_odd.jlcon | 6 + .../expl_order.jlcon | 7 + .../expl_plusminus.jlcon | 20 ++ .../expl_ray_class.jlcon | 5 + .../expl_specht.jlcon | 7 + .../expl_syl.jlcon | 7 + .../decker-schmitt-invariant-theory/H3.jlcon | 92 +++++++++ .../LR-inv.jlcon | 40 ++++ .../bertin.jlcon | 30 +++ .../cox_ring.jlcon | 75 +++++++ .../gleason.jlcon | 30 +++ .../klein.jlcon | 78 +++++++ .../nakajima.jlcon | 41 ++++ .../decker-schmitt-invariant-theory/sym.jlcon | 26 +++ .../combinatorics.jlcon | 32 +++ .../eder-mohr-ideal-theoretic/fglm.jlcon | 12 ++ .../gbeliminate.jlcon | 26 +++ .../eder-mohr-ideal-theoretic/hilbert.jlcon | 24 +++ .../eder-mohr-ideal-theoretic/lcis.jlcon | 53 +++++ .../eder-mohr-ideal-theoretic/nonproper.jlcon | 47 +++++ .../eder-mohr-ideal-theoretic/realsols.jlcon | 27 +++ .../eder-mohr-ideal-theoretic/whitney.jlcon | 71 +++++++ .../flake-fourier-monomial-bases/basis.jlcon | 22 ++ .../flake-fourier-monomial-bases/fflv.jlcon | 17 ++ .../get-operators.jlcon | 12 ++ .../lusztig.jlcon | 25 +++ .../flake-fourier-monomial-bases/nz.jlcon | 20 ++ .../flake-fourier-monomial-bases/string.jlcon | 20 ++ .../holt-ren-tropical-geometry/curve1.jlcon | 11 + .../holt-ren-tropical-geometry/curve2.jlcon | 6 + .../holt-ren-tropical-geometry/det.jlcon | 9 + .../holt-ren-tropical-geometry/grc.jlcon | 12 ++ .../holt-ren-tropical-geometry/groebner.jlcon | 28 +++ .../hypersurface1.jlcon | 31 +++ .../hypersurface2.jlcon | 5 + .../hypersurface3.jlcon | 20 ++ .../intersection.jlcon | 34 +++ .../linearSpace1.jlcon | 23 +++ .../linearSpace2.jlcon | 13 ++ .../linearSpace3.jlcon | 14 ++ .../matrixAndPoly.jlcon | 27 +++ .../holt-ren-tropical-geometry/semiring.jlcon | 11 + .../semiringMaps1.jlcon | 8 + .../semiringMaps2.jlcon | 8 + .../semiringMaps3.jlcon | 11 + .../holt-ren-tropical-geometry/variety.jlcon | 18 ++ .../polynomial-load.jlcon | 12 ++ .../snf.jlcon | 17 ++ .../versioninfo.jlcon | 33 +++ .../kuehne-schroeter-matroids/ChowRings.jlcon | 97 +++++++++ .../kuehne-schroeter-matroids/basics.jlcon | 47 +++++ .../realization_space.jlcon | 126 ++++++++++++ .../draw_hypersurface.jlcon | 22 ++ .../eliminate_xz.jlcon | 15 ++ .../eliminate_yz.jlcon | 13 ++ .../vertices_P1.jlcon | 21 ++ .../vertices_P2.jlcon | 22 ++ .../chow_fan.jlcon | 5 + .../chow_transl.jlcon | 1 + .../coeffs_fin.jlcon | 12 ++ .../gen_impl.jlcon | 27 +++ .../get_hyperdet.jlcon | 8 + .../hyperdet.jlcon | 4 + .../pol_from_surface.jlcon | 1 + .../triang.jlcon | 12 ++ test/book/test.jl | 192 +++++++++++++++++ 177 files changed, 5468 insertions(+) create mode 100644 test/book/cornerstones/algebraic-geometry/alexander-surface.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/canonicalimage.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/char3-surface-1.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/char3-surface-2.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/circlepar.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/default.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/deformation.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/delta.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/dual_curve_function.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/dualcurve.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/ex-dim.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/ex-primdec.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/ex11.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/ex11dist.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/ex21.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/ex21a.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/ex21b.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/ex23.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/ex23a.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/ex314.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/ex32.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/exres.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/exres2.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/hilbert-polynomial.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/monodromy.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/param.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/twocusps.jlcon create mode 100644 test/book/cornerstones/algebraic-geometry/zariski.jlcon create mode 100644 test/book/cornerstones/groups/actions.jlcon create mode 100644 test/book/cornerstones/groups/chars.jlcon create mode 100644 test/book/cornerstones/groups/cohomology.jlcon create mode 100644 test/book/cornerstones/groups/explSL25.jlcon create mode 100644 test/book/cornerstones/groups/extensions.jlcon create mode 100644 test/book/cornerstones/groups/genchar.jlcon create mode 100644 test/book/cornerstones/groups/intro.jlcon create mode 100644 test/book/cornerstones/groups/reps.jlcon create mode 100644 test/book/cornerstones/number-theory/cohenlenstra.jlcon create mode 100644 test/book/cornerstones/number-theory/embeddings.jlcon create mode 100644 test/book/cornerstones/number-theory/galoismod.jlcon create mode 100644 test/book/cornerstones/number-theory/galoismod_1.jlcon create mode 100644 test/book/cornerstones/number-theory/galoismod_2.jlcon create mode 100644 test/book/cornerstones/number-theory/general.jlcon create mode 100644 test/book/cornerstones/number-theory/intro.jlcon create mode 100644 test/book/cornerstones/number-theory/intro4.jlcon create mode 100644 test/book/cornerstones/number-theory/intro_plot_lattice.jlcon create mode 100644 test/book/cornerstones/number-theory/sym.jlcon create mode 100644 test/book/cornerstones/number-theory/sym_1.jlcon create mode 100644 test/book/cornerstones/number-theory/unit_log_plot.jlcon create mode 100644 test/book/cornerstones/number-theory/unit_plot.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/D222Computation.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/Explosion.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/GKZ_orbits.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/GT_character.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/GelfandTsetlinEx.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/SecondaryPolytope.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/ch-benchmark.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/dodecahedron.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/g-vector-example.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/g-vectors-upper-bound.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/g-vectors.jl create mode 100644 test/book/cornerstones/polyhedral-geometry/generalized_gelfand_tsetlin.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/hyperdeterminant.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/johnson-orbits.jl create mode 100644 test/book/cornerstones/polyhedral-geometry/johnson-orbits.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/lp.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/not-pointed.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/pentagon.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/perm3.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/platonic.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/simple_polyhedral_fan.jlcon create mode 100644 test/book/cornerstones/polyhedral-geometry/tetrahedron.jlcon create mode 100644 test/book/introduction/introduction/julia-jit.jlcon create mode 100644 test/book/introduction/introduction/julia.jlcon create mode 100644 test/book/introduction/introduction/julia2.jlcon create mode 100644 test/book/introduction/introduction/julia3.jlcon create mode 100644 test/book/introduction/julia-jit.jlcon create mode 100644 test/book/introduction/julia.jlcon create mode 100644 test/book/introduction/julia2.jlcon create mode 100644 test/book/introduction/julia3.jlcon create mode 100644 test/book/ordered_examples.json create mode 100644 test/book/specialized/aga-boehm-hoffmann-markwig-traore/Caterpillar3.jlcon create mode 100644 test/book/specialized/aga-boehm-hoffmann-markwig-traore/graphname.jlcon create mode 100644 test/book/specialized/bies-kastner-toric-geometry/chow_ring.jlcon create mode 100644 test/book/specialized/bies-kastner-toric-geometry/cube.jlcon create mode 100644 test/book/specialized/bies-kastner-toric-geometry/cyclic.jlcon create mode 100644 test/book/specialized/bies-kastner-toric-geometry/glsm.jlcon create mode 100644 test/book/specialized/bies-kastner-toric-geometry/normal_fan_square.jlcon create mode 100644 test/book/specialized/bies-kastner-toric-geometry/p1xp1_cohomologies.jlcon create mode 100644 test/book/specialized/bies-kastner-toric-geometry/p1xp1_vanishing_sets.jlcon create mode 100644 test/book/specialized/bies-kastner-toric-geometry/p2.jlcon create mode 100644 test/book/specialized/bies-kastner-toric-geometry/polyhedral_fan.jlcon create mode 100644 test/book/specialized/bies-kastner-toric-geometry/starsubdivision.jlcon create mode 100644 test/book/specialized/bies-turner-string-theory-applications/SU5-2.jlcon create mode 100644 test/book/specialized/bies-turner-string-theory-applications/SU5.jlcon create mode 100644 test/book/specialized/boehm-breuer-git-fans/explG25_1.jlcon create mode 100644 test/book/specialized/boehm-breuer-git-fans/explG25_2.jlcon create mode 100644 test/book/specialized/boehm-breuer-git-fans/explG25_2A.jlcon create mode 100644 test/book/specialized/boehm-breuer-git-fans/explG25_3.jlcon create mode 100644 test/book/specialized/boehm-breuer-git-fans/explG25_3A.jlcon create mode 100644 test/book/specialized/boehm-breuer-git-fans/explG25_4.jlcon create mode 100644 test/book/specialized/boehm-breuer-git-fans/explG25_5.jlcon create mode 100644 test/book/specialized/boehm-breuer-git-fans/explG25_6.jlcon create mode 100644 test/book/specialized/boehm-breuer-git-fans/explG25_7.jlcon create mode 100644 test/book/specialized/boehm-breuer-git-fans/explG25_8.jlcon create mode 100644 test/book/specialized/brandhorst-zach-fibration-hopping/vinberg_1.jlcon create mode 100644 test/book/specialized/brandhorst-zach-fibration-hopping/vinberg_2.jlcon create mode 100644 test/book/specialized/brandhorst-zach-fibration-hopping/vinberg_3.jlcon create mode 100644 test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_G23_info.jlcon create mode 100644 test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_G23_tbl.jlcon create mode 100644 test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_ev.jlcon create mode 100644 test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_nongalois.jlcon create mode 100644 test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_od_odd.jlcon create mode 100644 test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_order.jlcon create mode 100644 test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_plusminus.jlcon create mode 100644 test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_ray_class.jlcon create mode 100644 test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_specht.jlcon create mode 100644 test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_syl.jlcon create mode 100644 test/book/specialized/decker-schmitt-invariant-theory/H3.jlcon create mode 100644 test/book/specialized/decker-schmitt-invariant-theory/LR-inv.jlcon create mode 100644 test/book/specialized/decker-schmitt-invariant-theory/bertin.jlcon create mode 100644 test/book/specialized/decker-schmitt-invariant-theory/cox_ring.jlcon create mode 100644 test/book/specialized/decker-schmitt-invariant-theory/gleason.jlcon create mode 100644 test/book/specialized/decker-schmitt-invariant-theory/klein.jlcon create mode 100644 test/book/specialized/decker-schmitt-invariant-theory/nakajima.jlcon create mode 100644 test/book/specialized/decker-schmitt-invariant-theory/sym.jlcon create mode 100644 test/book/specialized/eder-mohr-ideal-theoretic/combinatorics.jlcon create mode 100644 test/book/specialized/eder-mohr-ideal-theoretic/fglm.jlcon create mode 100644 test/book/specialized/eder-mohr-ideal-theoretic/gbeliminate.jlcon create mode 100644 test/book/specialized/eder-mohr-ideal-theoretic/hilbert.jlcon create mode 100644 test/book/specialized/eder-mohr-ideal-theoretic/lcis.jlcon create mode 100644 test/book/specialized/eder-mohr-ideal-theoretic/nonproper.jlcon create mode 100644 test/book/specialized/eder-mohr-ideal-theoretic/realsols.jlcon create mode 100644 test/book/specialized/eder-mohr-ideal-theoretic/whitney.jlcon create mode 100644 test/book/specialized/flake-fourier-monomial-bases/basis.jlcon create mode 100644 test/book/specialized/flake-fourier-monomial-bases/fflv.jlcon create mode 100644 test/book/specialized/flake-fourier-monomial-bases/get-operators.jlcon create mode 100644 test/book/specialized/flake-fourier-monomial-bases/lusztig.jlcon create mode 100644 test/book/specialized/flake-fourier-monomial-bases/nz.jlcon create mode 100644 test/book/specialized/flake-fourier-monomial-bases/string.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/curve1.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/curve2.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/det.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/grc.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/groebner.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/hypersurface1.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/hypersurface2.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/hypersurface3.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/intersection.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/linearSpace1.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/linearSpace2.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/linearSpace3.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/matrixAndPoly.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/semiring.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/semiringMaps1.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/semiringMaps2.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/semiringMaps3.jlcon create mode 100644 test/book/specialized/holt-ren-tropical-geometry/variety.jlcon create mode 100644 test/book/specialized/joswig-kastner-lorenz-confirmable-workflows/polynomial-load.jlcon create mode 100644 test/book/specialized/joswig-kastner-lorenz-confirmable-workflows/snf.jlcon create mode 100644 test/book/specialized/joswig-kastner-lorenz-confirmable-workflows/versioninfo.jlcon create mode 100644 test/book/specialized/kuehne-schroeter-matroids/ChowRings.jlcon create mode 100644 test/book/specialized/kuehne-schroeter-matroids/basics.jlcon create mode 100644 test/book/specialized/kuehne-schroeter-matroids/realization_space.jlcon create mode 100644 test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/draw_hypersurface.jlcon create mode 100644 test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_xz.jlcon create mode 100644 test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_yz.jlcon create mode 100644 test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/vertices_P1.jlcon create mode 100644 test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/vertices_P2.jlcon create mode 100644 test/book/specialized/rose-sturmfels-telen-tropical-implicitization/chow_fan.jlcon create mode 100644 test/book/specialized/rose-sturmfels-telen-tropical-implicitization/chow_transl.jlcon create mode 100644 test/book/specialized/rose-sturmfels-telen-tropical-implicitization/coeffs_fin.jlcon create mode 100644 test/book/specialized/rose-sturmfels-telen-tropical-implicitization/gen_impl.jlcon create mode 100644 test/book/specialized/rose-sturmfels-telen-tropical-implicitization/get_hyperdet.jlcon create mode 100644 test/book/specialized/rose-sturmfels-telen-tropical-implicitization/hyperdet.jlcon create mode 100644 test/book/specialized/rose-sturmfels-telen-tropical-implicitization/pol_from_surface.jlcon create mode 100644 test/book/specialized/rose-sturmfels-telen-tropical-implicitization/triang.jlcon create mode 100644 test/book/test.jl diff --git a/test/book/cornerstones/algebraic-geometry/alexander-surface.jlcon b/test/book/cornerstones/algebraic-geometry/alexander-surface.jlcon new file mode 100644 index 000000000000..3639a00b22d9 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/alexander-surface.jlcon @@ -0,0 +1,57 @@ +julia> X = rational_d9_pi6(); + +julia> is_smooth(X) +true + +julia> degree(X) +9 + +julia> S = ambient_coordinate_ring(X) +Multivariate polynomial ring in 5 variables over GF(31991) graded by + x -> [1] + y -> [1] + z -> [1] + u -> [1] + v -> [1] + +julia> B, _ = quo(S, ideal(S, [gens(S)[1]])); + +julia> Y = proj(B) +Projective scheme + over finite field of characteristic 31991 +defined by ideal (x) + +julia> C = intersect(X, Y); + +julia> arithmetic_genus(C) +6 + +julia> A = homogeneous_coordinate_ring(X); + +julia> FA = free_resolution(A); + +julia> minimal_betti_table(FA) + 0 1 2 3 4 +----------------------- +0 : 1 - - - - +1 : - - - - - +2 : - - - - - +3 : - - - - - +4 : - 15 26 15 3 +5 : - 1 3 3 1 +----------------------- +total: 1 16 29 18 4 + +julia> I = defining_ideal(X); + +julia> IQ = ideal([x for x in gens(I) if degree(x)[1] == 5]); + +julia> J = saturation(IQ, I); + +julia> degree(J) +1 + +julia> M = I + J; + +julia> degree(M) +6 diff --git a/test/book/cornerstones/algebraic-geometry/canonicalimage.jlcon b/test/book/cornerstones/algebraic-geometry/canonicalimage.jlcon new file mode 100644 index 000000000000..535e21eb70cd --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/canonicalimage.jlcon @@ -0,0 +1,104 @@ +julia> Rt, (x,y,t) = polynomial_ring(QQ, ["x","y","t"]); + +julia> ft = -2*x^6 - 5*x^5*y*t + 8*x^5*t - 3*x^5 + 10*x^4*y^2*t^2 - 2*x^4*y^2*t + 10*x^4*y*t^2 - 12*x^4*y*t - 8*x^4*t^2 + 12*x^4*t + 24*x^3*y^3*t^2 + 14*x^3*y^3*t + 20*x^3*y^2*t^2 + 6*x^3*y^2*t + 24*x^3*y*t^2 + x^3*y*t - 12*x^3*t^2 + 10*x^2*y^4*t^2 - 2*x^2*y^4*t + 20*x^2*y^3*t^2 + 6*x^2*y^3*t - 44*x^2*y^2*t^2 - 20*x^2*y^2*t - 2*x^2*y*t^2 + x^2*y - 5*x*y^5*t + 10*x*y^4*t^2 - 12*x*y^4*t + 24*x*y^3*t^2 + x*y^3*t - 2*x*y^2*t^2 + x*y^2 - 2*x*y*t - 2*y^6 + 8*y^5*t - 3*y^5 - 8*y^4*t^2 + 12*y^4*t - 12*y^3*t^2; + +julia> R, (x,y) = polynomial_ring(QQ, ["x","y"]); + +julia> phi0 = hom(Rt,R,[x,y,0]); + +julia> f = phi0(ft); + +julia> H = homogenizer(R, "z"); + +julia> F = H(f); + +julia> S = parent(F); + +julia> C = plane_curve(F); + +julia> I = adjoint_ideal(C) +Ideal generated by + x*y - y^2 + x^2 - y^2 + y^3 + y^2*z + +julia> m3 = ideal(gens(S))^3; + +julia> K = intersect(I, m3) +Ideal generated by + x*y*z - y^2*z + x^2*z - y^2*z + y^3 + y^2*z + x*y^2 + y^2*z + x^2*y + y^2*z + x^3 + y^2*z + +julia> P5, _ = graded_polynomial_ring(QQ, ["x_0", "x_1", "x_2", "x_3", "x_4", "x_5"]); + +julia> PC, pr = quo(S, ideal([F])); + +julia> psi = hom(P5, PC, [pr(K[i]) for i = 1:6]); + +julia> J = kernel(psi); + +julia> JJ = ideal(minimal_generating_set(J)); + +julia> Q , _ = quo(P5, JJ); + +julia> re = free_resolution(Q); + +julia> minimal_betti_table(re) + 0 1 2 3 4 +--------------------- +0 : 1 - - - - +1 : - 6 8 3 - +2 : - 3 8 6 - +3 : - - - - 1 +--------------------- +total: 1 9 16 9 1 + +julia> phi1 = hom(Rt,R,[x,y,R(1//10)]); + +julia> f = phi1(ft); + +julia> F = H(f); + +julia> C = plane_curve(F); + +julia> I = adjoint_ideal(C) +Ideal generated by + 6*x*y - 5*y^2 + y*z + 5*x^2 - x*z - 5*y^2 + y*z + +julia> m3 = ideal(gens(S))^3; + +julia> K = intersect(I, m3) +Ideal generated by + 6*x*y*z - 5*y^2*z + y*z^2 + 5*x^2*z - x*z^2 - 5*y^2*z + y*z^2 + 5*y^3 + 4*y^2*z - y*z^2 + 6*x*y^2 + 5*y^2*z - y*z^2 + 6*x^2*y + 5*y^2*z - y*z^2 + 25*x^3 - x*z^2 + 20*y^2*z - 4*y*z^2 + +julia> PC, pr = quo(S, ideal([F])); + +julia> psi = hom(P5, PC, [pr(K[i]) for i = 1:6]); + +julia> J = kernel(psi); + +julia> JJ = ideal(minimal_generating_set(J)); + +julia> Q , _ = quo(P5, JJ); + +julia> re = free_resolution(Q); + +julia> minimal_betti_table(re) + 0 1 2 3 4 +--------------------- +0 : 1 - - - - +1 : - 6 5 - - +2 : - - 5 6 - +3 : - - - - 1 +--------------------- +total: 1 6 10 6 1 diff --git a/test/book/cornerstones/algebraic-geometry/char3-surface-1.jlcon b/test/book/cornerstones/algebraic-geometry/char3-surface-1.jlcon new file mode 100644 index 000000000000..fdb0d668a212 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/char3-surface-1.jlcon @@ -0,0 +1,16 @@ +julia> S, (x0, x1, x2, x3, x4) = graded_polynomial_ring(GF(3), ["x0", "x1", "x2", "x3", "x4"]); + +julia> m = ideal(S, [x1^2+(-x1+x2+x3-x4)*x0, x1*x2+(x1-x3+x4)*x0, x1*x3+(-x1+x4+x0)*x0, x1*x4+(-x1+x3+x4-x0)*x0, x2^2+(x1-x2-x4-x0)*x0, x2*x3+(x1-x2+x3+x4-x0)*x0, x2*x4+(x1+x2-x3-x4-x0)*x0, x3^2+(x3+x4-x0)*x0,x3*x4+(-x3-x4+x0)*x0, x4^2+(x1+x3-x4-x0)*x0]); + +julia> Qm, _ = quo(S, m); + +julia> FQm = free_resolution(Qm, algorithm = :mres); + +julia> betti_table(FQm) + 0 1 2 3 4 5 +--------------------------- +0 : 1 - - - - - +1 : - 10 15 2 - - +2 : - - 7 26 20 5 +--------------------------- +total: 1 10 22 28 20 5 diff --git a/test/book/cornerstones/algebraic-geometry/char3-surface-2.jlcon b/test/book/cornerstones/algebraic-geometry/char3-surface-2.jlcon new file mode 100644 index 000000000000..171ccbc7a550 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/char3-surface-2.jlcon @@ -0,0 +1,79 @@ +julia> phi = map(FQm, 3); + +julia> M = transpose(matrix(phi)[1:2, 1:15]); + +julia> DM = [map_entries(x->derivative(x,i), M) for i = 1:5]; + +julia> MM = transpose(hcat(DM...)); + +julia> size(MM) +(10, 15) + +julia> NN = matrix(map(FQm, 2))[1:15, 1:10]; + +julia> size(NN) +(15, 10) + +julia> D = graded_cokernel(transpose(MM*NN)); + +julia> FD = free_resolution(D, algorithm = :mres); + +julia> betti_table(FD) + 0 1 2 +---------------- +0 : 10 10 - +1 : - - 1 +2 : - - - +3 : - - 1 +---------------- +total: 10 10 2 + +julia> P = cokernel(transpose(matrix(map(FD, 2)))); + +julia> I = annihilator(P); + +julia> QI, _ = quo(S, I); + +julia> FQI = free_resolution(QI, algorithm = :mres); + +julia> betti_table(FQI) + 0 1 2 3 4 +----------------------- +0 : 1 - - - - +1 : - - - - - +2 : - - - - - +3 : - - - - - +4 : - 5 - - - +5 : - 7 26 20 5 +----------------------- +total: 1 12 26 20 5 + +julia> dim(I) +3 + +julia> degree(I) +11 + +julia> MI = ideal_as_module(I); + +julia> sheaf_cohomology(MI, -2, 8, algorithm = :loccoh) +twist: -2 -1 0 1 2 3 4 5 6 7 8 +------------------------------------------------------------- +4: - - - - - - - - - - - +3: 30 10 - - - - - - - - - +2: - - - 2 - - - - - - - +1: - - - - 1 5 5 - - - - +0: - - - - - - - 5 32 84 170 +------------------------------------------------------------- +chi: 30 10 - 2 1 5 5 5 32 84 170 + +julia> sheaf_cohomology(MI, -2, 8) +twist: -2 -1 0 1 2 3 4 5 6 7 8 +------------------------------------------------------------- +4: - - - - - - - * * * * +3: * 10 - - - - - - * * * +2: * * - 2 - - - - - * * +1: * * * - 1 5 5 - - - * +0: * * * * - - - 5 32 84 170 +------------------------------------------------------------- +chi: * * * * 1 5 5 * * * * diff --git a/test/book/cornerstones/algebraic-geometry/circlepar.jlcon b/test/book/cornerstones/algebraic-geometry/circlepar.jlcon new file mode 100644 index 000000000000..d7a017457722 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/circlepar.jlcon @@ -0,0 +1,25 @@ +julia> R, (x, y, t) = polynomial_ring(QQ, ["x", "y", "t"]); + +julia> I = ideal(R, [x^2 + y^2 - 1, y - t*x - 1]); + +julia> Gy = groebner_basis(I, ordering = lex([y, x, t]), complete_reduction=true) +Gröbner basis with elements +1 -> x^2*t^2 + x^2 + 2*x*t +2 -> y - x*t - 1 +with respect to the ordering +lex([y, x, t]) + +julia> factor(Gy[1]) +1 * (x*t^2 + x + 2*t) * x + +julia> Gx = groebner_basis(I, ordering = lex([x, y, t]), complete_reduction=true) +Gröbner basis with elements +1 -> y^2*t^2 + y^2 - 2*y - t^2 + 1 +2 -> x*t - y + 1 +3 -> x*y - x + y^2*t - t +4 -> x^2 + y^2 - 1 +with respect to the ordering +lex([x, y, t]) + +julia> factor(Gx[1]) +1 * (y - 1) * (y*t^2 + y + t^2 - 1) diff --git a/test/book/cornerstones/algebraic-geometry/default.jlcon b/test/book/cornerstones/algebraic-geometry/default.jlcon new file mode 100644 index 000000000000..2185fd51f635 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/default.jlcon @@ -0,0 +1,4 @@ +julia> S, (x, y) = graded_polynomial_ring(QQ, ["x", "y"], [1, 2]); + +julia> default_ordering(S) +wdegrevlex([x, y], [1, 2]) diff --git a/test/book/cornerstones/algebraic-geometry/deformation.jlcon b/test/book/cornerstones/algebraic-geometry/deformation.jlcon new file mode 100644 index 000000000000..5c0b5e6422d5 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/deformation.jlcon @@ -0,0 +1,46 @@ +julia> K = GF(3); + +julia> S, (x0, x1, x2, x3, x4) = graded_polynomial_ring(K, ["x0", "x1", "x2", "x3", "x4"]); + +julia> m = ideal(S, [x1^2+(-x1+x2+x3-x4)*x0, x1*x2+(x1-x3+x4)*x0, x1*x3+(-x1+x4+x0)*x0, x1*x4+(-x1+x3+x4-x0)*x0, x2^2+(x1-x2-x4-x0)*x0, x2*x3+(x1-x2+x3+x4-x0)*x0, x2*x4+(x1+x2-x3-x4-x0)*x0, x3^2+(x3+x4-x0)*x0,x3*x4+(-x3-x4+x0)*x0, x4^2+(x1+x3-x4-x0)*x0]); + +julia> R, _ = quo(S, m); + +julia> FR = free_resolution(R, algorithm = :mres); + +julia> L = monomial_basis(R, 2) +5-element Vector{MPolyDecRingElem{FqFieldElem, FqMPolyRingElem}}: + x4^2 + x3*x4 + x2*x4 + x2*x3 + x1*x4 + +julia> versal_unfolding = [[i == div((j-1), 5) + 1 ? S(L[(j-1) % 5 + 1]) : S(0) for i in 1:10] for j in 1:50]; + +julia> function normal_space_generator(FR, A1t) + phi1 = map(FR, 1) + e1 = gen(codomain(phi1),1) + phi2 = map(FR, 2) + phi3 = map(FR, 3) + A1 = hom(domain(phi1), codomain(phi1), [p*e1 for p in A1t]) + A1phi2 = phi2 * A1 + A2 = lift(A1phi2, phi1) + A2phi3 = phi3 * A2 + A3 = lift(A2phi3, phi2) + A3m = matrix(A3) + return A3m[1:2, 16:22] + end; + +julia> nlist = [normal_space_generator(FR, v) for v in versal_unfolding]; + +julia> TS, t = graded_polynomial_ring(K, "t"=>(1:50)); + +julia> nlist_t = [map_entries(x -> x * t[i], map_entries(constant_coefficient, nlist[i])) for i in 1:50]; + +julia> B = sum(nlist_t); + +julia> tangent_space = ideal(vec(collect(B))); + +julia> ngens(leading_ideal(tangent_space)) +14 diff --git a/test/book/cornerstones/algebraic-geometry/delta.jlcon b/test/book/cornerstones/algebraic-geometry/delta.jlcon new file mode 100644 index 000000000000..dbb2d99874f9 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/delta.jlcon @@ -0,0 +1,10 @@ +julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]); + +julia> f = -3*x^5 - 2*x^4*y - 3*x^3*y^2 + x*y^4 + 3*y^5 + 6*x^4 + 7*x^3*y + 3*x^2*y^2 - 2*x*y^3 - 6*y^4 - 3*x^3 - 5*x^2*y + x*y^2 + 3*y^3; + +julia> A, _ = quo(R, ideal(R, [f])); + +julia> L = normalization_with_delta(A); + +julia> L[3] +6 diff --git a/test/book/cornerstones/algebraic-geometry/dual_curve_function.jlcon b/test/book/cornerstones/algebraic-geometry/dual_curve_function.jlcon new file mode 100644 index 000000000000..fd06f8644442 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/dual_curve_function.jlcon @@ -0,0 +1,28 @@ +function dual_curve(f::MPolyRingElem, P_dual::MPolyRing) + P = parent(f) + vars_P = gens(P) + nvars_P = ngens(P) + vars_P_dual = gens(P_dual) + # Extend the original polynomial ring to include the variables of P_dual + P_ext, vars_ext = polynomial_ring(base_ring(P), [[string(v) for v in vars_P]; [string(v) for v in vars_P_dual]]) + inc = hom(P, P_ext, vars_ext[1:nvars_P]) + f_ext = inc(f) + # Compute the Jacobian matrix with respect to the original variables + jf = transpose(jacobian_matrix(f_ext)[1:nvars_P, 1:1]) + # Form the matrix with the last 'ngens(P_dual)' variables of P_ext + A = matrix([vars_ext[(end-ngens(P_dual)+1):end]]) + # Stack the Jacobian matrix and the matrix A + m2x3 = vcat(jf, A) + # Compute minors and saturate + I = ideal(minors(m2x3, 2)) + J = ideal([jf[1, i] for i in 1:ncols(jf)]) + Isat = saturation(I + ideal([f_ext]), J) + # Project to the dual space + proj_dual_images = vcat([zero(P_dual) for _ in 1:nvars_P], gens(P_dual)) + proj = hom(P_ext, P_dual, proj_dual_images) + dual_curve = groebner_basis(proj(Isat)) + return dual_curve[1] +end + +# output +dual_curve (generic function with 1 method) diff --git a/test/book/cornerstones/algebraic-geometry/dualcurve.jlcon b/test/book/cornerstones/algebraic-geometry/dualcurve.jlcon new file mode 100644 index 000000000000..2202427fc231 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/dualcurve.jlcon @@ -0,0 +1,22 @@ +julia> P, (x, y, z) = graded_polynomial_ring(QQ, ["x", "y", "z"]); + +julia> f = 8*x^4+20*x^2*y^2+8*y^4-48*x^2*z^2-48*y^2*z^2+65*z^4; + +julia> P_dual, (u, v, w) = graded_polynomial_ring(QQ, ["u", "v", "w"]); + +julia> f_dual = dual_curve(f, P_dual) +101920*u^12 - 283920*u^10*v^2 - 424704*u^10*w^2 - 329160*u^8*v^4 - 420192*u^8*v^2*w^2 + 701152*u^8*w^4 + 1211860*u^6*v^6 - 200976*u^6*v^4*w^2 + 1603016*u^6*v^2*w^4 - 585600*u^6*w^6 - 329160*u^4*v^8 - 200976*u^4*v^6*w^2 + 1873041*u^4*v^4*w^4 - 1405488*u^4*v^2*w^6 + 261000*u^4*w^8 - 283920*u^2*v^10 - 420192*u^2*v^8*w^2 + 1603016*u^2*v^6*w^4 - 1405488*u^2*v^4*w^6 + 489600*u^2*v^2*w^8 - 58752*u^2*w^10 + 101920*v^12 - 424704*v^10*w^2 + 701152*v^8*w^4 - 585600*v^6*w^6 + 261000*v^4*w^8 - 58752*v^2*w^10 + 5184*w^12 + +julia> f1 = x^4+y^3*z-y*z^3; + +julia> f1_dual = dual_curve(f1, P_dual); + +julia> f1_dual(u,1,w) +4*u^12 - 48*u^8*w^3 + 48*u^8*w - 27*u^4*w^8 + 84*u^4*w^6 - 546*u^4*w^4 + 84*u^4*w^2 - 27*u^4 - 256*w^9 + 768*w^7 - 768*w^5 + 256*w^3 + +julia> f2 = x^4+y^3*z-y*z^3-2//9*x^2*z^2+1//81*z^4; + +julia> f2_dual = dual_curve(f2, P_dual); + +julia> f2_dual(u,1,w) +235953*u^12 + 8748*u^10*w^2 + 314928*u^10*w + 2916*u^10 - 118098*u^8*w^4 - 2834352*u^8*w^3 + 8748*u^8*w^2 + 2831760*u^8*w - 1458*u^8 + 708588*u^6*w^6 - 866052*u^6*w^4 + 90720*u^6*w^3 + 3700404*u^6*w^2 + 33696*u^6*w + 235940*u^6 - 1594323*u^4*w^8 + 4960116*u^4*w^6 - 1189728*u^4*w^5 - 32240754*u^4*w^4 + 46656*u^4*w^3 + 4967028*u^4*w^2 + 303264*u^4*w - 1589715*u^4 + 6928416*u^2*w^7 - 8188128*u^2*w^5 - 62208*u^2*w^4 + 3149280*u^2*w^3 - 1889568*u^2*w - 20736*u^2 - 15116544*w^9 + 45349632*w^7 + 186624*w^6 - 45349632*w^5 - 373248*w^4 + 15116544*w^3 + 186624*w^2 diff --git a/test/book/cornerstones/algebraic-geometry/ex-dim.jlcon b/test/book/cornerstones/algebraic-geometry/ex-dim.jlcon new file mode 100644 index 000000000000..31e8ddd276d8 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/ex-dim.jlcon @@ -0,0 +1,11 @@ +julia> R, (x1, x2, x3) = polynomial_ring(QQ, ["x1", "x2", "x3"]); + +julia> I = ideal(R, [x2 - x1^2, x3 - x1*x2]); + +julia> radical(leading_ideal(I)) +Ideal generated by + x2 + x1 + +julia> dim(I) +1 diff --git a/test/book/cornerstones/algebraic-geometry/ex-primdec.jlcon b/test/book/cornerstones/algebraic-geometry/ex-primdec.jlcon new file mode 100644 index 000000000000..77484cf4a149 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/ex-primdec.jlcon @@ -0,0 +1,22 @@ +julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]); + +julia> I = ideal(R, [x*y, y*z]); + +julia> minimal_primes(I) +2-element Vector{MPolyIdeal{QQMPolyRingElem}}: + Ideal (z, x) + Ideal (y) + +julia> J = ideal(R, [x^2+1])^2; + +julia> primary_decomposition(J) +1-element Vector{Tuple{MPolyIdeal{QQMPolyRingElem}, MPolyIdeal{QQMPolyRingElem}}}: + (Ideal (x^4 + 2*x^2 + 1), Ideal (x^2 + 1)) + +julia> L = absolute_primary_decomposition(J) +1-element Vector{Tuple{MPolyIdeal{QQMPolyRingElem}, MPolyIdeal{QQMPolyRingElem}, MPolyIdeal{AbstractAlgebra.Generic.MPoly{AbsSimpleNumFieldElem}}, Int64}}: + (Ideal (x^4 + 2*x^2 + 1), Ideal (x^2 + 1), Ideal (x - _a), 2) + +julia> base_ring(L[1][3]) +Multivariate polynomial ring in 3 variables x, y, z + over number field of degree 2 over QQ diff --git a/test/book/cornerstones/algebraic-geometry/ex11.jlcon b/test/book/cornerstones/algebraic-geometry/ex11.jlcon new file mode 100644 index 000000000000..1fdb5883036c --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/ex11.jlcon @@ -0,0 +1,11 @@ +julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]); + +julia> I = ideal(R, [x^2+y^2+2*z^2-8, x^2-y^2-z^2+1, x-y+z]); + +julia> groebner_basis(I, ordering = lex(R), complete_reduction = true) +Gröbner basis with elements +1 -> 6*z^4 - 18*z^2 + 1 +2 -> y + 3*z^3 - 9*z +3 -> x + 3*z^3 - 8*z +with respect to the ordering +lex([x, y, z]) diff --git a/test/book/cornerstones/algebraic-geometry/ex11dist.jlcon b/test/book/cornerstones/algebraic-geometry/ex11dist.jlcon new file mode 100644 index 000000000000..a5a3be0fb5f6 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/ex11dist.jlcon @@ -0,0 +1,2 @@ +julia> normal_form(x^2+y^2+z^2, I, ordering = lex(R)) +-z^2 + 8 diff --git a/test/book/cornerstones/algebraic-geometry/ex21.jlcon b/test/book/cornerstones/algebraic-geometry/ex21.jlcon new file mode 100644 index 000000000000..0d68853f391d --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/ex21.jlcon @@ -0,0 +1,11 @@ +julia> R, (x1, x2, x3) = polynomial_ring(QQ, ["x1", "x2", "x3"]); + +julia> I = ideal(R, [x2 - x1^2, x3 - x1*x2]); + +julia> H = homogenizer(R, "x0"; pos=1); + +julia> J = H(I) +Ideal generated by + -x1*x3 + x2^2 + -x0*x3 + x1*x2 + -x0*x2 + x1^2 diff --git a/test/book/cornerstones/algebraic-geometry/ex21a.jlcon b/test/book/cornerstones/algebraic-geometry/ex21a.jlcon new file mode 100644 index 000000000000..01a275352dd2 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/ex21a.jlcon @@ -0,0 +1,12 @@ +julia> J1 = ideal([H(I[1]), H(I[2])]) +Ideal generated by + x0*x2 - x1^2 + x0*x3 - x1*x2 + +julia> MP = minimal_primes(J1) +2-element Vector{MPolyIdeal{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}}: + Ideal (x1*x3 - x2^2, x0*x3 - x1*x2, x0*x2 - x1^2) + Ideal (x1, x0) + +julia> J in MP +true diff --git a/test/book/cornerstones/algebraic-geometry/ex21b.jlcon b/test/book/cornerstones/algebraic-geometry/ex21b.jlcon new file mode 100644 index 000000000000..26e25d90fd71 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/ex21b.jlcon @@ -0,0 +1,5 @@ +julia> pt = radical(J+ideal([base_ring(J)[1]])) +Ideal generated by + x2 + x1 + x0 diff --git a/test/book/cornerstones/algebraic-geometry/ex23.jlcon b/test/book/cornerstones/algebraic-geometry/ex23.jlcon new file mode 100644 index 000000000000..792a8c49e805 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/ex23.jlcon @@ -0,0 +1,31 @@ +julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]); + +julia> f = (x-y)*((x+y)^2-(x-y)^3)-(x+y)^4; + +julia> g = y^2-x^2+3*x^3; + +julia> H = homogenizer(R, "z"); + +julia> F = H(f); + +julia> G = H(g); + +julia> I = ideal([F, G]); + +julia> degree(radical(I)) +5 + +julia> cI = primary_decomposition(I); + +julia> degrees = map(comp -> degree(comp[1]), cI) +2-element Vector{ZZRingElem}: + 4 + 8 + +julia> pos = findfirst(deg -> deg == 8, degrees) +2 + +julia> cI[pos][2] +Ideal generated by + y + x diff --git a/test/book/cornerstones/algebraic-geometry/ex23a.jlcon b/test/book/cornerstones/algebraic-geometry/ex23a.jlcon new file mode 100644 index 000000000000..eaca161def65 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/ex23a.jlcon @@ -0,0 +1,39 @@ +julia> cIabs = absolute_primary_decomposition(I); + +julia> pos_abs = findfirst(cp -> degree(cp[1]) == 8, cIabs) +2 + +julia> degree(cIabs[pos_abs][1]) +8 + +julia> other_pos_abs = pos_abs == 1 ? 2 : 1 +1 + +julia> cI2 = cIabs[other_pos_abs][3] +Ideal generated by + 648*y + (-160*_a^3 - 1269*_a^2 + 22446*_a + 972)*z + 184147758075888*x + (2850969000960*_a^3 + 22611747888864*_a^2 - 399955313722176*_a - 17319636680832)*y + (2884707374400*_a^3 + 22782606070410*_a^2 - 405172045313820*_a - 57843867366864)*z + +julia> R2 = base_ring(cI2) +Multivariate polynomial ring in 3 variables over number field graded by + x -> [1] + y -> [1] + z -> [1] + +julia> K = coefficient_ring(R2) +Number field with defining polynomial 160*x^4 + 1269*x^3 - 22446*x^2 - 972*x - 648 + over rational field + +julia> a = gen(K); + +julia> mp = minpoly(a) +x^4 + 1269//160*x^3 - 11223//80*x^2 - 243//40*x - 81//20 + +julia> S, (x,) = polynomial_ring(QQ, ["x"]); + +julia> g = mp(x); + +julia> sols, _ = real_solutions(ideal([g])); + +julia> length(sols) +2 diff --git a/test/book/cornerstones/algebraic-geometry/ex314.jlcon b/test/book/cornerstones/algebraic-geometry/ex314.jlcon new file mode 100644 index 000000000000..d387821bc9bc --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/ex314.jlcon @@ -0,0 +1,125 @@ +julia> S, x = graded_polynomial_ring(QQ, ["x_0", "x_1", "x_2", "x_3"]); + +julia> m3x3 = matrix(S, 3, 3, [(i + j == 4) ? 0 : x[4 - (i + j)] for i in 0:2, j in 0:2]) +[x_3 x_2 x_1] +[x_2 x_1 x_0] +[x_1 x_0 0] + +julia> f = det(m3x3[1:2, 1:2]) +x_1*x_3 - x_2^2 + +julia> g = det(m3x3) +-x_0^2*x_3 + 2*x_0*x_1*x_2 - x_1^3 + +julia> leading_term(f) +-x_2^2 + +julia> leading_term(g) +-x_1^3 + +julia> J = ideal([f, g]); + +julia> p1 = radical(J); + +julia> p1 == ideal(minors(m3x3[1:3, 1:2],2)) +true + +julia> mp1 = ideal_as_module(p1) +Graded submodule of S^1 +1 -> (-x_1*x_3 + x_2^2)*e[1] +2 -> (-x_0*x_3 + x_1*x_2)*e[1] +3 -> (-x_0*x_2 + x_1^2)*e[1] +represented as subquotient with no relations + +julia> M1, _ = quo(ambient_free_module(mp1), mp1); + +julia> M1 +Graded subquotient of submodule of S^1 generated by +1 -> e[1] +by submodule of S^1 generated by +1 -> (-x_1*x_3 + x_2^2)*e[1] +2 -> (-x_0*x_3 + x_1*x_2)*e[1] +3 -> (-x_0*x_2 + x_1^2)*e[1] + +julia> mJ = ideal_as_module(J); + +julia> M, _ = quo(ambient_free_module(mJ),mJ); + +julia> homM1M, psi = hom(M1, M); + +julia> hom1, tohomM1M = prune_with_map(homM1M); + +julia> hom1 +Graded subquotient of submodule of S^2 generated by +1 -> e[1] +2 -> e[2] +by submodule of S^2 generated by +1 -> -x_2*e[1] + x_3*e[2] +2 -> x_0*e[1] - x_1*e[2] +3 -> -x_1*e[1] + x_2*e[2] + +julia> degrees_of_generators(hom1) +2-element Vector{FinGenAbGroupElem}: + [2] + [2] + +julia> phi1 = psi(tohomM1M(hom1[1])) +M1 -> M +e[1] -> (-x_0*x_3 + x_1*x_2)*e[1] +Graded module homomorphism of degree [2] + +julia> phi2 = psi(tohomM1M(hom1[2])) +M1 -> M +e[1] -> (-x_0*x_2 + x_1^2)*e[1] +Graded module homomorphism of degree [2] + +julia> kerphi2, _ = kernel(phi2); + +julia> iszero(kerphi2) +true + +julia> MmodM1 = cokernel(phi2) +Graded subquotient of submodule of S^1 generated by +1 -> e[1] +by submodule of S^1 generated by +1 -> (x_1*x_3 - x_2^2)*e[1] +2 -> (-x_0^2*x_3 + 2*x_0*x_1*x_2 - x_1^3)*e[1] +3 -> (-x_0*x_2 + x_1^2)*e[1] + +julia> p2 = ideal([x[1],x[2],x[3]]) +Ideal generated by + x_0 + x_1 + x_2 + +julia> f = x[2]*x[3]-x[1]*x[4] +-x_0*x_3 + x_1*x_2 + +julia> v = f*MmodM1[1]; + +julia> U, inclU = sub(MmodM1, [v]); + +julia> annihilator(U) == p2 +true + +julia> mp2 = ideal_as_module(p2); + +julia> Smodp2, _ = quo(ambient_free_module(mp2), mp2); + +julia> homp2M1, tau = hom(Smodp2, MmodM1); + +julia> hom2, tohomp2M1 = prune_with_map(homp2M1); + +julia> psi = tau(tohomp2M1(hom2[1])); + +julia> iszero(kernel(psi)[1]) +true + +julia> annihilator(cokernel(psi)) +Ideal generated by + -x_1*x_3 + x_2^2 + -x_0*x_3 + x_1*x_2 + -x_0*x_2 + x_1^2 + +julia> annihilator(cokernel(psi)) == p1 +true diff --git a/test/book/cornerstones/algebraic-geometry/ex32.jlcon b/test/book/cornerstones/algebraic-geometry/ex32.jlcon new file mode 100644 index 000000000000..976c51a71b1a --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/ex32.jlcon @@ -0,0 +1,23 @@ +julia> R, (x0, x1, x2, x3) = polynomial_ring(QQ, ["x0", "x1", "x2", "x3"]); + +julia> I = ideal([x0, x1]); + +julia> J = ideal([x2, x3]); + +julia> A = matrix(R, [1 x0 x1 0 0; 1 0 0 x2 x3]) +[1 x0 x1 0 0] +[1 0 0 x2 x3] + +julia> B = transpose(syz(transpose(A))) +[ 0 0 x1*x3 x0*x3 x1*x2 x0*x2] +[ 0 -x1 0 -x3 0 -x2] +[ 0 x0 -x3 0 -x2 0] +[-x3 0 0 0 -x1 -x0] +[ x2 0 -x1 -x0 0 0] + +julia> intersect(I,J) +Ideal generated by + x1*x3 + x0*x3 + x1*x2 + x0*x2 diff --git a/test/book/cornerstones/algebraic-geometry/exres.jlcon b/test/book/cornerstones/algebraic-geometry/exres.jlcon new file mode 100644 index 000000000000..087305294474 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/exres.jlcon @@ -0,0 +1,44 @@ +julia> R, (w, x, y, z) = graded_polynomial_ring(QQ, ["w", "x", "y", "z"]); + +julia> I = ideal([w^2-x*z,w*x-y*z,x^2-w*y,x*y-z^2,y^2-w*z]); + +julia> A, _ = quo(R, I); + +julia> FA = free_resolution(A) +Free resolution of A +R^1 <---- R^5 <---- R^6 <---- R^2 <---- 0 +0 1 2 3 4 + +julia> FA[1] +Graded free module R^5([-2]) of rank 5 over R + +julia> FA[2] +Graded free module R^5([-3]) + R^1([-4]) of rank 6 over R + +julia> FA[3] +Graded free module R^1([-4]) + R^1([-5]) of rank 2 over R + +julia> map(FA,1) +R^5 -> R^1 +e[1] -> (-w*z + y^2)*e[1] +e[2] -> (x*y - z^2)*e[1] +e[3] -> (-w*y + x^2)*e[1] +e[4] -> (w*x - y*z)*e[1] +e[5] -> (w^2 - x*z)*e[1] +Homogeneous module homomorphism + +julia> map(FA,2) +R^6 -> R^5 +e[1] -> -x*e[1] + y*e[2] - z*e[4] +e[2] -> w*e[1] - x*e[2] + y*e[3] + z*e[5] +e[3] -> -w*e[3] + x*e[4] - y*e[5] +e[4] -> z*e[1] - w*e[2] + y*e[4] +e[5] -> z*e[3] - w*e[4] + x*e[5] +e[6] -> (-w^2 + x*z)*e[1] + (-w*z + y^2)*e[5] +Homogeneous module homomorphism + +julia> map(FA,3) +R^2 -> R^6 +e[1] -> -w*e[2] - y*e[3] + x*e[4] - e[6] +e[2] -> (-w^2 + x*z)*e[1] + y*z*e[2] + z^2*e[3] - w*y*e[4] + (w*z - y^2)*e[5] + x*e[6] +Homogeneous module homomorphism diff --git a/test/book/cornerstones/algebraic-geometry/exres2.jlcon b/test/book/cornerstones/algebraic-geometry/exres2.jlcon new file mode 100644 index 000000000000..3181f5c529ed --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/exres2.jlcon @@ -0,0 +1,17 @@ +julia> betti_table(FA) + 0 1 2 3 +----------------- +0 : 1 - - - +1 : - 5 5 1 +2 : - - 1 1 +----------------- +total: 1 5 6 2 + +julia> minimal_betti_table(FA) + 0 1 2 3 +----------------- +0 : 1 - - - +1 : - 5 5 - +2 : - - - 1 +----------------- +total: 1 5 5 1 diff --git a/test/book/cornerstones/algebraic-geometry/hilbert-polynomial.jlcon b/test/book/cornerstones/algebraic-geometry/hilbert-polynomial.jlcon new file mode 100644 index 000000000000..f35655f922e3 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/hilbert-polynomial.jlcon @@ -0,0 +1,17 @@ +julia> R, (w,x,y,z) = graded_polynomial_ring(QQ, ["w", "x", "y", "z"]); + +julia> I = ideal(R, [x*w-y*z, y*w-(x-z)*(x-2*z)]); + +julia> Q = projective_scheme(I); + +julia> is_smooth(Q) +true + +julia> hilbert_polynomial(Q) +4*t + +julia> degree(Q) +4 + +julia> arithmetic_genus(Q) +1 diff --git a/test/book/cornerstones/algebraic-geometry/monodromy.jlcon b/test/book/cornerstones/algebraic-geometry/monodromy.jlcon new file mode 100644 index 000000000000..17888159a731 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/monodromy.jlcon @@ -0,0 +1,56 @@ +julia> P2, (x, y, z) = polynomial_ring(QQ,["x","y","z"]); + +julia> f1 = 8*x^4+20*x^2*y^2+8*y^4-48*x^2*z^2-48*y^2*z^2+65*z^4+x*y^3; + +julia> f2 = x^3*y+y^3*z+z^3*x+x^4; + +julia> g1 = 1771*f1 - 1317*f2; + +julia> hess1 = hessian(g1); + +julia> I1 = ideal([hess1,g1]); + +julia> g1yz = eliminate(I1,[x]); + +julia> Q, t = polynomial_ring(QQ,"y"); + +julia> phi = hom(P2, Q, [0,t,1]); + +julia> g1t = phi(g1yz[1]); + +julia> G1,_ = galois_group(g1t); + +julia> G1 +Sym(24) + +julia> g2 = 7713*f1 - 1313*f2; + +julia> g2t = phi(eliminate(ideal([hessian(g2),g2]),[x])[1]); + +julia> G2,_ = galois_group(g2t); + +julia> G2==G1 +true + +julia> dg1 = discriminant(g1t); + +julia> dg2 = discriminant(g2t); + +julia> ggT = gcd(dg1,dg2); + +julia> factor(ZZ(ggT)) +1 * 2^4 + +julia> KK, _ = number_field(g2t); + +julia> degree(KK) +24 + +julia> O = any_order(KK); + +julia> OO = pmaximal_overorder(O, 2); + +julia> d = discriminant(OO); + +julia> gcd(d,2) +1 diff --git a/test/book/cornerstones/algebraic-geometry/param.jlcon b/test/book/cornerstones/algebraic-geometry/param.jlcon new file mode 100644 index 000000000000..1e975acf1854 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/param.jlcon @@ -0,0 +1,56 @@ +julia> P, (x, y, z) = graded_polynomial_ring(QQ, ["x", "y", "z"]); + +julia> f = x^5 + 10*x^4*y + 20*x^3*y^2 + 130*x^2*y^3 - 20*x*y^4 + 20*y^5 - 2*x^4*z - 40*x^3*y*z - 150*x^2*y^2*z - 90*x*y^3*z - 40*y^4*z + x^3*z^2 + 30*x^2*y*z^2 + 110*x*y^2*z^2 + 20*y^3*z^2; + +julia> C = plane_curve(f) +Projective plane curve + defined by 0 = x^5 + 10*x^4*y - 2*x^4*z + 20*x^3*y^2 - 40*x^3*y*z + x^3*z^2 + 130*x^2*y^3 - 150*x^2*y^2*z + 30*x^2*y*z^2 - 20*x*y^4 - 90*x*y^3*z + 110*x*y^2*z^2 + 20*y^5 - 40*y^4*z + 20*y^3*z^2 + +julia> conics = [x^2-x*z, y^2-y*z]; + +julia> BM = invert_birational_map(conics, C); + +julia> phi = BM["inverse"] +3-element Vector{QQMPolyRingElem}: + -10*y(1)^5 - 430*y(1)^4*y(2) - 5020*y(1)^3*y(2)^2 - 15100*y(1)^2*y(2)^3 - 4800*y(1)*y(2)^4 - 400*y(2)^5 + y(1)^5 + 50*y(1)^4*y(2) + 690*y(1)^3*y(2)^2 + 1620*y(1)^2*y(2)^3 - 1800*y(1)*y(2)^4 - 400*y(2)^5 + y(1)^5 - 60*y(1)^4*y(2) - 2240*y(1)^3*y(2)^2 - 18100*y(1)^2*y(2)^3 - 4800*y(1)*y(2)^4 - 400*y(2)^5 + +julia> evaluate(defining_equation(C), phi) +0 + +julia> I = adjoint_ideal(C) +Ideal generated by + y^3 - y^2*z + x*y^2 - x*y*z + x^2*y - x*y*z + x^3 - x^2*z + +julia> D = Oscar.map_to_rational_normal_curve(C) +Projective curve + in projective 3-space over QQ with coordinates [y(1), y(2), y(3), y(4)] +defined by ideal with 3 generators + +julia> betti(free_resolution(defining_ideal(D))) + 0 1 +----------- +2 : 3 2 +----------- +total: 3 2 + +julia> Oscar.rat_normal_curve_anticanonical_map(D) +2-element Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}: + 2*y(2) + 13*y(4) + y(4) + +julia> rational_point_conic(plane_curve(y^2 - x*z)) +3-element Vector{QQMPolyRingElem}: + 0 + 0 + -1 + +julia> I = parametrization(C) +3-element Vector{QQMPolyRingElem}: + 25*s^5 - 1025*s^4*t + 14825*s^3*t^2 - 85565*s^2*t^3 + 146420*s*t^4 - 20780*t^5 + 25*s^5 - 1400*s^4*t + 30145*s^3*t^2 - 305650*s^2*t^3 + 1396410*s*t^4 - 2023972*t^5 + 25*s^5 - 1025*s^4*t + 15575*s^3*t^2 - 116205*s^2*t^3 + 562440*s*t^4 - 1898652*t^5 diff --git a/test/book/cornerstones/algebraic-geometry/twocusps.jlcon b/test/book/cornerstones/algebraic-geometry/twocusps.jlcon new file mode 100644 index 000000000000..0e2b3c21bccf --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/twocusps.jlcon @@ -0,0 +1,30 @@ +julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]); + +julia> f = y^2-x^3; + +julia> g = 2*y^2-x^3; + +julia> U = complement_of_point_ideal(R, [0 ,0]); + +julia> Rloc, _ = localization(R, U); + +julia> I = ideal(Rloc, [f, g]); + +julia> A, _ = quo(Rloc, I); + +julia> vector_space_dimension(A) +6 + +julia> C = plane_curve(f) +Affine plane curve + defined by 0 = x^3 - y^2 + +julia> D = plane_curve(g); + +julia> P = D([0, 0]) +Rational point + of scheme(x^3 - 2*y^2) +with coordinates (0, 0) + +julia> intersection_multiplicity(C, D, P) +6 diff --git a/test/book/cornerstones/algebraic-geometry/zariski.jlcon b/test/book/cornerstones/algebraic-geometry/zariski.jlcon new file mode 100644 index 000000000000..cfa647e86d87 --- /dev/null +++ b/test/book/cornerstones/algebraic-geometry/zariski.jlcon @@ -0,0 +1,28 @@ +julia> k = GF(31991); + +julia> S, (x, y, z, t) = polynomial_ring(k, ["x", "y", "z", "t"]); + +julia> a, b, c = 40, 30, 8 +(40, 30, 8) + +julia> ft=x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z^3+x^(c-2)*y^c*(y^2+t*x)^2; + +julia> R, (x, y, z) = polynomial_ring(k, ["x", "y", "z"]); + +julia> f0 = hom(S, R, [x, y, z, 0])(ft); + +julia> f1 = hom(S, R, [x, y, z, 1])(ft); + +julia> MI0 = jacobian_ideal(f0); MI1 = jacobian_ideal(f1); + +julia> U = complement_of_point_ideal(R, [0 ,0, 0]); + +julia> Rloc, phi = localization(R, U); + +julia> A0, _ = quo(Rloc, phi(MI0)); A1, _ = quo(Rloc, phi(MI1)); + +julia> vector_space_dimension(A0) +10661 + +julia> vector_space_dimension(A1) +10655 diff --git a/test/book/cornerstones/groups/actions.jlcon b/test/book/cornerstones/groups/actions.jlcon new file mode 100644 index 000000000000..7746383e5ced --- /dev/null +++ b/test/book/cornerstones/groups/actions.jlcon @@ -0,0 +1,85 @@ +julia> gset(alternating_group(4)) +G-set of + Alt(4) + with seeds 1:4 + +julia> G = dihedral_group(6) +Pc group of order 6 + +julia> U = sub(G, [g for g in gens(G) if order(g) == 2])[1] +Pc group of order 2 + +julia> r = right_cosets(G, U) +Right cosets of + pc group of order 2 in + pc group of order 6 + +julia> acting_group(r) +Pc group of order 6 + +julia> collect(r) +3-element Vector{GroupCoset{PcGroup, PcGroupElem}}: + Right coset of U with representative of ... + Right coset of U with representative f2 + Right coset of U with representative f2^2 + +julia> action_function(r) +* (generic function with 1736 methods) + +julia> permutation(r, G[1]) +(2,3) + +julia> phi = right_coset_action(G,U) +Group homomorphism + from pc group of order 6 + to permutation group of degree 3 and order 6 + +julia> phi(G[1]), phi(G[2]) +((2,3), (1,2,3)) + +julia> function optimal_perm_rep(G) + is_natural_symmetric_group(G) && return hom(G,G,gens(G)) + is_natural_alternating_group(G) && return hom(G,G,gens(G)) + cand = [] # pairs (U,h) with U ≤ G and h a map G -> Sym(G/U) + for C in subgroup_classes(G) + U = representative(C) + h = right_coset_action(G, U) + is_injective(h) && push!(cand, (U, h)) + end + return argmax(a -> order(a[1]), cand)[2] + end; + +julia> U = dihedral_group(8) +Pc group of order 8 + +julia> optimal_perm_rep(U) +Group homomorphism + from pc group of order 8 + to permutation group of degree 4 and order 8 + +julia> isomorphism(PermGroup, U) +Group homomorphism + from pc group of order 8 + to permutation group of degree 8 and order 8 + +julia> permutation_group(U) +Permutation group of degree 8 and order 8 + +julia> for g in all_transitive_groups(degree => 3:9, !is_primitive) + h = image(optimal_perm_rep(g))[1] + if degree(h) < degree(g) + id = transitive_group_identification(g) + id_new = transitive_group_identification(h) + println(id => id_new) + end + end +(6, 2) => (3, 2) +(6, 4) => (4, 4) +(6, 7) => (4, 5) +(6, 8) => (4, 5) +(8, 4) => (4, 3) +(8, 13) => (6, 6) +(8, 14) => (4, 5) +(8, 24) => (6, 11) +(9, 4) => (6, 5) +(9, 8) => (6, 9) diff --git a/test/book/cornerstones/groups/chars.jlcon b/test/book/cornerstones/groups/chars.jlcon new file mode 100644 index 000000000000..a1c43f0089d9 --- /dev/null +++ b/test/book/cornerstones/groups/chars.jlcon @@ -0,0 +1,48 @@ +julia> t = character_table("J2"); + +julia> mx = character_table.(maxes(t)); + +julia> pis = [trivial_character(s)^t for s in mx]; + +julia> ords = orders_class_representatives(t); println(ords) +[1, 2, 2, 3, 3, 4, 5, 5, 5, 5, 6, 6, 7, 8, 10, 10, 10, 10, 12, 15, 15] + +julia> ord7 = findall(is_equal(7), ords); + +julia> filt = filter(pi -> pi[ord7[1]] != 0, pis); + +julia> degree.(filt) +2-element Vector{QQFieldElem}: + 100 + 1800 + +julia> ord5 = findall(is_equal(5), ords); + +julia> s = sum(filt); + +julia> all(i -> s[i] == 0, ord5) +true + +julia> (x -> [x["1a"], x["2b"], x["3a"], x["3b"]]).(filt) +2-element Vector{Vector{QQAbElem{AbsSimpleNumFieldElem}}}: + [100, 0, 10, 4] + [1800, 20, 0, 6] + +julia> ord3 = findall(is_equal(3), ords); + +julia> [class_multiplication_coefficient(t, 3, i, ord7[1]) for i in ord3] +2-element Vector{ZZRingElem}: + 0 + 70 + +julia> s = mx[findfirst(is_equal(filt[2]), pis)]; + +julia> identifier(s) +"L3(2).2" + +julia> possible_class_fusions(s, t) +1-element Vector{Vector{Int64}}: + [1, 2, 5, 6, 13, 3, 12, 14, 14] + +julia> class_multiplication_coefficient(s, 6, 3, 5) +0 diff --git a/test/book/cornerstones/groups/cohomology.jlcon b/test/book/cornerstones/groups/cohomology.jlcon new file mode 100644 index 000000000000..8da02fba696d --- /dev/null +++ b/test/book/cornerstones/groups/cohomology.jlcon @@ -0,0 +1,13 @@ +julia> irreducible_modules(symmetric_group(3)) +3-element Vector{GModule}: + G-module for Sym(3) acting on vector space of dimension 1 over abelian closure of Q + G-module for Sym(3) acting on vector space of dimension 1 over abelian closure of Q + G-module for Sym(3) acting on vector space of dimension 2 over abelian closure of Q + +julia> G = symmetric_group(3); + +julia> A = abelian_group([2,2,2]) +(Z/2)^3 + +julia> M = gmodule(G, [hom(A, A, permuted(gens(A), g)) for g in gens(G)]) +G-module for G acting on A diff --git a/test/book/cornerstones/groups/explSL25.jlcon b/test/book/cornerstones/groups/explSL25.jlcon new file mode 100644 index 000000000000..62ecf567ff0b --- /dev/null +++ b/test/book/cornerstones/groups/explSL25.jlcon @@ -0,0 +1,72 @@ +julia> G = SL(2, 5) +SL(2,5) + +julia> T = character_table(G) +Character table of SL(2,5) + + 2 3 1 1 3 1 + 3 1 . . 1 . + 5 1 1 1 1 1 + + 1a 10a 10b 2a 5a + +X_1 1 1 1 1 1 +X_2 2 z_5^3 + z_5^2 + 1 -z_5^3 - z_5^2 -2 -z_5^3 - z_5^2 - 1 +X_3 2 -z_5^3 - z_5^2 z_5^3 + z_5^2 + 1 -2 z_5^3 + z_5^2 +X_4 3 -z_5^3 - z_5^2 z_5^3 + z_5^2 + 1 3 -z_5^3 - z_5^2 +X_5 3 z_5^3 + z_5^2 + 1 -z_5^3 - z_5^2 3 z_5^3 + z_5^2 + 1 +X_6 4 -1 -1 4 -1 +X_7 4 1 1 -4 -1 +X_8 5 . . 5 . +X_9 6 -1 -1 -6 1 + + 2 1 1 1 2 + 3 . 1 1 . + 5 1 . . . + + 5b 3a 6a 4a + +X_1 1 1 1 1 +X_2 z_5^3 + z_5^2 -1 1 . +X_3 -z_5^3 - z_5^2 - 1 -1 1 . +X_4 z_5^3 + z_5^2 + 1 . . -1 +X_5 -z_5^3 - z_5^2 . . -1 +X_6 -1 1 1 . +X_7 -1 1 -1 . +X_8 . -1 -1 1 +X_9 1 . . . + +julia> R = gmodule(T[end]) +G-module for G acting on vector space of dimension 6 over abelian closure of Q + +julia> S = gmodule(CyclotomicField, R) +G-module for G acting on vector space of dimension 6 over cyclotomic field of order 5 + +julia> schur_index(T[end]) +2 + +julia> gmodule_minimal_field(S) +G-module for G acting on vector space of dimension 6 over number field of degree 4 over QQ + +julia> B, mB = relative_brauer_group(base_ring(S), character_field(S)); + +julia> B +Relative Brauer group for cyclotomic field of order 5 over number field of degree 1 over QQ + +julia> b = B(S) +Element of relative Brauer group of number field of degree 1 over QQ + <2, 2> -> 1//2 + Z + <5, 5> -> 0 + Z + Complex embedding of number field -> 1//2 + Z + +julia> K = grunwald_wang(b) +Class field defined mod (<40, 360>, InfPlc{AbsSimpleNumField, AbsSimpleNumFieldEmbedding}[Infinite place corresponding to (Complex embedding corresponding to 1.00 of number field)]) of structure Z/2 + +julia> F, _ = absolute_simple_field(number_field(K)) +(Number field of degree 2 over QQ, Map: F -> non-simple number field) + +julia> L, _, F_to_L = compositum(base_ring(S), F) +(Number field of degree 8 over QQ, Map: cyclotomic field of order 5 -> L, Map: F -> L) + +julia> gmodule_over(F_to_L, gmodule(L, S)) +G-module for G acting on vector space of dimension 6 over F diff --git a/test/book/cornerstones/groups/extensions.jlcon b/test/book/cornerstones/groups/extensions.jlcon new file mode 100644 index 000000000000..438e7e15293b --- /dev/null +++ b/test/book/cornerstones/groups/extensions.jlcon @@ -0,0 +1,46 @@ +julia> Oscar.randseed!(42) + +julia> G = dihedral_group(PermGroup, 10); + +julia> h = epimorphism_from_free_group(G) +Group homomorphism + from free group of rank 2 + to permutation group of degree 5 + +julia> gens(G) +2-element Vector{PermGroupElem}: + (1,2,3,4,5) + (2,5)(3,4) + +julia> g = rand(G) +(1,4)(2,3) + +julia> w = preimage(h, g) +x1^-1*x2^-1*x1^-3 + +julia> map_word(w, gens(G)) # evaluate w at generators to get back g +(1,4)(2,3) + +julia> k, mk = kernel(h); # mk is a map from k to domain(h) + +julia> ngens(k) +11 + +julia> mk(k[2]) # pick any kernel generator ... +x1*x2^-2*x1^-1 + +julia> G[1]*G[-2]^2*G[-1] # ... and it evaluates to the identity +() + +julia> U = cyclic_group(5); V = cyclic_group(2); F = free_group(2); + +julia> q = quo(F, [F[1]^5, F[2]^2*F[1]])[1]; + +julia> describe(q) +"C10" + +julia> q, mq = quo(F, [F[1]^5, F[2]^2, F[-1]*F[-2]*F[1]*F[2]*F[1]^2]) +(Finitely presented group, Hom: F -> q) + +julia> describe(q) +"D10" diff --git a/test/book/cornerstones/groups/genchar.jlcon b/test/book/cornerstones/groups/genchar.jlcon new file mode 100644 index 000000000000..af619ac65fae --- /dev/null +++ b/test/book/cornerstones/groups/genchar.jlcon @@ -0,0 +1,64 @@ +julia> T = genchartab("SL3.n1") +Generic character table + of order q^8 - q^6 - q^5 + q^3 + with 8 irreducible character types + with 8 class types + with parameters (a, b, m, n) + +julia> printval(T,char=4,class=4) +Value of character type 4 on class type + 4: (q + 1) * exp(2π𝑖(1//(q - 1)*a*n)) + (1) * exp(2π𝑖(-2//(q - 1)*a*n)) + +julia> h = tensor!(T,2,2) +9 + +julia> scalar(T,4,h) +(0, Set(ParameterException{QQPolyRingElem}[(2*n1)//(q - 1) ∈ ℤ])) + +julia> print_decomposition(T, h) +Decomposing character 9: + <1,9> = 1 + <2,9> = 2 + <3,9> = 2 + <4,9> = 0 with possible exceptions: + (2*n1)//(q - 1) ∈ ℤ + <5,9> = 0 with possible exceptions: + (2*n1)//(q - 1) ∈ ℤ + <6,9> = 0 with possible exceptions: + (m1 + n1)//(q - 1) ∈ ℤ + (2*m1 - n1)//(q - 1) ∈ ℤ + (m1)//(q - 1) ∈ ℤ + (n1)//(q - 1) ∈ ℤ + (m1 - n1)//(q - 1) ∈ ℤ + (m1 - 2*n1)//(q - 1) ∈ ℤ + <7,9> = 0 with possible exceptions: + (n1)//(q - 1) ∈ ℤ + <8,9> = 0 with possible exceptions: + ((q + 1)*n1)//(q^2 + q + 1) ∈ ℤ + (q*n1)//(q^2 + q + 1) ∈ ℤ + (n1)//(q^2 + q + 1) ∈ ℤ + +julia> chardeg(T, lincomb!(T,[1,2,2],[1,2,3])) +2*q^3 + 2*q^2 + 2*q + 1 + +julia> chardeg(T, h) +q^4 + 2*q^3 + q^2 + +julia> printcharparam(T,4) +4 n ∈ {1,…, q - 1} except (n)//(q - 1) ∈ ℤ + +julia> T2 = setcongruence(T, (0,2)); + +julia> (q, (a, b, m, n)) = params(T2); + +julia> x = param(T2, "x"); # create an additional "free" variable + +julia> speccharparam!(T2, 6, m, -n + (q-1)*x) # force m = -n (mod q-1) + +julia> s, e = scalar(T2,6,h); s +1 + +julia> e +Set{ParameterException{QQPolyRingElem}} with 2 elements: + (2*n1)//(q - 1) ∈ ℤ + (3*n1)//(q - 1) ∈ ℤ diff --git a/test/book/cornerstones/groups/intro.jlcon b/test/book/cornerstones/groups/intro.jlcon new file mode 100644 index 000000000000..fb7e8a623aaf --- /dev/null +++ b/test/book/cornerstones/groups/intro.jlcon @@ -0,0 +1,145 @@ +julia> G_perm = @permutation_group(5, (2,5)(3,4), (1,3)(4,5)) +Permutation group of degree 5 + +julia> order(G_perm) +10 + +julia> describe(G_perm) +"D10" + +julia> r = G_perm[1] * G_perm[2] +(1,3,5,2,4) + +julia> g = perm([1,2,3,5,4]) # 'tabular' notation +(4,5) + +julia> g in G_perm +false + +julia> G_perm([2,1,5,4,3]) # 'tabular' notation with explicit parent +(1,2)(3,5) + +julia> cperm([1,2],[4,5]) # cycle decomposition +(1,2)(4,5) + +julia> @perm (1,2)(4,5) # cycle notation via macro +(1,2)(4,5) + +julia> K = algebraic_closure(QQ) +Field of algebraic numbers + +julia> e = one(K) +Root 1.00000 of x - 1 + +julia> s, c = sinpi(2*e/5), cospi(2*e/5) +(Root 0.951057 of 16x^4 - 20x^2 + 5, Root 0.309017 of 4x^2 + 2x - 1) + +julia> mat_rot = matrix([ c -s ; s c ]); + +julia> mat_sigma1 = matrix(K, [ -1 0 ; 0 1 ]); + +julia> G_mat = matrix_group(mat_rot, mat_sigma1) +Matrix group of degree 2 + over field of algebraic numbers + +julia> is_isomorphic(G_mat, G_perm) +true + +julia> p = K.([0,1]); # coordinates of vertex 1, expressed over K + +julia> orb = orbit(G_mat, *, p) +G-set of + matrix group of degree 2 over QQBar + with seeds Vector{QQBarFieldElem}[[Root 0 of x, Root 1.00000 of x - 1]] + +julia> pts = collect(orb) +5-element Vector{Vector{QQBarFieldElem}}: + [Root 0 of x, Root 1.00000 of x - 1] + [Root 0.951057 of 16x^4 - 20x^2 + 5, Root 0.309017 of 4x^2 + 2x - 1] + [Root 0.587785 of 16x^4 - 20x^2 + 5, Root -0.809017 of 4x^2 + 2x - 1] + [Root -0.951057 of 16x^4 - 20x^2 + 5, Root 0.309017 of 4x^2 + 2x - 1] + [Root -0.587785 of 16x^4 - 20x^2 + 5, Root -0.809017 of 4x^2 + 2x - 1] + +julia> visualize(convex_hull(pts)) + +julia> R2 = free_module(K, 2) # the "euclidean" plane over K +Vector space of dimension 2 over field of algebraic numbers + +julia> A = R2([0,1]) +(Root 0 of x, Root 1.00000 of x - 1) + +julia> pts = [A*mat_rot^i for i in 0:4]; + +julia> sigma_1 = hom(R2, R2, [-R2[1], R2[2]]) +Module homomorphism + from vector space of dimension 2 over field of algebraic numbers + to vector space of dimension 2 over field of algebraic numbers + +julia> rot = hom(R2, R2, mat_rot); + +julia> G_generic = generic_group(closure([rot, sigma_1], *), *)[1] +Generic group of order 10 with multiplication table + +julia> permutation_group(G_generic) +Permutation group of degree 10 + +julia> is_isomorphic(ans, G_perm) +true + +julia> G_fp = fp_group(G_perm) +Finitely presented group of order 10 + +julia> gens(G_fp) +2-element Vector{FPGroupElem}: + F1 + F2 + +julia> relators(G_fp) +3-element Vector{FPGroupElem}: + F1^2 + F1^-1*F2*F1*F2^-4 + F2^5 + +julia> F = free_group(2) +Free group of rank 2 + +julia> G_cox, _ = quo(F, [F[1]^2, F[2]^2, (F[1]*F[2])^5]) +(Finitely presented group, Hom: F -> G_cox) + +julia> is_isomorphic(G_cox, G_perm) +true + +julia> F = free_group(:a, :b, :c); a,b,c = gens(F); + +julia> G, _ = quo(F, [a^2, b^2, c^2, (a*b)^3, (a*c)^2, (b*c)^3]) +(Finitely presented group, Hom: F -> G) + +julia> H, _ = quo(F, [a^2, b^2, c^2, (a*b)^3, (a*c)^3, (b*c)^3]) +(Finitely presented group, Hom: F -> H) + +julia> is_finite(G) +true + +julia> describe(G) +"S4" + +julia> describe(H) +"a finitely presented group" + +julia> H1, _ = derived_subgroup(H) +(Finitely presented group, Hom: H1 -> H) + +julia> H2, _ = derived_subgroup(H1) +(Finitely presented group, Hom: H2 -> H1) + +julia> describe(H2) +"Z x Z" + +julia> describe(quo(H, H2)[1]) +"(C3 x C3) : C2" + +julia> dihedral_group(10) +Pc group of order 10 + +julia> dihedral_group(PermGroup, 10) +Permutation group of degree 5 diff --git a/test/book/cornerstones/groups/reps.jlcon b/test/book/cornerstones/groups/reps.jlcon new file mode 100644 index 000000000000..792bd17669d9 --- /dev/null +++ b/test/book/cornerstones/groups/reps.jlcon @@ -0,0 +1,78 @@ +julia> function regular_gmodule(F::Field, G::Oscar.GAPGroup) + FM = free_module(F, order(Int, G)); + gs = gset(G, *, [one(G)]) + return gmodule(G, [hom(FM, FM, permutation_matrix(F, permutation(gs, g))) for g in gens(G)]) + end; + +julia> Base.:^(a::T, b::T) where T <: MatElem = inv(b)*a*b + +julia> G = dihedral_group(10); + +julia> M = regular_gmodule(GF(7), G); + +julia> C = composition_factors_with_multiplicity(M) +3-element Vector{Any}: + (G-module for G acting on vector space of dimension 1 over prime field of characteristic 7, 1) + (G-module for G acting on vector space of dimension 1 over prime field of characteristic 7, 1) + (G-module for G acting on vector space of dimension 4 over prime field of characteristic 7, 2) + +julia> [is_absolutely_irreducible(x[1]) for x in C] +3-element Vector{Bool}: + 1 + 1 + 0 + +julia> phi = embed(GF(7), splitting_field(C[3][1])) +Morphism of finite fields + from prime field of characteristic 7 + to finite field of degree 2 and characteristic 7 + +julia> M = extension_of_scalars(C[3][1], phi) +G-module for G acting on vector space of dimension 4 over finite field of degree 2 and characteristic 7 + +julia> composition_factors_with_multiplicity(M) +2-element Vector{Any}: + (G-module for G acting on vector space of dimension 2 over finite field of degree 2 and characteristic 7, 1) + (G-module for G acting on vector space of dimension 2 over finite field of degree 2 and characteristic 7, 1) + +julia> G = pc_group(symmetric_group(4)); + +julia> C = abelian_closure(QQ)[1]; + +julia> F = free_module(C, 1); + +julia> s, ms = sub(G, [G[3], G[4]]); # subgroup generated by c, d + +julia> T = trivial_gmodule(s, F); + +julia> z = root_of_unity(C, 3); + +julia> ss, mss = sub(G, [G[2], G[3], G[4]]); + +julia> M = gmodule(ss, [hom(F, F, [z*F[1]]), action(T, s[1]), action(T, s[2])]) +G-module for ss acting on F + +julia> FF = free_module(C, 2); + +julia> zm = 0*matrix(action(M, one(ss))); + +julia> im = [hom(FF, FF, [matrix(action(M, x)) zm; zm matrix(action(M, preimage(mss, mss(x)^G[1])))]) for x in gens(ss)]; + +julia> pushfirst!(im, hom(FF, FF, matrix(C, [0 1; 1 0]))); + +julia> phi = gmodule(G, im); + +julia> character(phi) +class_function(character table of G, QQAbElem{AbsSimpleNumFieldElem}[2, 0, -1, 2, 0]) + +julia> schur_index(ans) +1 + +julia> T = matrix(C, [C(1) -z; z+1 z]); + +julia> [matrix(x)^T for x in action(phi)] +4-element Vector{AbstractAlgebra.Generic.MatSpaceElem{QQAbElem{AbsSimpleNumFieldElem}}}: + [1 0; -1 -1] + [0 1; -1 -1] + [1 0; 0 1] + [1 0; 0 1] diff --git a/test/book/cornerstones/number-theory/cohenlenstra.jlcon b/test/book/cornerstones/number-theory/cohenlenstra.jlcon new file mode 100644 index 000000000000..b83af286a45c --- /dev/null +++ b/test/book/cornerstones/number-theory/cohenlenstra.jlcon @@ -0,0 +1,49 @@ +julia> fields = [d for d in 1:10^6 if + d != 1 && is_fundamental_discriminant(d)]; + +julia> length(fields) +303957 + +julia> clgrps = [class_group(quadratic_field(d, cached = false)[1])[1] + for d in fields]; + +julia> using Tally; + +julia> tally(clgrps, + by = x -> sylow_subgroup(x, 5)[1], + equivalence = (x, y) -> is_isomorphic(x, y)[1]) +Tally with 303957 items in 4 groups: +[Z/1] | 291400 | 95.869% +[Z/5] | 12324 | 4.055% +[Z/25] | 230 | 0.076% +[(Z/5)^2] | 3 | 0.001% + +julia> ab_grps = abelian_group.([[1], [5], [25], [5, 5]]); + +julia> w = prod(1 - 1/5.0^i for i in 2:1000) +0.9504159948390403 + +julia> [ 100 * w/(1.0 * (order(A) * + order(automorphism_group(A)))) for A in ab_grps] +4-element Vector{BigFloat}: + 95.041[...] + 4.752[...] + 0.190[...] + 0.007[...] + +julia> clnumbs = order.(clgrps); + +julia> x = range(1, length(clnumbs), 1000); + +julia> values = [count(c -> is_divisible_by(c, 5), + clnumbs[1:Int(ceil(step))])/Int(ceil(step)) for + step in x]; + +julia> pr = 1 - prod(1 - 1/5.0^i for i in 2:1000) +0.04958400516095973 + +julia> using Plots; + plot(x, [values fill(pr, length(x))], linewidth = 2, + xlabel = "Number of fields", + label = ["Proportion" "Prediction"]) +Plot{Plots.GRBackend() n=2} diff --git a/test/book/cornerstones/number-theory/embeddings.jlcon b/test/book/cornerstones/number-theory/embeddings.jlcon new file mode 100644 index 000000000000..3d8638fa8588 --- /dev/null +++ b/test/book/cornerstones/number-theory/embeddings.jlcon @@ -0,0 +1,19 @@ +julia> Qx, x = QQ["x"]; + +julia> K, a = number_field(x^3 - 2, "a"); + +julia> signature(K) +(1, 1) + +julia> real_embeddings(K) +1-element Vector{AbsSimpleNumFieldEmbedding}: + Complex embedding corresponding to 1.26 of K + +julia> embs = complex_embeddings(K) # printed with limited precision +3-element Vector{AbsSimpleNumFieldEmbedding}: + Complex embedding corresponding to 1.26 of K + Complex embedding corresponding to -0.63 + 1.09 * i of K + Complex embedding corresponding to -0.63 - 1.09 * i of K + +julia> embs[1](a - 1) +[0.2599210499 +/- 8.44e-11] diff --git a/test/book/cornerstones/number-theory/galoismod.jlcon b/test/book/cornerstones/number-theory/galoismod.jlcon new file mode 100644 index 000000000000..6e46fdcb4463 --- /dev/null +++ b/test/book/cornerstones/number-theory/galoismod.jlcon @@ -0,0 +1,91 @@ +julia> Oscar.randseed!(3371100); + +julia> Qx, x = QQ["x"]; + +julia> K, a = number_field(x^4 + 4*x^2 + 2, "a"); + +julia> b = rand(K, -10:10) # random element with coefficients + # between -10 and 10 +5*a^3 - 7*a^2 + 8*a - 8 + +julia> A, mA = automorphism_group(K); + +julia> list = [mA(s)(b) for s in A] +4-element Vector{AbsSimpleNumFieldElem}: + 5*a^3 - 7*a^2 + 8*a - 8 + -7*a^3 + 7*a^2 - 26*a + 20 + -5*a^3 - 7*a^2 - 8*a - 8 + 7*a^3 + 7*a^2 + 26*a + 20 + +julia> X = matrix(QQ, coordinates.(list)) +[-8 8 -7 5] +[20 -26 7 -7] +[-8 -8 -7 -5] +[20 26 7 7] + +julia> det(X) != 0 +true + +julia> det(matrix(QQ, [coordinates(mA(s)(a)) for s in A])) +0 + +julia> V, f = galois_module(K); + +julia> OK = ring_of_integers(K); + +julia> M = f(OK); + +julia> is_free(M) +false + +julia> fl = is_locally_free(M, 2) +false + +julia> prime_decomposition_type(OK, 2) +1-element Vector{Tuple{Int64, Int64}}: + (1, 4) + +julia> K, a = number_field(x^4 - x^3 + x^2 - x + 1, "a"); + +julia> is_tamely_ramified(K) +true + +julia> V, f = galois_module(K); OK = ring_of_integers(K); M = f(OK); + +julia> fl, c = is_free_with_basis(M); # the elements of c are a basis + +julia> b = preimage(f, c[1]) # the element might different per session +a + +julia> A, mA = automorphism_group(K); + +julia> X = matrix(ZZ, [coordinates(OK(mA(s)(b))) for s in A]) +[0 1 0 0] +[0 0 0 1] +[1 -1 1 -1] +[0 0 -1 0] + +julia> det(X) +1 + +julia> k, = number_field(x^4 - 13*x^2 + 16); candidates = []; for F in abelian_normal_extensions(k, [2], ZZ(10)^13) + K, = absolute_simple_field(number_field(F)) + if !is_tamely_ramified(K) + continue + end + if !is_isomorphic(galois_group(K)[1], quaternion_group(8)) + continue + end + push!(candidates, K) + end + +julia> length(candidates) +2 + +julia> K = candidates[2]; V, f = galois_module(K); OK = ring_of_integers(K); M = f(OK); + +julia> fl = is_free(M) +false + +julia> defining_polynomial(K) +x^8 + 105*x^6 + 3465*x^4 + 44100*x^2 + 176400 diff --git a/test/book/cornerstones/number-theory/galoismod_1.jlcon b/test/book/cornerstones/number-theory/galoismod_1.jlcon new file mode 100644 index 000000000000..39dd228a45d7 --- /dev/null +++ b/test/book/cornerstones/number-theory/galoismod_1.jlcon @@ -0,0 +1,16 @@ +for i in 1:8, j in 1:number_of_small_groups(i) + G = small_group(i, j) + if is_abelian(G) + continue + end + QG = QQ[G] + ZG = integral_group_ring(QG) + println(i, " ", j, " ", describe(G), ": ", locally_free_class_group(ZG)) +end + +# output +┌ Warning: Assignment to `G` in soft scope is ambiguous because a global variable by the same name exists: `G` will be treated as a new local. Disambiguate by using `local G` to suppress this warning or `global G` to assign to the existing global variable. +└ @ none:2 +6 1 S3: Z/1 +8 3 D8: Z/1 +8 4 Q8: Z/2 diff --git a/test/book/cornerstones/number-theory/galoismod_2.jlcon b/test/book/cornerstones/number-theory/galoismod_2.jlcon new file mode 100644 index 000000000000..652c8cf30ba1 --- /dev/null +++ b/test/book/cornerstones/number-theory/galoismod_2.jlcon @@ -0,0 +1,16 @@ +Qx, x = QQ["x"] +k, = number_field(x^4 - 13*x^2 + 16) +candidates = [] +for F in abelian_normal_extensions(k, [2], ZZ(10)^13) + K, = absolute_simple_field(number_field(F)) + if !is_tamely_ramified(K) + continue + end + if !is_isomorphic(galois_group(K)[1], quaternion_group(8)) + continue + end + push!(candidates, K) +end +# output +┌ Warning: Assignment to `K` in soft scope is ambiguous because a global variable by the same name exists: `K` will be treated as a new local. Disambiguate by using `local K` to suppress this warning or `global K` to assign to the existing global variable. +└ @ none:2 diff --git a/test/book/cornerstones/number-theory/general.jlcon b/test/book/cornerstones/number-theory/general.jlcon new file mode 100644 index 000000000000..9b64bb7af492 --- /dev/null +++ b/test/book/cornerstones/number-theory/general.jlcon @@ -0,0 +1,48 @@ +julia> Qx, x = QQ["x"]; + +julia> K, a = number_field([x^2 - 2, x^2 - 3]); + +julia> a[1]^2 == 2 && a[2]^2 == 3 +true + +julia> k, b = quadratic_field(3); + +julia> kt, t = k["t"]; + +julia> L, c = number_field(t^2 - 2); + +julia> base_field(L) == k +true + +julia> base_field(K) == QQ +true + +julia> degree(K) +4 + +julia> degree(L) +2 + +julia> absolute_degree(K) +4 + +julia> absolute_norm(c) +4 + +julia> f = hom(K, K, [-a[1], -a[2]]); + +julia> f(a[1]) == -a[1] && f(a[2]) == -a[2] +true + +julia> g = hom(L, L, hom(k, k, -b), -c); + +julia> g(c) == -c && g(L(b)) == L(-b) +true + +julia> Lprime, LprimetoL = absolute_simple_field(L); + +julia> defining_polynomial(Lprime) +x^4 - 10*x^2 + 1 + +julia> C, _ = class_group(ring_of_integers(Lprime)); order(C) +1 diff --git a/test/book/cornerstones/number-theory/intro.jlcon b/test/book/cornerstones/number-theory/intro.jlcon new file mode 100644 index 000000000000..8a7bda27db33 --- /dev/null +++ b/test/book/cornerstones/number-theory/intro.jlcon @@ -0,0 +1,86 @@ +julia> Qx, x = QQ["x"]; + +julia> K, a = number_field(x^2 - 235, "a") +(Number field of degree 2 over QQ, a) + +julia> a^2 - 235 # confirm that a is a root of x^2 - 235 +0 + +julia> b = 2 + 1//3 * a +1//3*a + 2 + +julia> coordinates(b) +2-element Vector{QQFieldElem}: + 2 + 1//3 + +julia> K(x^3 + x + 2) # map the polynomial x^3 + x + 2 to K +236*a + 2 + +julia> degree(K) +2 + +julia> trace(a) +0 + +julia> norm(a) +-235 + +julia> OK = ring_of_integers(K); + +julia> basis(OK) +2-element Vector{AbsSimpleNumFieldOrderElem}: + 1 + a + +julia> discriminant(OK) +940 + +julia> prime_ideals_over(OK, 7) +2-element Vector{AbsSimpleNumFieldOrderIdeal}: + <7, a + 5> + <7, a + 2> + +julia> factor(change_coefficient_ring(GF(7), x^2 - 235)) +1 * (x + 5) * (x + 2) + +julia> factor(a * OK) +Dict{AbsSimpleNumFieldOrderIdeal, Int64} with 2 entries: + <47, a> => 1 + <5, a> => 1 + +julia> A, m = class_group(OK); + +julia> A +Z/6 + +julia> m(zero(A)) # apply m to the neutral element of A +<1, 1> +[...] + +julia> P = prime_ideals_over(OK, 2)[1] +<2, a + 1> +[...] + +julia> preimage(m, P) +Abelian group element [3] + +julia> is_principal_with_data(P^2) +(true, 2) + +julia> P^2 == 2*OK +true + +julia> U, mU = unit_group(OK); + +julia> U +Z/2 x Z + +julia> mU(U[1]), mU(U[2]) +(-1, 3*a + 46) + +julia> preimage(mU, -214841715*a - 3293461126) +Abelian group element [1, 5] + +julia> -214841715*a - 3293461126 == (-1)^1 * (3a + 46)^5 +true diff --git a/test/book/cornerstones/number-theory/intro4.jlcon b/test/book/cornerstones/number-theory/intro4.jlcon new file mode 100644 index 000000000000..3e36ab8464f0 --- /dev/null +++ b/test/book/cornerstones/number-theory/intro4.jlcon @@ -0,0 +1,6 @@ +julia> Qx, x = QQ["x"]; + +julia> K, a = embedded_number_field(x^3 - 2, 1.26); + +julia> 0 < a < 2 +true diff --git a/test/book/cornerstones/number-theory/intro_plot_lattice.jlcon b/test/book/cornerstones/number-theory/intro_plot_lattice.jlcon new file mode 100644 index 000000000000..f309293c0461 --- /dev/null +++ b/test/book/cornerstones/number-theory/intro_plot_lattice.jlcon @@ -0,0 +1,12 @@ +using Plots; +w1, w2 = Complex(1),(sqrt(Complex(-3)) + 1)/2 +pts = filter(z -> max(abs(imag(z)), abs(real(z))) <= 3, + [ a*w1 + b*w2 for a in -5:5 for b in -5:5]); +x = range(0, real(w1) + real(w2), 100); +y1 = (x -> min(sqrt(3)*x, imag(w2))).(x); +y2 = (x -> max(0, sqrt(3)*x - sqrt(3))).(x); +p = scatter(real.(pts), imag.(pts), framestyle=:origin, + legend = false, mc = :red) +plot!(p, x, y1, fillrange = y2, fillalpha = 0.25, color = :blue) +# output +Plot{Plots.GRBackend() n=2} diff --git a/test/book/cornerstones/number-theory/sym.jlcon b/test/book/cornerstones/number-theory/sym.jlcon new file mode 100644 index 000000000000..674d0860a309 --- /dev/null +++ b/test/book/cornerstones/number-theory/sym.jlcon @@ -0,0 +1,72 @@ +julia> Qx, x = QQ["x"]; + +julia> K, a = number_field(x^4 - 13*x^2 + 16, "a"); + +julia> G, m = automorphism_group(PermGroup, K); G # we only print G +Permutation group of degree 4 + +julia> describe(G) +"C2 x C2" + +julia> m(G[1]) +Map + from number field of degree 4 over QQ + to number field of degree 4 over QQ + +julia> m(G[1])(a) +-1//4*a^3 + 13//4*a + +julia> preimage(m, hom(K, K, -a)) +(1,2)(3,4) + +julia> k, a = number_field(x^2 - 18, "a"); kt, t = k["t"]; + +julia> K, b = number_field(t^4 + (a + 6)*t^2 + 2a + 9, "b"); + +julia> G, m = automorphism_group(PermGroup, K); describe(G) +"C4" + +julia> G, m = absolute_automorphism_group(PermGroup, K); describe(G) +"Q8" + +julia> K, a = number_field(x^4 - 2); + +julia> G, mA = automorphism_group(PermGroup, K); + +julia> describe(G) +"C2" + +julia> G, C = galois_group(K); describe(G) +"D8" + +julia> L = splitting_field(x^4 - 2); + +julia> GL, = automorphism_group(PermGroup, L); + +julia> fl, = is_isomorphic(G, GL); fl +true + +julia> N, = normal_closure(K); + +julia> GN, = automorphism_group(PermGroup, N); + +julia> fl, = is_isomorphic(G, GN); fl +true + +julia> rts = roots(C, 2) +4-element Vector{QadicFieldElem}: + (8*11^0 + O(11^2))*a + 8*11^0 + 9*11^1 + O(11^2) + (3*11^0 + 10*11^1 + O(11^2))*a + 7*11^0 + 4*11^1 + O(11^2) + (3*11^0 + 10*11^1 + O(11^2))*a + 3*11^0 + 11^1 + O(11^2) + (8*11^0 + O(11^2))*a + 4*11^0 + 6*11^1 + O(11^2) + +julia> parent(rts[1]) +Unramified extension of 11-adic numbers of degree 2 + +julia> k, = number_field(x^8 + x^7 - 7*x^6 - 23*x^5 + 22*x^4 + 80*x^3 + 99*x^2 + 27*x + 8, "a"); # not appearing in book + +julia> defining_polynomial(k) +x^8 + x^7 - 7*x^6 - 23*x^5 + 22*x^4 + 80*x^3 + 99*x^2 + 27*x + 8 + +julia> describe(galois_group(k)[1]) +"SL(2,3)" diff --git a/test/book/cornerstones/number-theory/sym_1.jlcon b/test/book/cornerstones/number-theory/sym_1.jlcon new file mode 100644 index 000000000000..775c2099a9ce --- /dev/null +++ b/test/book/cornerstones/number-theory/sym_1.jlcon @@ -0,0 +1,9 @@ +Qx, x = QQ["x"] +K, a = number_field(x^9 - 3*x^8 + x^6 + 15*x^5 - 13*x^4 - + 3*x^3 + 4*x - 1, "a") +G, C = galois_group(K) +subsG = subgroups(G) +H = first(H for H in subsG if order(H) == 27) +k, = simplify(fixed_field(C, H)) +# output +(Number field of degree 8 over QQ, Map: k -> number field) diff --git a/test/book/cornerstones/number-theory/unit_log_plot.jlcon b/test/book/cornerstones/number-theory/unit_log_plot.jlcon new file mode 100644 index 000000000000..2128901d99e1 --- /dev/null +++ b/test/book/cornerstones/number-theory/unit_log_plot.jlcon @@ -0,0 +1,10 @@ +using Plots +l(a, b) = (log(abs(a + sqrt(3)*b)), log(abs(a - sqrt(3)*b))) +pts = filter!(z -> maximum(abs.(z)) < 3, + [l(a, b) for a in -50:50 for b in -50:50]) +scatter(pts, framestyle=:origin, leg = false, mc = :blue, alpha = 0.25) +x = range(-3, 3, 100); y = -x; plot!(x, y, color = :black) +units = [ i .* l(2, 1) for i in -2:2] +scatter!(units, color = :red) +# output +Plot{Plots.GRBackend() n=3} diff --git a/test/book/cornerstones/number-theory/unit_plot.jlcon b/test/book/cornerstones/number-theory/unit_plot.jlcon new file mode 100644 index 000000000000..55ae585ec889 --- /dev/null +++ b/test/book/cornerstones/number-theory/unit_plot.jlcon @@ -0,0 +1,12 @@ +using Plots; +pts = [ (a, b) for a in -8:8 for b in -5:5] +x = range(-7.5, 7.5, 500) +y1 = (x -> x^2 - 1 < 0 ? missing : sqrt((x^2 - 1)/3)).(x) +y2 = (x -> sqrt((x^2 + 1)/3)).(x) +scatter(pts, framestyle=:origin, leg = false, mc = :blue, alpha = 0.25) +plot!(x, [y1 -y1 y2 -y2], color = :black) +units = [(1, 0), (-1, 0), (2, 1), (-2, 1), (-2, -1), + (2, -1), (7, 4), (7, -4), (-7, 4), (-7, -4)]; +scatter!(units, color = :red) +# output +Plot{Plots.GRBackend() n=6} diff --git a/test/book/cornerstones/polyhedral-geometry/D222Computation.jlcon b/test/book/cornerstones/polyhedral-geometry/D222Computation.jlcon new file mode 100644 index 000000000000..035139377135 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/D222Computation.jlcon @@ -0,0 +1,12 @@ +julia> C = cube(3, 0, 1); + +julia> R, x, c = polynomial_ring(QQ, :x=>1:3, :c=>(0:1,0:1,0:1)); + +julia> f = sum(prod(x[i]^Int(p[i]) for i=1:3) + * c[(Vector{Int}(p)+[1,1,1])...] for p=lattice_points(C)) +x[1]*x[2]*x[3]*c[1, 1, 1] + x[1]*x[2]*c[1, 1, 0] + x[1]*x[3]*c[1, 0, 1] + x[1]*c[1, 0, 0] + x[2]*x[3]*c[0, 1, 1] + x[2]*c[0, 1, 0] + x[3]*c[0, 0, 1] + c[0, 0, 0] + +julia> I = ideal(R, vcat([derivative(f,t) for t = x], [f])); + +julia> D222 = eliminate(I,x)[1] +c[0, 0, 0]^2*c[1, 1, 1]^2 - 2*c[0, 0, 0]*c[1, 0, 0]*c[0, 1, 1]*c[1, 1, 1] - 2*c[0, 0, 0]*c[0, 1, 0]*c[1, 0, 1]*c[1, 1, 1] - 2*c[0, 0, 0]*c[1, 1, 0]*c[0, 0, 1]*c[1, 1, 1] + 4*c[0, 0, 0]*c[1, 1, 0]*c[1, 0, 1]*c[0, 1, 1] + c[1, 0, 0]^2*c[0, 1, 1]^2 + 4*c[1, 0, 0]*c[0, 1, 0]*c[0, 0, 1]*c[1, 1, 1] - 2*c[1, 0, 0]*c[0, 1, 0]*c[1, 0, 1]*c[0, 1, 1] - 2*c[1, 0, 0]*c[1, 1, 0]*c[0, 0, 1]*c[0, 1, 1] + c[0, 1, 0]^2*c[1, 0, 1]^2 - 2*c[0, 1, 0]*c[1, 1, 0]*c[0, 0, 1]*c[1, 0, 1] + c[1, 1, 0]^2*c[0, 0, 1]^2 diff --git a/test/book/cornerstones/polyhedral-geometry/Explosion.jlcon b/test/book/cornerstones/polyhedral-geometry/Explosion.jlcon new file mode 100644 index 000000000000..697f3e60bc29 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/Explosion.jlcon @@ -0,0 +1,7 @@ +julia> IM = IncidenceMatrix(T); + +julia> V = matrix(QQ, vertices(C)); + +julia> PC = polyhedral_complex(IM,V); + +julia> visualize(PC) diff --git a/test/book/cornerstones/polyhedral-geometry/GKZ_orbits.jlcon b/test/book/cornerstones/polyhedral-geometry/GKZ_orbits.jlcon new file mode 100644 index 000000000000..1524f987593e --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/GKZ_orbits.jlcon @@ -0,0 +1,22 @@ +julia> G = automorphism_group(C)[:on_vertices] +Permutation group of degree 8 + +julia> OrbitRepresentatives= + unique([minimum(gset(G,permuted,[v])) + for v in GKZ_Vectors]) +6-element Vector{Vector{QQFieldElem}}: + [1, 3, 3, 5, 5, 3, 3, 1] + [1, 3, 3, 5, 6, 2, 2, 2] + [1, 3, 4, 4, 6, 2, 1, 3] + [1, 4, 4, 3, 6, 1, 1, 4] + [1, 5, 5, 1, 5, 1, 1, 5] + [2, 2, 2, 6, 6, 2, 2, 2] + +julia> OrbitSizes = + [length( + filter(x->minimum(gset(G,permuted,[x]))==u, + GKZ_Vectors) + ) for u in OrbitRepresentatives]; + +julia> show(OrbitSizes) +[12, 24, 24, 8, 2, 4] diff --git a/test/book/cornerstones/polyhedral-geometry/GT_character.jlcon b/test/book/cornerstones/polyhedral-geometry/GT_character.jlcon new file mode 100644 index 000000000000..62b26c795e11 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/GT_character.jlcon @@ -0,0 +1,5 @@ +julia> dc = demazure_character(lambda,w0) +x1^3*x2*x3 + x1^2*x2^2*x3 + x1*x2^3*x3 + +julia> dc(1,1,1) +3 diff --git a/test/book/cornerstones/polyhedral-geometry/GelfandTsetlinEx.jlcon b/test/book/cornerstones/polyhedral-geometry/GelfandTsetlinEx.jlcon new file mode 100644 index 000000000000..4a2ebaf6aa1b --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/GelfandTsetlinEx.jlcon @@ -0,0 +1,20 @@ +julia> lambda = Partition([3,1,1]) +[3, 1, 1] + +julia> GT = gelfand_tsetlin_polytope(lambda) +Polyhedron in ambient dimension 6 + +julia> lattice_points(GT) +6-element SubObjectIterator{PointVector{ZZRingElem}}: + [3, 1, 1, 1, 1, 1] + [3, 1, 1, 2, 1, 1] + [3, 1, 1, 2, 1, 2] + [3, 1, 1, 3, 1, 1] + [3, 1, 1, 3, 1, 2] + [3, 1, 1, 3, 1, 3] + +julia> ehrhart_polynomial(GT) +2*x^2 + 3*x + 1 + +julia> volume(project_full(GT)) +2 diff --git a/test/book/cornerstones/polyhedral-geometry/SecondaryPolytope.jlcon b/test/book/cornerstones/polyhedral-geometry/SecondaryPolytope.jlcon new file mode 100644 index 000000000000..a98401f22367 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/SecondaryPolytope.jlcon @@ -0,0 +1,41 @@ +julia> C = cube(3,0,1) +Polytope in ambient dimension 3 + +julia> SP = secondary_polytope(C) +Polytope in ambient dimension 8 + +julia> V = point_matrix(vertices(NP))[:, 4:11].+1; + +julia> SP == convex_hull(V) +true + +julia> AllTriangulations = all_triangulations(C); + +julia> Tri_as_SOP = [subdivision_of_points(C,T) + for T in AllTriangulations]; + +julia> GKZ_Vectors = [gkz_vector(T) for T in Tri_as_SOP]; + +julia> SP_from_GKZ = convex_hull(GKZ_Vectors) +Polyhedron in ambient dimension 8 + +julia> SP_from_GKZ == SP +true + +julia> T = AllTriangulations[1] +6-element Vector{Vector{Int64}}: + [1, 2, 3, 5] + [2, 3, 4, 5] + [2, 4, 5, 6] + [3, 4, 5, 7] + [4, 5, 6, 7] + [4, 6, 7, 8] + +julia> S = subdivision_of_points(C,T) +Subdivision of points in ambient dimension 3 + +julia> is_regular(S) +true + +julia> show(min_weights(S)) +[3, 1, 1, 0, 0, 0, 0, 1] diff --git a/test/book/cornerstones/polyhedral-geometry/ch-benchmark.jlcon b/test/book/cornerstones/polyhedral-geometry/ch-benchmark.jlcon new file mode 100644 index 000000000000..a0d13c9801d2 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/ch-benchmark.jlcon @@ -0,0 +1,24 @@ +julia> P = rand_spherical_polytope(6, 500; seed=11) +Polytope in ambient dimension 6 + +julia> Polymake.prefer("ppl") do + @time n_facets(P) + end +205.427732 seconds (7.13 G allocations: 321.966 GiB, 0.68% gc time) +58163 + +julia> P = rand_spherical_polytope(6, 500; seed=11); + +julia> Polymake.prefer("beneath_beyond") do + @time n_facets(P) + end + 61.090983 seconds (335.63 M allocations: 5.309 GiB, 0.08% gc time) +58163 + +julia> P = rand_spherical_polytope(6, 500; seed=11); + +julia> Polymake.prefer("libnormaliz") do + @time n_facets(P) + end + 11.167154 seconds (19.12 M allocations: 811.301 MiB, 0.07% gc time) +58163 diff --git a/test/book/cornerstones/polyhedral-geometry/dodecahedron.jlcon b/test/book/cornerstones/polyhedral-geometry/dodecahedron.jlcon new file mode 100644 index 000000000000..f60f479d3329 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/dodecahedron.jlcon @@ -0,0 +1,8 @@ +julia> D = dodecahedron() +Polytope in ambient dimension 3 with EmbeddedAbsSimpleNumFieldElem type coefficients + +julia> vertices(D)[1] +3-element PointVector{EmbeddedAbsSimpleNumFieldElem}: + 1//2 (0.50) + 1//4*sqrt(5) + 3//4 (1.31) + 0 (0.00) diff --git a/test/book/cornerstones/polyhedral-geometry/g-vector-example.jlcon b/test/book/cornerstones/polyhedral-geometry/g-vector-example.jlcon new file mode 100644 index 000000000000..192fe9c80752 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/g-vector-example.jlcon @@ -0,0 +1,9 @@ +julia> P = rand_spherical_polytope(6,30) +Polytope in ambient dimension 6 + +julia> show(f_vector(P)) +ZZRingElem[30, 336, 1468, 2874, 2568, 856] +julia> show(h_vector(P)) +ZZRingElem[1, 24, 201, 404, 201, 24, 1] +julia> show(g_vector(P)) +ZZRingElem[1, 23, 177, 203] diff --git a/test/book/cornerstones/polyhedral-geometry/g-vectors-upper-bound.jlcon b/test/book/cornerstones/polyhedral-geometry/g-vectors-upper-bound.jlcon new file mode 100644 index 000000000000..95f007329a82 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/g-vectors-upper-bound.jlcon @@ -0,0 +1,45 @@ +julia> min_g2 = minimum(g_vectors[:,1]) +159 + +julia> max_g2 = maximum(g_vectors[:,1]) +192 + +julia> show(upper_bound_g_vector(6,30)) +[1, 23, 276, 2300] + +julia> ub = [ Int(Polymake.polytope.pseudopower(g2,2)) for g2 in min_g2:max_g2 ] +34-element Vector{Int64}: + 990 + 997 + 1005 + 1014 + 1024 + 1035 + 1047 + 1060 + 1074 + 1089 + 1105 + 1122 + 1140 + 1141 + 1143 + 1146 + 1150 + 1155 + 1161 + 1168 + 1176 + 1185 + 1195 + 1206 + 1218 + 1231 + 1245 + 1260 + 1276 + 1293 + 1311 + 1330 + 1331 + 1333 diff --git a/test/book/cornerstones/polyhedral-geometry/g-vectors.jl b/test/book/cornerstones/polyhedral-geometry/g-vectors.jl new file mode 100644 index 000000000000..9718aee61628 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/g-vectors.jl @@ -0,0 +1,17 @@ +n_vertices = 30; +n_samples = 100; +g_vectors = Array{Int32}(undef,n_samples,2); + +for i=1:n_samples + RS = rand_spherical_polytope(6,n_vertices) + g = g_vector(RS) + g_vectors[i,1] = g[3] # notice index shift as Julia counts from 1 + g_vectors[i,2] = g[4] +end + +using Plots +scatter(g_vectors[:,1], g_vectors[:,2], + xlabel="g_2", ylabel="g_3", legend=false); + +# output +Plot{Plots.GRBackend() n=1} diff --git a/test/book/cornerstones/polyhedral-geometry/generalized_gelfand_tsetlin.jlcon b/test/book/cornerstones/polyhedral-geometry/generalized_gelfand_tsetlin.jlcon new file mode 100644 index 000000000000..b0973c574488 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/generalized_gelfand_tsetlin.jlcon @@ -0,0 +1,11 @@ +julia> w0 = @perm (1,3,2) +(1,3,2) + +julia> genGT = gelfand_tsetlin_polytope(lambda,w0) +Polyhedron in ambient dimension 6 + +julia> lattice_points(genGT) +3-element SubObjectIterator{PointVector{ZZRingElem}}: + [3, 1, 1, 3, 1, 1] + [3, 1, 1, 3, 1, 2] + [3, 1, 1, 3, 1, 3] diff --git a/test/book/cornerstones/polyhedral-geometry/hyperdeterminant.jlcon b/test/book/cornerstones/polyhedral-geometry/hyperdeterminant.jlcon new file mode 100644 index 000000000000..1680d72d82f2 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/hyperdeterminant.jlcon @@ -0,0 +1,24 @@ +julia> CubeFacets = [lattice_points(F) for F in faces(C,2)]; + +julia> VariableIndices = [[c+[1,1,1] for c=Vector{Vector{Int}}(F)] + for F=CubeFacets]; + +julia> FacialDeterminants = [c[v[1]...]*c[v[4]...]-c[v[2]...]*c[v[3]...] + for v=VariableIndices] +6-element Vector{QQMPolyRingElem}: + c[0, 0, 0]*c[0, 1, 1] - c[0, 1, 0]*c[0, 0, 1] + c[1, 0, 0]*c[1, 1, 1] - c[1, 1, 0]*c[1, 0, 1] + c[0, 0, 0]*c[1, 0, 1] - c[1, 0, 0]*c[0, 0, 1] + c[0, 1, 0]*c[1, 1, 1] - c[1, 1, 0]*c[0, 1, 1] + c[0, 0, 0]*c[1, 1, 0] - c[1, 0, 0]*c[0, 1, 0] + c[0, 0, 1]*c[1, 1, 1] - c[1, 0, 1]*c[0, 1, 1] + +julia> E222 = D222*prod(FacialDeterminants); + +julia> NP = newton_polytope(E222); + +julia> dim(NP) +4 + +julia> show(f_vector(NP)) +ZZRingElem[74, 152, 100, 22] diff --git a/test/book/cornerstones/polyhedral-geometry/johnson-orbits.jl b/test/book/cornerstones/polyhedral-geometry/johnson-orbits.jl new file mode 100644 index 000000000000..53b8a3509d85 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/johnson-orbits.jl @@ -0,0 +1,7 @@ +orbit_counts = MSet{Int}(); + +for k in 1:92 + J = johnson_solid(k) + Aut = automorphism_group(J)[:on_vertices] + push!(orbit_counts, length(orbits(Aut))) +end diff --git a/test/book/cornerstones/polyhedral-geometry/johnson-orbits.jlcon b/test/book/cornerstones/polyhedral-geometry/johnson-orbits.jlcon new file mode 100644 index 000000000000..e70ec7b213a6 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/johnson-orbits.jlcon @@ -0,0 +1,16 @@ +julia> sort(collect(orbit_counts.dict)) +14-element Vector{Pair{Int64, Int64}}: + 2 => 26 + 3 => 24 + 4 => 17 + 5 => 8 + 7 => 5 + 8 => 2 + 9 => 2 + 12 => 1 + 14 => 1 + 15 => 1 + 17 => 1 + 20 => 1 + 27 => 1 + 29 => 2 diff --git a/test/book/cornerstones/polyhedral-geometry/lp.jlcon b/test/book/cornerstones/polyhedral-geometry/lp.jlcon new file mode 100644 index 000000000000..3e448c0e0b09 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/lp.jlcon @@ -0,0 +1,17 @@ +julia> P = polyhedron([1 5; 2 -1; -1 0; 0 -1], [20,10,0,0]) +Polyhedron in ambient dimension 2 + +julia> LP = linear_program(P, [1,1], convention=:max) +Linear program + max{c*x + k | x in P} +where P is a Polyhedron{QQFieldElem} and + c=Polymake.LibPolymake.Rational[1 1] + k=0 + +julia> optimal_value(LP) +100/11 + +julia> optimal_vertex(LP) +2-element PointVector{QQFieldElem}: + 70//11 + 30//11 diff --git a/test/book/cornerstones/polyhedral-geometry/not-pointed.jlcon b/test/book/cornerstones/polyhedral-geometry/not-pointed.jlcon new file mode 100644 index 000000000000..5c0317e19c89 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/not-pointed.jlcon @@ -0,0 +1,9 @@ +julia> Q = convex_hull([0 0 0], [0 1 0; 0 0 1], [1 0 0]) +Polyhedron in ambient dimension 3 + +julia> vertices(Q) +0-element SubObjectIterator{PointVector{QQFieldElem}} + +julia> minimal_faces(Q) +(base_points = PointVector{QQFieldElem}[[0, 0, 0]], + lineality_basis = RayVector{QQFieldElem}[[1, 0, 0]]) diff --git a/test/book/cornerstones/polyhedral-geometry/pentagon.jlcon b/test/book/cornerstones/polyhedral-geometry/pentagon.jlcon new file mode 100644 index 000000000000..cf96a5f18ba5 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/pentagon.jlcon @@ -0,0 +1,30 @@ +julia> points = [1 0; 1 1; 0 1; -1 0; -1 -1]; + +julia> P = convex_hull(points) +Polyhedron in ambient dimension 2 + +julia> facets(P) +5-element SubObjectIterator{AffineHalfspace{QQFieldElem}} over the Halfspaces of R^2 described by: +-x_1 <= 1 +-x_1 + x_2 <= 1 +x_1 - 2*x_2 <= 1 +x_1 <= 1 +x_2 <= 1 + + +julia> f_vector(P) +2-element Vector{ZZRingElem}: + 5 + 5 + +julia> volume(P) +5//2 + +julia> lattice_points(P) +6-element SubObjectIterator{PointVector{ZZRingElem}}: + [-1, -1] + [-1, 0] + [0, 0] + [0, 1] + [1, 0] + [1, 1] diff --git a/test/book/cornerstones/polyhedral-geometry/perm3.jlcon b/test/book/cornerstones/polyhedral-geometry/perm3.jlcon new file mode 100644 index 000000000000..0dcf3a7c946e --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/perm3.jlcon @@ -0,0 +1,8 @@ +julia> P3 = orbit_polytope([1,2,3,4], symmetric_group(4)) +Polyhedron in ambient dimension 4 + +julia> dim(P3) +3 + +julia> describe(combinatorial_symmetries(P3)) +"C2 x S4" diff --git a/test/book/cornerstones/polyhedral-geometry/platonic.jlcon b/test/book/cornerstones/polyhedral-geometry/platonic.jlcon new file mode 100644 index 000000000000..5be3803224d1 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/platonic.jlcon @@ -0,0 +1,7 @@ +julia> [ f_vector(P) for P in [T, cube(3), cross_polytope(3), dodecahedron(), icosahedron()] ] +5-element Vector{Vector{ZZRingElem}}: + [4, 6, 4] + [8, 12, 6] + [6, 12, 8] + [20, 30, 12] + [12, 30, 20] diff --git a/test/book/cornerstones/polyhedral-geometry/simple_polyhedral_fan.jlcon b/test/book/cornerstones/polyhedral-geometry/simple_polyhedral_fan.jlcon new file mode 100644 index 000000000000..f7984cb4fe48 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/simple_polyhedral_fan.jlcon @@ -0,0 +1,6 @@ +julia> Rays = [1 0; 1 1; 0 1; -1 0; 0 -1]; + +julia> Cones = IncidenceMatrix([[1,2], [2,3], [3,4], [4,5], [5,1]]); + +julia> PF = polyhedral_fan(Cones, Rays) +Polyhedral fan in ambient dimension 2 diff --git a/test/book/cornerstones/polyhedral-geometry/tetrahedron.jlcon b/test/book/cornerstones/polyhedral-geometry/tetrahedron.jlcon new file mode 100644 index 000000000000..e29b98a06afd --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/tetrahedron.jlcon @@ -0,0 +1,9 @@ +julia> T = tetrahedron() +Polytope in ambient dimension 3 + +julia> vertices(T) +4-element SubObjectIterator{PointVector{QQFieldElem}}: + [1, -1, -1] + [-1, 1, -1] + [-1, -1, 1] + [1, 1, 1] diff --git a/test/book/introduction/introduction/julia-jit.jlcon b/test/book/introduction/introduction/julia-jit.jlcon new file mode 100644 index 000000000000..f6f80ee117b2 --- /dev/null +++ b/test/book/introduction/introduction/julia-jit.jlcon @@ -0,0 +1,5 @@ +julia> @time class_group(quadratic_field(7)[1]); + 0.659554 seconds (916.73 k allocations: 60.414 MiB, 4.44% gc time, 94.30% compilation time) + +julia> @time class_group(quadratic_field(11)[1]); + 0.003981 seconds (82.12 k allocations: 4.215 MiB) diff --git a/test/book/introduction/introduction/julia.jlcon b/test/book/introduction/introduction/julia.jlcon new file mode 100644 index 000000000000..cc529139329b --- /dev/null +++ b/test/book/introduction/introduction/julia.jlcon @@ -0,0 +1,102 @@ +julia> R, p = residue_ring(ZZ, 3); + +julia> typeof(R) +zzModRing + +julia> F, p = residue_field(ZZ, 3); + +julia> typeof(F) +FqField + +julia> typeof(2) +Int64 + +julia> 2^100 +0 + +julia> ZZ(2)^100 +1267650600228229401496703205376 + +julia> 1/2 +0.5 + +julia> 1//2 +1//2 + +julia> ccall(:sin, Float64, (Float64,), 1.0) +0.8414709848078965 + +julia> u = Int64[1,2,3,4,5,6]; + +julia> ccall(:memset, Cvoid, (Ptr{Int}, Int, UInt), u, 0, length(u)*sizeof(Int64)) + +julia> show(u) +[0, 0, 0, 0, 0, 0] + +julia> prod(1-1/a^2 for a = 1:100 if is_prime(a)) +0.6090337253995164 + +julia> QQx, x = polynomial_ring(QQ, "x"); + +julia> typeof(x) +QQPolyRingElem + +julia> Ry, y = polynomial_ring(QQ, ["y"]); + +julia> typeof(y) +Vector{QQMPolyRingElem} (alias for Array{QQMPolyRingElem, 1}) + +julia> QQx, x = QQ["x"]; + +julia> function next(a) + return a+1 + end; + +julia> next(2) +3 + +julia> next(x) +x + 1 + +julia> next('a') +'b': ASCII/Unicode U+0062 (category Ll: Letter, lowercase) + +julia> next(sin) +ERROR: MethodError: no method matching +(::typeof(sin), ::Int64) +[...] + +julia> function next(a::typeof(sin)) + return x->a(x)+1 + end; + +julia> next(sin) +#55 (generic function with 1 method) + +julia> ans(1) +1.8414709848078965 + +julia> sin(1)+1 +1.8414709848078965 + +julia> next(cos) +ERROR: MethodError: no method matching +(::typeof(cos), ::Int64) +[...] + +julia> supertype(typeof(sin)) +Function + +julia> supertype(typeof(cos)) +Function + +julia> function next(a::Function) + return x->a(x)+1 + end; + +julia> a = next(next(tan)) +#57 (generic function with 1 method) + +julia> a(1) +3.5574077246549023 + +julia> tan(1)+2 +3.5574077246549023 diff --git a/test/book/introduction/introduction/julia2.jlcon b/test/book/introduction/introduction/julia2.jlcon new file mode 100644 index 000000000000..5c6b208edbf5 --- /dev/null +++ b/test/book/introduction/introduction/julia2.jlcon @@ -0,0 +1,67 @@ +julia> R, mR = quo(ZZ, 2) +(Integers modulo 2, Map: ZZ -> ZZ/(2)) + +julia> S, mS = quo(ZZ, 3) +(Integers modulo 3, Map: ZZ -> ZZ/(3)) + +julia> typeof(R(1)) +zzModRingElem + +julia> typeof(S(1)) +zzModRingElem + +julia> S(1) + R(1) +ERROR: Operations on distinct residue rings not supported +Stacktrace: + [1] error(s::String) + @ Base ./error.jl:35 + [2] check_parent + @ ~/.julia/packages/Nemo/F0iQ2/src/flint/nmod.jl:22 [inlined] + [3] +(x::zzModRingElem, y::zzModRingElem) + @ Nemo ~/.julia/packages/Nemo/F0iQ2/src/flint/nmod.jl:138 +[...] + +julia> one(Int) +1 + +julia> one(Float64) +1.0 + +julia> [S(1) R(1)] +1×2 Matrix{zzModRingElem}: + 1 1 + +julia> dot(ans, ans) +ERROR: Operations on distinct residue rings not supported +Stacktrace: +[...] + +julia> matrix(S, 1, 2, [1, 2]) +[1 2] + +julia> dot(ans, ans) +2 + +julia> det([1 2; 3 4]) +-2.0 + +julia> det(BigInt[1 2; 3 4]) +-2 + +julia> inv(BigInt[1 2; 3 4]) +2×2 Matrix{BigFloat}: + -2.0 1.0 + 1.5 -0.5 + +julia> inv(BigInt[1 2; 0 1]) +2×2 Matrix{BigFloat}: + 1.0 -2.0 + 0.0 1.0 + +julia> inv(ZZ[1 2; 3 4]) +ERROR: Matrix not invertible +[...] + +julia> inv(QQ[1 2; 3 4]) +[ -2 1] +[3//2 -1//2] diff --git a/test/book/introduction/introduction/julia3.jlcon b/test/book/introduction/introduction/julia3.jlcon new file mode 100644 index 000000000000..fedb21d2d37d --- /dev/null +++ b/test/book/introduction/introduction/julia3.jlcon @@ -0,0 +1,21 @@ +julia> Qx,x = QQ[:x] +(Univariate polynomial ring in x over QQ, x) + +julia> QQx, xx = QQ[:x] +(Univariate polynomial ring in x over QQ, x) + +julia> Qx === QQx +true + +julia> x == xx +true + +julia> Qx, x = polynomial_ring(QQ, :x, cached = false) +(Univariate polynomial ring in x over QQ, x) + +julia> Qx == QQx +false + +julia> x + xx +ERROR: Incompatible polynomial rings in polynomial operation +[...] diff --git a/test/book/introduction/julia-jit.jlcon b/test/book/introduction/julia-jit.jlcon new file mode 100644 index 000000000000..f6f80ee117b2 --- /dev/null +++ b/test/book/introduction/julia-jit.jlcon @@ -0,0 +1,5 @@ +julia> @time class_group(quadratic_field(7)[1]); + 0.659554 seconds (916.73 k allocations: 60.414 MiB, 4.44% gc time, 94.30% compilation time) + +julia> @time class_group(quadratic_field(11)[1]); + 0.003981 seconds (82.12 k allocations: 4.215 MiB) diff --git a/test/book/introduction/julia.jlcon b/test/book/introduction/julia.jlcon new file mode 100644 index 000000000000..cc529139329b --- /dev/null +++ b/test/book/introduction/julia.jlcon @@ -0,0 +1,102 @@ +julia> R, p = residue_ring(ZZ, 3); + +julia> typeof(R) +zzModRing + +julia> F, p = residue_field(ZZ, 3); + +julia> typeof(F) +FqField + +julia> typeof(2) +Int64 + +julia> 2^100 +0 + +julia> ZZ(2)^100 +1267650600228229401496703205376 + +julia> 1/2 +0.5 + +julia> 1//2 +1//2 + +julia> ccall(:sin, Float64, (Float64,), 1.0) +0.8414709848078965 + +julia> u = Int64[1,2,3,4,5,6]; + +julia> ccall(:memset, Cvoid, (Ptr{Int}, Int, UInt), u, 0, length(u)*sizeof(Int64)) + +julia> show(u) +[0, 0, 0, 0, 0, 0] + +julia> prod(1-1/a^2 for a = 1:100 if is_prime(a)) +0.6090337253995164 + +julia> QQx, x = polynomial_ring(QQ, "x"); + +julia> typeof(x) +QQPolyRingElem + +julia> Ry, y = polynomial_ring(QQ, ["y"]); + +julia> typeof(y) +Vector{QQMPolyRingElem} (alias for Array{QQMPolyRingElem, 1}) + +julia> QQx, x = QQ["x"]; + +julia> function next(a) + return a+1 + end; + +julia> next(2) +3 + +julia> next(x) +x + 1 + +julia> next('a') +'b': ASCII/Unicode U+0062 (category Ll: Letter, lowercase) + +julia> next(sin) +ERROR: MethodError: no method matching +(::typeof(sin), ::Int64) +[...] + +julia> function next(a::typeof(sin)) + return x->a(x)+1 + end; + +julia> next(sin) +#55 (generic function with 1 method) + +julia> ans(1) +1.8414709848078965 + +julia> sin(1)+1 +1.8414709848078965 + +julia> next(cos) +ERROR: MethodError: no method matching +(::typeof(cos), ::Int64) +[...] + +julia> supertype(typeof(sin)) +Function + +julia> supertype(typeof(cos)) +Function + +julia> function next(a::Function) + return x->a(x)+1 + end; + +julia> a = next(next(tan)) +#57 (generic function with 1 method) + +julia> a(1) +3.5574077246549023 + +julia> tan(1)+2 +3.5574077246549023 diff --git a/test/book/introduction/julia2.jlcon b/test/book/introduction/julia2.jlcon new file mode 100644 index 000000000000..5c6b208edbf5 --- /dev/null +++ b/test/book/introduction/julia2.jlcon @@ -0,0 +1,67 @@ +julia> R, mR = quo(ZZ, 2) +(Integers modulo 2, Map: ZZ -> ZZ/(2)) + +julia> S, mS = quo(ZZ, 3) +(Integers modulo 3, Map: ZZ -> ZZ/(3)) + +julia> typeof(R(1)) +zzModRingElem + +julia> typeof(S(1)) +zzModRingElem + +julia> S(1) + R(1) +ERROR: Operations on distinct residue rings not supported +Stacktrace: + [1] error(s::String) + @ Base ./error.jl:35 + [2] check_parent + @ ~/.julia/packages/Nemo/F0iQ2/src/flint/nmod.jl:22 [inlined] + [3] +(x::zzModRingElem, y::zzModRingElem) + @ Nemo ~/.julia/packages/Nemo/F0iQ2/src/flint/nmod.jl:138 +[...] + +julia> one(Int) +1 + +julia> one(Float64) +1.0 + +julia> [S(1) R(1)] +1×2 Matrix{zzModRingElem}: + 1 1 + +julia> dot(ans, ans) +ERROR: Operations on distinct residue rings not supported +Stacktrace: +[...] + +julia> matrix(S, 1, 2, [1, 2]) +[1 2] + +julia> dot(ans, ans) +2 + +julia> det([1 2; 3 4]) +-2.0 + +julia> det(BigInt[1 2; 3 4]) +-2 + +julia> inv(BigInt[1 2; 3 4]) +2×2 Matrix{BigFloat}: + -2.0 1.0 + 1.5 -0.5 + +julia> inv(BigInt[1 2; 0 1]) +2×2 Matrix{BigFloat}: + 1.0 -2.0 + 0.0 1.0 + +julia> inv(ZZ[1 2; 3 4]) +ERROR: Matrix not invertible +[...] + +julia> inv(QQ[1 2; 3 4]) +[ -2 1] +[3//2 -1//2] diff --git a/test/book/introduction/julia3.jlcon b/test/book/introduction/julia3.jlcon new file mode 100644 index 000000000000..fedb21d2d37d --- /dev/null +++ b/test/book/introduction/julia3.jlcon @@ -0,0 +1,21 @@ +julia> Qx,x = QQ[:x] +(Univariate polynomial ring in x over QQ, x) + +julia> QQx, xx = QQ[:x] +(Univariate polynomial ring in x over QQ, x) + +julia> Qx === QQx +true + +julia> x == xx +true + +julia> Qx, x = polynomial_ring(QQ, :x, cached = false) +(Univariate polynomial ring in x over QQ, x) + +julia> Qx == QQx +false + +julia> x + xx +ERROR: Incompatible polynomial rings in polynomial operation +[...] diff --git a/test/book/ordered_examples.json b/test/book/ordered_examples.json new file mode 100644 index 000000000000..b94e54ca909b --- /dev/null +++ b/test/book/ordered_examples.json @@ -0,0 +1 @@ +{"_ns":{"Oscar":["https://github.com/oscar-system/Oscar.jl","1.0.0"]},"_type":{"name":"Dict","params":{"key_type":"String","specialized/boehm-breuer-git-fans":{"name":"Vector","params":"String"},"specialized/markwig-ristau-schleis-faithful-tropicalization":{"name":"Vector","params":"String"},"specialized/holt-ren-tropical-geometry":{"name":"Vector","params":"String"},"specialized/bies-turner-string-theory-applications":{"name":"Vector","params":"String"},"specialized/aga-boehm-hoffmann-markwig-traore":{"name":"Vector","params":"String"},"specialized/joswig-kastner-lorenz-confirmable-workflows":{"name":"Vector","params":"String"},"cornerstones/number-theory":{"name":"Vector","params":"String"},"cornerstones/groups":{"name":"Vector","params":"String"},"introduction/introduction":{"name":"Vector","params":"String"},"specialized/eder-mohr-ideal-theoretic":{"name":"Vector","params":"String"},"specialized/kuehne-schroeter-matroids":{"name":"Vector","params":"String"},"cornerstones/polyhedral-geometry":{"name":"Vector","params":"String"},"specialized/rose-sturmfels-telen-tropical-implicitization":{"name":"Vector","params":"String"},"specialized/flake-fourier-monomial-bases":{"name":"Vector","params":"String"},"specialized/brandhorst-zach-fibration-hopping":{"name":"Vector","params":"String"},"specialized/breuer-nebe-parker-orthogonal-discriminants":{"name":"Vector","params":"String"},"cornerstones/algebraic-geometry":{"name":"Vector","params":"String"},"specialized/decker-schmitt-invariant-theory":{"name":"Vector","params":"String"},"specialized/bies-kastner-toric-geometry":{"name":"Vector","params":"String"}}},"data":{"specialized/boehm-breuer-git-fans":["explG25_1.jlcon","explG25_2.jlcon","explG25_2A.jlcon","explG25_3.jlcon","explG25_3A.jlcon","explG25_4.jlcon","explG25_5.jlcon","explG25_6.jlcon","explG25_7.jlcon","explG25_8.jlcon"],"specialized/markwig-ristau-schleis-faithful-tropicalization":["draw_hypersurface.jlcon","vertices_P2.jlcon","vertices_P1.jlcon","eliminate_xz.jlcon","eliminate_yz.jlcon"],"specialized/holt-ren-tropical-geometry":["semiring.jlcon","matrixAndPoly.jlcon","det.jlcon","semiringMaps1.jlcon","semiringMaps2.jlcon","semiringMaps3.jlcon","groebner.jlcon","variety.jlcon","hypersurface1.jlcon","hypersurface2.jlcon","hypersurface3.jlcon","linearSpace1.jlcon","linearSpace2.jlcon","linearSpace3.jlcon","curve1.jlcon","curve2.jlcon","intersection.jlcon","grc.jlcon"],"specialized/bies-turner-string-theory-applications":["SU5.jlcon","SU5-2.jlcon"],"specialized/aga-boehm-hoffmann-markwig-traore":["graphname.jlcon","Caterpillar3.jlcon"],"specialized/joswig-kastner-lorenz-confirmable-workflows":["versioninfo.jlcon","polynomial-load.jlcon","snf.jlcon"],"cornerstones/number-theory":["intro.jlcon","intro_plot_lattice.jlcon","unit_plot.jlcon","unit_log_plot.jlcon","general.jlcon","embeddings.jlcon","intro4.jlcon","sym.jlcon","sym_1.jlcon","cohenlenstra.jlcon","galoismod.jlcon","galoismod_1.jlcon","galoismod_2.jlcon"],"cornerstones/groups":["intro.jlcon","actions.jlcon","explSL25.jlcon","chars.jlcon","extensions.jlcon","cohomology.jlcon","reps.jlcon","genchar.jlcon"],"introduction/introduction":["julia.jlcon","julia-jit.jlcon","julia2.jlcon","julia3.jlcon"],"specialized/eder-mohr-ideal-theoretic":["hilbert.jlcon","gbeliminate.jlcon","fglm.jlcon","realsols.jlcon","nonproper.jlcon","whitney.jlcon","combinatorics.jlcon","lcis.jlcon"],"specialized/kuehne-schroeter-matroids":["basics.jlcon","realization_space.jlcon","ChowRings.jlcon"],"cornerstones/polyhedral-geometry":["pentagon.jlcon","lp.jlcon","tetrahedron.jlcon","platonic.jlcon","dodecahedron.jlcon","johnson-orbits.jl","johnson-orbits.jlcon","perm3.jlcon","not-pointed.jlcon","simple_polyhedral_fan.jlcon","g-vector-example.jlcon","g-vectors.jl","g-vectors-upper-bound.jlcon","GelfandTsetlinEx.jlcon","generalized_gelfand_tsetlin.jlcon","GT_character.jlcon","D222Computation.jlcon","hyperdeterminant.jlcon","SecondaryPolytope.jlcon","Explosion.jlcon","GKZ_orbits.jlcon","ch-benchmark.jlcon"],"specialized/rose-sturmfels-telen-tropical-implicitization":["gen_impl.jlcon","hyperdet.jlcon","get_hyperdet.jlcon","pol_from_surface.jlcon","coeffs_fin.jlcon","triang.jlcon","chow_fan.jlcon","chow_transl.jlcon"],"specialized/flake-fourier-monomial-bases":["get-operators.jlcon","basis.jlcon","fflv.jlcon","string.jlcon","lusztig.jlcon","nz.jlcon"],"specialized/brandhorst-zach-fibration-hopping":["vinberg_1.jlcon","vinberg_2.jlcon","vinberg_3.jlcon"],"specialized/breuer-nebe-parker-orthogonal-discriminants":["expl_order.jlcon","expl_ev.jlcon","expl_specht.jlcon","expl_syl.jlcon","expl_G23_tbl.jlcon","expl_G23_info.jlcon","expl_ray_class.jlcon","expl_nongalois.jlcon","expl_od_odd.jlcon","expl_plusminus.jlcon"],"cornerstones/algebraic-geometry":["ex11.jlcon","ex11dist.jlcon","default.jlcon","ex-primdec.jlcon","ex-dim.jlcon","circlepar.jlcon","twocusps.jlcon","delta.jlcon","ex21.jlcon","ex21a.jlcon","ex21b.jlcon","ex23.jlcon","ex23a.jlcon","param.jlcon","ex32.jlcon","exres.jlcon","hilbert-polynomial.jlcon","exres2.jlcon","ex314.jlcon","char3-surface-1.jlcon","char3-surface-2.jlcon","alexander-surface.jlcon","dual_curve_function.jlcon","dualcurve.jlcon","monodromy.jlcon","canonicalimage.jlcon","deformation.jlcon","zariski.jlcon"],"specialized/decker-schmitt-invariant-theory":["sym.jlcon","H3.jlcon","bertin.jlcon","klein.jlcon","gleason.jlcon","nakajima.jlcon","LR-inv.jlcon","cox_ring.jlcon"],"specialized/bies-kastner-toric-geometry":["cyclic.jlcon","normal_fan_square.jlcon","cube.jlcon","p2.jlcon","chow_ring.jlcon","polyhedral_fan.jlcon","p1xp1_cohomologies.jlcon","p1xp1_vanishing_sets.jlcon","glsm.jlcon","starsubdivision.jlcon"]}} \ No newline at end of file diff --git a/test/book/specialized/aga-boehm-hoffmann-markwig-traore/Caterpillar3.jlcon b/test/book/specialized/aga-boehm-hoffmann-markwig-traore/Caterpillar3.jlcon new file mode 100644 index 000000000000..21b8ba613c49 --- /dev/null +++ b/test/book/specialized/aga-boehm-hoffmann-markwig-traore/Caterpillar3.jlcon @@ -0,0 +1,20 @@ +julia> using GromovWitten + +julia> G = feynman_graph([(1, 3),(1, 2),(1, 2),(2, 4),(3, 4),(3, 4)]) +FeynmanGraph([(1, 3), (1, 2), (1, 2), (2, 4), (3, 4), (3, 4)]) + +julia> F = feynman_integral(G); + +julia> a = [0, 2, 1, 0, 0, 1]; + +julia> feynman_integral_branch_type(F, a) +256*q[2]^4*q[3]^2*q[6]^2 + +julia> feynman_integral_degree(F, 3) +288*q[1]^6 + 32*q[1]^4*q[2]^2 + 32*q[1]^4*q[3]^2 + 32*q[1]^4*q[5]^2 + 32*q[1]^4*q[6]^2 + 8*q[1]^2*q[2]^2*q[5]^2 + 8*q[1]^2*q[2]^2*q[6]^2 + 8*q[1]^2*q[3]^2*q[5]^2 + 8*q[1]^2*q[3]^2*q[6]^2 + 24*q[2]^6 + 152*q[2]^4*q[3]^2 + 8*q[2]^4*q[5]^2 + 8*q[2]^4*q[6]^2 + 152*q[2]^2*q[3]^4 + 32*q[2]^2*q[3]^2*q[5]^2 + 32*q[2]^2*q[3]^2*q[6]^2 + 32*q[2]^2*q[4]^4 + 8*q[2]^2*q[4]^2*q[5]^2 + 8*q[2]^2*q[4]^2*q[6]^2 + 8*q[2]^2*q[5]^4 + 32*q[2]^2*q[5]^2*q[6]^2 + 8*q[2]^2*q[6]^4 + 24*q[3]^6 + 8*q[3]^4*q[5]^2 + 8*q[3]^4*q[6]^2 + 32*q[3]^2*q[4]^4 + 8*q[3]^2*q[4]^2*q[5]^2 + 8*q[3]^2*q[4]^2*q[6]^2 + 8*q[3]^2*q[5]^4 + 32*q[3]^2*q[5]^2*q[6]^2 + 8*q[3]^2*q[6]^4 + 288*q[4]^6 + 32*q[4]^4*q[5]^2 + 32*q[4]^4*q[6]^2 + 24*q[5]^6 + 152*q[5]^4*q[6]^2 + 152*q[5]^2*q[6]^4 + 24*q[6]^6 + +julia> f = feynman_integral_degree_sum(F, 3) +288*q[1]^6 + 32*q[1]^4*q[2]^2 + 32*q[1]^4*q[3]^2 + 32*q[1]^4*q[5]^2 + 32*q[1]^4*q[6]^2 + 8*q[1]^4 + 8*q[1]^2*q[2]^2*q[5]^2 + 8*q[1]^2*q[2]^2*q[6]^2 + 8*q[1]^2*q[3]^2*q[5]^2 + 8*q[1]^2*q[3]^2*q[6]^2 + 24*q[2]^6 + 152*q[2]^4*q[3]^2 + 8*q[2]^4*q[5]^2 + 8*q[2]^4*q[6]^2 + 152*q[2]^2*q[3]^4 + 32*q[2]^2*q[3]^2*q[5]^2 + 32*q[2]^2*q[3]^2*q[6]^2 + 8*q[2]^2*q[3]^2 + 32*q[2]^2*q[4]^4 + 8*q[2]^2*q[4]^2*q[5]^2 + 8*q[2]^2*q[4]^2*q[6]^2 + 8*q[2]^2*q[5]^4 + 32*q[2]^2*q[5]^2*q[6]^2 + 8*q[2]^2*q[6]^4 + 24*q[3]^6 + 8*q[3]^4*q[5]^2 + 8*q[3]^4*q[6]^2 + 32*q[3]^2*q[4]^4 + 8*q[3]^2*q[4]^2*q[5]^2 + 8*q[3]^2*q[4]^2*q[6]^2 + 8*q[3]^2*q[5]^4 + 32*q[3]^2*q[5]^2*q[6]^2 + 8*q[3]^2*q[6]^4 + 288*q[4]^6 + 32*q[4]^4*q[5]^2 + 32*q[4]^4*q[6]^2 + 8*q[4]^4 + 24*q[5]^6 + 152*q[5]^4*q[6]^2 + 152*q[5]^2*q[6]^4 + 8*q[5]^2*q[6]^2 + 24*q[6]^6 + +julia> substitute(f) +1792*q[1]^6 + 32*q[1]^4 diff --git a/test/book/specialized/aga-boehm-hoffmann-markwig-traore/graphname.jlcon b/test/book/specialized/aga-boehm-hoffmann-markwig-traore/graphname.jlcon new file mode 100644 index 000000000000..bfd43419c4b7 --- /dev/null +++ b/test/book/specialized/aga-boehm-hoffmann-markwig-traore/graphname.jlcon @@ -0,0 +1,9 @@ +julia> using GromovWitten + +julia> G = feynman_graph([(1,2),(1,2),(1,2)]); + +julia> G = feynman_graph([(1,2),(1,2),(2,4),(1,3),(3,4),(3,4)]); + +julia> G = feynman_graph([(1,2),(1,2),(1,3),(2,4),(3,4),(3,5),(4,6),(5,6),(5,6)]); + +julia> G = feynman_graph([(1,2),(1,3),(1,4),(2,4),(2,3),(3,4)]); diff --git a/test/book/specialized/bies-kastner-toric-geometry/chow_ring.jlcon b/test/book/specialized/bies-kastner-toric-geometry/chow_ring.jlcon new file mode 100644 index 000000000000..383047642281 --- /dev/null +++ b/test/book/specialized/bies-kastner-toric-geometry/chow_ring.jlcon @@ -0,0 +1,20 @@ +julia> v = normal_toric_variety(IncidenceMatrix([[1], [2], [3]]), [[1, 0], [0, 1], [-1, -1]]) +Normal toric variety + +julia> is_complete(v) +false + +julia> chow_ring(v) +Quotient + of multivariate polynomial ring in 3 variables x1, x2, x3 + over rational field + by ideal (x1 - x3, x2 - x3, x1*x2, x1*x3, x2*x3) + +julia> M = cycle_matroid(complete_graph(3)) +Matroid of rank 2 on 3 elements + +julia> chow_ring(M) +Quotient + of multivariate polynomial ring in 3 variables x_{Edge(2, 1)}, x_{Edge(3, 1)}, x_{Edge(3, 2)} + over rational field + by ideal with 5 generators diff --git a/test/book/specialized/bies-kastner-toric-geometry/cube.jlcon b/test/book/specialized/bies-kastner-toric-geometry/cube.jlcon new file mode 100644 index 000000000000..03fbed21f16b --- /dev/null +++ b/test/book/specialized/bies-kastner-toric-geometry/cube.jlcon @@ -0,0 +1,5 @@ +julia> c = cube(3) +Polytope in ambient dimension 3 + +julia> tv = normal_toric_variety(c) +Normal toric variety diff --git a/test/book/specialized/bies-kastner-toric-geometry/cyclic.jlcon b/test/book/specialized/bies-kastner-toric-geometry/cyclic.jlcon new file mode 100644 index 000000000000..d54bfd244832 --- /dev/null +++ b/test/book/specialized/bies-kastner-toric-geometry/cyclic.jlcon @@ -0,0 +1,15 @@ +julia> sigma = positive_hull([1 0; -1 2]) +Polyhedral cone in ambient dimension 2 + +julia> Usigma = affine_normal_toric_variety(sigma) +Normal toric variety + +julia> toric_ideal(Usigma) +Ideal generated by + -x1*x2 + x3^2 + +julia> hilbert_basis(weight_cone(Usigma)) +3-element SubObjectIterator{PointVector{ZZRingElem}}: + [2, 1] + [0, 1] + [1, 1] diff --git a/test/book/specialized/bies-kastner-toric-geometry/glsm.jlcon b/test/book/specialized/bies-kastner-toric-geometry/glsm.jlcon new file mode 100644 index 000000000000..2d37bac55fdc --- /dev/null +++ b/test/book/specialized/bies-kastner-toric-geometry/glsm.jlcon @@ -0,0 +1,8 @@ +julia> normal_toric_varieties_from_glsm([[1,1,1]]) +1-element Vector{NormalToricVariety}: + Normal toric variety + +julia> normal_toric_varieties_from_glsm([[1,1,-1,-1]]) +2-element Vector{NormalToricVariety}: + Normal toric variety + Normal toric variety diff --git a/test/book/specialized/bies-kastner-toric-geometry/normal_fan_square.jlcon b/test/book/specialized/bies-kastner-toric-geometry/normal_fan_square.jlcon new file mode 100644 index 000000000000..5aaaab8dc660 --- /dev/null +++ b/test/book/specialized/bies-kastner-toric-geometry/normal_fan_square.jlcon @@ -0,0 +1,12 @@ +julia> R = [1 0; 0 -1; -1 0; 0 1]; + +julia> IM = IncidenceMatrix([[1,2],[2,3],[3,4],[1,4]]); + +julia> ntv = normal_toric_variety(IM, R) +Normal toric variety + +julia> is_complete(ntv) +true + +julia> is_smooth(ntv) +true diff --git a/test/book/specialized/bies-kastner-toric-geometry/p1xp1_cohomologies.jlcon b/test/book/specialized/bies-kastner-toric-geometry/p1xp1_cohomologies.jlcon new file mode 100644 index 000000000000..2971bee5b265 --- /dev/null +++ b/test/book/specialized/bies-kastner-toric-geometry/p1xp1_cohomologies.jlcon @@ -0,0 +1,8 @@ +julia> P1 = projective_space(NormalToricVariety,1) +Normal toric variety + +julia> l = toric_line_bundle(P1*P1, [-3,1]) +Toric line bundle on a normal toric variety + +julia> cohomology(l, 1) +4 diff --git a/test/book/specialized/bies-kastner-toric-geometry/p1xp1_vanishing_sets.jlcon b/test/book/specialized/bies-kastner-toric-geometry/p1xp1_vanishing_sets.jlcon new file mode 100644 index 000000000000..4d412ab3c970 --- /dev/null +++ b/test/book/specialized/bies-kastner-toric-geometry/p1xp1_vanishing_sets.jlcon @@ -0,0 +1,24 @@ +julia> P1 = projective_space(NormalToricVariety,1) +Normal toric variety + +julia> v0, v1, v2 = vanishing_sets(P1*P1) +3-element Vector{ToricVanishingSet}: + Toric vanishing set for cohomology indices [0] + Toric vanishing set for cohomology indices [1] + Toric vanishing set for cohomology indices [2] + +julia> print_constraints(polyhedra(v0)[1]) +-x_1 <= 0 +-x_2 <= 0 + +julia> print_constraints(polyhedra(v1)[1]) +-x_2 <= 0 +x_1 <= -2 + +julia> print_constraints(polyhedra(v1)[2]) +-x_1 <= 0 +x_2 <= -2 + +julia> print_constraints(polyhedra(v2)[1]) +x_2 <= -2 +x_1 <= -2 diff --git a/test/book/specialized/bies-kastner-toric-geometry/p2.jlcon b/test/book/specialized/bies-kastner-toric-geometry/p2.jlcon new file mode 100644 index 000000000000..7abc591a9cd1 --- /dev/null +++ b/test/book/specialized/bies-kastner-toric-geometry/p2.jlcon @@ -0,0 +1,12 @@ +julia> PP2 = projective_space(NormalToricVariety, 2) +Normal toric variety + +julia> irrelevant_ideal(PP2) +Ideal generated by + x3 + x1 + x2 + +julia> stanley_reisner_ideal(PP2) +Ideal generated by + x1*x2*x3 diff --git a/test/book/specialized/bies-kastner-toric-geometry/polyhedral_fan.jlcon b/test/book/specialized/bies-kastner-toric-geometry/polyhedral_fan.jlcon new file mode 100644 index 000000000000..b9ebde553b16 --- /dev/null +++ b/test/book/specialized/bies-kastner-toric-geometry/polyhedral_fan.jlcon @@ -0,0 +1,23 @@ +julia> pp1 = projective_space(NormalToricVariety, 1) +Normal toric variety + +julia> tv = pp1 * pp1 +Normal toric variety + +julia> rays(tv) +4-element SubObjectIterator{RayVector{QQFieldElem}}: + [1, 0] + [-1, 0] + [0, 1] + [0, -1] + +julia> maximal_cones(IncidenceMatrix, tv) +4×4 IncidenceMatrix +[1, 3] +[1, 4] +[2, 3] +[2, 4] + + +julia> Sigma = polyhedral_fan(tv) +Polyhedral fan in ambient dimension 2 diff --git a/test/book/specialized/bies-kastner-toric-geometry/starsubdivision.jlcon b/test/book/specialized/bies-kastner-toric-geometry/starsubdivision.jlcon new file mode 100644 index 000000000000..3279c6193f74 --- /dev/null +++ b/test/book/specialized/bies-kastner-toric-geometry/starsubdivision.jlcon @@ -0,0 +1,41 @@ +julia> rs = [1 1; -1 1]; + +julia> max_cones = IncidenceMatrix([[1,2]]); + +julia> v = normal_toric_variety(IncidenceMatrix([[1,2]]), [1 1; -1 1]); + +julia> set_coordinate_names(v, ["u1", "u2"]) + +julia> is_smooth(v) +false + +julia> toric_ideal(v) +Ideal generated by + -x1*x2 + x3^2 + +julia> rays(maximal_cones(v)[1]) +2-element SubObjectIterator{RayVector{QQFieldElem}}: + [1, 1] + [-1, 1] + +julia> bu = blow_up(v, [0,1]) +Toric blowdown morphism + +julia> v2 = domain(bu) +Normal toric variety + +julia> is_smooth(v2) +true + +julia> is_affine(v2) +false + +julia> cox_ring(v2) +Multivariate polynomial ring in 3 variables over QQ graded by + u1 -> [1] + u2 -> [1] + e -> [-2] + +julia> stanley_reisner_ideal(v2) +Ideal generated by + u1*u2 diff --git a/test/book/specialized/bies-turner-string-theory-applications/SU5-2.jlcon b/test/book/specialized/bies-turner-string-theory-applications/SU5-2.jlcon new file mode 100644 index 000000000000..98cb9c604347 --- /dev/null +++ b/test/book/specialized/bies-turner-string-theory-applications/SU5-2.jlcon @@ -0,0 +1,28 @@ +julia> B3 = projective_space(NormalToricVariety, 3) +Normal toric variety + +julia> W = torusinvariant_prime_divisors(B3)[1] +Torus-invariant, prime divisor on a normal toric variety + +julia> t = literature_model(arxiv_id = "1109.3454", equation = "3.1", base_space = B3, model_sections = Dict("w" => W), completeness_check = false) +Construction over concrete base may lead to singularity enhancement. Consider computing singular_loci. However, this may take time! + +Global Tate model over a concrete base -- SU(5)xU(1) restricted Tate model based on arXiv paper 1109.3454 Eq. (3.1) + +julia> t5 = resolve(t, 1) +Partially resolved global Tate model over a concrete base -- SU(5)xU(1) restricted Tate model based on arXiv paper 1109.3454 Eq. (3.1) + +julia> cox_ring(ambient_space(t5)) +Multivariate polynomial ring in 12 variables over QQ graded by + x1 -> [1 0 0 0 0 0 0] + x2 -> [0 1 0 0 0 0 0] + x3 -> [0 1 0 0 0 0 0] + x4 -> [0 1 0 0 0 0 0] + x -> [0 0 1 0 0 0 0] + y -> [0 0 0 1 0 0 0] + z -> [0 0 0 0 1 0 0] + e1 -> [0 0 0 0 0 1 0] + e4 -> [0 0 0 0 0 0 1] + e2 -> [-1 -3 -1 1 -1 -1 0] + e3 -> [0 4 1 -1 1 0 -1] + s -> [2 6 -1 0 2 1 1] diff --git a/test/book/specialized/bies-turner-string-theory-applications/SU5.jlcon b/test/book/specialized/bies-turner-string-theory-applications/SU5.jlcon new file mode 100644 index 000000000000..b5ca8295cd83 --- /dev/null +++ b/test/book/specialized/bies-turner-string-theory-applications/SU5.jlcon @@ -0,0 +1,89 @@ +julia> B3 = projective_space(NormalToricVariety, 3) +Normal toric variety + +julia> cox_ring(B3) +Multivariate polynomial ring in 4 variables over QQ graded by + x1 -> [1] + x2 -> [1] + x3 -> [1] + x4 -> [1] + +julia> Kbar = anticanonical_bundle(B3) +Toric line bundle on a normal toric variety + +julia> W = toric_line_bundle(torusinvariant_prime_divisors(B3)[1]) +Toric line bundle on a normal toric variety + +julia> x1 = basis_of_global_sections(W)[4] +x1 + +julia> a10 = sum([rand(Int) * b for b in basis_of_global_sections(Kbar)]); + +julia> a21 = sum([rand(Int) * b for b in basis_of_global_sections(Kbar^2 * W^(-1))]); + +julia> a32 = sum([rand(Int) * b for b in basis_of_global_sections(Kbar^3 * W^(-2))]); + +julia> a43 = sum([rand(Int) * b for b in basis_of_global_sections(Kbar^4 * W^(-3))]); + +julia> a65 = 0; + +julia> t = global_tate_model(B3, [a10, a21 * x1, a32 * x1^2, a43 * x1^3, a65 * x1^5], completeness_check = false) +Global Tate model over a concrete base + +julia> sing = singular_loci(t); + +julia> length(sing) +2 + +julia> singular_loci(t)[2] +(Ideal (x1), (0, 0, 5), "Split I_5") + +julia> singular_loci(t)[1][2:3] +((0, 0, 1), "I_1") + +julia> amb = ambient_space(t) +Normal toric variety + +julia> cox_ring(amb) +Multivariate polynomial ring in 7 variables over QQ graded by + x1 -> [1 0] + x2 -> [1 0] + x3 -> [1 0] + x4 -> [1 0] + x -> [8 2] + y -> [12 3] + z -> [0 1] + +julia> is_smooth(amb) +false + +julia> t1 = blow_up(t, ["x", "y", "x1"]; coordinate_name = "e1") +Partially resolved global Tate model over a concrete base + +julia> amb1 = ambient_space(t1) +Normal toric variety + +julia> cox_ring(amb1) +Multivariate polynomial ring in 8 variables over QQ graded by + x1 -> [1 0 0] + x2 -> [0 1 0] + x3 -> [0 1 0] + x4 -> [0 1 0] + x -> [1 1 2] + y -> [1 2 3] + z -> [0 -3 1] + e1 -> [-1 1 0] + +julia> t2 = blow_up(t1, ["y", "e1"]; coordinate_name = "e4") +Partially resolved global Tate model over a concrete base + +julia> t3 = blow_up(t2, ["x", "e4"]; coordinate_name = "e2") +Partially resolved global Tate model over a concrete base + +julia> t4 = blow_up(t3, ["y", "e2"]; coordinate_name = "e3") +Partially resolved global Tate model over a concrete base + +julia> t5 = blow_up(t4, ["x", "y"]; coordinate_name = "s") +Partially resolved global Tate model over a concrete base + +julia> tate_polynomial(t5); diff --git a/test/book/specialized/boehm-breuer-git-fans/explG25_1.jlcon b/test/book/specialized/boehm-breuer-git-fans/explG25_1.jlcon new file mode 100644 index 000000000000..36ebb41c8d57 --- /dev/null +++ b/test/book/specialized/boehm-breuer-git-fans/explG25_1.jlcon @@ -0,0 +1,32 @@ +julia> using Oscar.GITFans + +julia> Q = [ + 1 1 0 0 0 + 1 0 1 1 0 + 1 0 1 0 1 + 1 0 0 1 1 + 0 1 0 0 -1 + 0 1 0 -1 0 + 0 1 -1 0 0 + 0 0 1 0 0 + 0 0 0 1 0 + 0 0 0 0 1 + ]; + +julia> n = nrows(Q); + +julia> Qt, T = polynomial_ring(QQ, :T => 1:n); + +julia> D = free_abelian_group(ncols(Q)); + +julia> w = [D(Q[i, :]) for i = 1:n]; + +julia> R, T = grade(Qt, w); + +julia> a = ideal([ + T[5]*T[10] - T[6]*T[9] + T[7]*T[8], + T[1]*T[9] - T[2]*T[7] + T[4]*T[5], + T[1]*T[8] - T[2]*T[6] + T[3]*T[5], + T[1]*T[10] - T[3]*T[7] + T[4]*T[6], + T[2]*T[10] - T[3]*T[9] + T[4]*T[8], + ]); diff --git a/test/book/specialized/boehm-breuer-git-fans/explG25_2.jlcon b/test/book/specialized/boehm-breuer-git-fans/explG25_2.jlcon new file mode 100644 index 000000000000..ad115f355325 --- /dev/null +++ b/test/book/specialized/boehm-breuer-git-fans/explG25_2.jlcon @@ -0,0 +1,18 @@ +julia> perms_list = [ [1,3,2,4,6,5,7,8,10,9], [5,7,1,6,9,2,8,4,10,3] ]; + +julia> sym = symmetric_group(n); + +julia> G, emb = sub([sym(x) for x in perms_list]...); + +julia> G +Permutation group of degree 10 + +julia> describe(G) +"S5" + +julia> iso = isomorphism(G, symmetric_group(5)); + +julia> [iso(x) for x in gens(G)] +2-element Vector{PermGroupElem}: + (1,3) + (1,5,4,3,2) diff --git a/test/book/specialized/boehm-breuer-git-fans/explG25_2A.jlcon b/test/book/specialized/boehm-breuer-git-fans/explG25_2A.jlcon new file mode 100644 index 000000000000..58273042cfbb --- /dev/null +++ b/test/book/specialized/boehm-breuer-git-fans/explG25_2A.jlcon @@ -0,0 +1,17 @@ +julia> matrix_action = GITFans.action_on_target(Q, G) +Group homomorphism + from permutation group of degree 10 and order 120 + to matrix group of degree 5 over QQ + +julia> x = gen(G, 2) +(1,5,9,10,3)(2,7,8,4,6) + +julia> Ax = matrix_action(x) +[-1 1 -1 -1 -2] +[ 1 0 1 1 1] +[ 1 0 0 1 1] +[ 0 0 0 0 1] +[ 1 0 1 0 1] + +julia> matrix(QQ, Q[Vector{Int}(x), 1:5]) == matrix(QQ, Q) * Ax +true diff --git a/test/book/specialized/boehm-breuer-git-fans/explG25_3.jlcon b/test/book/specialized/boehm-breuer-git-fans/explG25_3.jlcon new file mode 100644 index 000000000000..1ef82922cb3f --- /dev/null +++ b/test/book/specialized/boehm-breuer-git-fans/explG25_3.jlcon @@ -0,0 +1,9 @@ +julia> collector_cones = GITFans.orbit_cones(a, Q, G); + +julia> length(collector_cones) +4 + +julia> orbit_list = GITFans.orbit_cone_orbits(collector_cones, matrix_action); + +julia> println(map(length, orbit_list)) +[10, 15, 10, 1] diff --git a/test/book/specialized/boehm-breuer-git-fans/explG25_3A.jlcon b/test/book/specialized/boehm-breuer-git-fans/explG25_3A.jlcon new file mode 100644 index 000000000000..31ed0f7b63fb --- /dev/null +++ b/test/book/specialized/boehm-breuer-git-fans/explG25_3A.jlcon @@ -0,0 +1,6 @@ +julia> perm_actions = GITFans.action_on_orbit_cone_orbits(orbit_list, matrix_action); + +julia> perm_actions[1] +Group homomorphism + from permutation group of degree 10 and order 120 + to permutation group of degree 10 diff --git a/test/book/specialized/boehm-breuer-git-fans/explG25_4.jlcon b/test/book/specialized/boehm-breuer-git-fans/explG25_4.jlcon new file mode 100644 index 000000000000..84cae3c19aa7 --- /dev/null +++ b/test/book/specialized/boehm-breuer-git-fans/explG25_4.jlcon @@ -0,0 +1,10 @@ +julia> q_cone = positive_hull(Q) +Polyhedral cone in ambient dimension 5 + +julia> (hash_list, edges) = GITFans.fan_traversal(orbit_list, q_cone, perm_actions); + +julia> length(hash_list) +6 + +julia> println(edges) +Set([[4, 6], [2, 3], [3, 5], [1, 2], [3, 4]]) diff --git a/test/book/specialized/boehm-breuer-git-fans/explG25_5.jlcon b/test/book/specialized/boehm-breuer-git-fans/explG25_5.jlcon new file mode 100644 index 000000000000..3016d577212a --- /dev/null +++ b/test/book/specialized/boehm-breuer-git-fans/explG25_5.jlcon @@ -0,0 +1,34 @@ +julia> fanobj = GITFans.hashes_to_polyhedral_fan(orbit_list, hash_list, matrix_action) +Polyhedral fan in ambient dimension 5 + +julia> println(f_vector(fanobj)) +ZZRingElem[20, 110, 240, 225, 76] + +julia> c = cones(fanobj, 5)[1] +Polyhedral cone in ambient dimension 5 + +julia> rays(c) +5-element SubObjectIterator{RayVector{QQFieldElem}}: + [0, 1, 0, 0, -1] + [1, 0, 1, 1, 0] + [1, 1, 0, 0, 0] + [1, 1, 0, 1, 0] + [1, 1, 1, 0, 0] + +julia> dim(fanobj) +5 + +julia> n_rays(fanobj) +20 + +julia> n_maximal_cones(fanobj) +76 + +julia> n_cones(fanobj) +671 + +julia> is_pointed(fanobj) +true + +julia> is_complete(fanobj) +false diff --git a/test/book/specialized/boehm-breuer-git-fans/explG25_6.jlcon b/test/book/specialized/boehm-breuer-git-fans/explG25_6.jlcon new file mode 100644 index 000000000000..4bc443aa53c1 --- /dev/null +++ b/test/book/specialized/boehm-breuer-git-fans/explG25_6.jlcon @@ -0,0 +1,2 @@ +julia> fanobj = GITFans.git_fan(a, Q, G) +Polyhedral fan in ambient dimension 5 diff --git a/test/book/specialized/boehm-breuer-git-fans/explG25_7.jlcon b/test/book/specialized/boehm-breuer-git-fans/explG25_7.jlcon new file mode 100644 index 000000000000..474768f73001 --- /dev/null +++ b/test/book/specialized/boehm-breuer-git-fans/explG25_7.jlcon @@ -0,0 +1,14 @@ +julia> expanded = GITFans.orbits_of_maximal_GIT_cones(orbit_list, hash_list, matrix_action); + +julia> orbit_lengths = map(length, expanded); println(orbit_lengths) +[1, 10, 30, 20, 10, 5] + +julia> sum(orbit_lengths) +76 + +julia> maxcones = vcat( expanded... ); + +julia> full_edges = GITFans.edges_intersection_graph(maxcones, size(Q, 2) - 1); + +julia> length(full_edges) +180 diff --git a/test/book/specialized/boehm-breuer-git-fans/explG25_8.jlcon b/test/book/specialized/boehm-breuer-git-fans/explG25_8.jlcon new file mode 100644 index 000000000000..e94ae33825b0 --- /dev/null +++ b/test/book/specialized/boehm-breuer-git-fans/explG25_8.jlcon @@ -0,0 +1,11 @@ +julia> full_graph = Graph{Undirected}(length(maxcones)); + +julia> [add_edge!(full_graph, e...) for e in full_edges]; + +julia> visualize(full_graph) + +julia> orbit_graph = Graph{Undirected}(length(hash_list)); + +julia> [add_edge!(orbit_graph, e...) for e in edges]; + +julia> visualize(orbit_graph) diff --git a/test/book/specialized/brandhorst-zach-fibration-hopping/vinberg_1.jlcon b/test/book/specialized/brandhorst-zach-fibration-hopping/vinberg_1.jlcon new file mode 100644 index 000000000000..2324e16baaa0 --- /dev/null +++ b/test/book/specialized/brandhorst-zach-fibration-hopping/vinberg_1.jlcon @@ -0,0 +1,94 @@ +julia> Qt, t = polynomial_ring(QQ, :t) +(Univariate polynomial ring in t over QQ, t) + +julia> Qtf = fraction_field(Qt) +Fraction field + of univariate polynomial ring in t over QQ + +julia> E = elliptic_curve(Qtf, [0,0,0,0,t^5*(t-1)^2]) +Elliptic curve with equation +y^2 = x^3 + t^7 - 2*t^6 + t^5 + +julia> j_invariant(E) +0 + +julia> discriminant(E) +-432*t^14 + 1728*t^13 - 2592*t^12 + 1728*t^11 - 432*t^10 + +julia> factor(Qt, discriminant(E)) +-432 * (t - 1)^4 * t^10 + +julia> R = rescale(root_lattice([(:E, 8), (:E, 8), (:A, 2)]), -1); + +julia> U = integer_lattice(gram=ZZ[0 1; 1 -2]); + +julia> NS, _ = direct_sum([U, R]); + +julia> e = matrix(ZZ,1,20,ones(Int,20));e[1,1]=51; + +julia> ample = e*inv(gram_matrix(NS)); + +julia> minimum(rescale(orthogonal_submodule(NS, ample),-1)) +4 + +julia> Xaut, Xchambers, Xrational_curves = K3_surface_automorphism_group(NS, ample); + +julia> length(Xrational_curves) +2 + +julia> length(Xchambers) +1 + +julia> C = Xchambers[1] +Chamber in dimension 20 with 36 walls + +julia> Xelliptic_classes = [f for f in rays(C) if 0 == f*gram_matrix(NS)*transpose(f)]; + +julia> Xelliptic_classes_orb = orbits(gset(matrix_group(aut(C)),(x,g)->x*matrix(g), Xelliptic_classes)); + +julia> length(Xelliptic_classes_orb) +6 + +julia> f1 = identity_matrix(ZZ, 20)[1:1,:]; + +julia> f1_2neighbors = [f for f in Xelliptic_classes if 2 == (f1*gram_matrix(NS)*transpose(f))[1,1]]; + +julia> f2, f3, _ = f1_2neighbors; + +julia> f2_2neighbors = [f for f in Xelliptic_classes if 2 == (f2*gram_matrix(NS)*transpose(f))[1,1]]; + +julia> fibers = [f1,f2,f3]; + +julia> todo = [o for o in Xelliptic_classes_orb if !any(f in o for f in fibers)]; + +julia> while length(todo) > 0 + o = popfirst!(todo) + f = findfirst(x-> x in o, f2_2neighbors) + push!(fibers, f2_2neighbors[f]) + end + +julia> fibers = [vec(collect(i*basis_matrix(NS))) for i in fibers] +6-element Vector{Vector{QQFieldElem}}: + [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + [4, 2, -4, -7, -10, -8, -6, -4, -2, -5, -2, -4, -6, -5, -4, -3, -2, -3, -1, -1] + [4, 2, -4, -7, -10, -8, -6, -4, -2, -5, -4, -7, -10, -8, -6, -4, -2, -5, 0, 0] + [6, 3, -5, -10, -15, -12, -9, -6, -3, -8, -5, -10, -15, -12, -9, -6, -3, -8, -1, -1] + [10, 5, -8, -16, -24, -20, -15, -10, -5, -12, -7, -14, -21, -17, -13, -9, -5, -11, -3, -2] + [6, 3, -4, -8, -12, -10, -8, -6, -3, -6, -4, -8, -12, -10, -8, -6, -3, -6, -2, -1] + +julia> [fibration_type(NS, f) for f in fibers] +6-element Vector{Tuple{Int64, FinGenAbGroup, Vector{Tuple{Symbol, Int64}}}}: + (0, Z/1, [(:A, 2), (:E, 8), (:E, 8)]) + (1, Z/2, [(:D, 10), (:E, 7)]) + (0, Z/2, [(:A, 2), (:D, 16)]) + (1, Z/3, [(:A, 17)]) + (0, Z/4, [(:A, 11), (:D, 7)]) + (0, Z/3, [(:E, 6), (:E, 6), (:E, 6)]) + +julia> F = transpose(matrix((reduce(hcat, fibers)))); F * gram_matrix(NS) * transpose(F) +[0 2 2 3 5 3] +[2 0 2 2 2 2] +[2 2 0 2 5 4] +[3 2 2 0 2 3] +[5 2 5 2 0 2] +[3 2 4 3 2 0] diff --git a/test/book/specialized/brandhorst-zach-fibration-hopping/vinberg_2.jlcon b/test/book/specialized/brandhorst-zach-fibration-hopping/vinberg_2.jlcon new file mode 100644 index 000000000000..e5db55dc780c --- /dev/null +++ b/test/book/specialized/brandhorst-zach-fibration-hopping/vinberg_2.jlcon @@ -0,0 +1,193 @@ +julia> K = QQ; + +julia> Kt, t = polynomial_ring(K, :t); + +julia> Ktf = fraction_field(Kt); + +julia> E = elliptic_curve(Ktf, [0,0,0,0,t^5*(t-1)^2]); + +julia> R = rescale(root_lattice([(:E, 8), (:E, 8), (:A, 2)]), -1); + +julia> U = integer_lattice(gram=ZZ[0 1; 1 -2]); + +julia> NS, _ = direct_sum([U, R]); + +julia> e = matrix(ZZ,1,20,ones(Int,20));e[1,1]=51; + +julia> ample = e*inv(gram_matrix(NS)); + +julia> fibers = [vec(collect(i)) for i in [ + QQ[1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;], + QQ[4 2 -4 -7 -10 -8 -6 -4 -2 -5 -2 -4 -6 -5 -4 -3 -2 -3 -1 -1;], + QQ[4 2 -4 -7 -10 -8 -6 -4 -2 -5 -4 -7 -10 -8 -6 -4 -2 -5 0 0;], + QQ[6 3 -5 -10 -15 -12 -9 -6 -3 -8 -5 -10 -15 -12 -9 -6 -3 -8 -1 -1;], + QQ[10 5 -8 -16 -24 -20 -15 -10 -5 -12 -7 -14 -21 -17 -13 -9 -5 -11 -3 -2;], + QQ[6 3 -4 -8 -12 -10 -8 -6 -3 -6 -4 -8 -12 -10 -8 -6 -3 -6 -2 -1;]]]; + +julia> Y1 = elliptic_surface(E, 2) +Elliptic surface + over rational field +with generic fiber + -x^3 + y^2 - t^7 + 2*t^6 - t^5 + +julia> S = weierstrass_model(Y1)[1] +Scheme + over rational field +with default covering + described by patches + 1: scheme(-(x//z)^3 + (y//z)^2 - t^7 + 2*t^6 - t^5) + 2: scheme((z//x)^3*t^7 - 2*(z//x)^3*t^6 + (z//x)^3*t^5 - (z//x)*(y//x)^2 + 1) + 3: scheme((z//y)^3*t^7 - 2*(z//y)^3*t^6 + (z//y)^3*t^5 - (z//y) + (x//y)^3) + 4: scheme((x//z)^3 - (y//z)^2 + s^7 - 2*s^6 + s^5) + 5: scheme((z//x)^3*s^7 - 2*(z//x)^3*s^6 + (z//x)^3*s^5 - (z//x)*(y//x)^2 + 1) + 6: scheme((z//y)^3*s^7 - 2*(z//y)^3*s^6 + (z//y)^3*s^5 - (z//y) + (x//y)^3) + in the coordinate(s) + 1: [(x//z), (y//z), t] + 2: [(z//x), (y//x), t] + 3: [(z//y), (x//y), t] + 4: [(x//z), (y//z), s] + 5: [(z//x), (y//x), s] + 6: [(z//y), (x//y), s] + +julia> piS = weierstrass_contraction(Y1) +Composite morphism of[...] + +julia> basisNSY1, gramTriv = trivial_lattice(Y1); + +julia> [(i[1],i[2]) for i in reducible_fibers(Y1)] +3-element Vector{Tuple{Vector{QQFieldElem}, Tuple{Symbol, Int64}}}: + ([1, 1], (:A, 2)) + ([0, 1], (:E, 8)) + ([1, 0], (:E, 8)) + +julia> basisNSY1, _, NSY1 = algebraic_lattice(Y1); + +julia> basisNSY1 +20-element Vector{Any}: + Fiber over (2, 1) + section: (0 : 1 : 0) + component A2_1 of fiber over (1, 1) + component A2_2 of fiber over (1, 1) + component E8_1 of fiber over (0, 1) + component E8_2 of fiber over (0, 1) + component E8_3 of fiber over (0, 1) + component E8_4 of fiber over (0, 1) + component E8_5 of fiber over (0, 1) + component E8_6 of fiber over (0, 1) + component E8_7 of fiber over (0, 1) + component E8_8 of fiber over (0, 1) + component E8_1 of fiber over (1, 0) + component E8_2 of fiber over (1, 0) + component E8_3 of fiber over (1, 0) + component E8_4 of fiber over (1, 0) + component E8_5 of fiber over (1, 0) + component E8_6 of fiber over (1, 0) + component E8_7 of fiber over (1, 0) + component E8_8 of fiber over (1, 0) + +julia> basisNSY1[1] +Effective weil divisor Fiber over (2, 1) + on elliptic surface with generic fiber -x^3 + y^2 - t^7 + 2*t^6 - t^5 +with coefficients in integer Ring +given as the formal sum of + 1 * sheaf of ideals + +julia> b, I = Oscar._is_equal_up_to_permutation_with_permutation(gram_matrix(NS), gram_matrix(NSY1)) +(true, [1, 2, 19, 20, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]) + +julia> @assert gram_matrix(NSY1) == gram_matrix(NS)[I,I] + +julia> Oscar.horizontal_decomposition(Y1, fibers[2][I])[2] +Effective weil divisor + on elliptic surface with generic fiber -x^3 + y^2 - t^7 + 2*t^6 - t^5 +with coefficients in integer Ring +given as the formal sum of + 2 * component E8_7 of fiber over (0, 1) + 2 * section: (0 : 1 : 0) + 1 * component A2_0 of fiber over (1, 1) + 1 * component E8_0 of fiber over (1, 0) + 2 * component E8_4 of fiber over (0, 1) + 2 * component E8_3 of fiber over (0, 1) + 1 * component E8_2 of fiber over (0, 1) + 2 * component E8_0 of fiber over (0, 1) + 2 * component E8_6 of fiber over (0, 1) + 2 * component E8_5 of fiber over (0, 1) + 1 * component E8_8 of fiber over (0, 1) + +julia> representative(elliptic_parameter(Y1, fibers[2][I])) +(x//z)//(t^3 - t^2) + +julia> g, phi1 = two_neighbor_step(Y1, fibers[2][I]); g +-t^3*x^3 + t^3*x^2 - x + y^2 + +julia> kt2 = base_ring(parent(g)); P = kt2.([0,0]); + +julia> Y2, phi2 = elliptic_surface(g, P); Y2 +Elliptic surface + over rational field +with generic fiber + -x^3 + t^3*x^2 - t^3*x + y^2 +and relatively minimal model + scheme over QQ covered with 47 patches + +julia> E2 = generic_fiber(Y2); t2 = gen(kt2); + +julia> P2 = E2([t2^3, t2^3]); set_mordell_weil_basis!(Y2, [P2]); + +julia> U2 = weierstrass_chart_on_minimal_model(Y2); U1 = weierstrass_chart_on_minimal_model(Y1); + +julia> imgs = phi2.(phi1.(ambient_coordinates(U1))) # k(Y1) -> k(Y2) +3-element Vector{AbstractAlgebra.Generic.Frac{QQMPolyRingElem}}: + (-(x//z)*t + t)//(x//z)^3 + ((x//z)*(y//z) - (y//z))//(x//z)^5 + 1//(x//z) + +julia> phi_rat = morphism_from_rational_functions(Y2, Y1, U2, U1, imgs); + +julia> set_attribute!(phi_rat, :is_isomorphism=>true); + +julia> pullbackDivY1 = [pullback(phi_rat, D) for D in basisNSY1]; + +julia> B = [basis_representation(Y2, D) for D in pullbackDivY1]; +20-element Vector{Vector{QQFieldElem}}: + [4, 2, 0, 0, 0, 0, 0, 0, 0, -4, -4, -8, -7, -6, -5, -4, -3, -2, -1, 0] + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0] + [4, 2, -1, -2, -3, -5//2, -2, -3//2, -3//2, -3, -5//2, -5, -9//2, -4, -7//2, -3, -5//2, -2, -3//2, -1] + [0, 0, 1, 2, 3, 5//2, 2, 3//2, 3//2, -2, -3//2, -3, -5//2, -2, -3//2, -1, -1//2, 0, 1//2, 1] + [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + [1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -2, -2, -2, -2, -2, -2, -2, -1, 0] + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0] + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0] + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0] + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0] + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0] + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0] + [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + [2, 1, -1, -2, -3, -5//2, -2, -3//2, -3//2, -2, -5//2, -4, -7//2, -3, -5//2, -2, -3//2, -1, -1//2, 0] + [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + +julia> B = matrix(QQ, 20, 20, reduce(vcat, B)); NSY2 = algebraic_lattice(Y2)[3]; + +julia> NSY1inY2 = lattice(ambient_space(NSY2),B); + +julia> @assert NSY1inY2 == NSY2 && gram_matrix(NSY1inY2) == gram_matrix(NSY1) + +julia> fibers_in_Y2 = [f[I]*B for f in fibers] +6-element Vector{Vector{QQFieldElem}}: + [4, 2, 0, 0, 0, 0, 0, 0, 0, -4, -4, -8, -7, -6, -5, -4, -3, -2, -1, 0] + [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + [5, 2, -2, -3, -4, -3, -2, -1, -2, -5, -4, -8, -7, -6, -5, -4, -3, -2, -1, 0] + [4, 2, -2, -4, -6, -9//2, -3, -3//2, -7//2, -3, -5//2, -5, -9//2, -4, -7//2, -3, -5//2, -2, -3//2, 0] + [2, 1, -1, -2, -3, -2, -1, 0, -2, -1, -1, -2, -2, -2, -2, -2, -2, -1, 0, 1] + [2, 1, 0, 0, 0, 0, 0, 0, 0, -2, -2, -4, -4, -4, -4, -3, -2, -1, 0, 1] + +julia> f3 = fibers[3][I]; representative(elliptic_parameter(Y1, f3)) +(x//z)//t^2 + +julia> g3a, phi3a = two_neighbor_step(Y1, f3); g3a +-x^3 + (-t^3 + 2)*x^2 - x + y^2 diff --git a/test/book/specialized/brandhorst-zach-fibration-hopping/vinberg_3.jlcon b/test/book/specialized/brandhorst-zach-fibration-hopping/vinberg_3.jlcon new file mode 100644 index 000000000000..c6816e061453 --- /dev/null +++ b/test/book/specialized/brandhorst-zach-fibration-hopping/vinberg_3.jlcon @@ -0,0 +1,84 @@ +julia> K = QQ +Rational field + +julia> Kt, t = polynomial_ring(K, :t) +(Univariate polynomial ring in t over QQ, t) + +julia> Ktf = fraction_field(Kt) +Fraction field + of univariate polynomial ring in t over QQ + +julia> E = elliptic_curve(Ktf, [0, -t^3, 0, t^3, 0]) +Elliptic curve with equation +y^2 = x^3 - t^3*x^2 + t^3*x + +julia> P = E([t^3, t^3]); + +julia> Y2 = elliptic_surface(E, 2, [P]); + +julia> S = weierstrass_model(Y2)[1]; + +julia> basisNSY2, _, NSY2 = algebraic_lattice(Y2); + +julia> fibers_in_Y2 = [QQ.(vec(collect(i))) for i in [ + [4 2 0 0 0 0 0 0 0 -4 -4 -8 -7 -6 -5 -4 -3 -2 -1 0], + [1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], + [5 2 -2 -3 -4 -3 -2 -1 -2 -5 -4 -8 -7 -6 -5 -4 -3 -2 -1 0], + [4 2 -2 -4 -6 -9//2 -3 -3//2 -7//2 -3 -5//2 -5 -9//2 -4 -7//2 -3 -5//2 -2 -3//2 0], + [2 1 -1 -2 -3 -2 -1 0 -2 -1 -1 -2 -2 -2 -2 -2 -2 -1 0 1], + [2 1 0 0 0 0 0 0 0 -2 -2 -4 -4 -4 -4 -3 -2 -1 0 1] + ]] +6-element Vector{Vector{QQFieldElem}}: + [4, 2, 0, 0, 0, 0, 0, 0, 0, -4, -4, -8, -7, -6, -5, -4, -3, -2, -1, 0] + [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + [5, 2, -2, -3, -4, -3, -2, -1, -2, -5, -4, -8, -7, -6, -5, -4, -3, -2, -1, 0] + [4, 2, -2, -4, -6, -9//2, -3, -3//2, -7//2, -3, -5//2, -5, -9//2, -4, -7//2, -3, -5//2, -2, -3//2, 0] + [2, 1, -1, -2, -3, -2, -1, 0, -2, -1, -1, -2, -2, -2, -2, -2, -2, -1, 0, 1] + [2, 1, 0, 0, 0, 0, 0, 0, 0, -2, -2, -4, -4, -4, -4, -3, -2, -1, 0, 1] + +julia> @assert all(inner_product(ambient_space(NSY2), i,i) == 0 for i in fibers_in_Y2) + +julia> [representative(elliptic_parameter(Y2, f)) for f in fibers_in_Y2[4:6]] +3-element Vector{AbstractAlgebra.Generic.FracFieldElem{QQMPolyRingElem}}: + (y//z)//((x//z)*t) + ((y//z) + t^3)//((x//z)*t - t^4) + ((y//z) + t^3)//((x//z) - t^3) + +julia> g,_ = two_neighbor_step(Y2, fibers_in_Y2[4]);g +-1//4*x^4 - 1//2*t^2*x^3 - 1//4*t^4*x^2 + x + y^2 + +julia> R = parent(g); K_t = base_ring(R); + +julia> (x,y) = gens(R); P = K_t.([0,0]); # rational point + +julia> g, _ = transform_to_weierstrass(g, x, y, P); + +julia> E4 = elliptic_curve(g, x, y) +Elliptic curve with equation +y^2 = x^3 + 1//4*t^4*x^2 - 1//2*t^2*x + 1//4 + +julia> g,_ = two_neighbor_step(Y2, fibers_in_Y2[5]);g +t^2*x^3 + (-1//4*t^4 + 2*t)*x^2 + x + y^2 + +julia> R = parent(g); K_t = base_ring(R); + +julia> (x,y) = gens(R); P = K_t.([0,0]); # rational point + +julia> g, _ = transform_to_weierstrass(g, x, y, P); + +julia> E5 = elliptic_curve(g, x, y) +Elliptic curve with equation +y^2 = x^3 + (1//4*t^4 - 2*t)*x^2 + t^2*x + +julia> g,_ = two_neighbor_step(Y2, fibers_in_Y2[6]);g +(t^2 + 2*t + 1)*x^3 + y^2 - 1//4*t^4 + +julia> R = parent(g); K_t = base_ring(R); t = gen(K_t); + +julia> (x,y) = gens(R); P = K_t.([0,1//2*t^2]); # rational point + +julia> g, _ = transform_to_weierstrass(g, x, y, P); + +julia> E6 = elliptic_curve(g, x, y) +Elliptic curve with equation +y^2 + (-t^2 - 2*t - 1)//t^4*y = x^3 diff --git a/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_G23_info.jlcon b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_G23_info.jlcon new file mode 100644 index 000000000000..8e2ee192560b --- /dev/null +++ b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_G23_info.jlcon @@ -0,0 +1,44 @@ +julia> show_OD_info("G2(3)") +G2(3): 2^6*3^6*7*13 +-------------------- + + i| chi| K|disc| 2|3| 7| 13 +--+----+------+----+------------+-+-------------+-------- + 2| 14a| Q| -3| 14a| | 14a| 14a + | | | | O-| | O+| O+ +--+----+------+----+------------+-+-------------+-------- + 5| 78a| Q| -3| 78a| | 78a| 78a + | | | | O-| | O+| O+ +--+----+------+----+------------+-+-------------+-------- + 9|104a| Q| 21| 14a+90a| | (def. 1)| 104a + | | | | O-, O+| | | O- +--+----+------+----+------------+-+-------------+-------- +10|168a| Q| 13| 78a+90a| | 168a|(def. 1) + | | | | O-, O+| | O-| +--+----+------+----+------------+-+-------------+-------- +11|182a| Q| -3| 14a+78a+90c| | 182a| 182a + | | | | O-, O-, O-| | O+| O+ +--+----+------+----+------------+-+-------------+-------- +12|182b| Q| -3| 14a+78a+90b| | 182b| 182b + | | | | O-, O-, O-| | O+| O+ +--+----+------+----+------------+-+-------------+-------- +15|448a|Q(b13)| 1| 448a| | 448a|14a+434a + | | | | O+| | O+| O+, O+ +--+----+------+----+------------+-+-------------+-------- +16|448b|Q(b13)| 1| 448b| | 448b|14a+434a + | | | | O+| | O+| O+, O+ +--+----+------+----+------------+-+-------------+-------- +17|546a| Q| -3|78a+90b+378a| | 546a| 546a + | | | | O-, O-, O-| | O+| O+ +--+----+------+----+------------+-+-------------+-------- +18|546b| Q| -3|78a+90c+378a| | 546b| 546b + | | | | O-, O-, O-| | O+| O+ +--+----+------+----+------------+-+-------------+-------- +19|728a| Q| 1| 14a+378a| | 728a| 728a + | | | | O-, O-| | O+| O+ +--+----+------+----+------------+-+-------------+-------- +20|728b| Q| 1| 14a+378a| | 728b| 728b + | | | | O-, O-| | O+| O+ +--+----+------+----+------------+-+-------------+-------- +23|832a| Q| 1| 832a| |64ab+78a+626a| 832a + | | | | O+| | O+, O+, O+| O+ diff --git a/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_G23_tbl.jlcon b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_G23_tbl.jlcon new file mode 100644 index 000000000000..79c5af782859 --- /dev/null +++ b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_G23_tbl.jlcon @@ -0,0 +1,32 @@ +julia> Oscar.OrthogonalDiscriminants.show_with_ODs( +character_table("G2(3)", 2)) +G2(3)mod2 + + 2 6 3 3 . 1 1 . . . . . . + 3 6 6 6 6 4 4 . 3 3 3 . . + 7 1 . . . . . 1 . . . . . + 13 1 . . . . . . . . . 1 1 + + 1a 3a 3b 3c 3d 3e 7a 9a 9b 9c 13a 13b + 2P 1a 3a 3b 3c 3d 3e 7a 9a 9c 9b 13b 13a + 3P 1a 1a 1a 1a 1a 1a 7a 3c 3c 3c 13a 13b + 7P 1a 3a 3b 3c 3d 3e 1a 9a 9b 9c 13b 13a + 13P 1a 3a 3b 3c 3d 3e 7a 9a 9b 9c 1a 1a + d OD 2 + X_1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 + X_2 1 O- + 14 5 5 -4 2 -1 . 2 -1 -1 1 1 + X_3 2 o 64 -8 -8 1 4 -2 1 1 A /A -1 -1 + X_4 2 o 64 -8 -8 1 4 -2 1 1 /A A -1 -1 + X_5 1 O- + 78 -3 -3 -3 -3 6 1 . . . . . + X_6 1 O+ + 90 9 9 9 . . -1 . . . -1 -1 + X_7 1 O- + 90 -9 18 . 3 -3 -1 -3 . . -1 -1 + X_8 1 O- + 90 18 -9 . 3 -3 -1 -3 . . -1 -1 + X_9 1 O- + 378 -9 -9 9 -3 -6 . 3 . . 1 1 +X_10 2 O+ + 448 16 16 -11 -2 -2 . 1 1 1 B B* +X_11 2 O+ + 448 16 16 -11 -2 -2 . 1 1 1 B* B +X_12 1 O+ + 832 -32 -32 -5 4 4 -1 1 1 1 . . + +A = 3z_3 + 1 +/A = -3z_3 - 2 +B = -z_13^11 - z_13^8 - z_13^7 - z_13^6 - z_13^5 - z_13^2 - 1 +B* = z_13^11 + z_13^8 + z_13^7 + z_13^6 + z_13^5 + z_13^2 \ No newline at end of file diff --git a/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_ev.jlcon b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_ev.jlcon new file mode 100644 index 000000000000..f74a003c4b8d --- /dev/null +++ b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_ev.jlcon @@ -0,0 +1,7 @@ +julia> ch = character_table("Co3", 3)[2]; + +julia> degree(ch) +22 + +julia> Oscar.OrthogonalDiscriminants.od_from_eigenvalues(ch) +(true, "O+") diff --git a/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_nongalois.jlcon b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_nongalois.jlcon new file mode 100644 index 000000000000..37af7ddd9f03 --- /dev/null +++ b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_nongalois.jlcon @@ -0,0 +1,26 @@ +julia> function is_galois_discriminant_field(data) + chi = Oscar.OrthogonalDiscriminants.character_of_entry(data) + F, emb = character_field(chi) + c = conductor(emb(gen(F))) + galgens = Oscar.AbelianClosure.generators_galois_group_cyclotomic_field(c) + delta = atlas_irrationality(data[:valuestring]) + return all(x -> is_square(preimage(emb, delta * x(delta))), + galgens) + end; + +julia> info = all_od_infos(characteristic => 0, is_simple); + +julia> filter!(r -> r[:valuestring] != "?" && + conductor(atlas_irrationality(r[:valuestring])) > 1, + info); + +julia> length(info) +58 + +julia> filter!(!is_galois_discriminant_field, info); + +julia> length(info) +26 + +julia> println(sort!(collect(Set([r[:groupname] for r in info])))) +["HN", "He", "J1", "J3", "ON", "Ru"] diff --git a/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_od_odd.jlcon b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_od_odd.jlcon new file mode 100644 index 000000000000..a721f3d0b5ac --- /dev/null +++ b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_od_odd.jlcon @@ -0,0 +1,6 @@ +julia> info = all_od_infos(characteristic => 0, degree => 1); + +julia> all(x -> x[:valuestring] == "?" || + is_odd(parse(Int, x[:valuestring])), + info) +true diff --git a/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_order.jlcon b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_order.jlcon new file mode 100644 index 000000000000..2f9677092c93 --- /dev/null +++ b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_order.jlcon @@ -0,0 +1,7 @@ +julia> ch = character_table("Co2", 2)[2]; + +julia> degree(ch) +22 + +julia> Oscar.OrthogonalDiscriminants.od_from_order(ch) +(true, "O+") diff --git a/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_plusminus.jlcon b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_plusminus.jlcon new file mode 100644 index 000000000000..37a18e424072 --- /dev/null +++ b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_plusminus.jlcon @@ -0,0 +1,20 @@ +julia> plus = []; minus = []; + +julia> for d in all_od_infos() + if d[:valuestring] == "O+" + push!(plus, (d[:groupname], d[:characteristic], d[:degree], + parse(Int, filter(isdigit, d[:charname])))) + elseif d[:valuestring] == "O-" + push!(minus, (d[:groupname], d[:characteristic], d[:degree], + parse(Int, filter(isdigit, d[:charname])))) + end + end + +julia> both = intersect!(plus, minus); + +julia> filter(x -> x[2] == 2, both) +1-element Vector{Any}: + ("G2(3)", 2, 1, 90) + +julia> length(both) +103 diff --git a/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_ray_class.jlcon b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_ray_class.jlcon new file mode 100644 index 000000000000..4e84832d4aee --- /dev/null +++ b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_ray_class.jlcon @@ -0,0 +1,5 @@ +julia> K, _ = quadratic_field(13) +(Real quadratic field defined by x^2 - 13, sqrt(13)) + +julia> ray_class_field(3*maximal_order(K)) +Class field defined mod (<3, 3>, InfPlc{AbsSimpleNumField, AbsSimpleNumFieldEmbedding}[]) of structure Z/1 diff --git a/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_specht.jlcon b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_specht.jlcon new file mode 100644 index 000000000000..76e79a6726a4 --- /dev/null +++ b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_specht.jlcon @@ -0,0 +1,7 @@ +julia> ch = character_table("A12")[26]; + +julia> degree(ch) +1728 + +julia> Oscar.OrthogonalDiscriminants.od_for_specht_module(ch) +(true, "1") diff --git a/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_syl.jlcon b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_syl.jlcon new file mode 100644 index 000000000000..c1680370cdba --- /dev/null +++ b/test/book/specialized/breuer-nebe-parker-orthogonal-discriminants/expl_syl.jlcon @@ -0,0 +1,7 @@ +julia> ch = character_table("R(27)")[16]; + +julia> degree(ch) +18278 + +julia> Oscar.OrthogonalDiscriminants.od_from_p_subgroup(ch, 3) +(true, "-3") diff --git a/test/book/specialized/decker-schmitt-invariant-theory/H3.jlcon b/test/book/specialized/decker-schmitt-invariant-theory/H3.jlcon new file mode 100644 index 000000000000..9e51b1a925be --- /dev/null +++ b/test/book/specialized/decker-schmitt-invariant-theory/H3.jlcon @@ -0,0 +1,92 @@ +julia> K, a = cyclotomic_field(3, "a"); + +julia> S = matrix(K, [0 0 1; 1 0 0; 0 1 0]) +[0 0 1] +[1 0 0] +[0 1 0] + +julia> T = matrix(K, [1 0 0; 0 a 0; 0 0 -a-1]) +[1 0 0] +[0 a 0] +[0 0 -a - 1] + +julia> H3 = matrix_group(S, T) +Matrix group of degree 3 + over cyclotomic field of order 3 + +julia> order(H3) +27 + +julia> exponent(H3) +3 + +julia> is_abelian(H3) +false + +julia> R, (x, y, z) = graded_polynomial_ring(K, ["x", "y", "z"]); + +julia> RH3 = invariant_ring(R, H3); + +julia> MSH3 = molien_series(RH3) +(-t^6 + t^3 - 1)//(t^9 - 3*t^6 + 3*t^3 - 1) + +julia> expand(MSH3, 10) +1 + 2*t^3 + 4*t^6 + 7*t^9 + O(t^11) + +julia> P = basis(RH3, 3) +2-element Vector{MPolyDecRingElem{AbsSimpleNumFieldElem, AbstractAlgebra.Generic.MPoly{AbsSimpleNumFieldElem}}}: + x*y*z + x^3 + y^3 + z^3 + +julia> MP = minimal_primes(ideal(R, P)); + +julia> length(MP) +9 + +julia> [[ kernel(reduce(hcat, [ K[coeff(p, x); coeff(p, y); coeff(p, z)] for p in gens(Q) ])) for Q in MP ]] +1-element Vector{Vector{AbstractAlgebra.Generic.MatSpaceElem{AbsSimpleNumFieldElem}}}: + [[a+1 1 0], [-a 1 0], [-1 1 0], [a+1 0 1], [-a 0 1], [-1 0 1], [0 -a 1], [0 a+1 1], [0 -1 1]] + +julia> T, t = polynomial_ring(QQ, "t") +(Univariate polynomial ring in t over QQ, t) + +julia> RR, (X, Y, Z) = graded_polynomial_ring(T, [ "X", "Y", "Z"]); + +julia> F = X^3+Y^3+Z^3; + +julia> G = t*F+hessian(F); + +julia> L = syzygy_generators([hessian(G), F, hessian(F)]); + +julia> collect(coefficients(L[1])) +3-element Vector{QQPolyRingElem}: + 1 + 279936*t + -t^3 - 93312 + +julia> C, iC = center(H3); + +julia> gens(C)[1] +[-a - 1 0 0] +[ 0 -a - 1 0] +[ 0 0 -a - 1] + +julia> Q, pQ = quo(H3, C) +(Pc group of order 9, Hom: H3 -> Q) + +julia> describe(Q) +"C3 x C3" + +julia> SSG = filter(cls -> order(representative(cls)) == 3 && length(cls) == 3, subgroup_classes(H3)); + +julia> length(SSG) +4 + +julia> L1 = [basis(invariant_ring(R, H), 1)[1] for H in collect(SSG[1])] +3-element Vector{MPolyDecRingElem{AbsSimpleNumFieldElem, AbstractAlgebra.Generic.MPoly{AbsSimpleNumFieldElem}}}: + x + y + z + x + (-a - 1)*y + a*z + x + a*y + (-a - 1)*z + +julia> Triangle1 = L1[1]*L1[2]*L1[3] +x^3 - 3*x*y*z + y^3 + z^3 diff --git a/test/book/specialized/decker-schmitt-invariant-theory/LR-inv.jlcon b/test/book/specialized/decker-schmitt-invariant-theory/LR-inv.jlcon new file mode 100644 index 000000000000..d4ea85e6080f --- /dev/null +++ b/test/book/specialized/decker-schmitt-invariant-theory/LR-inv.jlcon @@ -0,0 +1,40 @@ +julia> G = linearly_reductive_group(:SL, 2, QQ) +Reductive group SL2 + over QQ + +julia> r = representation_on_forms(G, 2) +Representation of SL2 + on symmetric forms of degree 2 + +julia> RG = invariant_ring(r) +Invariant Ring of +graded multivariate polynomial ring in 3 variables over QQ + under group action of SL2 + +julia> fundamental_invariants(RG) +1-element Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}: + -X[1]*X[3] + X[2]^2 + +julia> G = linearly_reductive_group(:SL, 3, QQ); + +julia> r = representation_on_forms(G, 3); + +julia> S, x = graded_polynomial_ring(QQ, "x" => 1:10); + +julia> RG = invariant_ring(S, r); + +julia> 75*reynolds_operator(RG, x[5]^4) +x[1]*x[4]*x[8]*x[10] - x[1]*x[4]*x[9]^2 - x[1]*x[5]*x[7]*x[10] + x[1]*x[5]*x[8]*x[9] + x[1]*x[6]*x[7]*x[9] - x[1]*x[6]*x[8]^2 - x[2]^2*x[8]*x[10] + x[2]^2*x[9]^2 + x[2]*x[3]*x[7]*x[10] - x[2]*x[3]*x[8]*x[9] + x[2]*x[4]*x[5]*x[10] - x[2]*x[4]*x[6]*x[9] - 2*x[2]*x[5]^2*x[9] + 3*x[2]*x[5]*x[6]*x[8] - x[2]*x[6]^2*x[7] - x[3]^2*x[7]*x[9] + x[3]^2*x[8]^2 - x[3]*x[4]^2*x[10] + 3*x[3]*x[4]*x[5]*x[9] - x[3]*x[4]*x[6]*x[8] - 2*x[3]*x[5]^2*x[8] + x[3]*x[5]*x[6]*x[7] + x[4]^2*x[6]^2 - 2*x[4]*x[5]^2*x[6] + x[5]^4 + +julia> T = torus_group(QQ,2) +Torus of rank 2 + over QQ + +julia> r = representation_from_weights(T, [1 0; 0 1; -1 -1; -1 1]); + +julia> RT = invariant_ring(r); + +julia> fundamental_invariants(RT) +2-element Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}: + X[1]*X[2]*X[3] + X[1]^2*X[3]*X[4] diff --git a/test/book/specialized/decker-schmitt-invariant-theory/bertin.jlcon b/test/book/specialized/decker-schmitt-invariant-theory/bertin.jlcon new file mode 100644 index 000000000000..0403110b4fcd --- /dev/null +++ b/test/book/specialized/decker-schmitt-invariant-theory/bertin.jlcon @@ -0,0 +1,30 @@ +julia> G = permutation_group(4, [ cperm([1, 2, 3, 4]) ]); + +julia> RG = invariant_ring(GF(2), G); + +julia> primary_invariants(RG) +4-element Vector{MPolyDecRingElem{FqFieldElem, FqMPolyRingElem}}: + x[1] + x[2] + x[3] + x[4] + x[1]*x[3] + x[2]*x[4] + x[1]*x[2] + x[2]*x[3] + x[1]*x[4] + x[3]*x[4] + x[1]*x[2]*x[3]*x[4] + +julia> secondary_invariants(RG) +5-element Vector{MPolyDecRingElem{FqFieldElem, FqMPolyRingElem}}: + 1 + x[1]^2*x[2] + x[2]^2*x[3] + x[3]^2*x[4] + x[1]*x[4]^2 + x[1]*x[2]*x[3] + x[1]*x[2]*x[4] + x[1]*x[3]*x[4] + x[2]*x[3]*x[4] + x[1]^2*x[2]*x[3] + x[2]^2*x[3]*x[4] + x[1]*x[3]^2*x[4] + x[1]*x[2]*x[4]^2 + x[1]^3*x[2]*x[3] + x[2]^3*x[3]*x[4] + x[1]*x[3]^3*x[4] + x[1]*x[2]*x[4]^3 + +julia> M, MtoR, StoR = module_syzygies(RG); + +julia> M +Subquotient of Submodule with 5 generators +1 -> e[1] +2 -> e[2] +3 -> e[3] +4 -> e[4] +5 -> e[5] +by Submodule with 1 generator +1 -> t2*e[2] + (t2 + t3)*e[3] + t1*e[4] diff --git a/test/book/specialized/decker-schmitt-invariant-theory/cox_ring.jlcon b/test/book/specialized/decker-schmitt-invariant-theory/cox_ring.jlcon new file mode 100644 index 000000000000..f66cc90d9a35 --- /dev/null +++ b/test/book/specialized/decker-schmitt-invariant-theory/cox_ring.jlcon @@ -0,0 +1,75 @@ +julia> K, z_3 = cyclotomic_field(3) +(Cyclotomic field of order 3, z_3) + +julia> g1 = matrix(K, 3, 3, [ -1 0 0; 0 1 0; 0 0 1 ]); + +julia> g2 = matrix(K, 3, 3, [ 0 0 1; 1 0 0; 0 1 0 ]); + +julia> G = matrix_group(g1, g2) +Matrix group of degree 3 + over cyclotomic field of order 3 + +julia> chi = character_table(G)[6]; + +julia> RG = invariant_ring(G) +Invariant ring + of matrix group of degree 3 over K + +julia> semi_invariants(RG, chi) +2-element Vector{MPolyDecRingElem{AbsSimpleNumFieldElem, AbstractAlgebra.Generic.MPoly{AbsSimpleNumFieldElem}}}: + x[1]^2 + z_3*x[2]^2 + (-z_3 - 1)*x[3]^2 + x[1]^2*x[2]^2 + (-z_3 - 1)*x[1]^2*x[3]^2 + z_3*x[2]^2*x[3]^2 + +julia> H, HtoG = subgroup_of_pseudo_reflections(G) +(Matrix group of degree 3 over K, Hom: H -> G) + +julia> RH = invariant_ring(H) +Invariant ring + of matrix group of degree 3 over K + +julia> A, AtoR = affine_algebra(RH) +(Quotient of multivariate polynomial ring by ideal (0), Hom: A -> graded multivariate polynomial ring) + +julia> map(AtoR, gens(A)) +3-element Vector{MPolyDecRingElem{AbsSimpleNumFieldElem, AbstractAlgebra.Generic.MPoly{AbsSimpleNumFieldElem}}}: + x[3]^2 + x[2]^2 + x[1]^2 + +julia> VG = linear_quotient(G) +Linear quotient by matrix group of degree 3 over K + +julia> B, BtoR = cox_ring(VG) +(Quotient of multivariate polynomial ring by ideal (), Hom: B -> graded multivariate polynomial ring) + +julia> map(BtoR, gens(B)) +3-element Vector{MPolyDecRingElem{AbsSimpleNumFieldElem, AbstractAlgebra.Generic.MPoly{AbsSimpleNumFieldElem}}}: + x[1]^2 + z_3*x[2]^2 + (-z_3 - 1)*x[3]^2 + x[1]^2 + x[2]^2 + x[3]^2 + x[1]^2 + (-z_3 - 1)*x[2]^2 + z_3*x[3]^2 + +julia> f1 = BtoR(B[1]); f2 = BtoR(B[2]); f3 = BtoR(B[3]); + +julia> f1^G(g2) == z_3*f1 +true + +julia> f2^G(g2) == f2 +true + +julia> f3^G(g2) == z_3^(-1)*f3 +true + +julia> grading_group(B) +Z/3 + +julia> degree(B[1]) +Abelian group element [2] + +julia> degree(B[2]) +Abelian group element [0] + +julia> degree(B[3]) +Abelian group element [1] + +julia> is_zero(modulus(B)) +true diff --git a/test/book/specialized/decker-schmitt-invariant-theory/gleason.jlcon b/test/book/specialized/decker-schmitt-invariant-theory/gleason.jlcon new file mode 100644 index 000000000000..04bbe290781b --- /dev/null +++ b/test/book/specialized/decker-schmitt-invariant-theory/gleason.jlcon @@ -0,0 +1,30 @@ +julia> Qt, t = QQ["t"]; + +julia> K, (a, b) = number_field([t^2 - 2, t^2 + 1], ["a", "b"]); + +julia> M1 = 1/a*matrix(K, [1 1; 1 -1]) +[1//2*a 1//2*a] +[1//2*a -1//2*a] + +julia> M2 = matrix(K, [1 0; 0 b]) +[1 0] +[0 b] + +julia> G = matrix_group(M1, M2); + +julia> order(G) +192 + +julia> RG = invariant_ring(G); + +julia> f = fundamental_invariants(RG) +2-element Vector{MPolyDecRingElem{AbsNonSimpleNumFieldElem, AbstractAlgebra.Generic.MPoly{AbsNonSimpleNumFieldElem}}}: + x[1]^8 + 14*x[1]^4*x[2]^4 + x[2]^8 + x[1]^24 + 10626//1025*x[1]^20*x[2]^4 + 735471//1025*x[1]^16*x[2]^8 + 2704156//1025*x[1]^12*x[2]^12 + 735471//1025*x[1]^8*x[2]^16 + 10626//1025*x[1]^4*x[2]^20 + x[2]^24 + +julia> A, AtoR = affine_algebra(RG) +(Quotient of multivariate polynomial ring by ideal (0), Hom: A -> graded multivariate polynomial ring) + +julia> modulus(A) +Ideal generated by + 0 diff --git a/test/book/specialized/decker-schmitt-invariant-theory/klein.jlcon b/test/book/specialized/decker-schmitt-invariant-theory/klein.jlcon new file mode 100644 index 000000000000..c07476149406 --- /dev/null +++ b/test/book/specialized/decker-schmitt-invariant-theory/klein.jlcon @@ -0,0 +1,78 @@ +julia> A = matrix(QQ, [0 1 0 0; 1 0 0 0; 0 0 0 1; 0 0 1 0]) +[0 1 0 0] +[1 0 0 0] +[0 0 0 1] +[0 0 1 0] + +julia> B = matrix(QQ, [0 0 1 0; 0 0 0 1; 1 0 0 0; 0 1 0 0]) +[0 0 1 0] +[0 0 0 1] +[1 0 0 0] +[0 1 0 0] + +julia> K4 = matrix_group(A, B) +Matrix group of degree 4 + over rational field + +julia> small_group_identification(K4) +(4, 2) + +julia> describe(K4) +"C2 x C2" + +julia> RK4 = invariant_ring(K4); + +julia> MSK4 = molien_series(RK4) +(t^2 - t + 1)//(t^6 - 2*t^5 - t^4 + 4*t^3 - t^2 - 2*t + 1) + +julia> expand(MSK4, 4) +1 + t + 4*t^2 + 5*t^3 + 11*t^4 + O(t^5) + +julia> primary_invariants(RK4) +4-element Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}: + x[1] + x[2] + x[3] + x[4] + x[1]^2 + x[2]^2 + x[3]^2 + x[4]^2 + x[1]*x[2] + x[3]*x[4] + x[1]*x[3] + x[2]*x[4] + +julia> secondary_invariants(RK4) +2-element Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}: + 1 + x[1]^3 + x[2]^3 + x[3]^3 + x[4]^3 + +julia> fundamental_invariants(RK4) +5-element Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}: + x[1] + x[2] + x[3] + x[4] + x[1]^2 + x[2]^2 + x[3]^2 + x[4]^2 + x[1]*x[2] + x[3]*x[4] + x[1]*x[3] + x[2]*x[4] + x[1]^3 + x[2]^3 + x[3]^3 + x[4]^3 + +julia> A = matrix(GF(2), [0 1 0 0; 1 0 0 0; 0 0 0 1; 0 0 1 0]); + +julia> B = matrix(GF(2), [0 0 1 0; 0 0 0 1; 1 0 0 0; 0 1 0 0]); + +julia> RK42 = invariant_ring(matrix_group(A, B)); + +julia> primary_invariants(RK42) +4-element Vector{MPolyDecRingElem{FqFieldElem, FqMPolyRingElem}}: + x[1] + x[2] + x[3] + x[4] + x[2]*x[3] + x[1]*x[4] + x[1]*x[2] + x[1]*x[3] + x[2]*x[4] + x[3]*x[4] + x[1]*x[2]*x[3]*x[4] + +julia> secondary_invariants(RK42) +4-element Vector{MPolyDecRingElem{FqFieldElem, FqMPolyRingElem}}: + 1 + x[1]*x[3] + x[2]*x[4] + x[2]^2*x[3] + x[2]*x[3]^2 + x[1]^2*x[4] + x[1]*x[4]^2 + x[1]*x[2]^2*x[3]^2 + x[1]*x[2]*x[3]^3 + x[1]^3*x[3]*x[4] + x[2]^3*x[3]*x[4] + x[2]^2*x[3]^2*x[4] + x[1]^2*x[2]*x[4]^2 + x[1]^2*x[3]*x[4]^2 + x[1]*x[2]*x[4]^3 + +julia> fundamental_invariants(RK42) +6-element Vector{MPolyDecRingElem{FqFieldElem, FqMPolyRingElem}}: + x[1] + x[2] + x[3] + x[4] + x[1]*x[3] + x[2]*x[4] + x[2]*x[3] + x[1]*x[4] + x[1]*x[2] + x[1]*x[3] + x[2]*x[4] + x[3]*x[4] + x[2]^2*x[3] + x[2]*x[3]^2 + x[1]^2*x[4] + x[1]*x[4]^2 + x[1]*x[2]*x[3]*x[4] diff --git a/test/book/specialized/decker-schmitt-invariant-theory/nakajima.jlcon b/test/book/specialized/decker-schmitt-invariant-theory/nakajima.jlcon new file mode 100644 index 000000000000..7cc591086338 --- /dev/null +++ b/test/book/specialized/decker-schmitt-invariant-theory/nakajima.jlcon @@ -0,0 +1,41 @@ +julia> K = GF(3); + +julia> M1 = matrix(K, [1 0 1 0; 0 1 0 0; 0 0 1 0; 0 0 0 1]) +[1 0 1 0] +[0 1 0 0] +[0 0 1 0] +[0 0 0 1] + +julia> M2 = matrix(K, [1 0 0 0; 0 1 0 1; 0 0 1 0; 0 0 0 1]) +[1 0 0 0] +[0 1 0 1] +[0 0 1 0] +[0 0 0 1] + +julia> M3 = matrix(K, [1 0 1 1; 0 1 1 1; 0 0 1 0; 0 0 0 1]) +[1 0 1 1] +[0 1 1 1] +[0 0 1 0] +[0 0 0 1] + +julia> G = matrix_group(M1, M2, M3); + +julia> all(is_pseudo_reflection, gens(G)) +true + +julia> RG = invariant_ring(G); + +julia> fundamental_invariants(RG) +5-element Vector{MPolyDecRingElem{FqFieldElem, FqMPolyRingElem}}: + x[3] + x[4] + x[1]^3*x[3] + 2*x[1]*x[3]^3 + x[2]^3*x[4] + 2*x[2]*x[4]^3 + x[1]^9 + 2*x[1]^3*x[3]^6 + 2*x[1]^3*x[3]^4*x[4]^2 + x[1]*x[3]^6*x[4]^2 + 2*x[1]^3*x[3]^2*x[4]^4 + x[1]*x[3]^4*x[4]^4 + 2*x[1]^3*x[4]^6 + x[1]*x[3]^2*x[4]^6 + x[2]^9 + 2*x[2]^3*x[3]^6 + x[1]^3*x[3]^5*x[4] + 2*x[1]*x[3]^7*x[4] + x[2]*x[3]^6*x[4]^2 + x[1]^3*x[3]^3*x[4]^3 + 2*x[1]*x[3]^5*x[4]^3 + 2*x[2]^3*x[4]^6 + +julia> A, AtoR = affine_algebra(RG) +(Quotient of multivariate polynomial ring by ideal (y1^6*y2^2*y3 + y1^3*y4 + y2^3*y5 + 2*y3^3), Hom: A -> graded multivariate polynomial ring) + +julia> modulus(A) +Ideal generated by + y1^6*y2^2*y3 + y1^3*y4 + y2^3*y5 + 2*y3^3 diff --git a/test/book/specialized/decker-schmitt-invariant-theory/sym.jlcon b/test/book/specialized/decker-schmitt-invariant-theory/sym.jlcon new file mode 100644 index 000000000000..cf1e7f8df41d --- /dev/null +++ b/test/book/specialized/decker-schmitt-invariant-theory/sym.jlcon @@ -0,0 +1,26 @@ +julia> RS4 = invariant_ring(GF(2), symmetric_group(4)) +Invariant ring + of Sym(4) + +julia> L = fundamental_invariants(RS4) +4-element Vector{MPolyDecRingElem{FqFieldElem, FqMPolyRingElem}}: + x[1] + x[2] + x[3] + x[4] + x[1]*x[2] + x[1]*x[3] + x[2]*x[3] + x[1]*x[4] + x[2]*x[4] + x[3]*x[4] + x[1]*x[2]*x[3] + x[1]*x[2]*x[4] + x[1]*x[3]*x[4] + x[2]*x[3]*x[4] + x[1]*x[2]*x[3]*x[4] + +julia> is_algebraically_independent(L) +true + +julia> RS3 = invariant_ring(QQ, symmetric_group(3)); + +julia> R = polynomial_ring(RS3) +Multivariate polynomial ring in 3 variables over QQ graded by + x[1] -> [1] + x[2] -> [1] + x[3] -> [1] + +julia> x = gens(R); + +julia> reynolds_operator(RS3, x[1]^2) +1//3*x[1]^2 + 1//3*x[2]^2 + 1//3*x[3]^2 diff --git a/test/book/specialized/eder-mohr-ideal-theoretic/combinatorics.jlcon b/test/book/specialized/eder-mohr-ideal-theoretic/combinatorics.jlcon new file mode 100644 index 000000000000..81ca442958d0 --- /dev/null +++ b/test/book/specialized/eder-mohr-ideal-theoretic/combinatorics.jlcon @@ -0,0 +1,32 @@ +julia> F = GF(rand_bits_prime(ZZ, 20)) +Prime field of characteristic 646637 + +julia> R, (z0, z1, z2, t, u, x) = polynomial_ring(F, ["z0","z1","z2","t", "u","x"]); + +julia> P = (u^3-t*(u^7+1))*x-u^3+t*z0+t*u*z1+inv(F(2))*t*u^2*z2; + +julia> sys = [P,derivative(P,u),derivative(P,x)]; + +julia> I = saturation(ideal(R, sys), ideal(R, u)); + +julia> I = eliminate(ideal(R, sys), [x]); + +julia> sys[3] +646636*t*u^7 + 646636*t + u^3 + +julia> S, (z0, z1, z2, t, u, u1, u2, x) = polynomial_ring(F, ["z0","z1","z2","t","u","u1","u2","x"]); + +julia> phi = hom(R,S,[z0,z1,z2,t,u,x]); + +julia> I = phi(I); + +julia> I += ideal(S, [f(z0,z1,z2,t,u1,u1,u2,x) for f in gens(I)]); + +julia> I += ideal(S, [f(z0,z1,z2,t,u2,u1,u2,x) for f in gens(I)]); + +julia> I = saturation(I,ideal(S,(u-u1)*(u1-u2)*(u-u2))); + +julia> res = eliminate(I, [z1,z2,u,u1,u2,x]); + +julia> factor(first(gens(res))) +1 * (z0^35*t^35 + 646636*z0^31*t^28 + z0^30*t^28 + 646636*z0^29*t^28 + 5*z0^28*t^28 + 646636*z0^25*t^21 + z0^24*t^21 + 3*z0^23*t^21 + 646633*z0^22*t^21 + 10*z0^21*t^21 + z0^19*t^14 + 646636*z0^18*t^14 + 5*z0^17*t^14 + 3*z0^16*t^14 + 646631*z0^15*t^14 + 10*z0^14*t^14 + z0^13*t^7 + 646636*z0^12*t^7 + 3*z0^10*t^7 + z0^9*t^7 + 646633*z0^8*t^7 + 5*z0^7*t^7 + 646636*z0 + 1) diff --git a/test/book/specialized/eder-mohr-ideal-theoretic/fglm.jlcon b/test/book/specialized/eder-mohr-ideal-theoretic/fglm.jlcon new file mode 100644 index 000000000000..5bdc6f07b602 --- /dev/null +++ b/test/book/specialized/eder-mohr-ideal-theoretic/fglm.jlcon @@ -0,0 +1,12 @@ +julia> R, (x1, x2, x3, x4, x5, x6, x7, x8) = polynomial_ring(GF(65521), ["x1","x2","x3","x4","x5","x6", "x7","x8"]); + +julia> I = ideal(R, [x1 + 2*x2 + 2*x3 + 2*x4 + 2*x5 + 2*x6 + 2*x7 + 2*x8 - 1, x1^2 - x1 + 2*x2^2 + 2*x3^2 + 2*x4^2 + 2*x5^2 + 2*x6^2 + 2*x7^2 + 2*x8^2, 2*x1*x2 + 2*x2*x3 - x2 + 2*x3*x4 + 2*x4*x5 + 2*x5*x6 + 2*x6*x7 + 2*x7*x8, 2*x1*x3 + x2^2 + 2*x2*x4 + 2*x3*x5 - x3 + 2*x4*x6 + 2*x5*x7 + 2*x6*x8, 2*x1*x4 + 2*x2*x3 + 2*x2*x5 + 2*x3*x6 + 2*x4*x7 - x4 + 2*x5*x8, 2*x1*x5 + 2*x2*x4 + 2*x2*x6 + x3^2 + 2*x3*x7 + 2*x4*x8 - x5, 2*x1*x6 + 2*x2*x5 + 2*x2*x7 + 2*x3*x4 + 2*x3*x8 - x6, 2*x1*x7 + 2*x2*x6 + 2*x2*x8 + 2*x3*x5 + x4^2 - x7]); + +julia> @time groebner_basis_f4(I); + 0.010955 seconds (57.13 k allocations: 3.081 MiB) + +julia> dim(I) == 0 +true + +julia> @time fglm(I, destination_ordering = lex(R)); + 0.062046 seconds (130.52 k allocations: 3.313 MiB) diff --git a/test/book/specialized/eder-mohr-ideal-theoretic/gbeliminate.jlcon b/test/book/specialized/eder-mohr-ideal-theoretic/gbeliminate.jlcon new file mode 100644 index 000000000000..c4027b70ecd6 --- /dev/null +++ b/test/book/specialized/eder-mohr-ideal-theoretic/gbeliminate.jlcon @@ -0,0 +1,26 @@ +julia> R, (x, y, z) = polynomial_ring(QQ, ["x","y","z"]); + +julia> o = degrevlex([x, y])*degrevlex([z]); + +julia> I = ideal(R, [x^2 + y + z - 1, x + y^2 + z - 1, x + y + z^2 - 1]); + +julia> groebner_basis(I, ordering = o) +Gröbner basis with elements +1 -> z^6 - 4*z^4 + 4*z^3 - z^2 +2 -> 2*y*z^2 + z^4 - z^2 +3 -> x + y + z^2 - 1 +4 -> y^2 + x + z - 1 +with respect to the ordering +degrevlex([x, y])*degrevlex([z]) + +julia> eliminate(I, [x,y]) # internally computes the above Gröbner basis +Ideal generated by + z^6 - 4*z^4 + 4*z^3 - z^2 + +julia> groebner_basis(I) +Gröbner basis with elements +1 -> z^2 + x + y - 1 +2 -> y^2 + x + z - 1 +3 -> x^2 + y + z - 1 +with respect to the ordering +degrevlex([x, y, z]) diff --git a/test/book/specialized/eder-mohr-ideal-theoretic/hilbert.jlcon b/test/book/specialized/eder-mohr-ideal-theoretic/hilbert.jlcon new file mode 100644 index 000000000000..2e2121e59f0b --- /dev/null +++ b/test/book/specialized/eder-mohr-ideal-theoretic/hilbert.jlcon @@ -0,0 +1,24 @@ +julia> R, (X0, X1, X2, X3) = graded_polynomial_ring(QQ, ["X$i" for i in 0:3]); + +julia> I = ideal(R, [X0*X2 - X1^2, X1*X3 - X2^2, X0*X3 - X1*X2]); + +julia> A, _ = quo(R, I); + +julia> hilbert_series(A) +(2*t^3 - 3*t^2 + 1, (-t + 1)^4) + +julia> p = next_prime(rand(1:10000)) +4783 + +julia> R, (X0, X1, X2, X3) = graded_polynomial_ring(GF(p), ["X$i" for i in 0:3]); + +julia> I = ideal(R, [X0*X2 - X1^2, X1*X3 - X2^2, X0*X3 - X1*X2]); + +julia> gb = groebner_basis_f4(forget_grading(I)); + +julia> lm_ideal = ideal(R, (leading_monomial).(gens(gb))); + +julia> A, _ = quo(R, lm_ideal); + +julia> hilbert_series(A) +(2*t^3 - 3*t^2 + 1, (-t + 1)^4) diff --git a/test/book/specialized/eder-mohr-ideal-theoretic/lcis.jlcon b/test/book/specialized/eder-mohr-ideal-theoretic/lcis.jlcon new file mode 100644 index 000000000000..af11cab95091 --- /dev/null +++ b/test/book/specialized/eder-mohr-ideal-theoretic/lcis.jlcon @@ -0,0 +1,53 @@ +julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]); + +julia> I = ideal(R, [x*y, x*z, y*z]); + +julia> conorm = subquotient(matrix(gens(I)), matrix(gens(I^2))) +Subquotient of Submodule with 3 generators +1 -> x*y*e[1] +2 -> x*z*e[1] +3 -> y*z*e[1] +by Submodule with 6 generators +1 -> x^2*y^2*e[1] +2 -> x^2*y*z*e[1] +3 -> x*y^2*z*e[1] +4 -> x^2*z^2*e[1] +5 -> x*y*z^2*e[1] +6 -> y^2*z^2*e[1] + +julia> fitting_ideal(conorm, 1) +Ideal generated by + y*z + x*z + x*y + +julia> fitting_ideal(conorm, 2) +Ideal generated by + z + y + x + +julia> equidimensional_decomposition_weak(I) +1-element Vector{MPolyIdeal{QQMPolyRingElem}}: + Ideal (x*y, x*z, y*z) + +julia> F = fitting_ideal(ideal_as_module(I), 2); + +julia> codim(F) >= codim(I) + 1 +true + +julia> I1 = ideal(R, [x-1, y-1]); + +julia> I2 = ideal(R, [x, y, z]); + +julia> I = intersect(I1, I2); + +julia> conorm = subquotient(matrix(gens(I)), matrix(gens(I^2))); + +julia> Pk(conorm, k) = saturation(I, fitting_ideal(conorm, k)) + fitting_ideal(conorm, k-1); + +julia> Pk(conorm, 2) == ideal(R, [x-1,y-1]) +true + +julia> Pk(conorm, 3) == ideal(R, [z,y,x]) +true diff --git a/test/book/specialized/eder-mohr-ideal-theoretic/nonproper.jlcon b/test/book/specialized/eder-mohr-ideal-theoretic/nonproper.jlcon new file mode 100644 index 000000000000..b1911fd8d4c6 --- /dev/null +++ b/test/book/specialized/eder-mohr-ideal-theoretic/nonproper.jlcon @@ -0,0 +1,47 @@ +julia> R, (x, y, z, t) = polynomial_ring(QQ, ["x", "y", "z", "t"]); + +julia> graph_id = ideal(R, [x*y, x*z, y*z, x*(x-1), x-t]); + +julia> w = [1 1 1 0] +1×4 Matrix{Int64}: + 1 1 1 0 + +julia> H = homogenizer(R, w, "w"); clo = H(graph_id) +Ideal generated by + -x + t*w + t^2 - t + z*t + y*t + x*t - x + y*z + x*z + x*y + x^2 - x*w + +julia> S = base_ring(clo) +Multivariate polynomial ring in 5 variables over QQ graded by + x -> [1] + y -> [1] + z -> [1] + t -> [0] + w -> [1] + +julia> x, y, z, t, w = gens(S); + +julia> irrel_ideal = ideal(S, [x,y,z,w]); + +julia> eliminate(saturation(clo + ideal(S,x), irrel_ideal), [x,y,z,w]) +Ideal generated by + t + +julia> eliminate(saturation(clo + ideal(S,y), irrel_ideal), [x,y,z,w]) +Ideal generated by + t^2 - t + +julia> eliminate(saturation(clo + ideal(S,z), irrel_ideal), [x,y,z,w]) +Ideal generated by + t^2 - t + +julia> eliminate(saturation(clo + ideal(S,w), irrel_ideal), [x,y,z,w]) +Ideal generated by + t diff --git a/test/book/specialized/eder-mohr-ideal-theoretic/realsols.jlcon b/test/book/specialized/eder-mohr-ideal-theoretic/realsols.jlcon new file mode 100644 index 000000000000..6703c8969ae4 --- /dev/null +++ b/test/book/specialized/eder-mohr-ideal-theoretic/realsols.jlcon @@ -0,0 +1,27 @@ +julia> R, (t1, t2) = polynomial_ring(QQ, ["t1", "t2"]); + +julia> psi = [rand(R, 6:6, 3:5, -10:10) for _ in 1:3] +3-element Vector{QQMPolyRingElem}: + 1//2*t1^5*t2^3 - 2*t1^3*t2^4 + 2//9*t1^3*t2^3 + -3//5*t1^5*t2^5 - 8//7*t1^3*t2^4 - 17//4*t1^3*t2^3 + -23//12*t1^5*t2^5 - 3//7*t1^4*t2^3 - 13//6*t1^3*t2^5 - 9*t1^3*t2^4 + +julia> D = sum([(f - rand(Int))^2 for f in psi]); + +julia> J = jacobian_ideal(D); + +julia> S, (t1, t2, s) = polynomial_ring(QQ, ["t1", "t2", "s"]); + +julia> phi = hom(R, S, [t1, t2]); + +julia> f = sum([rand(Int) * p for p in minors(jacobian_matrix(psi), 2)]); + +julia> JJ = phi(J) + ideal(S, s*phi(f) - 1); + +julia> sols, param = real_solutions(JJ); + +julia> length(sols) +8 + +julia> degree(param.elim) +62 diff --git a/test/book/specialized/eder-mohr-ideal-theoretic/whitney.jlcon b/test/book/specialized/eder-mohr-ideal-theoretic/whitney.jlcon new file mode 100644 index 000000000000..aa00cfd12de2 --- /dev/null +++ b/test/book/specialized/eder-mohr-ideal-theoretic/whitney.jlcon @@ -0,0 +1,71 @@ +julia> R, (x, y, z, w) = graded_polynomial_ring(QQ, ["x","y","z","w"]); + +julia> f = y^2*w^2 + z^3*w - x^2*z^2; + +julia> J = jacobian_matrix(f) +[ -2*x*z^2] +[ 2*y*w^2] +[-2*x^2*z + 3*z^2*w] +[ 2*y^2*w + z^3] + +julia> I_sing = ideal(R, [f, minors(J, 1)...]) +Ideal generated by + -x^2*z^2 + y^2*w^2 + z^3*w + -2*x*z^2 + 2*y*w^2 + -2*x^2*z + 3*z^2*w + 2*y^2*w + z^3 + +julia> minimal_primes(I_sing) +2-element Vector{MPolyIdeal{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}}: + Ideal (w, z) + Ideal (z, y) + +julia> (comp -> comp[2]).(primary_decomposition(I_sing)) +6-element Vector{MPolyIdeal{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}}: + Ideal (w, z) + Ideal (z, y) + Ideal (w, z, y) + Ideal (w, z, x) + Ideal (z, y, x) + Ideal (x, y, z, w) + +julia> R, (x0,x1,x2,x3,a0,a1,a2,a3) = polynomial_ring(QQ, ["x0","x1","x2","x3","a0","a1","a2","a3"]); + +julia> f = x0^6 + x0^4*x1*x2 + x2^3*x3^3; + +julia> J = jacobian_matrix(f)[1:4, 1:1] +[6*x0^5 + 4*x0^3*x1*x2] +[ x0^4*x2] +[x0^4*x1 + 3*x2^2*x3^3] +[ 3*x2^3*x3^2] + +julia> JJ = hcat(J, R[a0; a1; a2; a3]) +[6*x0^5 + 4*x0^3*x1*x2 a0] +[ x0^4*x2 a1] +[x0^4*x1 + 3*x2^2*x3^3 a2] +[ 3*x2^3*x3^2 a3] + +julia> id = ideal(R, minors(JJ, 2)); + +julia> I_sing = ideal(R, minors(J, 1)); + +julia> conorm = saturation(ideal(R, f) + id, I_sing); + +julia> Y = radical(ideal(R,f) + I_sing) +Ideal generated by + x0 + x2*x3 + +julia> id_fib_Y = saturation(conorm + Y, ideal(R, [x0,x1,x2,x3])); + +julia> prim_comps = (comp -> comp[2]).(primary_decomposition(id_fib_Y)); + +julia> [eliminate(comp, [a0,a1,a2,a3]) for comp in prim_comps] +6-element Vector{MPolyIdeal{QQMPolyRingElem}}: + Ideal (x2, x0) + Ideal (x3, x2, x0) + Ideal (x3, x0) + Ideal (x3, x2, x0) + Ideal (x3, x1, x0) + Ideal (x2, x0, 4*x1^3 + 27*x3^3) diff --git a/test/book/specialized/flake-fourier-monomial-bases/basis.jlcon b/test/book/specialized/flake-fourier-monomial-bases/basis.jlcon new file mode 100644 index 000000000000..90588ddbe535 --- /dev/null +++ b/test/book/specialized/flake-fourier-monomial-bases/basis.jlcon @@ -0,0 +1,22 @@ +julia> basis_lie_highest_weight(:A, 4, [2,1,2,1], [1,2,3,4,1,5,8,2,6,3]; monomial_ordering=:degrevlex) +Monomial basis of a highest weight module + of highest weight [2, 1, 2, 1] + of dimension 8750 + with monomial ordering degrevlex([x1, x2, x3, x4, x5, x6, x7, x8, x9, x10]) +over Lie algebra of type A4 + where the used birational sequence consists of the following roots (given as coefficients w.r.t. alpha_i): + [1, 0, 0, 0] + [0, 1, 0, 0] + [0, 0, 1, 0] + [0, 0, 0, 1] + [1, 0, 0, 0] + [1, 1, 0, 0] + [1, 1, 1, 0] + [0, 1, 0, 0] + [0, 1, 1, 0] + [0, 0, 1, 0] + and the basis was generated by Minkowski sums of the bases of the following highest weight modules: + [1, 0, 0, 0] + [0, 1, 0, 0] + [0, 0, 1, 0] + [0, 0, 0, 1] diff --git a/test/book/specialized/flake-fourier-monomial-bases/fflv.jlcon b/test/book/specialized/flake-fourier-monomial-bases/fflv.jlcon new file mode 100644 index 000000000000..ff9415d33975 --- /dev/null +++ b/test/book/specialized/flake-fourier-monomial-bases/fflv.jlcon @@ -0,0 +1,17 @@ +julia> basis_lie_highest_weight_ffl(:A, 3, [1,1,1]) +Monomial basis of a highest weight module + of highest weight [1, 1, 1] + of dimension 64 + with monomial ordering degrevlex([x1, x2, x3, x4, x5, x6]) +over Lie algebra of type A3 + where the used birational sequence consists of the following roots (given as coefficients w.r.t. alpha_i): + [1, 1, 1] + [0, 1, 1] + [1, 1, 0] + [0, 0, 1] + [0, 1, 0] + [1, 0, 0] + and the basis was generated by Minkowski sums of the bases of the following highest weight modules: + [1, 0, 0] + [0, 1, 0] + [0, 0, 1] diff --git a/test/book/specialized/flake-fourier-monomial-bases/get-operators.jlcon b/test/book/specialized/flake-fourier-monomial-bases/get-operators.jlcon new file mode 100644 index 000000000000..d89f74466679 --- /dev/null +++ b/test/book/specialized/flake-fourier-monomial-bases/get-operators.jlcon @@ -0,0 +1,12 @@ +julia> basis_lie_highest_weight_operators(:A, 4) +10-element Vector{Tuple{Int64, Vector{QQFieldElem}}}: + (1, [1, 0, 0, 0]) + (2, [0, 1, 0, 0]) + (3, [0, 0, 1, 0]) + (4, [0, 0, 0, 1]) + (5, [1, 1, 0, 0]) + (6, [0, 1, 1, 0]) + (7, [0, 0, 1, 1]) + (8, [1, 1, 1, 0]) + (9, [0, 1, 1, 1]) + (10, [1, 1, 1, 1]) diff --git a/test/book/specialized/flake-fourier-monomial-bases/lusztig.jlcon b/test/book/specialized/flake-fourier-monomial-bases/lusztig.jlcon new file mode 100644 index 000000000000..b943c7d3f247 --- /dev/null +++ b/test/book/specialized/flake-fourier-monomial-bases/lusztig.jlcon @@ -0,0 +1,25 @@ +julia> basis_lie_highest_weight_lusztig(:D, 4, [1,1,1,1], [4,3,2,4,3,2,1,2,4,3,2,1]) +Monomial basis of a highest weight module + of highest weight [1, 1, 1, 1] + of dimension 4096 + with monomial ordering wdegrevlex([x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12], [1, 1, 3, 2, 2, 1, 5, 4, 3, 3, 2, 1]) +over Lie algebra of type D4 + where the used birational sequence consists of the following roots (given as coefficients w.r.t. alpha_i): + [0, 0, 0, 1] + [0, 0, 1, 0] + [0, 1, 1, 1] + [0, 1, 1, 0] + [0, 1, 0, 1] + [0, 1, 0, 0] + [1, 2, 1, 1] + [1, 1, 1, 1] + [1, 1, 0, 1] + [1, 1, 1, 0] + [1, 1, 0, 0] + [1, 0, 0, 0] + and the basis was generated by Minkowski sums of the bases of the following highest weight modules: + [1, 0, 0, 0] + [0, 1, 0, 0] + [0, 0, 1, 0] + [0, 0, 0, 1] + [0, 0, 1, 1] diff --git a/test/book/specialized/flake-fourier-monomial-bases/nz.jlcon b/test/book/specialized/flake-fourier-monomial-bases/nz.jlcon new file mode 100644 index 000000000000..218149fe9fa7 --- /dev/null +++ b/test/book/specialized/flake-fourier-monomial-bases/nz.jlcon @@ -0,0 +1,20 @@ +julia> basis_lie_highest_weight_nz(:C, 3, [1,1,1], [3,2,3,2,1,2,3,2,1]) +Monomial basis of a highest weight module + of highest weight [1, 1, 1] + of dimension 512 + with monomial ordering degrevlex([x1, x2, x3, x4, x5, x6, x7, x8, x9]) +over Lie algebra of type C3 + where the used birational sequence consists of the following roots (given as coefficients w.r.t. alpha_i): + [0, 0, 1] + [0, 1, 0] + [0, 0, 1] + [0, 1, 0] + [1, 0, 0] + [0, 1, 0] + [0, 0, 1] + [0, 1, 0] + [1, 0, 0] + and the basis was generated by Minkowski sums of the bases of the following highest weight modules: + [1, 0, 0] + [0, 1, 0] + [0, 0, 1] diff --git a/test/book/specialized/flake-fourier-monomial-bases/string.jlcon b/test/book/specialized/flake-fourier-monomial-bases/string.jlcon new file mode 100644 index 000000000000..f410e15fcdab --- /dev/null +++ b/test/book/specialized/flake-fourier-monomial-bases/string.jlcon @@ -0,0 +1,20 @@ +julia> basis_lie_highest_weight_string(:B, 3, [1,1,1], [3,2,3,2,1,2,3,2,1]) +Monomial basis of a highest weight module + of highest weight [1, 1, 1] + of dimension 512 + with monomial ordering neglex([x1, x2, x3, x4, x5, x6, x7, x8, x9]) +over Lie algebra of type B3 + where the used birational sequence consists of the following roots (given as coefficients w.r.t. alpha_i): + [0, 0, 1] + [0, 1, 0] + [0, 0, 1] + [0, 1, 0] + [1, 0, 0] + [0, 1, 0] + [0, 0, 1] + [0, 1, 0] + [1, 0, 0] + and the basis was generated by Minkowski sums of the bases of the following highest weight modules: + [1, 0, 0] + [0, 1, 0] + [0, 0, 1] diff --git a/test/book/specialized/holt-ren-tropical-geometry/curve1.jlcon b/test/book/specialized/holt-ren-tropical-geometry/curve1.jlcon new file mode 100644 index 000000000000..b9ccc6f68397 --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/curve1.jlcon @@ -0,0 +1,11 @@ +julia> R,(x,y) = QQ["x","y"]; + +julia> nu = tropical_semiring_map(QQ); + +julia> f = 1+x+y+x*(x^2+y^2); + +julia> TropH = tropical_hypersurface(f,nu) +Min tropical hypersurface + +julia> TropC = tropical_curve(TropH) +Embedded min tropical curve diff --git a/test/book/specialized/holt-ren-tropical-geometry/curve2.jlcon b/test/book/specialized/holt-ren-tropical-geometry/curve2.jlcon new file mode 100644 index 000000000000..a2150a9689c3 --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/curve2.jlcon @@ -0,0 +1,6 @@ +julia> G = dualgraph(cube(3)) +Undirected graph with 6 nodes and the following edges: +(3, 1)(3, 2)(4, 1)(4, 2)(5, 1)(5, 2)(5, 3)(5, 4)(6, 1)(6, 2)(6, 3)(6, 4) + +julia> tropical_curve(G) +Abstract min tropical curve diff --git a/test/book/specialized/holt-ren-tropical-geometry/det.jlcon b/test/book/specialized/holt-ren-tropical-geometry/det.jlcon new file mode 100644 index 000000000000..e36ed924ed90 --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/det.jlcon @@ -0,0 +1,9 @@ +julia> T = tropical_semiring() +Min tropical semiring + +julia> M = matrix(T,[0 1; 2 3]) +[(0) (1)] +[(2) (3)] + +julia> det(M) +(3) diff --git a/test/book/specialized/holt-ren-tropical-geometry/grc.jlcon b/test/book/specialized/holt-ren-tropical-geometry/grc.jlcon new file mode 100644 index 000000000000..f2919fb9538a --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/grc.jlcon @@ -0,0 +1,12 @@ +julia> include("generic_root_count/src/main.jl") + +julia> A,(a0,a1,a2,a3,a4,b0,b1,b2,b3,b4) = QQ["a0","a1","a2","a3","a4","b0","b1","b2","b3","b4"]; + +julia> R,(u,v) = A["u","v"]; + +julia> f = a0+a1*u+a2*v+a3*u*(u^2+v^2)+a4*u*(u^2+v^2)^2; + +julia> g = b0+b1*u+b2*v+b3*v*(u^2+v^2)+b4*v*(u^2+v^2)^2; + +julia> generic_root_count([f,g]) +9 diff --git a/test/book/specialized/holt-ren-tropical-geometry/groebner.jlcon b/test/book/specialized/holt-ren-tropical-geometry/groebner.jlcon new file mode 100644 index 000000000000..866f45c64dc3 --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/groebner.jlcon @@ -0,0 +1,28 @@ +julia> R,(x1,x2,x3,x4) = QQ["x1","x2","x3","x4"]; + +julia> I = ideal([x1+2*x2-3*x3, 3*x2-4*x3+5*x4]); + +julia> nu_2 = tropical_semiring_map(QQ,2); + +julia> GBI = groebner_basis(I,nu_2,[0,0,0,0]) +2-element Vector{QQMPolyRingElem}: + x1 + 2*x2 - 3*x3 + 3*x2 - 4*x3 + 5*x4 + +julia> inI = initial(I,nu_2,[0,0,0,0]) +Ideal generated by + x1 + x3 + x2 + x4 + +julia> GBI = groebner_basis(I,nu_2,[1,0,0,1]) +2-element Vector{QQMPolyRingElem}: + 3*x2 - 4*x3 + 5*x4 + -x1 - 2*x2 + 3*x3 + +julia> inI = initial(I,nu_2,[1,0,0,1]) +Ideal generated by + x2 + x3 + +julia> coefficient_ring(inI) +Prime field of characteristic 2 diff --git a/test/book/specialized/holt-ren-tropical-geometry/hypersurface1.jlcon b/test/book/specialized/holt-ren-tropical-geometry/hypersurface1.jlcon new file mode 100644 index 000000000000..1d86c5bf978b --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/hypersurface1.jlcon @@ -0,0 +1,31 @@ +julia> K,t = rational_function_field(QQ,"t"); + +julia> nu = tropical_semiring_map(K,t,max); + +julia> R,(x,y) = K["x","y"]; + +julia> f = t^3+x+t^2*y+x*(x^2+y^2) +x^3 + x*y^2 + x + t^2*y + t^3 + +julia> TropH = tropical_hypersurface(f,nu) +Max tropical hypersurface + +julia> vertices_and_rays(TropH) # 1,2,3 are vertices, rest are rays +7-element SubObjectIterator{Union{PointVector{QQFieldElem}, RayVector{QQFieldElem}}}: + [0, -1] + [-2, 0] + [-3, -1] + [0, 0] + [1, 1] + [-1, 1] + [-1, 0] + +julia> maximal_polyhedra(IncidenceMatrix,TropH) +7×7 IncidenceMatrix +[4, 5] +[1, 4] +[2, 4] +[2, 6] +[2, 3] +[1, 3] +[3, 7] diff --git a/test/book/specialized/holt-ren-tropical-geometry/hypersurface2.jlcon b/test/book/specialized/holt-ren-tropical-geometry/hypersurface2.jlcon new file mode 100644 index 000000000000..6d238d4abd0f --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/hypersurface2.jlcon @@ -0,0 +1,5 @@ +julia> tropf = tropical_polynomial(f,nu) +x^3 + x*y^2 + x + (-2)*y + (-3) + +julia> tropical_hypersurface(tropf) +Max tropical hypersurface diff --git a/test/book/specialized/holt-ren-tropical-geometry/hypersurface3.jlcon b/test/book/specialized/holt-ren-tropical-geometry/hypersurface3.jlcon new file mode 100644 index 000000000000..c56794b4c858 --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/hypersurface3.jlcon @@ -0,0 +1,20 @@ +julia> points = matrix(ZZ,collect(exponents(tropf))) +[3 0] +[1 2] +[1 0] +[0 1] +[0 0] + +julia> heights = QQ.(collect(coefficients(tropf))) +5-element Vector{QQFieldElem}: + 0 + 0 + 0 + -2 + -3 + +julia> Delta = subdivision_of_points(points,heights) +Subdivision of points in ambient dimension 2 + +julia> tropical_hypersurface(Delta,max) +Max tropical hypersurface diff --git a/test/book/specialized/holt-ren-tropical-geometry/intersection.jlcon b/test/book/specialized/holt-ren-tropical-geometry/intersection.jlcon new file mode 100644 index 000000000000..f4a5dbff88ba --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/intersection.jlcon @@ -0,0 +1,34 @@ +julia> K,t = rational_function_field(QQ,"t"); + +julia> nu = tropical_semiring_map(K,t,max); + +julia> R,(x,y) = K["x","y"]; + +julia> f = t^3+x+t^2*y+x*(x^2+y^2) +x^3 + x*y^2 + x + t^2*y + t^3 + +julia> g = t^4+t^4*x+t^2*y+y*(x^2+y^2) +x^2*y + t^4*x + y^3 + t^2*y + t^4 + +julia> TropHf = tropical_hypersurface(f,nu) +Max tropical hypersurface + +julia> TropHg = tropical_hypersurface(g,nu) +Max tropical hypersurface + +julia> TropV = stable_intersection(TropHf,TropHg) +Max tropical variety + +julia> vertices(TropV) +4-element SubObjectIterator{PointVector{QQFieldElem}}: + [0, 0] + [0, -4] + [-3, -1] + [-3, -2] + +julia> multiplicities(TropV) # same ordering as above +4-element Vector{ZZRingElem}: + 4 + 2 + 2 + 1 diff --git a/test/book/specialized/holt-ren-tropical-geometry/linearSpace1.jlcon b/test/book/specialized/holt-ren-tropical-geometry/linearSpace1.jlcon new file mode 100644 index 000000000000..89ecbed8d31e --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/linearSpace1.jlcon @@ -0,0 +1,23 @@ +julia> R,(w,x,y,z) = QQ["w","x","y","z"]; + +julia> nu = tropical_semiring_map(QQ); + +julia> I = ideal([w+x+y+z,w+2*x+5*y+11*z]); + +julia> TropL = tropical_linear_space(I,nu) +Min tropical linear space + +julia> vertices_and_rays(TropL) +5-element SubObjectIterator{Union{PointVector{QQFieldElem}, RayVector{QQFieldElem}}}: + [0, 0, 0, 0] + [0, -1, -1, -1] + [0, 1, 0, 0] + [0, 0, 1, 0] + [0, 0, 0, 1] + +julia> maximal_polyhedra(IncidenceMatrix,TropL) +4×5 IncidenceMatrix +[1, 2] +[1, 3] +[1, 4] +[1, 5] diff --git a/test/book/specialized/holt-ren-tropical-geometry/linearSpace2.jlcon b/test/book/specialized/holt-ren-tropical-geometry/linearSpace2.jlcon new file mode 100644 index 000000000000..2a8a6de60c5e --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/linearSpace2.jlcon @@ -0,0 +1,13 @@ +julia> A = matrix(QQ,[1 1 1 0; 1 1 0 1]) +[1 1 1 0] +[1 1 0 1] + +julia> TropL1 = tropical_linear_space(A, nu) # not Stiefel +Min tropical linear space + +julia> tropA = nu.(A) +[(0) (0) (0) infty] +[(0) (0) infty (0)] + +julia> TropL2 = tropical_linear_space(tropA) # not equal TropL1 +Min tropical linear space diff --git a/test/book/specialized/holt-ren-tropical-geometry/linearSpace3.jlcon b/test/book/specialized/holt-ren-tropical-geometry/linearSpace3.jlcon new file mode 100644 index 000000000000..e8a1ffca1a57 --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/linearSpace3.jlcon @@ -0,0 +1,14 @@ +julia> plueckerIndices = [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]; + +julia> algebraicPlueckerVector = [0,-1,-1,1,1,1]; + +julia> TropL1 = tropical_linear_space(plueckerIndices, + algebraicPlueckerVector, + nu) +Min tropical linear space + +julia> tropicalPlueckerVector = nu.(algebraicPlueckerVector); + +julia> TropL2 = tropical_linear_space(plueckerIndices, + tropicalPlueckerVector) +Min tropical linear space diff --git a/test/book/specialized/holt-ren-tropical-geometry/matrixAndPoly.jlcon b/test/book/specialized/holt-ren-tropical-geometry/matrixAndPoly.jlcon new file mode 100644 index 000000000000..c1408091bccd --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/matrixAndPoly.jlcon @@ -0,0 +1,27 @@ +julia> T = tropical_semiring() +Min tropical semiring + +julia> M = matrix(T,[0 1; 2 3]) +[(0) (1)] +[(2) (3)] + +julia> v = T.([-1,-1]) +2-element Vector{TropicalSemiringElem{typeof(min)}}: + (-1) + (-1) + +julia> M^2*v +2-element Vector{TropicalSemiringElem{typeof(min)}}: + (-1) + (1) + +julia> R,(x,y) = T["x","y"]; + +julia> f = 1*x^2+2*y^2+0 +(1)*x^2 + (2)*y^2 + (0) + +julia> f^2+2*f +(2)*x^4 + (3)*x^2*y^2 + (4)*y^4 + (1)*x^2 + (2)*y^2 + (0) + +julia> evaluate(f,T.([1,1])) +(0) diff --git a/test/book/specialized/holt-ren-tropical-geometry/semiring.jlcon b/test/book/specialized/holt-ren-tropical-geometry/semiring.jlcon new file mode 100644 index 000000000000..5ca9afd09198 --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/semiring.jlcon @@ -0,0 +1,11 @@ +julia> T = tropical_semiring() +Min tropical semiring + +julia> T(1)+T(2), T(1)*T(2), zero(T), one(T) +((1), (3), infty, (0)) + +julia> T = tropical_semiring(max) +Max tropical semiring + +julia> T(1)+T(2), T(1)*T(2), zero(T), one(T) +((2), (3), -infty, (0)) diff --git a/test/book/specialized/holt-ren-tropical-geometry/semiringMaps1.jlcon b/test/book/specialized/holt-ren-tropical-geometry/semiringMaps1.jlcon new file mode 100644 index 000000000000..c5b36a4faa3f --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/semiringMaps1.jlcon @@ -0,0 +1,8 @@ +julia> nu = tropical_semiring_map(GF(3)) +Map into Min tropical semiring encoding the trivial valuation on Prime field of characteristic 3 + +julia> nu.([0,1,2]) +3-element Vector{TropicalSemiringElem{typeof(min)}}: + infty + (0) + (0) diff --git a/test/book/specialized/holt-ren-tropical-geometry/semiringMaps2.jlcon b/test/book/specialized/holt-ren-tropical-geometry/semiringMaps2.jlcon new file mode 100644 index 000000000000..cce0abfaa1a3 --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/semiringMaps2.jlcon @@ -0,0 +1,8 @@ +julia> nu = tropical_semiring_map(QQ,3,max) +Map into Max tropical semiring encoding the 3-adic valuation on Rational field + +julia> nu.([1//3,1,3]) +3-element Vector{TropicalSemiringElem{typeof(max)}}: + (1) + (0) + (-1) diff --git a/test/book/specialized/holt-ren-tropical-geometry/semiringMaps3.jlcon b/test/book/specialized/holt-ren-tropical-geometry/semiringMaps3.jlcon new file mode 100644 index 000000000000..7a139eecaab7 --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/semiringMaps3.jlcon @@ -0,0 +1,11 @@ +julia> Ft,t = rational_function_field(GF(3),"t") +(Rational function field over GF(3), t) + +julia> nu = tropical_semiring_map(Ft,t,max) +Map into Max tropical semiring encoding the t-adic valuation on Rational function field over GF(3) + +julia> nu.([t^(-1),1,t]) +3-element Vector{TropicalSemiringElem{typeof(max)}}: + (1) + (0) + (-1) diff --git a/test/book/specialized/holt-ren-tropical-geometry/variety.jlcon b/test/book/specialized/holt-ren-tropical-geometry/variety.jlcon new file mode 100644 index 000000000000..3783833e1a6a --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/variety.jlcon @@ -0,0 +1,18 @@ +julia> K,t = rational_function_field(GF(101),"t"); + +julia> nu = tropical_semiring_map(K,t); + +julia> R,(x,y,z) = K["x","y","z"]; + +julia> I = intersect(ideal([x+y+z+1,2*x+11*y+23*z+31]), + ideal([t^3*x*y*z-1])); + +julia> TropV = tropical_variety(I,nu) +2-element Vector{TropicalVariety}: + Min tropical variety + Min tropical variety + +julia> dim.(TropV) +2-element Vector{Int64}: + 2 + 1 diff --git a/test/book/specialized/joswig-kastner-lorenz-confirmable-workflows/polynomial-load.jlcon b/test/book/specialized/joswig-kastner-lorenz-confirmable-workflows/polynomial-load.jlcon new file mode 100644 index 000000000000..cfe2de4da68f --- /dev/null +++ b/test/book/specialized/joswig-kastner-lorenz-confirmable-workflows/polynomial-load.jlcon @@ -0,0 +1,12 @@ +julia> F, o = finite_field(7,2) +(Finite field of degree 2 and characteristic 7, o) + +julia> R, (y,z) = F["y","z"] +(Multivariate polynomial ring in 2 variables over GF(7, 2), FqMPolyRingElem[y, z]) + +julia> save("p.mrdi", 2*y^3*z^4 + (o + 3)*z^2 + 5*o*y + 1) + +julia> save("q.mrdi", y^17*z^3 + (o + 4)*z + 2*o*y) + +julia> print( load("p.mrdi") + load("q.mrdi") ) +y^17*z^3 + 2*y^3*z^4 + (o + 3)*z^2 + (o + 4)*z + 1 diff --git a/test/book/specialized/joswig-kastner-lorenz-confirmable-workflows/snf.jlcon b/test/book/specialized/joswig-kastner-lorenz-confirmable-workflows/snf.jlcon new file mode 100644 index 000000000000..e7b32c6416a9 --- /dev/null +++ b/test/book/specialized/joswig-kastner-lorenz-confirmable-workflows/snf.jlcon @@ -0,0 +1,17 @@ +julia> m = matrix(ZZ, [1 2; 3 4]) +[1 2] +[3 4] + +julia> snf(m) +[1 0] +[0 2] + +julia> methods(snf, Tuple{MatrixElem{ZZRingElem}}) +# 2 methods for generic function "snf" from AbstractAlgebra: + [1] snf(x::ZZMatrix) + @ Nemo ~/.julia/packages/Nemo/xwSoX/src/flint/fmpz_mat.jl:1096 + [2] snf(a::MatrixElem{T}) where T<:RingElement + @ ~/.julia/packages/AbstractAlgebra/dsta0/src/Matrix.jl:5431 + +julia> invoke(snf, Tuple{MatrixElem{ZZRingElem}}, m) == snf(m) +true diff --git a/test/book/specialized/joswig-kastner-lorenz-confirmable-workflows/versioninfo.jlcon b/test/book/specialized/joswig-kastner-lorenz-confirmable-workflows/versioninfo.jlcon new file mode 100644 index 000000000000..30c3e78aa04f --- /dev/null +++ b/test/book/specialized/joswig-kastner-lorenz-confirmable-workflows/versioninfo.jlcon @@ -0,0 +1,33 @@ +julia> Oscar.versioninfo(full=true) +OSCAR version 1.0.0 + combining: + AbstractAlgebra.jl v0.40.1 + GAP.jl v0.10.3 + Hecke.jl v0.30.2 + Nemo.jl v0.43.1 + Polymake.jl v0.11.14 + Singular.jl v0.22.4 + building on: + Antic_jll v0.201.500+0 + Arb_jll v200.2300.0+0 + Calcium_jll v0.401.100+0 + FLINT_jll v200.900.9+0 + GAP_jll v400.1200.200+9 + Singular_jll v403.214.1400+0 + libpolymake_julia_jll v0.11.4+0 + libsingular_julia_jll v0.43.0+0 + polymake_jll v400.1100.1+0 +See `]st -m` for a full list of dependencies. + +Julia Version 1.10.2 +Commit bd47eca2c8a (2024-03-01 10:14 UTC) +Build Info: + Official https://julialang.org/ release +Platform Info: + OS: Linux (x86_64-linux-gnu) + CPU: 8 × 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz + WORD_SIZE: 64 + LIBM: libopenlibm + LLVM: libLLVM-15.0.7 (ORCJIT, tigerlake) +Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores) +Official https://julialang.org/ release diff --git a/test/book/specialized/kuehne-schroeter-matroids/ChowRings.jlcon b/test/book/specialized/kuehne-schroeter-matroids/ChowRings.jlcon new file mode 100644 index 000000000000..048441a4fb83 --- /dev/null +++ b/test/book/specialized/kuehne-schroeter-matroids/ChowRings.jlcon @@ -0,0 +1,97 @@ +julia> M = cycle_matroid(complete_graph(4)) +Matroid of rank 3 on 6 elements + +julia> tutte_polynomial(M) +x^3 + 3*x^2 + 4*x*y + 2*x + y^3 + 3*y^2 + 2*y + +julia> char_poly = characteristic_polynomial(M) +q^3 - 6*q^2 + 11*q - 6 + +julia> factor(char_poly) +1 * (q - 2) * (q - 1) * (q - 3) + +julia> A = chow_ring(M); + +julia> GR, _ = graded_polynomial_ring(QQ,symbols(base_ring(A))); + +julia> AA = chow_ring(M,ring=GR); + +julia> vol_map = volume_map(M,AA) +#3605 (generic function with 1 method) + +julia> e = matroid_groundset(M)[1]; + +julia> proper_flats = flats(M)[2:length(flats(M))-1]; + +julia> a = sum([AA[i] for i in 1:length(proper_flats) if e in proper_flats[i]]) +x_{Edge(2, 1)} + x_{Edge(2, 1),Edge(3, 1),Edge(3, 2)} + x_{Edge(2, 1),Edge(4, 1),Edge(4, 2)} + x_{Edge(2, 1),Edge(4, 3)} + +julia> b = sum([AA[i] for i in 1:length(proper_flats) if !(e in proper_flats[i])]) +x_{Edge(3, 1)} + x_{Edge(3, 2)} + x_{Edge(4, 1)} + x_{Edge(4, 2)} + x_{Edge(4, 3)} + x_{Edge(3, 1),Edge(4, 2)} + x_{Edge(3, 1),Edge(4, 1),Edge(4, 3)} + x_{Edge(3, 2),Edge(4, 1)} + x_{Edge(3, 2),Edge(4, 2),Edge(4, 3)} + +julia> k = 1 +1 + +julia> R = base_ring(AA); + +julia> g = grading_group(R)[1]; + +julia> PD1, mapPD1 = homogeneous_component(AA,k*g); + +julia> basis_PD1 = [mapPD1(x) for x in gens(PD1)]; + +julia> PD2, mapPD2 = homogeneous_component(AA,(rank(M)-k-1)*g); + +julia> basis_PD2 = [mapPD2(x) for x in gens(PD2)]; + +julia> Mat1 = matrix(QQ,[[vol_map(b1*b2) for b1 in basis_PD1] for b2 in basis_PD2]) +[-1 0 0 0 0 0 0 1] +[ 0 -1 0 0 0 0 0 0] +[ 0 0 -1 0 0 0 0 1] +[ 0 0 0 -1 0 0 0 0] +[ 0 0 0 0 -1 0 0 1] +[ 0 0 0 0 0 -1 0 0] +[ 0 0 0 0 0 0 -1 0] +[ 1 0 1 0 1 0 0 -2] + +julia> Mat2 = matrix(QQ,[[vol_map(b1*b^(rank(M)-2k-1)*b2) for b1 in basis_PD1] for b2 in basis_PD1]); + +julia> Mat1 == Mat2 +true + +julia> RR, _ = graded_polynomial_ring(QQ,"y_#" => 1:length(basis_PD1)); + +julia> map = hom(RR,AA,basis_PD1); + +julia> K = kernel(hom(RR,AA,[b^(rank(M)-2k)*b for b in basis_PD1])); + +julia> basis_HR = [map(h) for h in gens(K) if degree(h).coeff==k*g.coeff] +7-element Vector{MPolyQuoRingElem{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}}: + -x_{Edge(4, 3)} + 2*x_{Edge(2, 1),Edge(3, 1),Edge(3, 2)} + -x_{Edge(4, 3)} + 2*x_{Edge(2, 1),Edge(4, 1),Edge(4, 2)} + -x_{Edge(4, 3)} + 2*x_{Edge(2, 1),Edge(4, 3)} + -x_{Edge(4, 3)} + 2*x_{Edge(3, 1),Edge(4, 2)} + -x_{Edge(4, 3)} + 2*x_{Edge(3, 1),Edge(4, 1),Edge(4, 3)} + -x_{Edge(4, 3)} + 2*x_{Edge(3, 2),Edge(4, 1)} + -x_{Edge(4, 3)} + 2*x_{Edge(3, 2),Edge(4, 2),Edge(4, 3)} + +julia> Mat3 = matrix(QQ,[[(-1)^k*vol_map(b1*b^(rank(M)-2k-1)*b2) for b1 in basis_HR] for b2 in basis_HR]) +[6 2 4 2 4 2 4] +[2 6 4 2 4 2 4] +[4 4 10 4 6 4 6] +[2 2 4 6 4 2 4] +[4 4 6 4 10 4 6] +[2 2 4 2 4 6 4] +[4 4 6 4 6 4 10] + +julia> is_positive_definite(matrix(ZZ,[ZZ(i) for i in Mat3])) +true + +julia> reduced_characteristic_polynomial(M) +q^2 - 5*q + 6 + +julia> [vol_map(a^(rank(M)-j-1)*b^j) for j in range(0,rank(M)-1)] +3-element Vector{QQFieldElem}: + 1 + 5 + 6 diff --git a/test/book/specialized/kuehne-schroeter-matroids/basics.jlcon b/test/book/specialized/kuehne-schroeter-matroids/basics.jlcon new file mode 100644 index 000000000000..9fe0234f347a --- /dev/null +++ b/test/book/specialized/kuehne-schroeter-matroids/basics.jlcon @@ -0,0 +1,47 @@ +julia> B = [[1,2],[1,3],[1,4],[2,3],[2,4]]; + +julia> M = matroid_from_bases(B,4) +Matroid of rank 2 on 4 elements + +julia> independent_sets(M) +10-element Vector{Vector{Int64}}: + [] + [1] + [2] + [3] + [4] + [1, 4] + [2, 4] + [1, 3] + [2, 3] + [1, 2] + +julia> flats(M) +5-element Vector{Vector{Int64}}: + [] + [1] + [2] + [3, 4] + [1, 2, 3, 4] + +julia> circuits(M) +3-element Vector{Vector{Int64}}: + [3, 4] + [1, 2, 4] + [1, 2, 3] + +julia> X = matrix(GF(2), [1 0 1 0 1 0 1; 0 1 1 0 0 1 1; 0 0 0 1 1 1 1]) +[1 0 1 0 1 0 1] +[0 1 1 0 0 1 1] +[0 0 0 1 1 1 1] + +julia> F = matroid_from_matrix_columns(X) +Matroid of rank 3 on 7 elements + +julia> is_isomorphic(F, fano_matroid()) +true + +julia> G = automorphism_group(F); + +julia> describe(G) +"PSL(3,2)" diff --git a/test/book/specialized/kuehne-schroeter-matroids/realization_space.jlcon b/test/book/specialized/kuehne-schroeter-matroids/realization_space.jlcon new file mode 100644 index 000000000000..b6b82ceba9fa --- /dev/null +++ b/test/book/specialized/kuehne-schroeter-matroids/realization_space.jlcon @@ -0,0 +1,126 @@ +julia> nonbases(vamos_matroid()) +5-element Vector{Vector{Int64}}: + [1, 2, 3, 4] + [1, 2, 5, 6] + [1, 2, 7, 8] + [3, 4, 5, 6] + [5, 6, 7, 8] + +julia> M = moebius_kantor_matroid(); + +julia> nonbases(M) +8-element Vector{Vector{Int64}}: + [1, 2, 3] + [1, 4, 5] + [1, 7, 8] + [2, 4, 6] + [2, 5, 8] + [3, 4, 7] + [3, 6, 8] + [5, 6, 7] + +julia> realization_space(M) +The realization space is + [1 0 1 0 1 0 1 1] + [0 1 1 0 0 1 1 x1] + [0 0 0 1 1 -x1 -x1 + 1 1] +in the multivariate polynomial ring in 1 variable over ZZ +within the vanishing set of the ideal +Ideal (x1^2 - x1 + 1) +avoiding the zero loci of the polynomials +RingElem[x1, x1 - 1, x1^2 + 1] + +julia> X = matrix(GF(2), [1 0 1 0 1 0 1; 0 1 1 0 0 1 1; 0 0 0 1 1 1 1]) +[1 0 1 0 1 0 1] +[0 1 1 0 0 1 1] +[0 0 0 1 1 1 1] + +julia> F = matroid_from_matrix_columns(X) +Matroid of rank 3 on 7 elements + +julia> realization_space(F, simplify=false) +The realization space is + [0 1 1 1 1 0 0] + [1 0 1 x2 0 1 0] + [1 0 x1 0 x3 0 1] +in the multivariate polynomial ring in 3 variables over ZZ +within the vanishing set of the ideal +Ideal (2, x3 + 1, x2 - 1, x1 + 1) +avoiding the zero loci of the polynomials +RingElem[x2, x3, x1, x1*x2 - x2*x3 + x3, x1 - x3 - 1, x1 + x2 - 1] + +julia> realization_space(F, simplify=true) +The realization space is + [0 1 1 1 1 0 0] + [1 0 1 1 0 1 0] + [1 0 1 0 1 0 1] +in the integer ring +within the vanishing set of the ideal +2ZZ + +julia> is_realizable(F, char=5) +false + +julia> realization_space(non_fano_matroid()) +The realization space is + [1 1 0 0 1 1 0] + [0 1 1 1 1 0 0] + [0 1 1 0 0 1 1] +in the integer ring +avoiding the zero loci of the polynomials +RingElem[2] + +julia> is_realizable(vamos_matroid()) +false + +julia> is_realizable(M, q=9) +true + +julia> qs = [2,3,4,5,7,8,9,11,13]; + +julia> println([is_realizable(M, q=a) for a in qs]) +Bool[0, 1, 1, 0, 1, 0, 1, 0, 1] + +julia> M = cycle_matroid(complete_graph(4)); + +julia> realization_space(M) +The realization space is + [1 0 1 0 1 0] + [0 1 1 0 0 1] + [0 0 0 1 1 -1] +in the integer ring + +julia> db = Polymake.Polydb.get_db(); + +julia> collection = db["Matroids.Small"]; + +julia> query = Dict("RANK"=>3,"N_ELEMENTS"=>9,"SIMPLE"=>true); + +julia> results = Polymake.Polydb.find(collection, query); + +julia> oscar_matroids = [Matroid(pm) for pm in results]; + +julia> length(oscar_matroids) +383 + +julia> char_0_matroids = [M for M in oscar_matroids + if is_realizable(M, char=0)]; + +julia> length(char_0_matroids) +370 + +julia> RS = realization_space(pappus_matroid(), char=0) +The realization space is + [1 0 1 0 x2 x2 x2^2 1 0] + [0 1 1 0 1 1 -x1*x2 + x1 + x2^2 1 1] + [0 0 0 1 x2 x1 x1*x2 x1 x2] +in the multivariate polynomial ring in 2 variables over QQ +avoiding the zero loci of the polynomials +RingElem[x1 - x2, x2, x1, x2 - 1, x1 + x2^2 - x2, x1 - 1, x1*x2 - x1 - x2^2] + +julia> realization(RS) +One realization is given by + [1 0 1 0 2 2 4 1 0] + [0 1 1 0 1 1 1 1 1] + [0 0 0 1 2 3 6 3 2] +in the rational field diff --git a/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/draw_hypersurface.jlcon b/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/draw_hypersurface.jlcon new file mode 100644 index 000000000000..4847f599b04a --- /dev/null +++ b/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/draw_hypersurface.jlcon @@ -0,0 +1,22 @@ +julia> Kt,t = rational_function_field(QQ,"t") +(Rational function field over QQ, t) + +julia> Kxy, (x,y) = Kt["x", "y"] +(Multivariate polynomial ring in 2 variables over rational function field, AbstractAlgebra.Generic.MPoly{AbstractAlgebra.Generic.RationalFunctionFieldElem{QQFieldElem, QQPolyRingElem}}[x, y]) + +julia> f=-x^3-4*x^2+y^2+(-8*t^4)*x +-x^3 - 4*x^2 - 8*t^4*x + y^2 + +julia> val_t = tropical_semiring_map(Kt,t) +Map into Min tropical semiring encoding the t-adic valuation on Rational function field over QQ + +julia> ftrop=tropical_polynomial(f,val_t) +x^3 + x^2 + y^2 + (4)*x + +julia> Tf = tropical_hypersurface(ftrop) +Min tropical hypersurface + +julia> PC = polyhedral_complex(Tf) +Polyhedral complex in ambient dimension 2 + +julia> visualize(PC) diff --git a/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_xz.jlcon b/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_xz.jlcon new file mode 100644 index 000000000000..536e974116ef --- /dev/null +++ b/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_xz.jlcon @@ -0,0 +1,15 @@ +julia> S,(b2,b34,b4,b56,b6,b7)=polynomial_ring(QQ,["b2", "b34", "b4", "b56", "b6", "b7"]) +(Multivariate polynomial ring in 6 variables over QQ, QQMPolyRingElem[b2, b34, b4, b56, b6, b7]) + +julia> R,(x, y, z)=polynomial_ring(S,["x", "y", "z"]) +(Multivariate polynomial ring in 3 variables over multivariate polynomial ring, AbstractAlgebra.Generic.MPoly{QQMPolyRingElem}[x, y, z]) + +julia> g = y^2-x*(x-b2^2)*(x-(b34+b4)^2)*(x-(b4)^2)*(x-(b6+b56)^2)*(x-(b6)^2)*(x+(b7)^2); + +julia> f= y - b4*(b34 + b4)*b6*(b6 + b56)*b7*x + b6*(b6 + b56)*b7*x^2 - b7*x^3; + +julia> Igf = ideal(R,[g,f]); + +julia> eliminate(Igf,[y]) +Ideal generated by + -x^7 + (b2^2 + b34^2 + 2*b34*b4 + 2*b4^2 + b56^2 + 2*b56*b6 + 2*b6^2)*x^6 + (-b2^2*b34^2 - 2*b2^2*b34*b4 - 2*b2^2*b4^2 - b2^2*b56^2 - 2*b2^2*b56*b6 - 2*b2^2*b6^2 + b2^2*b7^2 - b34^2*b4^2 - b34^2*b56^2 - 2*b34^2*b56*b6 - 2*b34^2*b6^2 + b34^2*b7^2 - 2*b34*b4^3 - 2*b34*b4*b56^2 - 4*b34*b4*b56*b6 - 4*b34*b4*b6^2 + 2*b34*b4*b7^2 - b4^4 - 2*b4^2*b56^2 - 4*b4^2*b56*b6 - 4*b4^2*b6^2 + 2*b4^2*b7^2 - b56^2*b6^2 + b56^2*b7^2 - 2*b56*b6^3 - b6^4)*x^5 + (b2^2*b34^2*b4^2 + b2^2*b34^2*b56^2 + 2*b2^2*b34^2*b56*b6 + 2*b2^2*b34^2*b6^2 - b2^2*b34^2*b7^2 + 2*b2^2*b34*b4^3 + 2*b2^2*b34*b4*b56^2 + 4*b2^2*b34*b4*b56*b6 + 4*b2^2*b34*b4*b6^2 - 2*b2^2*b34*b4*b7^2 + b2^2*b4^4 + 2*b2^2*b4^2*b56^2 + 4*b2^2*b4^2*b56*b6 + 4*b2^2*b4^2*b6^2 - 2*b2^2*b4^2*b7^2 + b2^2*b56^2*b6^2 - b2^2*b56^2*b7^2 + 2*b2^2*b56*b6^3 - 2*b2^2*b56*b6*b7^2 + b2^2*b6^4 - 2*b2^2*b6^2*b7^2 + b34^2*b4^2*b56^2 + 2*b34^2*b4^2*b56*b6 + 2*b34^2*b4^2*b6^2 - b34^2*b4^2*b7^2 + b34^2*b56^2*b6^2 - b34^2*b56^2*b7^2 + 2*b34^2*b56*b6^3 - 2*b34^2*b56*b6*b7^2 + b34^2*b6^4 - 2*b34^2*b6^2*b7^2 + 2*b34*b4^3*b56^2 + 4*b34*b4^3*b56*b6 + 4*b34*b4^3*b6^2 - 2*b34*b4^3*b7^2 + 2*b34*b4*b56^2*b6^2 - 2*b34*b4*b56^2*b7^2 + 4*b34*b4*b56*b6^3 - 2*b34*b4*b56*b6*b7^2 + 2*b34*b4*b6^4 - 2*b34*b4*b6^2*b7^2 + b4^4*b56^2 + 2*b4^4*b56*b6 + 2*b4^4*b6^2 - b4^4*b7^2 + 2*b4^2*b56^2*b6^2 - 2*b4^2*b56^2*b7^2 + 4*b4^2*b56*b6^3 - 2*b4^2*b56*b6*b7^2 + 2*b4^2*b6^4 - 2*b4^2*b6^2*b7^2)*x^4 + (-b2^2*b34^2*b4^2*b56^2 - 2*b2^2*b34^2*b4^2*b56*b6 - 2*b2^2*b34^2*b4^2*b6^2 + b2^2*b34^2*b4^2*b7^2 - b2^2*b34^2*b56^2*b6^2 + b2^2*b34^2*b56^2*b7^2 - 2*b2^2*b34^2*b56*b6^3 + 2*b2^2*b34^2*b56*b6*b7^2 - b2^2*b34^2*b6^4 + 2*b2^2*b34^2*b6^2*b7^2 - 2*b2^2*b34*b4^3*b56^2 - 4*b2^2*b34*b4^3*b56*b6 - 4*b2^2*b34*b4^3*b6^2 + 2*b2^2*b34*b4^3*b7^2 - 2*b2^2*b34*b4*b56^2*b6^2 + 2*b2^2*b34*b4*b56^2*b7^2 - 4*b2^2*b34*b4*b56*b6^3 + 4*b2^2*b34*b4*b56*b6*b7^2 - 2*b2^2*b34*b4*b6^4 + 4*b2^2*b34*b4*b6^2*b7^2 - b2^2*b4^4*b56^2 - 2*b2^2*b4^4*b56*b6 - 2*b2^2*b4^4*b6^2 + b2^2*b4^4*b7^2 - 2*b2^2*b4^2*b56^2*b6^2 + 2*b2^2*b4^2*b56^2*b7^2 - 4*b2^2*b4^2*b56*b6^3 + 4*b2^2*b4^2*b56*b6*b7^2 - 2*b2^2*b4^2*b6^4 + 4*b2^2*b4^2*b6^2*b7^2 + b2^2*b56^2*b6^2*b7^2 + 2*b2^2*b56*b6^3*b7^2 + b2^2*b6^4*b7^2 - b34^2*b4^2*b56^2*b6^2 + b34^2*b4^2*b56^2*b7^2 - 2*b34^2*b4^2*b56*b6^3 + 2*b34^2*b4^2*b56*b6*b7^2 - b34^2*b4^2*b6^4 + 2*b34^2*b4^2*b6^2*b7^2 + b34^2*b56^2*b6^2*b7^2 + 2*b34^2*b56*b6^3*b7^2 + b34^2*b6^4*b7^2 - 2*b34*b4^3*b56^2*b6^2 + 2*b34*b4^3*b56^2*b7^2 - 4*b34*b4^3*b56*b6^3 + 4*b34*b4^3*b56*b6*b7^2 - 2*b34*b4^3*b6^4 + 4*b34*b4^3*b6^2*b7^2 - b4^4*b56^2*b6^2 + b4^4*b56^2*b7^2 - 2*b4^4*b56*b6^3 + 2*b4^4*b56*b6*b7^2 - b4^4*b6^4 + 2*b4^4*b6^2*b7^2)*x^3 + (b2^2*b34^2*b4^2*b56^2*b6^2 - b2^2*b34^2*b4^2*b56^2*b7^2 + 2*b2^2*b34^2*b4^2*b56*b6^3 - 2*b2^2*b34^2*b4^2*b56*b6*b7^2 + b2^2*b34^2*b4^2*b6^4 - 2*b2^2*b34^2*b4^2*b6^2*b7^2 - b2^2*b34^2*b56^2*b6^2*b7^2 - 2*b2^2*b34^2*b56*b6^3*b7^2 - b2^2*b34^2*b6^4*b7^2 + 2*b2^2*b34*b4^3*b56^2*b6^2 - 2*b2^2*b34*b4^3*b56^2*b7^2 + 4*b2^2*b34*b4^3*b56*b6^3 - 4*b2^2*b34*b4^3*b56*b6*b7^2 + 2*b2^2*b34*b4^3*b6^4 - 4*b2^2*b34*b4^3*b6^2*b7^2 - 2*b2^2*b34*b4*b56^2*b6^2*b7^2 - 4*b2^2*b34*b4*b56*b6^3*b7^2 - 2*b2^2*b34*b4*b6^4*b7^2 + b2^2*b4^4*b56^2*b6^2 - b2^2*b4^4*b56^2*b7^2 + 2*b2^2*b4^4*b56*b6^3 - 2*b2^2*b4^4*b56*b6*b7^2 + b2^2*b4^4*b6^4 - 2*b2^2*b4^4*b6^2*b7^2 - 2*b2^2*b4^2*b56^2*b6^2*b7^2 - 4*b2^2*b4^2*b56*b6^3*b7^2 - 2*b2^2*b4^2*b6^4*b7^2)*x^2 + (b2^2*b34^2*b4^2*b56^2*b6^2*b7^2 + 2*b2^2*b34^2*b4^2*b56*b6^3*b7^2 + b2^2*b34^2*b4^2*b6^4*b7^2 + 2*b2^2*b34*b4^3*b56^2*b6^2*b7^2 + 4*b2^2*b34*b4^3*b56*b6^3*b7^2 + 2*b2^2*b34*b4^3*b6^4*b7^2 + b2^2*b4^4*b56^2*b6^2*b7^2 + 2*b2^2*b4^4*b56*b6^3*b7^2 + b2^2*b4^4*b6^4*b7^2)*x diff --git a/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_yz.jlcon b/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_yz.jlcon new file mode 100644 index 000000000000..6853d63a4e14 --- /dev/null +++ b/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_yz.jlcon @@ -0,0 +1,13 @@ +julia> S,(b4,b56,b6,b7)=polynomial_ring(QQ,["b4", "b56", "b6", "b7"]) +(Multivariate polynomial ring in 4 variables over QQ, QQMPolyRingElem[b4, b56, b6, b7]) + +julia> R,(x, y, z)=polynomial_ring(S,["x", "y", "z"]) +(Multivariate polynomial ring in 3 variables over multivariate polynomial ring, AbstractAlgebra.Generic.MPoly{QQMPolyRingElem}[x, y, z]) + +julia> g = y^2-x*(x-1000^2)*(x-(1000000+b4)^2)*(x-(b4)^2)*(x-(b6+b56)^2)*(x-(b6)^2)*(x+(b7)^2); + +julia> f = y - b4*(1000000 + b4)*b6*(b6 + b56)*b7*x + b6*(b6 + b56)*b7*x^2 - b7*x^3; + +julia> Igf = ideal(R,[g,f]); + +julia> eliminate(Igf,[x]) diff --git a/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/vertices_P1.jlcon b/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/vertices_P1.jlcon new file mode 100644 index 000000000000..c12c812a237c --- /dev/null +++ b/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/vertices_P1.jlcon @@ -0,0 +1,21 @@ +julia> Kt,t = rational_function_field(QQ,"t"); + +julia> Kxy, (x,y) = Kt["x", "y"]; + +julia> f = (-t^2)*x^3+(t^20)*x^2*y+(t^2)*x*y^2+(t^14)*y^3+(-3*t^3)*x^2+x*y+(t^3+t^5-t^6)*y^2+(-3*t^4)*x+(t+t^2)*y+(2*t^2+t^5); + +julia> val_t = tropical_semiring_map(Kt,t); + +julia> ftrop=tropical_polynomial(f,val_t); + +julia> Tf=tropical_hypersurface(ftrop); + +julia> PC1 = polyhedral_complex(Tf); + +julia> vertices(PC1) +5-element SubObjectIterator{PointVector{QQFieldElem}}: + [1, -11] + [1, -2] + [-2, -2] + [0, 2] + [1, 1] diff --git a/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/vertices_P2.jlcon b/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/vertices_P2.jlcon new file mode 100644 index 000000000000..b92dbc6826a0 --- /dev/null +++ b/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/vertices_P2.jlcon @@ -0,0 +1,22 @@ +julia> Kt,t = rational_function_field(QQ,"t"); + +julia> Kxy, (x,y) = Kt["x", "y"]; + +julia> g = (-t^2)*x^3+(t^20)*x^2*y+(t^2)*x*y^2+(t^14)*y^3+(1-2*t^21)*x*y+(t^5-t^6)*y^2+(t^2+t^22)*y+(2*t^2+2*t^5); + +julia> val_t = tropical_semiring_map(Kt,t); + +julia> gtrop=tropical_polynomial(g,val_t); + +julia> Tg=tropical_hypersurface(gtrop); + +julia> PC2 = polyhedral_complex(Tg); + +julia> vertices(PC2) +6-element SubObjectIterator{PointVector{QQFieldElem}}: + [3, -9] + [-2, -2] + [2, -2] + [3, -3] + [2, 0] + [0, 2] diff --git a/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/chow_fan.jlcon b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/chow_fan.jlcon new file mode 100644 index 000000000000..8a4a3b285ffd --- /dev/null +++ b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/chow_fan.jlcon @@ -0,0 +1,5 @@ +julia> cone_list = positive_hull.([[1, 1, 0],[1, 2, 3], [1,0,1], [-1, -1, -4//3]]); + +julia> weight_list = ones(Int64, 4); + +julia> cone_list, weight_list = get_chow_fan(cone_list,weight_list); diff --git a/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/chow_transl.jlcon b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/chow_transl.jlcon new file mode 100644 index 000000000000..ecb34a69e183 --- /dev/null +++ b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/chow_transl.jlcon @@ -0,0 +1 @@ +julia> C_translated = get_polytope_from_cycle(cone_list,weight_list); diff --git a/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/coeffs_fin.jlcon b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/coeffs_fin.jlcon new file mode 100644 index 000000000000..ef719e325e9e --- /dev/null +++ b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/coeffs_fin.jlcon @@ -0,0 +1,12 @@ +julia> A = [1 1 1 1 1 1; 2 3 5 7 11 13; 13 8 5 3 2 1]; + +julia> cone_list, weight_list = get_trop_A_disc(A); + +julia> Delta = get_polytope_from_cycle(cone_list, weight_list); + +julia> @time mons, coeffs = compute_A_discriminant(A,Delta,GF(101)); +Collect all lattice points. +Sample 2754.0 points from Discriminant +Construct Vandermonde matrix. +Compute coefficients of the Discriminant. + 97.247222 seconds (210.17 M allocations: 17.505 GiB, 6.51% gc time, 0.00% compilation time) diff --git a/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/gen_impl.jlcon b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/gen_impl.jlcon new file mode 100644 index 000000000000..e2b9eeef4cd2 --- /dev/null +++ b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/gen_impl.jlcon @@ -0,0 +1,27 @@ +julia> using TropicalImplicitization, Oscar; + +julia> R, (t,) = polynomial_ring(QQ,["t"]); + +julia> f1 = 11*t^2 + 5*t^3 - 1*t^4; + +julia> f2 = 11 + 11*t + 7*t^8; + +julia> Q1 = newton_polytope(f1); + +julia> Q2 = newton_polytope(f2); + +julia> newton_pols = [Q1, Q2]; + +julia> cone_list, weight_list = get_tropical_cycle(newton_pols); + +julia> Delta = get_polytope_from_cycle(cone_list, weight_list); + +julia> B = lattice_points(Delta); + +julia> n_samples = length(B)-1; + +julia> P = sample([f1,f2], n_samples); + +julia> M_BP = get_vandermonde_matrix(B,P); + +julia> coeffs_F = nullspace(M_BP)[2]; diff --git a/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/get_hyperdet.jlcon b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/get_hyperdet.jlcon new file mode 100644 index 000000000000..fcccbfce001a --- /dev/null +++ b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/get_hyperdet.jlcon @@ -0,0 +1,8 @@ +julia> Oscar.randseed!(43); + +julia> Delta = get_polytope_from_cycle(cone_list, weight_list); + +julia> f_vec, lattice_pts = f_vector(Delta), lattice_points(Delta); + +julia> print(f_vec); +ZZRingElem[6, 14, 16, 8] diff --git a/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/hyperdet.jlcon b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/hyperdet.jlcon new file mode 100644 index 000000000000..559d0a491c4c --- /dev/null +++ b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/hyperdet.jlcon @@ -0,0 +1,4 @@ +julia> A = [1 1 1 1 1 1 1 1; 0 0 0 0 1 1 1 1; + 0 0 1 1 0 0 1 1; 0 1 0 1 0 1 0 1]; + +julia> cone_list, weight_list = get_trop_A_disc(A); diff --git a/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/pol_from_surface.jlcon b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/pol_from_surface.jlcon new file mode 100644 index 000000000000..b82dc3e7b585 --- /dev/null +++ b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/pol_from_surface.jlcon @@ -0,0 +1 @@ +julia> Delta = get_polytope_from_cycle(cone_list, weight_list); diff --git a/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/triang.jlcon b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/triang.jlcon new file mode 100644 index 000000000000..9b51e86df1f5 --- /dev/null +++ b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/triang.jlcon @@ -0,0 +1,12 @@ +julia> verts1 = [898 -614; -570 817; 892 -594]; + +julia> verts2 = [-603 -481; -623 -127; -36 732]; + +julia> verts3 = [-548 -864; -151 873; 800 -861]; + +julia> pols = convex_hull.([verts1, verts2, verts3]); + +julia> Delta = get_polytope_from_cycle(get_tropical_cycle(pols)...); + +julia> print(f_vector(Delta)) +ZZRingElem[25, 49, 26] diff --git a/test/book/test.jl b/test/book/test.jl new file mode 100644 index 000000000000..b2ae65da4b59 --- /dev/null +++ b/test/book/test.jl @@ -0,0 +1,192 @@ +const excluded = [ + # Excluded due to performance issues + "markwig-ristau-schleis-faithful-tropicalization/eliminate_xz", + "markwig-ristau-schleis-faithful-tropicalization/eliminate_yz", + "number-theory/cohenlenstra.jlcon", + "bies-turner-string-theory-applications/SU5.jlcon", + "brandhorst-zach-fibration-hopping/vinberg_2.jlcon", + "brandhorst-zach-fibration-hopping/vinberg_3.jlcon", + "cornerstones/polyhedral-geometry/ch-benchmark.jlcon", + "number-theory/unit_plot.jlcon", + "number-theory/intro_plot_lattice.jlcon", + "number-theory/intro5_0.jlcon", + # Excluded for easier testing + "number-theory", + "groups", + "algebraic-geometry", + "introduction", + "specialized/boehm-breuer-git-fans", + "specialized/markwig-ristau-schleis-faithful-tropicalization", + "specialized/holt-ren-tropical-geometry", + # "specialized/bies-turner-string-theory-applications", + "specialized/aga-boehm-hoffmann-markwig-traore", + "specialized/joswig-kastner-lorenz-confirmable-workflows", + # "cornerstones/number-theory", + "cornerstones/groups", + "introduction/introduction", + "specialized/eder-mohr-ideal-theoretic", + # "specialized/kuehne-schroeter-matroids", + "specialized/rose-sturmfels-telen-tropical-implicitization", + "specialized/flake-fourier-monomial-bases", + "specialized/brandhorst-zach-fibration-hopping", + # "specialized/breuer-nebe-parker-orthogonal-discriminants", + "cornerstones/algebraic-geometry", + "specialized/decker-schmitt-invariant-theory", + # "specialized/bies-kastner-toric-geometry", + # Excluded for Plots.jl + "g-vectors.jl", + "g-vectors-upper-bound.jl", + ] + +const broken = [ + "specialized/breuer-nebe-parker-orthogonal-discriminants/expl_syl.jlcon", + ] + +dispsize = (40, 120) + +using REPL +using Random +using Pkg +import Random.Xoshiro +include(joinpath(pkgdir(REPL),"test","FakeTerminals.jl")) + + +function normalize_repl_output(s::AbstractString) + result = string(s) + lafter = length(result) + lbefore = lafter+1 + while lafter < lbefore + lbefore = lafter + result = replace(result, r"^ "m => "") + result = strip(result) + result = replace(result, r"julia>$"s => "") + result = replace(result, r"\n\s*#[^\n]*\n"s => "\n") + lafter = length(result) + end + return strip(result) +end + + +function sanitize_input(s::AbstractString) + result = s + result = normalize_repl_output(result) + return result +end + +function sanitize_output(s::AbstractString) + result = s + # println("length before: ", length(result)) + lafter = length(result) + lbefore = lafter+1 + while lafter < lbefore + lbefore = lafter + result = replace(result, r"\r\e\[\d+[A-Z]"=>"") + result = replace(result, r"\e\[\?\d+[a-z]"=>"") + result = replace(result, r"\r\r\n"=>"") + result = replace(result, r"julia> julia> julia>" => "julia>") + lafter = length(result) + end + result = replace(result, r"julia> visualize\(PC\)julia> visualize\(PC\)" => "julia> visualize(PC)") + result = normalize_repl_output(result) + # println("length after: ", length(result)) + return result +end + +function set_task_rngstate!(state::Xoshiro) + Random.setstate!(Random.default_rng(), state.s0, state.s1, state.s2, state.s3, state.s4) +end +function get_task_rngstate!(state::Xoshiro) + t = current_task() + Random.setstate!(state, t.rngState0, t.rngState1, t.rngState2, t.rngState3, t.rngState4) +end + +function run_repl_string(s::AbstractString, rng::Random.Xoshiro; jlcon_mode=true) + input_string = s + if jlcon_mode + input_string = "\e[200~$s\e[201~\n" + end + input = Pipe() + output = Pipe() + err = Pipe() + Base.link_pipe!(input, reader_supports_async=true, writer_supports_async=true) + #outputbuf = IOBuffer() + Base.link_pipe!(output, reader_supports_async=true, writer_supports_async=true) + Base.link_pipe!(err, reader_supports_async=true, writer_supports_async=true) + stdin_write = input.in + out_stream = IOContext(output.in, :displaysize=>dispsize) + options = REPL.Options(confirm_exit=false, hascolor=false) + # options.extra_keymap = REPL.LineEdit.escape_defaults + repl = REPL.LineEditREPL(FakeTerminals.FakeTerminal(input.out, out_stream, err.in, options.hascolor), options.hascolor, false) + repl.options = options + # repl.specialdisplay = REPL.REPLDisplay(repl) + repltask = @async begin + redirect_stdout(out_stream) do + set_task_rngstate!(rng) + REPL.run_repl(repl) + get_task_rngstate!(rng) + end + end + input_task = @async write(stdin_write, input_string) + output_task = @async read(output.out, String) + wait(input_task) + input_task = @async write(stdin_write, "\x04") + wait(input_task) + wait(repltask) + close(output) + result = fetch(output_task) + return sanitize_output(result) +end + +# add overlay project for plots +custom_load_path = [] +copy!(custom_load_path, Base.DEFAULT_LOAD_PATH) +act_proj = dirname(Base.active_project()) +plots = mktempdir() +Pkg.activate(plots; io=devnull) +Pkg.add("Plots"; io=devnull) +Pkg.activate("$act_proj"; io=devnull) +pushfirst!(custom_load_path, plots) + +oefile = joinpath(Oscar.oscardir, "test/book/ordered_examples.json") +ordered_examples = load(oefile) +withenv("LINES" => dispsize[1], "COLUMNS" => dispsize[2], "DISPLAY" => "") do + for (chapter, example_list) in ordered_examples + @testset "$chapter" begin + println(chapter) + copy!(LOAD_PATH, custom_load_path) + auxmain = joinpath(Oscar.oscardir, "test/book", chapter, "auxiliary_code", "main.jl") + if isfile(auxmain) + # add overlay project for aux file + temp = mktempdir() + Pkg.activate(temp; io=devnull) + pushfirst!(LOAD_PATH, "$act_proj") + include(auxmain) + LOAD_PATH[1] = temp + Pkg.activate("$act_proj"; io=devnull) + end + Oscar.set_seed!(42) + Oscar.randseed!(42) + rng = copy(Random.default_rng()) + for example in example_list + full_file = joinpath(chapter, example) + exclude = filter(s->occursin(s, full_file), excluded) + if length(exclude) == 0 + println(" "*example) + if occursin("jlcon", example) + content = read(joinpath(Oscar.oscardir, "test/book", full_file), String) + content = sanitize_input(content) + computed = run_repl_string(content, rng) + @test normalize_repl_output(content) == computed broken=(full_file in broken) + elseif occursin("jl", example) + content = read(joinpath(Oscar.oscardir, "test/book", full_file), String) + run_repl_string(content, rng; jlcon_mode=false) + end + # else + # println(" "*example*" excluded") + end + end + end + end +end + +copy!(LOAD_PATH, Base.DEFAULT_LOAD_PATH) From 52dfd93f9ce495e5c481457adb94e33a8f0b24d8 Mon Sep 17 00:00:00 2001 From: Lars Kastner Date: Wed, 13 Mar 2024 15:36:17 +0100 Subject: [PATCH 16/30] fix jlcons, add aux code, fix whitespace --- .../number-theory/auxiliary_code/main.jl | 10 ++++++++++ .../{galoismod_1.jlcon => galoismod_1.jl} | 0 .../{galoismod_2.jlcon => galoismod_2.jl} | 0 .../book/cornerstones/number-theory/intro.jlcon | 17 ++++++++++++++--- .../number-theory/{sym_1.jlcon => sym_1.jl} | 0 .../{unit_log_plot.jlcon => unit_log_plot.jl} | 0 .../polyhedral-geometry/D222Computation.jlcon | 2 +- .../polyhedral-geometry/auxiliary_code/main.jl | 4 ++++ .../g-vectors-upper-bound.jlcon | 1 - .../polyhedral-geometry/not-pointed.jlcon | 3 +-- test/book/ordered_examples.json | 2 +- .../basis.jlcon | 0 .../fflv.jlcon | 0 .../get-operators.jlcon | 0 .../lusztig.jlcon | 0 .../nz.jlcon | 0 .../string.jlcon | 0 test/book/test.jl | 14 +++++++++++--- 18 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 test/book/cornerstones/number-theory/auxiliary_code/main.jl rename test/book/cornerstones/number-theory/{galoismod_1.jlcon => galoismod_1.jl} (100%) rename test/book/cornerstones/number-theory/{galoismod_2.jlcon => galoismod_2.jl} (100%) rename test/book/cornerstones/number-theory/{sym_1.jlcon => sym_1.jl} (100%) rename test/book/cornerstones/number-theory/{unit_log_plot.jlcon => unit_log_plot.jl} (100%) create mode 100644 test/book/cornerstones/polyhedral-geometry/auxiliary_code/main.jl rename test/book/specialized/{flake-fourier-monomial-bases => fang-fourier-monomial-bases}/basis.jlcon (100%) rename test/book/specialized/{flake-fourier-monomial-bases => fang-fourier-monomial-bases}/fflv.jlcon (100%) rename test/book/specialized/{flake-fourier-monomial-bases => fang-fourier-monomial-bases}/get-operators.jlcon (100%) rename test/book/specialized/{flake-fourier-monomial-bases => fang-fourier-monomial-bases}/lusztig.jlcon (100%) rename test/book/specialized/{flake-fourier-monomial-bases => fang-fourier-monomial-bases}/nz.jlcon (100%) rename test/book/specialized/{flake-fourier-monomial-bases => fang-fourier-monomial-bases}/string.jlcon (100%) diff --git a/test/book/cornerstones/number-theory/auxiliary_code/main.jl b/test/book/cornerstones/number-theory/auxiliary_code/main.jl new file mode 100644 index 000000000000..d5849b383e71 --- /dev/null +++ b/test/book/cornerstones/number-theory/auxiliary_code/main.jl @@ -0,0 +1,10 @@ +using Pkg +Pkg.add("Tally") + + +# pre-run some computation so that the same code doesn't affect the seeding when +# running the proper booktests +Qx, x = QQ["x"]; +K, a = number_field(x^2 - 235, "a") +OK = ring_of_integers(K); +class_group(OK); diff --git a/test/book/cornerstones/number-theory/galoismod_1.jlcon b/test/book/cornerstones/number-theory/galoismod_1.jl similarity index 100% rename from test/book/cornerstones/number-theory/galoismod_1.jlcon rename to test/book/cornerstones/number-theory/galoismod_1.jl diff --git a/test/book/cornerstones/number-theory/galoismod_2.jlcon b/test/book/cornerstones/number-theory/galoismod_2.jl similarity index 100% rename from test/book/cornerstones/number-theory/galoismod_2.jlcon rename to test/book/cornerstones/number-theory/galoismod_2.jl diff --git a/test/book/cornerstones/number-theory/intro.jlcon b/test/book/cornerstones/number-theory/intro.jlcon index 8a7bda27db33..55237aeef016 100644 --- a/test/book/cornerstones/number-theory/intro.jlcon +++ b/test/book/cornerstones/number-theory/intro.jlcon @@ -39,7 +39,13 @@ julia> discriminant(OK) julia> prime_ideals_over(OK, 7) 2-element Vector{AbsSimpleNumFieldOrderIdeal}: <7, a + 5> +Norm: 7 +Minimum: 7 +two normal wrt: 7 <7, a + 2> +Norm: 7 +Minimum: 7 +two normal wrt: 7 julia> factor(change_coefficient_ring(GF(7), x^2 - 235)) 1 * (x + 5) * (x + 2) @@ -56,11 +62,16 @@ Z/6 julia> m(zero(A)) # apply m to the neutral element of A <1, 1> -[...] +Norm: 1 +Minimum: 1 +principal generator 1 +two normal wrt: 1 julia> P = prime_ideals_over(OK, 2)[1] <2, a + 1> -[...] +Norm: 2 +Minimum: 2 +two normal wrt: 2 julia> preimage(m, P) Abelian group element [3] @@ -83,4 +94,4 @@ julia> preimage(mU, -214841715*a - 3293461126) Abelian group element [1, 5] julia> -214841715*a - 3293461126 == (-1)^1 * (3a + 46)^5 -true +true \ No newline at end of file diff --git a/test/book/cornerstones/number-theory/sym_1.jlcon b/test/book/cornerstones/number-theory/sym_1.jl similarity index 100% rename from test/book/cornerstones/number-theory/sym_1.jlcon rename to test/book/cornerstones/number-theory/sym_1.jl diff --git a/test/book/cornerstones/number-theory/unit_log_plot.jlcon b/test/book/cornerstones/number-theory/unit_log_plot.jl similarity index 100% rename from test/book/cornerstones/number-theory/unit_log_plot.jlcon rename to test/book/cornerstones/number-theory/unit_log_plot.jl diff --git a/test/book/cornerstones/polyhedral-geometry/D222Computation.jlcon b/test/book/cornerstones/polyhedral-geometry/D222Computation.jlcon index 035139377135..76949e796f79 100644 --- a/test/book/cornerstones/polyhedral-geometry/D222Computation.jlcon +++ b/test/book/cornerstones/polyhedral-geometry/D222Computation.jlcon @@ -3,7 +3,7 @@ julia> C = cube(3, 0, 1); julia> R, x, c = polynomial_ring(QQ, :x=>1:3, :c=>(0:1,0:1,0:1)); julia> f = sum(prod(x[i]^Int(p[i]) for i=1:3) - * c[(Vector{Int}(p)+[1,1,1])...] for p=lattice_points(C)) + * c[(Vector{Int}(p)+[1,1,1])...] for p=lattice_points(C)) x[1]*x[2]*x[3]*c[1, 1, 1] + x[1]*x[2]*c[1, 1, 0] + x[1]*x[3]*c[1, 0, 1] + x[1]*c[1, 0, 0] + x[2]*x[3]*c[0, 1, 1] + x[2]*c[0, 1, 0] + x[3]*c[0, 0, 1] + c[0, 0, 0] julia> I = ideal(R, vcat([derivative(f,t) for t = x], [f])); diff --git a/test/book/cornerstones/polyhedral-geometry/auxiliary_code/main.jl b/test/book/cornerstones/polyhedral-geometry/auxiliary_code/main.jl new file mode 100644 index 000000000000..98d81daf3250 --- /dev/null +++ b/test/book/cornerstones/polyhedral-geometry/auxiliary_code/main.jl @@ -0,0 +1,4 @@ +# warning: please keep this + +# loading this johnson solid triggers some `rand` call that messes with the seeding +johnson_solid(87) diff --git a/test/book/cornerstones/polyhedral-geometry/g-vectors-upper-bound.jlcon b/test/book/cornerstones/polyhedral-geometry/g-vectors-upper-bound.jlcon index 95f007329a82..38deeb26b927 100644 --- a/test/book/cornerstones/polyhedral-geometry/g-vectors-upper-bound.jlcon +++ b/test/book/cornerstones/polyhedral-geometry/g-vectors-upper-bound.jlcon @@ -6,7 +6,6 @@ julia> max_g2 = maximum(g_vectors[:,1]) julia> show(upper_bound_g_vector(6,30)) [1, 23, 276, 2300] - julia> ub = [ Int(Polymake.polytope.pseudopower(g2,2)) for g2 in min_g2:max_g2 ] 34-element Vector{Int64}: 990 diff --git a/test/book/cornerstones/polyhedral-geometry/not-pointed.jlcon b/test/book/cornerstones/polyhedral-geometry/not-pointed.jlcon index 5c0317e19c89..58bf9c305357 100644 --- a/test/book/cornerstones/polyhedral-geometry/not-pointed.jlcon +++ b/test/book/cornerstones/polyhedral-geometry/not-pointed.jlcon @@ -5,5 +5,4 @@ julia> vertices(Q) 0-element SubObjectIterator{PointVector{QQFieldElem}} julia> minimal_faces(Q) -(base_points = PointVector{QQFieldElem}[[0, 0, 0]], - lineality_basis = RayVector{QQFieldElem}[[1, 0, 0]]) +(base_points = PointVector{QQFieldElem}[[0, 0, 0]], lineality_basis = RayVector{QQFieldElem}[[1, 0, 0]]) diff --git a/test/book/ordered_examples.json b/test/book/ordered_examples.json index b94e54ca909b..af59b409145e 100644 --- a/test/book/ordered_examples.json +++ b/test/book/ordered_examples.json @@ -1 +1 @@ -{"_ns":{"Oscar":["https://github.com/oscar-system/Oscar.jl","1.0.0"]},"_type":{"name":"Dict","params":{"key_type":"String","specialized/boehm-breuer-git-fans":{"name":"Vector","params":"String"},"specialized/markwig-ristau-schleis-faithful-tropicalization":{"name":"Vector","params":"String"},"specialized/holt-ren-tropical-geometry":{"name":"Vector","params":"String"},"specialized/bies-turner-string-theory-applications":{"name":"Vector","params":"String"},"specialized/aga-boehm-hoffmann-markwig-traore":{"name":"Vector","params":"String"},"specialized/joswig-kastner-lorenz-confirmable-workflows":{"name":"Vector","params":"String"},"cornerstones/number-theory":{"name":"Vector","params":"String"},"cornerstones/groups":{"name":"Vector","params":"String"},"introduction/introduction":{"name":"Vector","params":"String"},"specialized/eder-mohr-ideal-theoretic":{"name":"Vector","params":"String"},"specialized/kuehne-schroeter-matroids":{"name":"Vector","params":"String"},"cornerstones/polyhedral-geometry":{"name":"Vector","params":"String"},"specialized/rose-sturmfels-telen-tropical-implicitization":{"name":"Vector","params":"String"},"specialized/flake-fourier-monomial-bases":{"name":"Vector","params":"String"},"specialized/brandhorst-zach-fibration-hopping":{"name":"Vector","params":"String"},"specialized/breuer-nebe-parker-orthogonal-discriminants":{"name":"Vector","params":"String"},"cornerstones/algebraic-geometry":{"name":"Vector","params":"String"},"specialized/decker-schmitt-invariant-theory":{"name":"Vector","params":"String"},"specialized/bies-kastner-toric-geometry":{"name":"Vector","params":"String"}}},"data":{"specialized/boehm-breuer-git-fans":["explG25_1.jlcon","explG25_2.jlcon","explG25_2A.jlcon","explG25_3.jlcon","explG25_3A.jlcon","explG25_4.jlcon","explG25_5.jlcon","explG25_6.jlcon","explG25_7.jlcon","explG25_8.jlcon"],"specialized/markwig-ristau-schleis-faithful-tropicalization":["draw_hypersurface.jlcon","vertices_P2.jlcon","vertices_P1.jlcon","eliminate_xz.jlcon","eliminate_yz.jlcon"],"specialized/holt-ren-tropical-geometry":["semiring.jlcon","matrixAndPoly.jlcon","det.jlcon","semiringMaps1.jlcon","semiringMaps2.jlcon","semiringMaps3.jlcon","groebner.jlcon","variety.jlcon","hypersurface1.jlcon","hypersurface2.jlcon","hypersurface3.jlcon","linearSpace1.jlcon","linearSpace2.jlcon","linearSpace3.jlcon","curve1.jlcon","curve2.jlcon","intersection.jlcon","grc.jlcon"],"specialized/bies-turner-string-theory-applications":["SU5.jlcon","SU5-2.jlcon"],"specialized/aga-boehm-hoffmann-markwig-traore":["graphname.jlcon","Caterpillar3.jlcon"],"specialized/joswig-kastner-lorenz-confirmable-workflows":["versioninfo.jlcon","polynomial-load.jlcon","snf.jlcon"],"cornerstones/number-theory":["intro.jlcon","intro_plot_lattice.jlcon","unit_plot.jlcon","unit_log_plot.jlcon","general.jlcon","embeddings.jlcon","intro4.jlcon","sym.jlcon","sym_1.jlcon","cohenlenstra.jlcon","galoismod.jlcon","galoismod_1.jlcon","galoismod_2.jlcon"],"cornerstones/groups":["intro.jlcon","actions.jlcon","explSL25.jlcon","chars.jlcon","extensions.jlcon","cohomology.jlcon","reps.jlcon","genchar.jlcon"],"introduction/introduction":["julia.jlcon","julia-jit.jlcon","julia2.jlcon","julia3.jlcon"],"specialized/eder-mohr-ideal-theoretic":["hilbert.jlcon","gbeliminate.jlcon","fglm.jlcon","realsols.jlcon","nonproper.jlcon","whitney.jlcon","combinatorics.jlcon","lcis.jlcon"],"specialized/kuehne-schroeter-matroids":["basics.jlcon","realization_space.jlcon","ChowRings.jlcon"],"cornerstones/polyhedral-geometry":["pentagon.jlcon","lp.jlcon","tetrahedron.jlcon","platonic.jlcon","dodecahedron.jlcon","johnson-orbits.jl","johnson-orbits.jlcon","perm3.jlcon","not-pointed.jlcon","simple_polyhedral_fan.jlcon","g-vector-example.jlcon","g-vectors.jl","g-vectors-upper-bound.jlcon","GelfandTsetlinEx.jlcon","generalized_gelfand_tsetlin.jlcon","GT_character.jlcon","D222Computation.jlcon","hyperdeterminant.jlcon","SecondaryPolytope.jlcon","Explosion.jlcon","GKZ_orbits.jlcon","ch-benchmark.jlcon"],"specialized/rose-sturmfels-telen-tropical-implicitization":["gen_impl.jlcon","hyperdet.jlcon","get_hyperdet.jlcon","pol_from_surface.jlcon","coeffs_fin.jlcon","triang.jlcon","chow_fan.jlcon","chow_transl.jlcon"],"specialized/flake-fourier-monomial-bases":["get-operators.jlcon","basis.jlcon","fflv.jlcon","string.jlcon","lusztig.jlcon","nz.jlcon"],"specialized/brandhorst-zach-fibration-hopping":["vinberg_1.jlcon","vinberg_2.jlcon","vinberg_3.jlcon"],"specialized/breuer-nebe-parker-orthogonal-discriminants":["expl_order.jlcon","expl_ev.jlcon","expl_specht.jlcon","expl_syl.jlcon","expl_G23_tbl.jlcon","expl_G23_info.jlcon","expl_ray_class.jlcon","expl_nongalois.jlcon","expl_od_odd.jlcon","expl_plusminus.jlcon"],"cornerstones/algebraic-geometry":["ex11.jlcon","ex11dist.jlcon","default.jlcon","ex-primdec.jlcon","ex-dim.jlcon","circlepar.jlcon","twocusps.jlcon","delta.jlcon","ex21.jlcon","ex21a.jlcon","ex21b.jlcon","ex23.jlcon","ex23a.jlcon","param.jlcon","ex32.jlcon","exres.jlcon","hilbert-polynomial.jlcon","exres2.jlcon","ex314.jlcon","char3-surface-1.jlcon","char3-surface-2.jlcon","alexander-surface.jlcon","dual_curve_function.jlcon","dualcurve.jlcon","monodromy.jlcon","canonicalimage.jlcon","deformation.jlcon","zariski.jlcon"],"specialized/decker-schmitt-invariant-theory":["sym.jlcon","H3.jlcon","bertin.jlcon","klein.jlcon","gleason.jlcon","nakajima.jlcon","LR-inv.jlcon","cox_ring.jlcon"],"specialized/bies-kastner-toric-geometry":["cyclic.jlcon","normal_fan_square.jlcon","cube.jlcon","p2.jlcon","chow_ring.jlcon","polyhedral_fan.jlcon","p1xp1_cohomologies.jlcon","p1xp1_vanishing_sets.jlcon","glsm.jlcon","starsubdivision.jlcon"]}} \ No newline at end of file +{"_ns":{"Oscar":["https://github.com/oscar-system/Oscar.jl","1.0.0"]},"_type":{"name":"Dict","params":{"key_type":"String","specialized/boehm-breuer-git-fans":{"name":"Vector","params":"String"},"specialized/markwig-ristau-schleis-faithful-tropicalization":{"name":"Vector","params":"String"},"specialized/holt-ren-tropical-geometry":{"name":"Vector","params":"String"},"specialized/bies-turner-string-theory-applications":{"name":"Vector","params":"String"},"specialized/aga-boehm-hoffmann-markwig-traore":{"name":"Vector","params":"String"},"specialized/joswig-kastner-lorenz-confirmable-workflows":{"name":"Vector","params":"String"},"cornerstones/number-theory":{"name":"Vector","params":"String"},"cornerstones/groups":{"name":"Vector","params":"String"},"introduction/introduction":{"name":"Vector","params":"String"},"specialized/eder-mohr-ideal-theoretic":{"name":"Vector","params":"String"},"specialized/kuehne-schroeter-matroids":{"name":"Vector","params":"String"},"cornerstones/polyhedral-geometry":{"name":"Vector","params":"String"},"specialized/rose-sturmfels-telen-tropical-implicitization":{"name":"Vector","params":"String"},"specialized/fang-fourier-monomial-bases":{"name":"Vector","params":"String"},"specialized/brandhorst-zach-fibration-hopping":{"name":"Vector","params":"String"},"specialized/breuer-nebe-parker-orthogonal-discriminants":{"name":"Vector","params":"String"},"cornerstones/algebraic-geometry":{"name":"Vector","params":"String"},"specialized/decker-schmitt-invariant-theory":{"name":"Vector","params":"String"},"specialized/bies-kastner-toric-geometry":{"name":"Vector","params":"String"}}},"data":{"specialized/boehm-breuer-git-fans":["explG25_1.jlcon","explG25_2.jlcon","explG25_2A.jlcon","explG25_3.jlcon","explG25_3A.jlcon","explG25_4.jlcon","explG25_5.jlcon","explG25_6.jlcon","explG25_7.jlcon","explG25_8.jlcon"],"specialized/markwig-ristau-schleis-faithful-tropicalization":["draw_hypersurface.jlcon","vertices_P2.jlcon","vertices_P1.jlcon","eliminate_xz.jlcon","eliminate_yz.jlcon"],"specialized/holt-ren-tropical-geometry":["semiring.jlcon","matrixAndPoly.jlcon","det.jlcon","semiringMaps1.jlcon","semiringMaps2.jlcon","semiringMaps3.jlcon","groebner.jlcon","variety.jlcon","hypersurface1.jlcon","hypersurface2.jlcon","hypersurface3.jlcon","linearSpace1.jlcon","linearSpace2.jlcon","linearSpace3.jlcon","curve1.jlcon","curve2.jlcon","intersection.jlcon","grc.jlcon"],"specialized/bies-turner-string-theory-applications":["SU5.jlcon","SU5-2.jlcon"],"specialized/aga-boehm-hoffmann-markwig-traore":["graphname.jlcon","Caterpillar3.jlcon"],"specialized/joswig-kastner-lorenz-confirmable-workflows":["versioninfo.jlcon","polynomial-load.jlcon","snf.jlcon"],"cornerstones/number-theory":["intro.jlcon","intro_plot_lattice.jlcon","unit_plot.jlcon","unit_log_plot.jl","general.jlcon","embeddings.jlcon","intro4.jlcon","sym.jlcon","sym_1.jl","cohenlenstra.jlcon","galoismod.jlcon","galoismod_1.jl","galoismod_2.jl"],"cornerstones/groups":["intro.jlcon","actions.jlcon","explSL25.jlcon","chars.jlcon","extensions.jlcon","cohomology.jlcon","reps.jlcon","genchar.jlcon"],"introduction/introduction":["julia.jlcon","julia-jit.jlcon","julia2.jlcon","julia3.jlcon"],"specialized/eder-mohr-ideal-theoretic":["hilbert.jlcon","gbeliminate.jlcon","fglm.jlcon","realsols.jlcon","nonproper.jlcon","whitney.jlcon","combinatorics.jlcon","lcis.jlcon"],"specialized/kuehne-schroeter-matroids":["basics.jlcon","realization_space.jlcon","ChowRings.jlcon"],"cornerstones/polyhedral-geometry":["pentagon.jlcon","lp.jlcon","tetrahedron.jlcon","platonic.jlcon","dodecahedron.jlcon","johnson-orbits.jl","johnson-orbits.jlcon","perm3.jlcon","not-pointed.jlcon","simple_polyhedral_fan.jlcon","g-vector-example.jlcon","g-vectors.jl","g-vectors-upper-bound.jlcon","GelfandTsetlinEx.jlcon","generalized_gelfand_tsetlin.jlcon","GT_character.jlcon","D222Computation.jlcon","hyperdeterminant.jlcon","SecondaryPolytope.jlcon","Explosion.jlcon","GKZ_orbits.jlcon","ch-benchmark.jlcon"],"specialized/rose-sturmfels-telen-tropical-implicitization":["gen_impl.jlcon","hyperdet.jlcon","get_hyperdet.jlcon","pol_from_surface.jlcon","coeffs_fin.jlcon","triang.jlcon","chow_fan.jlcon","chow_transl.jlcon"],"specialized/fang-fourier-monomial-bases":["get-operators.jlcon","basis.jlcon","fflv.jlcon","string.jlcon","lusztig.jlcon","nz.jlcon"],"specialized/brandhorst-zach-fibration-hopping":["vinberg_1.jlcon","vinberg_2.jlcon","vinberg_3.jlcon"],"specialized/breuer-nebe-parker-orthogonal-discriminants":["expl_order.jlcon","expl_ev.jlcon","expl_specht.jlcon","expl_syl.jlcon","expl_G23_tbl.jlcon","expl_G23_info.jlcon","expl_ray_class.jlcon","expl_nongalois.jlcon","expl_od_odd.jlcon","expl_plusminus.jlcon"],"cornerstones/algebraic-geometry":["ex11.jlcon","ex11dist.jlcon","default.jlcon","ex-primdec.jlcon","ex-dim.jlcon","circlepar.jlcon","twocusps.jlcon","delta.jlcon","ex21.jlcon","ex21a.jlcon","ex21b.jlcon","ex23.jlcon","ex23a.jlcon","param.jlcon","ex32.jlcon","exres.jlcon","hilbert-polynomial.jlcon","exres2.jlcon","ex314.jlcon","char3-surface-1.jlcon","char3-surface-2.jlcon","alexander-surface.jlcon","dual_curve_function.jlcon","dualcurve.jlcon","monodromy.jlcon","canonicalimage.jlcon","deformation.jlcon","zariski.jlcon"],"specialized/decker-schmitt-invariant-theory":["sym.jlcon","H3.jlcon","bertin.jlcon","klein.jlcon","gleason.jlcon","nakajima.jlcon","LR-inv.jlcon","cox_ring.jlcon"],"specialized/bies-kastner-toric-geometry":["cyclic.jlcon","normal_fan_square.jlcon","cube.jlcon","p2.jlcon","chow_ring.jlcon","polyhedral_fan.jlcon","p1xp1_cohomologies.jlcon","p1xp1_vanishing_sets.jlcon","glsm.jlcon","starsubdivision.jlcon"]}} diff --git a/test/book/specialized/flake-fourier-monomial-bases/basis.jlcon b/test/book/specialized/fang-fourier-monomial-bases/basis.jlcon similarity index 100% rename from test/book/specialized/flake-fourier-monomial-bases/basis.jlcon rename to test/book/specialized/fang-fourier-monomial-bases/basis.jlcon diff --git a/test/book/specialized/flake-fourier-monomial-bases/fflv.jlcon b/test/book/specialized/fang-fourier-monomial-bases/fflv.jlcon similarity index 100% rename from test/book/specialized/flake-fourier-monomial-bases/fflv.jlcon rename to test/book/specialized/fang-fourier-monomial-bases/fflv.jlcon diff --git a/test/book/specialized/flake-fourier-monomial-bases/get-operators.jlcon b/test/book/specialized/fang-fourier-monomial-bases/get-operators.jlcon similarity index 100% rename from test/book/specialized/flake-fourier-monomial-bases/get-operators.jlcon rename to test/book/specialized/fang-fourier-monomial-bases/get-operators.jlcon diff --git a/test/book/specialized/flake-fourier-monomial-bases/lusztig.jlcon b/test/book/specialized/fang-fourier-monomial-bases/lusztig.jlcon similarity index 100% rename from test/book/specialized/flake-fourier-monomial-bases/lusztig.jlcon rename to test/book/specialized/fang-fourier-monomial-bases/lusztig.jlcon diff --git a/test/book/specialized/flake-fourier-monomial-bases/nz.jlcon b/test/book/specialized/fang-fourier-monomial-bases/nz.jlcon similarity index 100% rename from test/book/specialized/flake-fourier-monomial-bases/nz.jlcon rename to test/book/specialized/fang-fourier-monomial-bases/nz.jlcon diff --git a/test/book/specialized/flake-fourier-monomial-bases/string.jlcon b/test/book/specialized/fang-fourier-monomial-bases/string.jlcon similarity index 100% rename from test/book/specialized/flake-fourier-monomial-bases/string.jlcon rename to test/book/specialized/fang-fourier-monomial-bases/string.jlcon diff --git a/test/book/test.jl b/test/book/test.jl index b2ae65da4b59..393b9b71ea9c 100644 --- a/test/book/test.jl +++ b/test/book/test.jl @@ -11,7 +11,7 @@ const excluded = [ "number-theory/intro_plot_lattice.jlcon", "number-theory/intro5_0.jlcon", # Excluded for easier testing - "number-theory", + # "number-theory", "groups", "algebraic-geometry", "introduction", @@ -27,7 +27,7 @@ const excluded = [ "specialized/eder-mohr-ideal-theoretic", # "specialized/kuehne-schroeter-matroids", "specialized/rose-sturmfels-telen-tropical-implicitization", - "specialized/flake-fourier-monomial-bases", + # "specialized/fang-fourier-monomial-bases", "specialized/brandhorst-zach-fibration-hopping", # "specialized/breuer-nebe-parker-orthogonal-discriminants", "cornerstones/algebraic-geometry", @@ -39,7 +39,14 @@ const excluded = [ ] const broken = [ + # Something broken in Oscar "specialized/breuer-nebe-parker-orthogonal-discriminants/expl_syl.jlcon", + # Output width depends on terminal size #3515 + "specialized/fang-fourier-monomial-bases/nz.jlcon", + "specialized/fang-fourier-monomial-bases/lusztig.jlcon", + "specialized/fang-fourier-monomial-bases/string.jlcon", + "specialized/fang-fourier-monomial-bases/fflv.jlcon", + "specialized/fang-fourier-monomial-bases/basis.jlcon", ] dispsize = (40, 120) @@ -48,6 +55,7 @@ using REPL using Random using Pkg import Random.Xoshiro +using Test include(joinpath(pkgdir(REPL),"test","FakeTerminals.jl")) @@ -60,7 +68,7 @@ function normalize_repl_output(s::AbstractString) result = replace(result, r"^ "m => "") result = strip(result) result = replace(result, r"julia>$"s => "") - result = replace(result, r"\n\s*#[^\n]*\n"s => "\n") + result = replace(result, r"\n\s*#[^\n]*generic[^\n]*\n"s => "\n") lafter = length(result) end return strip(result) From 0fd4a183292578c96c1c2b2a79d4c5e1a8b01962 Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Fri, 15 Mar 2024 11:12:30 +0100 Subject: [PATCH 17/30] booktests: allow skip, more aux code... --- .../number-theory/auxiliary_code/main.jl | 2 +- test/book/ordered_examples.json | 302 +++++++++++++++++- .../auxiliary_code/main.jl | 3 + .../auxiliary_code/main.jl | 6 + test/book/test.jl | 86 +++-- 5 files changed, 379 insertions(+), 20 deletions(-) create mode 100644 test/book/specialized/aga-boehm-hoffmann-markwig-traore/auxiliary_code/main.jl create mode 100644 test/book/specialized/holt-ren-tropical-geometry/auxiliary_code/main.jl diff --git a/test/book/cornerstones/number-theory/auxiliary_code/main.jl b/test/book/cornerstones/number-theory/auxiliary_code/main.jl index d5849b383e71..8eed5f63c5dc 100644 --- a/test/book/cornerstones/number-theory/auxiliary_code/main.jl +++ b/test/book/cornerstones/number-theory/auxiliary_code/main.jl @@ -1,5 +1,5 @@ using Pkg -Pkg.add("Tally") +Pkg.add("Tally"; io=devnull) # pre-run some computation so that the same code doesn't affect the seeding when diff --git a/test/book/ordered_examples.json b/test/book/ordered_examples.json index af59b409145e..dda86aa055e6 100644 --- a/test/book/ordered_examples.json +++ b/test/book/ordered_examples.json @@ -1 +1,301 @@ -{"_ns":{"Oscar":["https://github.com/oscar-system/Oscar.jl","1.0.0"]},"_type":{"name":"Dict","params":{"key_type":"String","specialized/boehm-breuer-git-fans":{"name":"Vector","params":"String"},"specialized/markwig-ristau-schleis-faithful-tropicalization":{"name":"Vector","params":"String"},"specialized/holt-ren-tropical-geometry":{"name":"Vector","params":"String"},"specialized/bies-turner-string-theory-applications":{"name":"Vector","params":"String"},"specialized/aga-boehm-hoffmann-markwig-traore":{"name":"Vector","params":"String"},"specialized/joswig-kastner-lorenz-confirmable-workflows":{"name":"Vector","params":"String"},"cornerstones/number-theory":{"name":"Vector","params":"String"},"cornerstones/groups":{"name":"Vector","params":"String"},"introduction/introduction":{"name":"Vector","params":"String"},"specialized/eder-mohr-ideal-theoretic":{"name":"Vector","params":"String"},"specialized/kuehne-schroeter-matroids":{"name":"Vector","params":"String"},"cornerstones/polyhedral-geometry":{"name":"Vector","params":"String"},"specialized/rose-sturmfels-telen-tropical-implicitization":{"name":"Vector","params":"String"},"specialized/fang-fourier-monomial-bases":{"name":"Vector","params":"String"},"specialized/brandhorst-zach-fibration-hopping":{"name":"Vector","params":"String"},"specialized/breuer-nebe-parker-orthogonal-discriminants":{"name":"Vector","params":"String"},"cornerstones/algebraic-geometry":{"name":"Vector","params":"String"},"specialized/decker-schmitt-invariant-theory":{"name":"Vector","params":"String"},"specialized/bies-kastner-toric-geometry":{"name":"Vector","params":"String"}}},"data":{"specialized/boehm-breuer-git-fans":["explG25_1.jlcon","explG25_2.jlcon","explG25_2A.jlcon","explG25_3.jlcon","explG25_3A.jlcon","explG25_4.jlcon","explG25_5.jlcon","explG25_6.jlcon","explG25_7.jlcon","explG25_8.jlcon"],"specialized/markwig-ristau-schleis-faithful-tropicalization":["draw_hypersurface.jlcon","vertices_P2.jlcon","vertices_P1.jlcon","eliminate_xz.jlcon","eliminate_yz.jlcon"],"specialized/holt-ren-tropical-geometry":["semiring.jlcon","matrixAndPoly.jlcon","det.jlcon","semiringMaps1.jlcon","semiringMaps2.jlcon","semiringMaps3.jlcon","groebner.jlcon","variety.jlcon","hypersurface1.jlcon","hypersurface2.jlcon","hypersurface3.jlcon","linearSpace1.jlcon","linearSpace2.jlcon","linearSpace3.jlcon","curve1.jlcon","curve2.jlcon","intersection.jlcon","grc.jlcon"],"specialized/bies-turner-string-theory-applications":["SU5.jlcon","SU5-2.jlcon"],"specialized/aga-boehm-hoffmann-markwig-traore":["graphname.jlcon","Caterpillar3.jlcon"],"specialized/joswig-kastner-lorenz-confirmable-workflows":["versioninfo.jlcon","polynomial-load.jlcon","snf.jlcon"],"cornerstones/number-theory":["intro.jlcon","intro_plot_lattice.jlcon","unit_plot.jlcon","unit_log_plot.jl","general.jlcon","embeddings.jlcon","intro4.jlcon","sym.jlcon","sym_1.jl","cohenlenstra.jlcon","galoismod.jlcon","galoismod_1.jl","galoismod_2.jl"],"cornerstones/groups":["intro.jlcon","actions.jlcon","explSL25.jlcon","chars.jlcon","extensions.jlcon","cohomology.jlcon","reps.jlcon","genchar.jlcon"],"introduction/introduction":["julia.jlcon","julia-jit.jlcon","julia2.jlcon","julia3.jlcon"],"specialized/eder-mohr-ideal-theoretic":["hilbert.jlcon","gbeliminate.jlcon","fglm.jlcon","realsols.jlcon","nonproper.jlcon","whitney.jlcon","combinatorics.jlcon","lcis.jlcon"],"specialized/kuehne-schroeter-matroids":["basics.jlcon","realization_space.jlcon","ChowRings.jlcon"],"cornerstones/polyhedral-geometry":["pentagon.jlcon","lp.jlcon","tetrahedron.jlcon","platonic.jlcon","dodecahedron.jlcon","johnson-orbits.jl","johnson-orbits.jlcon","perm3.jlcon","not-pointed.jlcon","simple_polyhedral_fan.jlcon","g-vector-example.jlcon","g-vectors.jl","g-vectors-upper-bound.jlcon","GelfandTsetlinEx.jlcon","generalized_gelfand_tsetlin.jlcon","GT_character.jlcon","D222Computation.jlcon","hyperdeterminant.jlcon","SecondaryPolytope.jlcon","Explosion.jlcon","GKZ_orbits.jlcon","ch-benchmark.jlcon"],"specialized/rose-sturmfels-telen-tropical-implicitization":["gen_impl.jlcon","hyperdet.jlcon","get_hyperdet.jlcon","pol_from_surface.jlcon","coeffs_fin.jlcon","triang.jlcon","chow_fan.jlcon","chow_transl.jlcon"],"specialized/fang-fourier-monomial-bases":["get-operators.jlcon","basis.jlcon","fflv.jlcon","string.jlcon","lusztig.jlcon","nz.jlcon"],"specialized/brandhorst-zach-fibration-hopping":["vinberg_1.jlcon","vinberg_2.jlcon","vinberg_3.jlcon"],"specialized/breuer-nebe-parker-orthogonal-discriminants":["expl_order.jlcon","expl_ev.jlcon","expl_specht.jlcon","expl_syl.jlcon","expl_G23_tbl.jlcon","expl_G23_info.jlcon","expl_ray_class.jlcon","expl_nongalois.jlcon","expl_od_odd.jlcon","expl_plusminus.jlcon"],"cornerstones/algebraic-geometry":["ex11.jlcon","ex11dist.jlcon","default.jlcon","ex-primdec.jlcon","ex-dim.jlcon","circlepar.jlcon","twocusps.jlcon","delta.jlcon","ex21.jlcon","ex21a.jlcon","ex21b.jlcon","ex23.jlcon","ex23a.jlcon","param.jlcon","ex32.jlcon","exres.jlcon","hilbert-polynomial.jlcon","exres2.jlcon","ex314.jlcon","char3-surface-1.jlcon","char3-surface-2.jlcon","alexander-surface.jlcon","dual_curve_function.jlcon","dualcurve.jlcon","monodromy.jlcon","canonicalimage.jlcon","deformation.jlcon","zariski.jlcon"],"specialized/decker-schmitt-invariant-theory":["sym.jlcon","H3.jlcon","bertin.jlcon","klein.jlcon","gleason.jlcon","nakajima.jlcon","LR-inv.jlcon","cox_ring.jlcon"],"specialized/bies-kastner-toric-geometry":["cyclic.jlcon","normal_fan_square.jlcon","cube.jlcon","p2.jlcon","chow_ring.jlcon","polyhedral_fan.jlcon","p1xp1_cohomologies.jlcon","p1xp1_vanishing_sets.jlcon","glsm.jlcon","starsubdivision.jlcon"]}} +{ + "_ns": { + "Oscar": [ + "https://github.com/oscar-system/Oscar.jl", + "1.0.0" + ] + }, + "_type": { + "name": "Dict", + "params": { + "key_type": "String", + "specialized/boehm-breuer-git-fans": { + "name": "Vector", + "params": "String" + }, + "specialized/markwig-ristau-schleis-faithful-tropicalization": { + "name": "Vector", + "params": "String" + }, + "specialized/holt-ren-tropical-geometry": { + "name": "Vector", + "params": "String" + }, + "specialized/bies-turner-string-theory-applications": { + "name": "Vector", + "params": "String" + }, + "specialized/aga-boehm-hoffmann-markwig-traore": { + "name": "Vector", + "params": "String" + }, + "specialized/joswig-kastner-lorenz-confirmable-workflows": { + "name": "Vector", + "params": "String" + }, + "cornerstones/number-theory": { + "name": "Vector", + "params": "String" + }, + "cornerstones/groups": { + "name": "Vector", + "params": "String" + }, + "introduction/introduction": { + "name": "Vector", + "params": "String" + }, + "specialized/eder-mohr-ideal-theoretic": { + "name": "Vector", + "params": "String" + }, + "specialized/kuehne-schroeter-matroids": { + "name": "Vector", + "params": "String" + }, + "cornerstones/polyhedral-geometry": { + "name": "Vector", + "params": "String" + }, + "specialized/rose-sturmfels-telen-tropical-implicitization": { + "name": "Vector", + "params": "String" + }, + "specialized/fang-fourier-monomial-bases": { + "name": "Vector", + "params": "String" + }, + "specialized/brandhorst-zach-fibration-hopping": { + "name": "Vector", + "params": "String" + }, + "specialized/breuer-nebe-parker-orthogonal-discriminants": { + "name": "Vector", + "params": "String" + }, + "cornerstones/algebraic-geometry": { + "name": "Vector", + "params": "String" + }, + "specialized/decker-schmitt-invariant-theory": { + "name": "Vector", + "params": "String" + }, + "specialized/bies-kastner-toric-geometry": { + "name": "Vector", + "params": "String" + } + } + }, + "data": { + "specialized/boehm-breuer-git-fans": [ + "explG25_1.jlcon", + "explG25_2.jlcon", + "explG25_2A.jlcon", + "explG25_3.jlcon", + "explG25_3A.jlcon", + "explG25_4.jlcon", + "explG25_5.jlcon", + "explG25_6.jlcon", + "explG25_7.jlcon", + "explG25_8.jlcon" + ], + "specialized/markwig-ristau-schleis-faithful-tropicalization": [ + "draw_hypersurface.jlcon", + "vertices_P2.jlcon", + "vertices_P1.jlcon", + "eliminate_xz.jlcon", + "eliminate_yz.jlcon" + ], + "specialized/holt-ren-tropical-geometry": [ + "semiring.jlcon", + "matrixAndPoly.jlcon", + "det.jlcon", + "semiringMaps1.jlcon", + "semiringMaps2.jlcon", + "semiringMaps3.jlcon", + "groebner.jlcon", + "variety.jlcon", + "hypersurface1.jlcon", + "hypersurface2.jlcon", + "hypersurface3.jlcon", + "linearSpace1.jlcon", + "linearSpace2.jlcon", + "linearSpace3.jlcon", + "curve1.jlcon", + "curve2.jlcon", + "intersection.jlcon", + "grc.jlcon" + ], + "specialized/bies-turner-string-theory-applications": [ + "SU5.jlcon", + "SU5-2.jlcon" + ], + "specialized/aga-boehm-hoffmann-markwig-traore": [ + "graphname.jlcon", + "Caterpillar3.jlcon" + ], + "specialized/joswig-kastner-lorenz-confirmable-workflows": [ + "versioninfo.jlcon", + "polynomial-load.jlcon", + "snf.jlcon" + ], + "cornerstones/number-theory": [ + "intro.jlcon", + "intro_plot_lattice.jlcon", + "unit_plot.jlcon", + "unit_log_plot.jl", + "general.jlcon", + "embeddings.jlcon", + "intro4.jlcon", + "sym.jlcon", + "sym_1.jl", + "cohenlenstra.jlcon", + "galoismod.jlcon", + "galoismod_1.jl", + "galoismod_2.jl" + ], + "cornerstones/groups": [ + "intro.jlcon", + "actions.jlcon", + "explSL25.jlcon", + "chars.jlcon", + "extensions.jlcon", + "cohomology.jlcon", + "reps.jlcon", + "genchar.jlcon" + ], + "introduction/introduction": [ + "julia.jlcon", + "julia-jit.jlcon", + "julia2.jlcon", + "julia3.jlcon" + ], + "specialized/eder-mohr-ideal-theoretic": [ + "hilbert.jlcon", + "gbeliminate.jlcon", + "fglm.jlcon", + "realsols.jlcon", + "nonproper.jlcon", + "whitney.jlcon", + "combinatorics.jlcon", + "lcis.jlcon" + ], + "specialized/kuehne-schroeter-matroids": [ + "basics.jlcon", + "realization_space.jlcon", + "ChowRings.jlcon" + ], + "cornerstones/polyhedral-geometry": [ + "pentagon.jlcon", + "lp.jlcon", + "tetrahedron.jlcon", + "platonic.jlcon", + "dodecahedron.jlcon", + "johnson-orbits.jl", + "johnson-orbits.jlcon", + "perm3.jlcon", + "not-pointed.jlcon", + "simple_polyhedral_fan.jlcon", + "g-vector-example.jlcon", + "g-vectors.jl", + "g-vectors-upper-bound.jlcon", + "GelfandTsetlinEx.jlcon", + "generalized_gelfand_tsetlin.jlcon", + "GT_character.jlcon", + "D222Computation.jlcon", + "hyperdeterminant.jlcon", + "SecondaryPolytope.jlcon", + "Explosion.jlcon", + "GKZ_orbits.jlcon", + "ch-benchmark.jlcon" + ], + "specialized/rose-sturmfels-telen-tropical-implicitization": [ + "gen_impl.jlcon", + "hyperdet.jlcon", + "get_hyperdet.jlcon", + "pol_from_surface.jlcon", + "coeffs_fin.jlcon", + "triang.jlcon", + "chow_fan.jlcon", + "chow_transl.jlcon" + ], + "specialized/fang-fourier-monomial-bases": [ + "get-operators.jlcon", + "basis.jlcon", + "fflv.jlcon", + "string.jlcon", + "lusztig.jlcon", + "nz.jlcon" + ], + "specialized/brandhorst-zach-fibration-hopping": [ + "vinberg_1.jlcon", + "vinberg_2.jlcon", + "vinberg_3.jlcon" + ], + "specialized/breuer-nebe-parker-orthogonal-discriminants": [ + "expl_order.jlcon", + "expl_ev.jlcon", + "expl_specht.jlcon", + "expl_syl.jlcon", + "expl_G23_tbl.jlcon", + "expl_G23_info.jlcon", + "expl_ray_class.jlcon", + "expl_nongalois.jlcon", + "expl_od_odd.jlcon", + "expl_plusminus.jlcon" + ], + "cornerstones/algebraic-geometry": [ + "ex11.jlcon", + "ex11dist.jlcon", + "default.jlcon", + "ex-primdec.jlcon", + "ex-dim.jlcon", + "circlepar.jlcon", + "twocusps.jlcon", + "delta.jlcon", + "ex21.jlcon", + "ex21a.jlcon", + "ex21b.jlcon", + "ex23.jlcon", + "ex23a.jlcon", + "param.jlcon", + "ex32.jlcon", + "exres.jlcon", + "hilbert-polynomial.jlcon", + "exres2.jlcon", + "ex314.jlcon", + "char3-surface-1.jlcon", + "char3-surface-2.jlcon", + "alexander-surface.jlcon", + "dual_curve_function.jlcon", + "dualcurve.jlcon", + "monodromy.jlcon", + "canonicalimage.jlcon", + "deformation.jlcon", + "zariski.jlcon" + ], + "specialized/decker-schmitt-invariant-theory": [ + "sym.jlcon", + "H3.jlcon", + "bertin.jlcon", + "klein.jlcon", + "gleason.jlcon", + "nakajima.jlcon", + "LR-inv.jlcon", + "cox_ring.jlcon" + ], + "specialized/bies-kastner-toric-geometry": [ + "cyclic.jlcon", + "normal_fan_square.jlcon", + "cube.jlcon", + "p2.jlcon", + "chow_ring.jlcon", + "polyhedral_fan.jlcon", + "p1xp1_cohomologies.jlcon", + "p1xp1_vanishing_sets.jlcon", + "glsm.jlcon", + "starsubdivision.jlcon" + ] + } +} diff --git a/test/book/specialized/aga-boehm-hoffmann-markwig-traore/auxiliary_code/main.jl b/test/book/specialized/aga-boehm-hoffmann-markwig-traore/auxiliary_code/main.jl new file mode 100644 index 000000000000..69c0cbe00270 --- /dev/null +++ b/test/book/specialized/aga-boehm-hoffmann-markwig-traore/auxiliary_code/main.jl @@ -0,0 +1,3 @@ +using Pkg +Pkg.add(url = "https://github.com/singular-gpispace/GromovWitten"; io=devnull) +using GromovWitten diff --git a/test/book/specialized/holt-ren-tropical-geometry/auxiliary_code/main.jl b/test/book/specialized/holt-ren-tropical-geometry/auxiliary_code/main.jl new file mode 100644 index 000000000000..f254305d82f7 --- /dev/null +++ b/test/book/specialized/holt-ren-tropical-geometry/auxiliary_code/main.jl @@ -0,0 +1,6 @@ +using Pkg +Pkg.add("MixedSubdivisions"; io=devnull) + +import LibGit2 +LibGit2.clone("https://github.com/isaacholt100/generic_root_count", "generic_root_count") +include(joinpath(@__DIR__,"generic_root_count","src","main.jl")); diff --git a/test/book/test.jl b/test/book/test.jl index 393b9b71ea9c..47bd1fdcfba3 100644 --- a/test/book/test.jl +++ b/test/book/test.jl @@ -41,15 +41,35 @@ const excluded = [ const broken = [ # Something broken in Oscar "specialized/breuer-nebe-parker-orthogonal-discriminants/expl_syl.jlcon", - # Output width depends on terminal size #3515 - "specialized/fang-fourier-monomial-bases/nz.jlcon", - "specialized/fang-fourier-monomial-bases/lusztig.jlcon", - "specialized/fang-fourier-monomial-bases/string.jlcon", - "specialized/fang-fourier-monomial-bases/fflv.jlcon", - "specialized/fang-fourier-monomial-bases/basis.jlcon", + + # weird errors with last line: + # 'tate_polynomial' + "specialized/bies-turner-string-theory-applications/SU5.jlcon", + # ideal + "specialized/boehm-breuer-git-fans/explG25_1.jlcon", + "specialized/boehm-breuer-git-fans/explG25_8.jlcon", + + # need to fix column width for output? + "specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_xz.jlcon", ] +const skipped = [ + # sometimes very slow: 4000-30000s + "specialized/brandhorst-zach-fibration-hopping/vinberg_2.jlcon", + # very slow: 24000s + "cornerstones/number-theory/cohenlenstra.jlcon", + # ultra slow: time unknown + "specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_yz.jlcon", + + # somewhat slow (~300s) + "cornerstones/polyhedral-geometry/ch-benchmark.jlcon", + "specialized/brandhorst-zach-fibration-hopping/vinberg_3.jlcon", + + # needs Mockdule: + # defines `l(a,b)`: + "cornerstones/number-theory/unit_log_plot.jl", + ] -dispsize = (40, 120) +dispsize = (40, 130) using REPL using Random @@ -68,7 +88,8 @@ function normalize_repl_output(s::AbstractString) result = replace(result, r"^ "m => "") result = strip(result) result = replace(result, r"julia>$"s => "") - result = replace(result, r"\n\s*#[^\n]*generic[^\n]*\n"s => "\n") + result = replace(result, r"\n\s*#.*generic.*\n" => "\n") + result = replace(result, r"^\s*[0-9\.]+ seconds (.* allocations: .*)$"m => "\n") lafter = length(result) end return strip(result) @@ -148,7 +169,9 @@ end # add overlay project for plots custom_load_path = [] copy!(custom_load_path, Base.DEFAULT_LOAD_PATH) +curdir = pwd() act_proj = dirname(Base.active_project()) +try plots = mktempdir() Pkg.activate(plots; io=devnull) Pkg.add("Plots"; io=devnull) @@ -157,18 +180,25 @@ pushfirst!(custom_load_path, plots) oefile = joinpath(Oscar.oscardir, "test/book/ordered_examples.json") ordered_examples = load(oefile) +if isdefined(Main, :run_only) && run_only !== nothing + ordered_examples = Dict("$run_only" => ordered_examples[run_only]) +end withenv("LINES" => dispsize[1], "COLUMNS" => dispsize[2], "DISPLAY" => "") do for (chapter, example_list) in ordered_examples - @testset "$chapter" begin + cd(curdir) + @testset "$chapter" verbose=true begin println(chapter) copy!(LOAD_PATH, custom_load_path) auxmain = joinpath(Oscar.oscardir, "test/book", chapter, "auxiliary_code", "main.jl") if isfile(auxmain) # add overlay project for aux file + # and run it from temp dir temp = mktempdir() Pkg.activate(temp; io=devnull) pushfirst!(LOAD_PATH, "$act_proj") - include(auxmain) + cp(auxmain,joinpath(temp, "main.jl")) + cd(temp) + include(joinpath(temp,"main.jl")) LOAD_PATH[1] = temp Pkg.activate("$act_proj"; io=devnull) end @@ -179,15 +209,31 @@ withenv("LINES" => dispsize[1], "COLUMNS" => dispsize[2], "DISPLAY" => "") do full_file = joinpath(chapter, example) exclude = filter(s->occursin(s, full_file), excluded) if length(exclude) == 0 - println(" "*example) - if occursin("jlcon", example) - content = read(joinpath(Oscar.oscardir, "test/book", full_file), String) + println(" $example$(full_file in skipped ? ": skip" : + full_file in broken ? ": broken" : "")") + filetype = endswith(example, "jlcon") ? :jlcon : + endswith(example, "jl") ? :jl : :unknown + content = read(joinpath(Oscar.oscardir, "test/book", full_file), String) + if filetype == :jlcon && !occursin("julia> ", content) + filetype = :jl + @warn "possibly wrong file type: $full_file" + end + if full_file in skipped + @test run_repl_string(content, rng) isa AbstractString skip=true + elseif filetype == :jlcon content = sanitize_input(content) computed = run_repl_string(content, rng) @test normalize_repl_output(content) == computed broken=(full_file in broken) - elseif occursin("jl", example) - content = read(joinpath(Oscar.oscardir, "test/book", full_file), String) - run_repl_string(content, rng; jlcon_mode=false) + elseif filetype == :jl + if occursin("# output\n", content) + (code, res) = split(content, "# output\n"; limit=2) + # TODO do we want to compare with `res` ? + @test run_repl_string(code, rng; jlcon_mode=false) isa AbstractString broken=(full_file in broken) + else + @test run_repl_string(content, rng; jlcon_mode=false) isa AbstractString broken=(full_file in broken) + end + else + @warn "unknown file type: $full_file" end # else # println(" "*example*" excluded") @@ -196,5 +242,9 @@ withenv("LINES" => dispsize[1], "COLUMNS" => dispsize[2], "DISPLAY" => "") do end end end - -copy!(LOAD_PATH, Base.DEFAULT_LOAD_PATH) +finally + cd(curdir) + copy!(LOAD_PATH, Base.DEFAULT_LOAD_PATH) + Pkg.activate("$act_proj"; io=devnull) +end +nothing From e6c15537e959f9e7bb86e7dc5865e18f51052c38 Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Fri, 15 Mar 2024 12:05:10 +0100 Subject: [PATCH 18/30] fix more whitespace, more aux code, cleanup --- .../algebraic-geometry/ex21a.jlcon | 2 +- .../algebraic-geometry/ex23a.jlcon | 2 +- .../groups/auxiliary_code/main.jl | 5 + test/book/cornerstones/groups/explSL25.jlcon | 46 +++----- test/book/cornerstones/groups/genchar.jlcon | 7 +- test/book/introduction/julia-jit.jlcon | 5 - test/book/introduction/julia.jlcon | 102 ------------------ test/book/introduction/julia2.jlcon | 67 ------------ test/book/introduction/julia3.jlcon | 21 ---- .../decker-schmitt-invariant-theory/sym.jlcon | 2 +- .../eder-mohr-ideal-theoretic/nonproper.jlcon | 2 +- .../auxiliary_code/main.jl | 3 + test/book/test.jl | 33 ++++-- 13 files changed, 57 insertions(+), 240 deletions(-) create mode 100644 test/book/cornerstones/groups/auxiliary_code/main.jl delete mode 100644 test/book/introduction/julia-jit.jlcon delete mode 100644 test/book/introduction/julia.jlcon delete mode 100644 test/book/introduction/julia2.jlcon delete mode 100644 test/book/introduction/julia3.jlcon create mode 100644 test/book/specialized/rose-sturmfels-telen-tropical-implicitization/auxiliary_code/main.jl diff --git a/test/book/cornerstones/algebraic-geometry/ex21a.jlcon b/test/book/cornerstones/algebraic-geometry/ex21a.jlcon index 01a275352dd2..4bf42c540163 100644 --- a/test/book/cornerstones/algebraic-geometry/ex21a.jlcon +++ b/test/book/cornerstones/algebraic-geometry/ex21a.jlcon @@ -1,4 +1,4 @@ -julia> J1 = ideal([H(I[1]), H(I[2])]) +julia> J1 = ideal([H(I[1]), H(I[2])]) Ideal generated by x0*x2 - x1^2 x0*x3 - x1*x2 diff --git a/test/book/cornerstones/algebraic-geometry/ex23a.jlcon b/test/book/cornerstones/algebraic-geometry/ex23a.jlcon index eaca161def65..dafe29060bcd 100644 --- a/test/book/cornerstones/algebraic-geometry/ex23a.jlcon +++ b/test/book/cornerstones/algebraic-geometry/ex23a.jlcon @@ -15,7 +15,7 @@ Ideal generated by 184147758075888*x + (2850969000960*_a^3 + 22611747888864*_a^2 - 399955313722176*_a - 17319636680832)*y + (2884707374400*_a^3 + 22782606070410*_a^2 - 405172045313820*_a - 57843867366864)*z julia> R2 = base_ring(cI2) -Multivariate polynomial ring in 3 variables over number field graded by +Multivariate polynomial ring in 3 variables over number field graded by x -> [1] y -> [1] z -> [1] diff --git a/test/book/cornerstones/groups/auxiliary_code/main.jl b/test/book/cornerstones/groups/auxiliary_code/main.jl new file mode 100644 index 000000000000..b0f0320b1744 --- /dev/null +++ b/test/book/cornerstones/groups/auxiliary_code/main.jl @@ -0,0 +1,5 @@ +import Pkg +Pkg.add(name="GenericCharacterTables", version=v"0.2"; io=devnull) +using GenericCharacterTables +# for nicer printing +using GenericCharacterTables: ParameterException diff --git a/test/book/cornerstones/groups/explSL25.jlcon b/test/book/cornerstones/groups/explSL25.jlcon index 62ecf567ff0b..bfe5f0582ff9 100644 --- a/test/book/cornerstones/groups/explSL25.jlcon +++ b/test/book/cornerstones/groups/explSL25.jlcon @@ -4,37 +4,21 @@ SL(2,5) julia> T = character_table(G) Character table of SL(2,5) - 2 3 1 1 3 1 - 3 1 . . 1 . - 5 1 1 1 1 1 - - 1a 10a 10b 2a 5a - -X_1 1 1 1 1 1 -X_2 2 z_5^3 + z_5^2 + 1 -z_5^3 - z_5^2 -2 -z_5^3 - z_5^2 - 1 -X_3 2 -z_5^3 - z_5^2 z_5^3 + z_5^2 + 1 -2 z_5^3 + z_5^2 -X_4 3 -z_5^3 - z_5^2 z_5^3 + z_5^2 + 1 3 -z_5^3 - z_5^2 -X_5 3 z_5^3 + z_5^2 + 1 -z_5^3 - z_5^2 3 z_5^3 + z_5^2 + 1 -X_6 4 -1 -1 4 -1 -X_7 4 1 1 -4 -1 -X_8 5 . . 5 . -X_9 6 -1 -1 -6 1 - - 2 1 1 1 2 - 3 . 1 1 . - 5 1 . . . - - 5b 3a 6a 4a - -X_1 1 1 1 1 -X_2 z_5^3 + z_5^2 -1 1 . -X_3 -z_5^3 - z_5^2 - 1 -1 1 . -X_4 z_5^3 + z_5^2 + 1 . . -1 -X_5 -z_5^3 - z_5^2 . . -1 -X_6 -1 1 1 . -X_7 -1 1 -1 . -X_8 . -1 -1 1 -X_9 1 . . . + 2 3 1 1 3 1 1 1 1 2 + 3 1 . . 1 . . 1 1 . + 5 1 1 1 1 1 1 . . . + + 1a 10a 10b 2a 5a 5b 3a 6a 4a + +X_1 1 1 1 1 1 1 1 1 1 +X_2 2 z_5^3 + z_5^2 + 1 -z_5^3 - z_5^2 -2 -z_5^3 - z_5^2 - 1 z_5^3 + z_5^2 -1 1 . +X_3 2 -z_5^3 - z_5^2 z_5^3 + z_5^2 + 1 -2 z_5^3 + z_5^2 -z_5^3 - z_5^2 - 1 -1 1 . +X_4 3 -z_5^3 - z_5^2 z_5^3 + z_5^2 + 1 3 -z_5^3 - z_5^2 z_5^3 + z_5^2 + 1 . . -1 +X_5 3 z_5^3 + z_5^2 + 1 -z_5^3 - z_5^2 3 z_5^3 + z_5^2 + 1 -z_5^3 - z_5^2 . . -1 +X_6 4 -1 -1 4 -1 -1 1 1 . +X_7 4 1 1 -4 -1 -1 1 -1 . +X_8 5 . . 5 . . -1 -1 1 +X_9 6 -1 -1 -6 1 1 . . . julia> R = gmodule(T[end]) G-module for G acting on vector space of dimension 6 over abelian closure of Q diff --git a/test/book/cornerstones/groups/genchar.jlcon b/test/book/cornerstones/groups/genchar.jlcon index af619ac65fae..0baa024cd04a 100644 --- a/test/book/cornerstones/groups/genchar.jlcon +++ b/test/book/cornerstones/groups/genchar.jlcon @@ -17,9 +17,9 @@ julia> scalar(T,4,h) julia> print_decomposition(T, h) Decomposing character 9: - <1,9> = 1 - <2,9> = 2 - <3,9> = 2 + <1,9> = 1 + <2,9> = 2 + <3,9> = 2 <4,9> = 0 with possible exceptions: (2*n1)//(q - 1) ∈ ℤ <5,9> = 0 with possible exceptions: @@ -37,7 +37,6 @@ Decomposing character 9: ((q + 1)*n1)//(q^2 + q + 1) ∈ ℤ (q*n1)//(q^2 + q + 1) ∈ ℤ (n1)//(q^2 + q + 1) ∈ ℤ - julia> chardeg(T, lincomb!(T,[1,2,2],[1,2,3])) 2*q^3 + 2*q^2 + 2*q + 1 diff --git a/test/book/introduction/julia-jit.jlcon b/test/book/introduction/julia-jit.jlcon deleted file mode 100644 index f6f80ee117b2..000000000000 --- a/test/book/introduction/julia-jit.jlcon +++ /dev/null @@ -1,5 +0,0 @@ -julia> @time class_group(quadratic_field(7)[1]); - 0.659554 seconds (916.73 k allocations: 60.414 MiB, 4.44% gc time, 94.30% compilation time) - -julia> @time class_group(quadratic_field(11)[1]); - 0.003981 seconds (82.12 k allocations: 4.215 MiB) diff --git a/test/book/introduction/julia.jlcon b/test/book/introduction/julia.jlcon deleted file mode 100644 index cc529139329b..000000000000 --- a/test/book/introduction/julia.jlcon +++ /dev/null @@ -1,102 +0,0 @@ -julia> R, p = residue_ring(ZZ, 3); - -julia> typeof(R) -zzModRing - -julia> F, p = residue_field(ZZ, 3); - -julia> typeof(F) -FqField - -julia> typeof(2) -Int64 - -julia> 2^100 -0 - -julia> ZZ(2)^100 -1267650600228229401496703205376 - -julia> 1/2 -0.5 - -julia> 1//2 -1//2 - -julia> ccall(:sin, Float64, (Float64,), 1.0) -0.8414709848078965 - -julia> u = Int64[1,2,3,4,5,6]; - -julia> ccall(:memset, Cvoid, (Ptr{Int}, Int, UInt), u, 0, length(u)*sizeof(Int64)) - -julia> show(u) -[0, 0, 0, 0, 0, 0] - -julia> prod(1-1/a^2 for a = 1:100 if is_prime(a)) -0.6090337253995164 - -julia> QQx, x = polynomial_ring(QQ, "x"); - -julia> typeof(x) -QQPolyRingElem - -julia> Ry, y = polynomial_ring(QQ, ["y"]); - -julia> typeof(y) -Vector{QQMPolyRingElem} (alias for Array{QQMPolyRingElem, 1}) - -julia> QQx, x = QQ["x"]; - -julia> function next(a) - return a+1 - end; - -julia> next(2) -3 - -julia> next(x) -x + 1 - -julia> next('a') -'b': ASCII/Unicode U+0062 (category Ll: Letter, lowercase) - -julia> next(sin) -ERROR: MethodError: no method matching +(::typeof(sin), ::Int64) -[...] - -julia> function next(a::typeof(sin)) - return x->a(x)+1 - end; - -julia> next(sin) -#55 (generic function with 1 method) - -julia> ans(1) -1.8414709848078965 - -julia> sin(1)+1 -1.8414709848078965 - -julia> next(cos) -ERROR: MethodError: no method matching +(::typeof(cos), ::Int64) -[...] - -julia> supertype(typeof(sin)) -Function - -julia> supertype(typeof(cos)) -Function - -julia> function next(a::Function) - return x->a(x)+1 - end; - -julia> a = next(next(tan)) -#57 (generic function with 1 method) - -julia> a(1) -3.5574077246549023 - -julia> tan(1)+2 -3.5574077246549023 diff --git a/test/book/introduction/julia2.jlcon b/test/book/introduction/julia2.jlcon deleted file mode 100644 index 5c6b208edbf5..000000000000 --- a/test/book/introduction/julia2.jlcon +++ /dev/null @@ -1,67 +0,0 @@ -julia> R, mR = quo(ZZ, 2) -(Integers modulo 2, Map: ZZ -> ZZ/(2)) - -julia> S, mS = quo(ZZ, 3) -(Integers modulo 3, Map: ZZ -> ZZ/(3)) - -julia> typeof(R(1)) -zzModRingElem - -julia> typeof(S(1)) -zzModRingElem - -julia> S(1) + R(1) -ERROR: Operations on distinct residue rings not supported -Stacktrace: - [1] error(s::String) - @ Base ./error.jl:35 - [2] check_parent - @ ~/.julia/packages/Nemo/F0iQ2/src/flint/nmod.jl:22 [inlined] - [3] +(x::zzModRingElem, y::zzModRingElem) - @ Nemo ~/.julia/packages/Nemo/F0iQ2/src/flint/nmod.jl:138 -[...] - -julia> one(Int) -1 - -julia> one(Float64) -1.0 - -julia> [S(1) R(1)] -1×2 Matrix{zzModRingElem}: - 1 1 - -julia> dot(ans, ans) -ERROR: Operations on distinct residue rings not supported -Stacktrace: -[...] - -julia> matrix(S, 1, 2, [1, 2]) -[1 2] - -julia> dot(ans, ans) -2 - -julia> det([1 2; 3 4]) --2.0 - -julia> det(BigInt[1 2; 3 4]) --2 - -julia> inv(BigInt[1 2; 3 4]) -2×2 Matrix{BigFloat}: - -2.0 1.0 - 1.5 -0.5 - -julia> inv(BigInt[1 2; 0 1]) -2×2 Matrix{BigFloat}: - 1.0 -2.0 - 0.0 1.0 - -julia> inv(ZZ[1 2; 3 4]) -ERROR: Matrix not invertible -[...] - -julia> inv(QQ[1 2; 3 4]) -[ -2 1] -[3//2 -1//2] diff --git a/test/book/introduction/julia3.jlcon b/test/book/introduction/julia3.jlcon deleted file mode 100644 index fedb21d2d37d..000000000000 --- a/test/book/introduction/julia3.jlcon +++ /dev/null @@ -1,21 +0,0 @@ -julia> Qx,x = QQ[:x] -(Univariate polynomial ring in x over QQ, x) - -julia> QQx, xx = QQ[:x] -(Univariate polynomial ring in x over QQ, x) - -julia> Qx === QQx -true - -julia> x == xx -true - -julia> Qx, x = polynomial_ring(QQ, :x, cached = false) -(Univariate polynomial ring in x over QQ, x) - -julia> Qx == QQx -false - -julia> x + xx -ERROR: Incompatible polynomial rings in polynomial operation -[...] diff --git a/test/book/specialized/decker-schmitt-invariant-theory/sym.jlcon b/test/book/specialized/decker-schmitt-invariant-theory/sym.jlcon index cf1e7f8df41d..7377a2268415 100644 --- a/test/book/specialized/decker-schmitt-invariant-theory/sym.jlcon +++ b/test/book/specialized/decker-schmitt-invariant-theory/sym.jlcon @@ -15,7 +15,7 @@ true julia> RS3 = invariant_ring(QQ, symmetric_group(3)); julia> R = polynomial_ring(RS3) -Multivariate polynomial ring in 3 variables over QQ graded by +Multivariate polynomial ring in 3 variables over QQ graded by x[1] -> [1] x[2] -> [1] x[3] -> [1] diff --git a/test/book/specialized/eder-mohr-ideal-theoretic/nonproper.jlcon b/test/book/specialized/eder-mohr-ideal-theoretic/nonproper.jlcon index b1911fd8d4c6..ca08d4aa827c 100644 --- a/test/book/specialized/eder-mohr-ideal-theoretic/nonproper.jlcon +++ b/test/book/specialized/eder-mohr-ideal-theoretic/nonproper.jlcon @@ -19,7 +19,7 @@ Ideal generated by x^2 - x*w julia> S = base_ring(clo) -Multivariate polynomial ring in 5 variables over QQ graded by +Multivariate polynomial ring in 5 variables over QQ graded by x -> [1] y -> [1] z -> [1] diff --git a/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/auxiliary_code/main.jl b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/auxiliary_code/main.jl new file mode 100644 index 000000000000..d8901eae6161 --- /dev/null +++ b/test/book/specialized/rose-sturmfels-telen-tropical-implicitization/auxiliary_code/main.jl @@ -0,0 +1,3 @@ +using Pkg +Pkg.add(url = "https://github.com/kemalrose/TropicalImplicitization.jl"; io=devnull) +using TropicalImplicitization diff --git a/test/book/test.jl b/test/book/test.jl index 47bd1fdcfba3..a9c7a017c6fd 100644 --- a/test/book/test.jl +++ b/test/book/test.jl @@ -42,15 +42,29 @@ const broken = [ # Something broken in Oscar "specialized/breuer-nebe-parker-orthogonal-discriminants/expl_syl.jlcon", - # weird errors with last line: - # 'tate_polynomial' + # weird errors with last line that has no output: "specialized/bies-turner-string-theory-applications/SU5.jlcon", - # ideal "specialized/boehm-breuer-git-fans/explG25_1.jlcon", "specialized/boehm-breuer-git-fans/explG25_8.jlcon", + "specialized/aga-boehm-hoffmann-markwig-traore/graphname.jlcon", + "specialized/rose-sturmfels-telen-tropical-implicitization/gen_impl.jlcon", + "specialized/rose-sturmfels-telen-tropical-implicitization/hyperdet.jlcon", + "specialized/rose-sturmfels-telen-tropical-implicitization/pol_from_surface.jlcon", + "specialized/rose-sturmfels-telen-tropical-implicitization/chow_fan.jlcon", + "specialized/rose-sturmfels-telen-tropical-implicitization/chow_transl.jlcon", - # need to fix column width for output? + # TODO: need to fix column width for output? "specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_xz.jlcon", + + # non-stable: + "specialized/joswig-kastner-lorenz-confirmable-workflows/versioninfo.jlcon", + + # output changed in oscar master? TODO check + adapt + "specialized/decker-schmitt-invariant-theory/gleason.jlcon", + + # FIXME: MethodError: no method matching (::Oscar.MPolyAnyMap{…})(::Oscar.MPolyAnyMap{…}, ::Vector{…}) + # function missing on master? + "specialized/decker-schmitt-invariant-theory/cox_ring.jlcon", ] const skipped = [ # sometimes very slow: 4000-30000s @@ -67,6 +81,10 @@ const skipped = [ # needs Mockdule: # defines `l(a,b)`: "cornerstones/number-theory/unit_log_plot.jl", + # printout changes on subsequent runs due to other variables + "cornerstones/groups/cohomology.jlcon", + # defines vars that affect other tests... (eder-mohr...) + "cornerstones/groups/genchar.jlcon", ] dispsize = (40, 130) @@ -88,8 +106,10 @@ function normalize_repl_output(s::AbstractString) result = replace(result, r"^ "m => "") result = strip(result) result = replace(result, r"julia>$"s => "") - result = replace(result, r"\n\s*#.*generic.*\n" => "\n") - result = replace(result, r"^\s*[0-9\.]+ seconds (.* allocations: .*)$"m => "\n") + result = replace(result, r"^\s*(?:#\d+)?(.* \(generic function with ).*\n"m => s"\1\n") + result = replace(result, r"^\s*[0-9\.]+ seconds \(.* allocations: .*\)$"m => "\n") + # this removes the package version slug, filename and linenumber + result = replace(result, r" @ \w* ?~/\.julia/packages/(?:Nemo|Hecke|AbstractAlgebra|Polymake)/\K[\w\d]+/.*\.jl:\d+"m => "") lafter = length(result) end return strip(result) @@ -195,6 +215,7 @@ withenv("LINES" => dispsize[1], "COLUMNS" => dispsize[2], "DISPLAY" => "") do # and run it from temp dir temp = mktempdir() Pkg.activate(temp; io=devnull) + Pkg.develop(path=act_proj; io=devnull) pushfirst!(LOAD_PATH, "$act_proj") cp(auxmain,joinpath(temp, "main.jl")) cd(temp) From 522057e6522cc2cd425792a893636c9029985ba4 Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Thu, 21 Mar 2024 17:17:31 +0100 Subject: [PATCH 19/30] refactor testing using mockdule keep repl per chapter simplify rng usage use broken and skipped lists more regex add to CI add dependencies to test project --- .github/workflows/CI.yml | 3 + src/utils/tests.jl | 2 + test/Project.toml | 6 + test/book/test.jl | 378 ++++++++++++++++++++------------------- test/runtests.jl | 32 ++-- 5 files changed, 224 insertions(+), 197 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6773b5b79097..9ce45aa9db81 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -54,6 +54,9 @@ jobs: - julia-version: '1.10' group: 'long' os: macOS-latest + - julia-version: '1.10' + group: 'book' + os: ubuntu-latest # nightly on macos is disabled for now since the macos jobs take too long # with just 5 runners #- julia-version: 'nightly' diff --git a/src/utils/tests.jl b/src/utils/tests.jl index 1ef0e379e076..b8972d36385e 100644 --- a/src/utils/tests.jl +++ b/src/utils/tests.jl @@ -36,6 +36,8 @@ function _gather_tests(path::AbstractString; ignore=[]) # this can only run on the main process and not on distributed workers # so it is included directly in runtests r"Serialization/IPC(\.jl)?$", + # ignore book example code (except for main file) + r"(^|/)book/.*/.*\.jl$", ] for i in ignore if i isa Regex diff --git a/test/Project.toml b/test/Project.toml index 8da5af336fcd..92092e75090a 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,15 +1,21 @@ [deps] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +DeepDiffs = "ab62b9b5-e342-54a8-a765-a90f495de1a6" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" +REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] Aqua = "0.8.2" +DeepDiffs = "1.2.0" Distributed = "1.6" Documenter = "0.27, 1.0" +Pkg = "1.6" PrettyTables = "2.2.7" +REPL = "1.6" Random = "1.6" Test = "1.6" diff --git a/test/book/test.jl b/test/book/test.jl index a9c7a017c6fd..66c6c73b85ae 100644 --- a/test/book/test.jl +++ b/test/book/test.jl @@ -1,72 +1,22 @@ -const excluded = [ - # Excluded due to performance issues - "markwig-ristau-schleis-faithful-tropicalization/eliminate_xz", - "markwig-ristau-schleis-faithful-tropicalization/eliminate_yz", - "number-theory/cohenlenstra.jlcon", - "bies-turner-string-theory-applications/SU5.jlcon", - "brandhorst-zach-fibration-hopping/vinberg_2.jlcon", - "brandhorst-zach-fibration-hopping/vinberg_3.jlcon", - "cornerstones/polyhedral-geometry/ch-benchmark.jlcon", - "number-theory/unit_plot.jlcon", - "number-theory/intro_plot_lattice.jlcon", - "number-theory/intro5_0.jlcon", - # Excluded for easier testing - # "number-theory", - "groups", - "algebraic-geometry", - "introduction", - "specialized/boehm-breuer-git-fans", - "specialized/markwig-ristau-schleis-faithful-tropicalization", - "specialized/holt-ren-tropical-geometry", - # "specialized/bies-turner-string-theory-applications", - "specialized/aga-boehm-hoffmann-markwig-traore", - "specialized/joswig-kastner-lorenz-confirmable-workflows", - # "cornerstones/number-theory", - "cornerstones/groups", - "introduction/introduction", - "specialized/eder-mohr-ideal-theoretic", - # "specialized/kuehne-schroeter-matroids", - "specialized/rose-sturmfels-telen-tropical-implicitization", - # "specialized/fang-fourier-monomial-bases", - "specialized/brandhorst-zach-fibration-hopping", - # "specialized/breuer-nebe-parker-orthogonal-discriminants", - "cornerstones/algebraic-geometry", - "specialized/decker-schmitt-invariant-theory", - # "specialized/bies-kastner-toric-geometry", - # Excluded for Plots.jl - "g-vectors.jl", - "g-vectors-upper-bound.jl", - ] - -const broken = [ +broken = [ # Something broken in Oscar "specialized/breuer-nebe-parker-orthogonal-discriminants/expl_syl.jlcon", - # weird errors with last line that has no output: - "specialized/bies-turner-string-theory-applications/SU5.jlcon", - "specialized/boehm-breuer-git-fans/explG25_1.jlcon", - "specialized/boehm-breuer-git-fans/explG25_8.jlcon", - "specialized/aga-boehm-hoffmann-markwig-traore/graphname.jlcon", - "specialized/rose-sturmfels-telen-tropical-implicitization/gen_impl.jlcon", - "specialized/rose-sturmfels-telen-tropical-implicitization/hyperdet.jlcon", - "specialized/rose-sturmfels-telen-tropical-implicitization/pol_from_surface.jlcon", - "specialized/rose-sturmfels-telen-tropical-implicitization/chow_fan.jlcon", - "specialized/rose-sturmfels-telen-tropical-implicitization/chow_transl.jlcon", - - # TODO: need to fix column width for output? - "specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_xz.jlcon", - # non-stable: "specialized/joswig-kastner-lorenz-confirmable-workflows/versioninfo.jlcon", # output changed in oscar master? TODO check + adapt "specialized/decker-schmitt-invariant-theory/gleason.jlcon", - # FIXME: MethodError: no method matching (::Oscar.MPolyAnyMap{…})(::Oscar.MPolyAnyMap{…}, ::Vector{…}) - # function missing on master? + # output changes? "specialized/decker-schmitt-invariant-theory/cox_ring.jlcon", + + # backtrace err + "introduction/introduction/julia.jlcon", + "introduction/introduction/julia2.jlcon", + "introduction/introduction/julia3.jlcon", ] -const skipped = [ +skipped = [ # sometimes very slow: 4000-30000s "specialized/brandhorst-zach-fibration-hopping/vinberg_2.jlcon", # very slow: 24000s @@ -77,26 +27,18 @@ const skipped = [ # somewhat slow (~300s) "cornerstones/polyhedral-geometry/ch-benchmark.jlcon", "specialized/brandhorst-zach-fibration-hopping/vinberg_3.jlcon", - - # needs Mockdule: - # defines `l(a,b)`: - "cornerstones/number-theory/unit_log_plot.jl", - # printout changes on subsequent runs due to other variables - "cornerstones/groups/cohomology.jlcon", - # defines vars that affect other tests... (eder-mohr...) - "cornerstones/groups/genchar.jlcon", ] dispsize = (40, 130) +using Oscar + using REPL -using Random using Pkg -import Random.Xoshiro using Test -include(joinpath(pkgdir(REPL),"test","FakeTerminals.jl")) - +isdefined(Main, :FakeTerminals) || include(joinpath(pkgdir(REPL),"test","FakeTerminals.jl")) +# this is run on both sample and output function normalize_repl_output(s::AbstractString) result = string(s) lafter = length(result) @@ -106,7 +48,9 @@ function normalize_repl_output(s::AbstractString) result = replace(result, r"^ "m => "") result = strip(result) result = replace(result, r"julia>$"s => "") + # canonicalize numbered anonymous functions result = replace(result, r"^\s*(?:#\d+)?(.* \(generic function with ).*\n"m => s"\1\n") + # remove timings result = replace(result, r"^\s*[0-9\.]+ seconds \(.* allocations: .*\)$"m => "\n") # this removes the package version slug, filename and linenumber result = replace(result, r" @ \w* ?~/\.julia/packages/(?:Nemo|Hecke|AbstractAlgebra|Polymake)/\K[\w\d]+/.*\.jl:\d+"m => "") @@ -122,150 +66,210 @@ function sanitize_input(s::AbstractString) return result end +# this is only applied to the output function sanitize_output(s::AbstractString) result = s - # println("length before: ", length(result)) lafter = length(result) lbefore = lafter+1 while lafter < lbefore lbefore = lafter - result = replace(result, r"\r\e\[\d+[A-Z]"=>"") - result = replace(result, r"\e\[\?\d+[a-z]"=>"") - result = replace(result, r"\r\r\n"=>"") - result = replace(result, r"julia> julia> julia>" => "julia>") + # remove control characters: + # kill line including previous line (move_up) + result = replace(result, r"^.*\n.*?\e\[1A\r\e\[0K"m=>"") + # kill line + result = replace(result, r"^.*(?"") + # move right + result = replace(result, r"\r\e\[\d+C"=>"") + # empty line with \r + result = replace(result, r"^\r\r\n"m=>"") + + # remove mockdule from prompt-prefix + result = replace(result, r"\(Main\.__\d+\) julia>"m => "julia>") + + # replace weird duplicated non-comments + result = replace(result, r"^(#.*)\n\1$"m => s"\1") + + # remove end marker + result = replace(result, "\n\njulia> println(\"\\nEND_BLOCK\");" => "") lafter = length(result) end - result = replace(result, r"julia> visualize\(PC\)julia> visualize\(PC\)" => "julia> visualize(PC)") result = normalize_repl_output(result) - # println("length after: ", length(result)) return result end -function set_task_rngstate!(state::Xoshiro) - Random.setstate!(Random.default_rng(), state.s0, state.s1, state.s2, state.s3, state.s4) +function get_preamble(modstr::String) + return """ + REPL.activate($modstr); + using Base.MainInclude: ans + using Oscar; + eval(Oscar.doctestsetup()); + println("\\nEND_PREAMBLE"); + """ +end + +struct MockREPLHelper + mockdule::Module + stdin_write::IO + out_stream::IOContext + input::Pipe + output::Pipe + err::Pipe + repltask + + function MockREPLHelper(prefix::AbstractString) + sym = Symbol("__", lstrip(string(gensym()), '#')) + mockdule = Module(sym) + # make it accessible from Main + setproperty!(Main, sym, mockdule) + Core.eval(mockdule, :(eval(x) = Core.eval($(mockdule), x))) + Core.eval(mockdule, :(include(x) = Base.include($(mockdule), abspath(x)))) + + input = Pipe() + output = Pipe() + err = Pipe() + Base.link_pipe!(input, reader_supports_async=true, writer_supports_async=true) + Base.link_pipe!(output, reader_supports_async=true, writer_supports_async=true) + Base.link_pipe!(err, reader_supports_async=true, writer_supports_async=true) + stdin_write = input.in + out_stream = IOContext(output.in, :displaysize=>dispsize) + options = REPL.Options(confirm_exit=false, hascolor=false) + repl = REPL.LineEditREPL(FakeTerminals.FakeTerminal(input.out, out_stream, err.in, options.hascolor), options.hascolor, false) + repl.options = options + Base.active_repl = repl + repltask = @async begin + REPL.run_repl(repl) + end + preout = redirect_stdout(out_stream) do + preamble_task = @async write(stdin_write, get_preamble(string(mockdule))) + wait(preamble_task) + readuntil(output.out, "\nEND_PREAMBLE\n") + end + # crude error checking, but using `err` doesn't seem to work here + if occursin("ERROR", preout) + error("Error in preamble for $prefix:\n$preout") + end + + return new(mockdule, stdin_write, out_stream, input, output, err, repltask) + end end -function get_task_rngstate!(state::Xoshiro) - t = current_task() - Random.setstate!(state, t.rngState0, t.rngState1, t.rngState2, t.rngState3, t.rngState4) + +function close_repl(mockrepl::MockREPLHelper) + input_task = @async write(mockrepl.stdin_write, "\x04") + wait(input_task) + wait(mockrepl.repltask) + close(mockrepl.output) end -function run_repl_string(s::AbstractString, rng::Random.Xoshiro; jlcon_mode=true) +function run_repl_string(mockrepl::MockREPLHelper, s::AbstractString; jlcon_mode=true) input_string = s if jlcon_mode - input_string = "\e[200~$s\e[201~\n" + input_string = "\e[200~$s\e[201~" end - input = Pipe() - output = Pipe() - err = Pipe() - Base.link_pipe!(input, reader_supports_async=true, writer_supports_async=true) - #outputbuf = IOBuffer() - Base.link_pipe!(output, reader_supports_async=true, writer_supports_async=true) - Base.link_pipe!(err, reader_supports_async=true, writer_supports_async=true) - stdin_write = input.in - out_stream = IOContext(output.in, :displaysize=>dispsize) - options = REPL.Options(confirm_exit=false, hascolor=false) - # options.extra_keymap = REPL.LineEdit.escape_defaults - repl = REPL.LineEditREPL(FakeTerminals.FakeTerminal(input.out, out_stream, err.in, options.hascolor), options.hascolor, false) - repl.options = options - # repl.specialdisplay = REPL.REPLDisplay(repl) - repltask = @async begin - redirect_stdout(out_stream) do - set_task_rngstate!(rng) - REPL.run_repl(repl) - get_task_rngstate!(rng) - end + REPL.activate(mockrepl.mockdule) + result = redirect_stdout(mockrepl.out_stream) do + input_task = @async begin + write(mockrepl.stdin_write, input_string) + write(mockrepl.stdin_write, """\nprintln("\\nEND_BLOCK");\n""") + end + wait(input_task) + readuntil(mockrepl.output.out, "\nEND_BLOCK") end - input_task = @async write(stdin_write, input_string) - output_task = @async read(output.out, String) - wait(input_task) - input_task = @async write(stdin_write, "\x04") - wait(input_task) - wait(repltask) - close(output) - result = fetch(output_task) + REPL.activate(Main) return sanitize_output(result) end -# add overlay project for plots -custom_load_path = [] -copy!(custom_load_path, Base.DEFAULT_LOAD_PATH) -curdir = pwd() -act_proj = dirname(Base.active_project()) -try -plots = mktempdir() -Pkg.activate(plots; io=devnull) -Pkg.add("Plots"; io=devnull) -Pkg.activate("$act_proj"; io=devnull) -pushfirst!(custom_load_path, plots) +function test_chapter(chapter::String="") + println("Running OscarBook-Examples\n") -oefile = joinpath(Oscar.oscardir, "test/book/ordered_examples.json") -ordered_examples = load(oefile) -if isdefined(Main, :run_only) && run_only !== nothing - ordered_examples = Dict("$run_only" => ordered_examples[run_only]) -end -withenv("LINES" => dispsize[1], "COLUMNS" => dispsize[2], "DISPLAY" => "") do - for (chapter, example_list) in ordered_examples - cd(curdir) - @testset "$chapter" verbose=true begin - println(chapter) - copy!(LOAD_PATH, custom_load_path) - auxmain = joinpath(Oscar.oscardir, "test/book", chapter, "auxiliary_code", "main.jl") - if isfile(auxmain) - # add overlay project for aux file - # and run it from temp dir - temp = mktempdir() - Pkg.activate(temp; io=devnull) - Pkg.develop(path=act_proj; io=devnull) - pushfirst!(LOAD_PATH, "$act_proj") - cp(auxmain,joinpath(temp, "main.jl")) - cd(temp) - include(joinpath(temp,"main.jl")) - LOAD_PATH[1] = temp - Pkg.activate("$act_proj"; io=devnull) - end - Oscar.set_seed!(42) - Oscar.randseed!(42) - rng = copy(Random.default_rng()) - for example in example_list - full_file = joinpath(chapter, example) - exclude = filter(s->occursin(s, full_file), excluded) - if length(exclude) == 0 - println(" $example$(full_file in skipped ? ": skip" : - full_file in broken ? ": broken" : "")") - filetype = endswith(example, "jlcon") ? :jlcon : - endswith(example, "jl") ? :jl : :unknown - content = read(joinpath(Oscar.oscardir, "test/book", full_file), String) - if filetype == :jlcon && !occursin("julia> ", content) - filetype = :jl - @warn "possibly wrong file type: $full_file" - end - if full_file in skipped - @test run_repl_string(content, rng) isa AbstractString skip=true - elseif filetype == :jlcon - content = sanitize_input(content) - computed = run_repl_string(content, rng) - @test normalize_repl_output(content) == computed broken=(full_file in broken) - elseif filetype == :jl - if occursin("# output\n", content) - (code, res) = split(content, "# output\n"; limit=2) - # TODO do we want to compare with `res` ? - @test run_repl_string(code, rng; jlcon_mode=false) isa AbstractString broken=(full_file in broken) - else - @test run_repl_string(content, rng; jlcon_mode=false) isa AbstractString broken=(full_file in broken) + # add overlay project for plots + custom_load_path = [] + copy!(custom_load_path, Base.DEFAULT_LOAD_PATH) + curdir = pwd() + act_proj = dirname(Base.active_project()) + try + plots = mktempdir() + Pkg.activate(plots; io=devnull) + Pkg.add("Plots"; io=devnull) + Pkg.activate("$act_proj"; io=devnull) + pushfirst!(custom_load_path, plots) + + oefile = joinpath(Oscar.oscardir, "test/book/ordered_examples.json") + ordered_examples = load(oefile) + if length(chapter) > 0 + ordered_examples = Dict("$chapter" => ordered_examples[chapter]) + end + withenv("LINES" => dispsize[1], "COLUMNS" => dispsize[2], "DISPLAY" => "") do + @testset "OscarBookExamples" verbose=true begin + for (chapter, example_list) in ordered_examples + cd(curdir) + @testset "$chapter" verbose=true begin + println(chapter) + mockrepl = MockREPLHelper(chapter) + println(" created mockrepl: $(mockrepl.mockdule)") + + copy!(LOAD_PATH, custom_load_path) + auxmain = joinpath(Oscar.oscardir, "test/book", chapter, "auxiliary_code", "main.jl") + if isfile(auxmain) + # add overlay project for aux file + # and run it from temp dir + temp = mktempdir() + Pkg.activate(temp; io=devnull) + osc_proj = dirname(Base.identify_package_env("Oscar")[2]) + #Pkg.develop(path=osc_proj; io=devnull) + pushfirst!(LOAD_PATH, "$osc_proj") + cp(auxmain,joinpath(temp, "main.jl")) + cd(temp) + run_repl_string(mockrepl, """include("$(joinpath(temp,"main.jl"))")\n""") + LOAD_PATH[1] = temp + Pkg.activate("$act_proj"; io=devnull) + println(" done with aux") end - else - @warn "unknown file type: $full_file" + + run_repl_string(mockrepl, """Oscar.randseed!(42);""") + for example in example_list + full_file = joinpath(chapter, example) + println(" $example$(full_file in skipped ? ": skip" : + full_file in broken ? ": broken" : "")") + filetype = endswith(example, "jlcon") ? :jlcon : + endswith(example, "jl") ? :jl : :unknown + content = read(joinpath(Oscar.oscardir, "test/book", full_file), String) + if filetype == :jlcon && !occursin("julia> ", content) + filetype = :jl + @warn "possibly wrong file type: $full_file" + end + if full_file in skipped + @test run_repl_string(mockrepl, content) isa AbstractString skip=true + elseif filetype == :jlcon + content = sanitize_input(content) + computed = run_repl_string(mockrepl, content) + res = @test normalize_repl_output(content) == computed broken=(full_file in broken) + if res isa Test.Fail && isdefined(Main, :deepdiff) + println(deepdiff(normalize_repl_output(content),computed)) + end + elseif filetype == :jl + if occursin("# output\n", content) + (code, res) = split(content, "# output\n"; limit=2) + # TODO do we want to compare with `res` ? + @test run_repl_string(mockrepl, code; jlcon_mode=false) isa AbstractString broken=(full_file in broken) + else + @test run_repl_string(mockrepl, content; jlcon_mode=false) isa AbstractString broken=(full_file in broken) + end + else + @warn "unknown file type: $full_file" + end + end + println(" closing mockrepl: $(mockrepl.mockdule)") + close_repl(mockrepl) end - # else - # println(" "*example*" excluded") end end end + finally + # restore some state + Main.REPL.activate(Main) + Pkg.activate("$act_proj"; io=devnull) + cd(curdir) + copy!(LOAD_PATH, Base.DEFAULT_LOAD_PATH) end + nothing end -finally - cd(curdir) - copy!(LOAD_PATH, Base.DEFAULT_LOAD_PATH) - Pkg.activate("$act_proj"; io=devnull) -end -nothing diff --git a/test/runtests.jl b/test/runtests.jl index 13171e195905..f65209ee9b87 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -114,6 +114,9 @@ test_large = [ "test/Modules/ModulesGraded.jl", "test/AlgebraicGeometry/Schemes/elliptic_surface.jl", ] +test_book = [ + "test/book/test.jl", + ] test_subset = get(ENV, "OSCAR_TEST_SUBSET", "") if haskey(ENV, "JULIA_PKGEVAL") @@ -121,29 +124,38 @@ if haskey(ENV, "JULIA_PKGEVAL") end if test_subset == "short" - filter!(x-> !in(relpath(x, Oscar.oscardir), test_large), testlist) + filter!(x-> !in(relpath(x, Oscar.oscardir), [test_large; test_book]), testlist) elseif test_subset == "long" - testlist = joinpath.(Oscar.oscardir, test_large) - filter!(isfile, testlist) + filter!(x-> in(relpath(x, Oscar.oscardir), test_large), testlist) +elseif test_subset == "book" + filter!(x-> in(relpath(x, Oscar.oscardir), test_book), testlist) +elseif test_subset == "" && !(Sys.islinux() && v"1.10" <= VERSION < v"1.11.0-DEV") + # book tests only on 1.10 and linux + @info "Skipping Oscar book tests" + filter!(x-> !in(relpath(x, Oscar.oscardir), test_book), testlist) end @everywhere testlist = $testlist -# if many workers, distribute tasks across them -# otherwise, is essentially a serial loop -stats = reduce(merge, pmap(testlist) do x - println("Starting tests for $x") - Oscar.test_module(x; new=false, timed=true, tempproject=false) - end) +stats = Dict{String,NamedTuple}() # this needs to run here to make sure it runs on the main process # it is in the ignore list for the other tests -if numprocs == 1 && test_subset != "short" +# try running it first for now +if numprocs == 1 && (test_subset == "long" || test_subset == "") println("Starting tests for Serialization/IPC.jl") push!(stats, Oscar._timed_include("Serialization/IPC.jl", Main)) end +# if many workers, distribute tasks across them +# otherwise, is essentially a serial loop +merge!(stats, reduce(merge, pmap(testlist) do x + println("Starting tests for $x") + Oscar.test_module(x; new=false, timed=true, tempproject=false) + end)) + + if haskey(ENV, "GITHUB_STEP_SUMMARY") open(ENV["GITHUB_STEP_SUMMARY"], "a") do io print_stats(io, stats; fmt=PrettyTables.tf_markdown) From ea702300e1b8ecde46c526a220cb32c24d313275 Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Fri, 22 Mar 2024 08:59:20 +0100 Subject: [PATCH 20/30] adjust some whitespace + linebreak --- .../alexander-surface.jlcon | 3 +- .../algebraic-geometry/canonicalimage.jlcon | 1 + .../algebraic-geometry/char3-surface-2.jlcon | 2 ++ .../algebraic-geometry/ex23a.jlcon | 3 +- .../algebraic-geometry/ex314.jlcon | 2 ++ .../algebraic-geometry/exres2.jlcon | 1 + .../algebraic-geometry/param.jlcon | 4 ++- .../eliminate_xz.jlcon | 30 ++++++++++++++++++- test/book/test.jl | 9 ++---- 9 files changed, 45 insertions(+), 10 deletions(-) diff --git a/test/book/cornerstones/algebraic-geometry/alexander-surface.jlcon b/test/book/cornerstones/algebraic-geometry/alexander-surface.jlcon index 3639a00b22d9..40bed762795c 100644 --- a/test/book/cornerstones/algebraic-geometry/alexander-surface.jlcon +++ b/test/book/cornerstones/algebraic-geometry/alexander-surface.jlcon @@ -7,7 +7,7 @@ julia> degree(X) 9 julia> S = ambient_coordinate_ring(X) -Multivariate polynomial ring in 5 variables over GF(31991) graded by +Multivariate polynomial ring in 5 variables over GF(31991) graded by x -> [1] y -> [1] z -> [1] @@ -42,6 +42,7 @@ julia> minimal_betti_table(FA) ----------------------- total: 1 16 29 18 4 + julia> I = defining_ideal(X); julia> IQ = ideal([x for x in gens(I) if degree(x)[1] == 5]); diff --git a/test/book/cornerstones/algebraic-geometry/canonicalimage.jlcon b/test/book/cornerstones/algebraic-geometry/canonicalimage.jlcon index 535e21eb70cd..0dc5f2256ec3 100644 --- a/test/book/cornerstones/algebraic-geometry/canonicalimage.jlcon +++ b/test/book/cornerstones/algebraic-geometry/canonicalimage.jlcon @@ -57,6 +57,7 @@ julia> minimal_betti_table(re) --------------------- total: 1 9 16 9 1 + julia> phi1 = hom(Rt,R,[x,y,R(1//10)]); julia> f = phi1(ft); diff --git a/test/book/cornerstones/algebraic-geometry/char3-surface-2.jlcon b/test/book/cornerstones/algebraic-geometry/char3-surface-2.jlcon index 171ccbc7a550..5e6d3083f2e1 100644 --- a/test/book/cornerstones/algebraic-geometry/char3-surface-2.jlcon +++ b/test/book/cornerstones/algebraic-geometry/char3-surface-2.jlcon @@ -28,6 +28,7 @@ julia> betti_table(FD) ---------------- total: 10 10 2 + julia> P = cokernel(transpose(matrix(map(FD, 2)))); julia> I = annihilator(P); @@ -48,6 +49,7 @@ julia> betti_table(FQI) ----------------------- total: 1 12 26 20 5 + julia> dim(I) 3 diff --git a/test/book/cornerstones/algebraic-geometry/ex23a.jlcon b/test/book/cornerstones/algebraic-geometry/ex23a.jlcon index dafe29060bcd..67637c6f9acf 100644 --- a/test/book/cornerstones/algebraic-geometry/ex23a.jlcon +++ b/test/book/cornerstones/algebraic-geometry/ex23a.jlcon @@ -12,7 +12,8 @@ julia> other_pos_abs = pos_abs == 1 ? 2 : 1 julia> cI2 = cIabs[other_pos_abs][3] Ideal generated by 648*y + (-160*_a^3 - 1269*_a^2 + 22446*_a + 972)*z - 184147758075888*x + (2850969000960*_a^3 + 22611747888864*_a^2 - 399955313722176*_a - 17319636680832)*y + (2884707374400*_a^3 + 22782606070410*_a^2 - 405172045313820*_a - 57843867366864)*z + 184147758075888*x + (2850969000960*_a^3 + 22611747888864*_a^2 - 399955313722176*_a - 17319636680832)*y + (2884707374400*_a^3 + 2 + 2782606070410*_a^2 - 405172045313820*_a - 57843867366864)*z julia> R2 = base_ring(cI2) Multivariate polynomial ring in 3 variables over number field graded by diff --git a/test/book/cornerstones/algebraic-geometry/ex314.jlcon b/test/book/cornerstones/algebraic-geometry/ex314.jlcon index d387821bc9bc..3a15caec9592 100644 --- a/test/book/cornerstones/algebraic-geometry/ex314.jlcon +++ b/test/book/cornerstones/algebraic-geometry/ex314.jlcon @@ -68,11 +68,13 @@ M1 -> M e[1] -> (-x_0*x_3 + x_1*x_2)*e[1] Graded module homomorphism of degree [2] + julia> phi2 = psi(tohomM1M(hom1[2])) M1 -> M e[1] -> (-x_0*x_2 + x_1^2)*e[1] Graded module homomorphism of degree [2] + julia> kerphi2, _ = kernel(phi2); julia> iszero(kerphi2) diff --git a/test/book/cornerstones/algebraic-geometry/exres2.jlcon b/test/book/cornerstones/algebraic-geometry/exres2.jlcon index 3181f5c529ed..567b531f14aa 100644 --- a/test/book/cornerstones/algebraic-geometry/exres2.jlcon +++ b/test/book/cornerstones/algebraic-geometry/exres2.jlcon @@ -7,6 +7,7 @@ julia> betti_table(FA) ----------------- total: 1 5 6 2 + julia> minimal_betti_table(FA) 0 1 2 3 ----------------- diff --git a/test/book/cornerstones/algebraic-geometry/param.jlcon b/test/book/cornerstones/algebraic-geometry/param.jlcon index 1e975acf1854..a186c3b3d1ef 100644 --- a/test/book/cornerstones/algebraic-geometry/param.jlcon +++ b/test/book/cornerstones/algebraic-geometry/param.jlcon @@ -4,7 +4,8 @@ julia> f = x^5 + 10*x^4*y + 20*x^3*y^2 + 130*x^2*y^3 - 20*x*y^4 + 20*y^5 - 2*x^4 julia> C = plane_curve(f) Projective plane curve - defined by 0 = x^5 + 10*x^4*y - 2*x^4*z + 20*x^3*y^2 - 40*x^3*y*z + x^3*z^2 + 130*x^2*y^3 - 150*x^2*y^2*z + 30*x^2*y*z^2 - 20*x*y^4 - 90*x*y^3*z + 110*x*y^2*z^2 + 20*y^5 - 40*y^4*z + 20*y^3*z^2 + defined by 0 = x^5 + 10*x^4*y - 2*x^4*z + 20*x^3*y^2 - 40*x^3*y*z + x^3*z^2 + 130*x^2*y^3 - 150*x^2*y^2*z + 30*x^2*y*z^2 - 20*x* + y^4 - 90*x*y^3*z + 110*x*y^2*z^2 + 20*y^5 - 40*y^4*z + 20*y^3*z^2 julia> conics = [x^2-x*z, y^2-y*z]; @@ -38,6 +39,7 @@ julia> betti(free_resolution(defining_ideal(D))) ----------- total: 3 2 + julia> Oscar.rat_normal_curve_anticanonical_map(D) 2-element Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}: 2*y(2) + 13*y(4) diff --git a/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_xz.jlcon b/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_xz.jlcon index 536e974116ef..b5abf8cf3424 100644 --- a/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_xz.jlcon +++ b/test/book/specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_xz.jlcon @@ -12,4 +12,32 @@ julia> Igf = ideal(R,[g,f]); julia> eliminate(Igf,[y]) Ideal generated by - -x^7 + (b2^2 + b34^2 + 2*b34*b4 + 2*b4^2 + b56^2 + 2*b56*b6 + 2*b6^2)*x^6 + (-b2^2*b34^2 - 2*b2^2*b34*b4 - 2*b2^2*b4^2 - b2^2*b56^2 - 2*b2^2*b56*b6 - 2*b2^2*b6^2 + b2^2*b7^2 - b34^2*b4^2 - b34^2*b56^2 - 2*b34^2*b56*b6 - 2*b34^2*b6^2 + b34^2*b7^2 - 2*b34*b4^3 - 2*b34*b4*b56^2 - 4*b34*b4*b56*b6 - 4*b34*b4*b6^2 + 2*b34*b4*b7^2 - b4^4 - 2*b4^2*b56^2 - 4*b4^2*b56*b6 - 4*b4^2*b6^2 + 2*b4^2*b7^2 - b56^2*b6^2 + b56^2*b7^2 - 2*b56*b6^3 - b6^4)*x^5 + (b2^2*b34^2*b4^2 + b2^2*b34^2*b56^2 + 2*b2^2*b34^2*b56*b6 + 2*b2^2*b34^2*b6^2 - b2^2*b34^2*b7^2 + 2*b2^2*b34*b4^3 + 2*b2^2*b34*b4*b56^2 + 4*b2^2*b34*b4*b56*b6 + 4*b2^2*b34*b4*b6^2 - 2*b2^2*b34*b4*b7^2 + b2^2*b4^4 + 2*b2^2*b4^2*b56^2 + 4*b2^2*b4^2*b56*b6 + 4*b2^2*b4^2*b6^2 - 2*b2^2*b4^2*b7^2 + b2^2*b56^2*b6^2 - b2^2*b56^2*b7^2 + 2*b2^2*b56*b6^3 - 2*b2^2*b56*b6*b7^2 + b2^2*b6^4 - 2*b2^2*b6^2*b7^2 + b34^2*b4^2*b56^2 + 2*b34^2*b4^2*b56*b6 + 2*b34^2*b4^2*b6^2 - b34^2*b4^2*b7^2 + b34^2*b56^2*b6^2 - b34^2*b56^2*b7^2 + 2*b34^2*b56*b6^3 - 2*b34^2*b56*b6*b7^2 + b34^2*b6^4 - 2*b34^2*b6^2*b7^2 + 2*b34*b4^3*b56^2 + 4*b34*b4^3*b56*b6 + 4*b34*b4^3*b6^2 - 2*b34*b4^3*b7^2 + 2*b34*b4*b56^2*b6^2 - 2*b34*b4*b56^2*b7^2 + 4*b34*b4*b56*b6^3 - 2*b34*b4*b56*b6*b7^2 + 2*b34*b4*b6^4 - 2*b34*b4*b6^2*b7^2 + b4^4*b56^2 + 2*b4^4*b56*b6 + 2*b4^4*b6^2 - b4^4*b7^2 + 2*b4^2*b56^2*b6^2 - 2*b4^2*b56^2*b7^2 + 4*b4^2*b56*b6^3 - 2*b4^2*b56*b6*b7^2 + 2*b4^2*b6^4 - 2*b4^2*b6^2*b7^2)*x^4 + (-b2^2*b34^2*b4^2*b56^2 - 2*b2^2*b34^2*b4^2*b56*b6 - 2*b2^2*b34^2*b4^2*b6^2 + b2^2*b34^2*b4^2*b7^2 - b2^2*b34^2*b56^2*b6^2 + b2^2*b34^2*b56^2*b7^2 - 2*b2^2*b34^2*b56*b6^3 + 2*b2^2*b34^2*b56*b6*b7^2 - b2^2*b34^2*b6^4 + 2*b2^2*b34^2*b6^2*b7^2 - 2*b2^2*b34*b4^3*b56^2 - 4*b2^2*b34*b4^3*b56*b6 - 4*b2^2*b34*b4^3*b6^2 + 2*b2^2*b34*b4^3*b7^2 - 2*b2^2*b34*b4*b56^2*b6^2 + 2*b2^2*b34*b4*b56^2*b7^2 - 4*b2^2*b34*b4*b56*b6^3 + 4*b2^2*b34*b4*b56*b6*b7^2 - 2*b2^2*b34*b4*b6^4 + 4*b2^2*b34*b4*b6^2*b7^2 - b2^2*b4^4*b56^2 - 2*b2^2*b4^4*b56*b6 - 2*b2^2*b4^4*b6^2 + b2^2*b4^4*b7^2 - 2*b2^2*b4^2*b56^2*b6^2 + 2*b2^2*b4^2*b56^2*b7^2 - 4*b2^2*b4^2*b56*b6^3 + 4*b2^2*b4^2*b56*b6*b7^2 - 2*b2^2*b4^2*b6^4 + 4*b2^2*b4^2*b6^2*b7^2 + b2^2*b56^2*b6^2*b7^2 + 2*b2^2*b56*b6^3*b7^2 + b2^2*b6^4*b7^2 - b34^2*b4^2*b56^2*b6^2 + b34^2*b4^2*b56^2*b7^2 - 2*b34^2*b4^2*b56*b6^3 + 2*b34^2*b4^2*b56*b6*b7^2 - b34^2*b4^2*b6^4 + 2*b34^2*b4^2*b6^2*b7^2 + b34^2*b56^2*b6^2*b7^2 + 2*b34^2*b56*b6^3*b7^2 + b34^2*b6^4*b7^2 - 2*b34*b4^3*b56^2*b6^2 + 2*b34*b4^3*b56^2*b7^2 - 4*b34*b4^3*b56*b6^3 + 4*b34*b4^3*b56*b6*b7^2 - 2*b34*b4^3*b6^4 + 4*b34*b4^3*b6^2*b7^2 - b4^4*b56^2*b6^2 + b4^4*b56^2*b7^2 - 2*b4^4*b56*b6^3 + 2*b4^4*b56*b6*b7^2 - b4^4*b6^4 + 2*b4^4*b6^2*b7^2)*x^3 + (b2^2*b34^2*b4^2*b56^2*b6^2 - b2^2*b34^2*b4^2*b56^2*b7^2 + 2*b2^2*b34^2*b4^2*b56*b6^3 - 2*b2^2*b34^2*b4^2*b56*b6*b7^2 + b2^2*b34^2*b4^2*b6^4 - 2*b2^2*b34^2*b4^2*b6^2*b7^2 - b2^2*b34^2*b56^2*b6^2*b7^2 - 2*b2^2*b34^2*b56*b6^3*b7^2 - b2^2*b34^2*b6^4*b7^2 + 2*b2^2*b34*b4^3*b56^2*b6^2 - 2*b2^2*b34*b4^3*b56^2*b7^2 + 4*b2^2*b34*b4^3*b56*b6^3 - 4*b2^2*b34*b4^3*b56*b6*b7^2 + 2*b2^2*b34*b4^3*b6^4 - 4*b2^2*b34*b4^3*b6^2*b7^2 - 2*b2^2*b34*b4*b56^2*b6^2*b7^2 - 4*b2^2*b34*b4*b56*b6^3*b7^2 - 2*b2^2*b34*b4*b6^4*b7^2 + b2^2*b4^4*b56^2*b6^2 - b2^2*b4^4*b56^2*b7^2 + 2*b2^2*b4^4*b56*b6^3 - 2*b2^2*b4^4*b56*b6*b7^2 + b2^2*b4^4*b6^4 - 2*b2^2*b4^4*b6^2*b7^2 - 2*b2^2*b4^2*b56^2*b6^2*b7^2 - 4*b2^2*b4^2*b56*b6^3*b7^2 - 2*b2^2*b4^2*b6^4*b7^2)*x^2 + (b2^2*b34^2*b4^2*b56^2*b6^2*b7^2 + 2*b2^2*b34^2*b4^2*b56*b6^3*b7^2 + b2^2*b34^2*b4^2*b6^4*b7^2 + 2*b2^2*b34*b4^3*b56^2*b6^2*b7^2 + 4*b2^2*b34*b4^3*b56*b6^3*b7^2 + 2*b2^2*b34*b4^3*b6^4*b7^2 + b2^2*b4^4*b56^2*b6^2*b7^2 + 2*b2^2*b4^4*b56*b6^3*b7^2 + b2^2*b4^4*b6^4*b7^2)*x + -x^7 + (b2^2 + b34^2 + 2*b34*b4 + 2*b4^2 + b56^2 + 2*b56*b6 + 2*b6^2)*x^6 + (-b2^2*b34^2 - 2*b2^2*b34*b4 - 2*b2^2*b4^2 - b2^2*b5 + 6^2 - 2*b2^2*b56*b6 - 2*b2^2*b6^2 + b2^2*b7^2 - b34^2*b4^2 - b34^2*b56^2 - 2*b34^2*b56*b6 - 2*b34^2*b6^2 + b34^2*b7^2 - 2*b34*b4 + ^3 - 2*b34*b4*b56^2 - 4*b34*b4*b56*b6 - 4*b34*b4*b6^2 + 2*b34*b4*b7^2 - b4^4 - 2*b4^2*b56^2 - 4*b4^2*b56*b6 - 4*b4^2*b6^2 + 2*b4 + ^2*b7^2 - b56^2*b6^2 + b56^2*b7^2 - 2*b56*b6^3 - b6^4)*x^5 + (b2^2*b34^2*b4^2 + b2^2*b34^2*b56^2 + 2*b2^2*b34^2*b56*b6 + 2*b2^2* + b34^2*b6^2 - b2^2*b34^2*b7^2 + 2*b2^2*b34*b4^3 + 2*b2^2*b34*b4*b56^2 + 4*b2^2*b34*b4*b56*b6 + 4*b2^2*b34*b4*b6^2 - 2*b2^2*b34*b4 + *b7^2 + b2^2*b4^4 + 2*b2^2*b4^2*b56^2 + 4*b2^2*b4^2*b56*b6 + 4*b2^2*b4^2*b6^2 - 2*b2^2*b4^2*b7^2 + b2^2*b56^2*b6^2 - b2^2*b56^2* + b7^2 + 2*b2^2*b56*b6^3 - 2*b2^2*b56*b6*b7^2 + b2^2*b6^4 - 2*b2^2*b6^2*b7^2 + b34^2*b4^2*b56^2 + 2*b34^2*b4^2*b56*b6 + 2*b34^2*b4 + ^2*b6^2 - b34^2*b4^2*b7^2 + b34^2*b56^2*b6^2 - b34^2*b56^2*b7^2 + 2*b34^2*b56*b6^3 - 2*b34^2*b56*b6*b7^2 + b34^2*b6^4 - 2*b34^2* + b6^2*b7^2 + 2*b34*b4^3*b56^2 + 4*b34*b4^3*b56*b6 + 4*b34*b4^3*b6^2 - 2*b34*b4^3*b7^2 + 2*b34*b4*b56^2*b6^2 - 2*b34*b4*b56^2*b7^2 + + 4*b34*b4*b56*b6^3 - 2*b34*b4*b56*b6*b7^2 + 2*b34*b4*b6^4 - 2*b34*b4*b6^2*b7^2 + b4^4*b56^2 + 2*b4^4*b56*b6 + 2*b4^4*b6^2 - b4 + ^4*b7^2 + 2*b4^2*b56^2*b6^2 - 2*b4^2*b56^2*b7^2 + 4*b4^2*b56*b6^3 - 2*b4^2*b56*b6*b7^2 + 2*b4^2*b6^4 - 2*b4^2*b6^2*b7^2)*x^4 + ( + -b2^2*b34^2*b4^2*b56^2 - 2*b2^2*b34^2*b4^2*b56*b6 - 2*b2^2*b34^2*b4^2*b6^2 + b2^2*b34^2*b4^2*b7^2 - b2^2*b34^2*b56^2*b6^2 + b2^2 + *b34^2*b56^2*b7^2 - 2*b2^2*b34^2*b56*b6^3 + 2*b2^2*b34^2*b56*b6*b7^2 - b2^2*b34^2*b6^4 + 2*b2^2*b34^2*b6^2*b7^2 - 2*b2^2*b34*b4^ + 3*b56^2 - 4*b2^2*b34*b4^3*b56*b6 - 4*b2^2*b34*b4^3*b6^2 + 2*b2^2*b34*b4^3*b7^2 - 2*b2^2*b34*b4*b56^2*b6^2 + 2*b2^2*b34*b4*b56^2* + b7^2 - 4*b2^2*b34*b4*b56*b6^3 + 4*b2^2*b34*b4*b56*b6*b7^2 - 2*b2^2*b34*b4*b6^4 + 4*b2^2*b34*b4*b6^2*b7^2 - b2^2*b4^4*b56^2 - 2*b + 2^2*b4^4*b56*b6 - 2*b2^2*b4^4*b6^2 + b2^2*b4^4*b7^2 - 2*b2^2*b4^2*b56^2*b6^2 + 2*b2^2*b4^2*b56^2*b7^2 - 4*b2^2*b4^2*b56*b6^3 + 4 + *b2^2*b4^2*b56*b6*b7^2 - 2*b2^2*b4^2*b6^4 + 4*b2^2*b4^2*b6^2*b7^2 + b2^2*b56^2*b6^2*b7^2 + 2*b2^2*b56*b6^3*b7^2 + b2^2*b6^4*b7^2 + - b34^2*b4^2*b56^2*b6^2 + b34^2*b4^2*b56^2*b7^2 - 2*b34^2*b4^2*b56*b6^3 + 2*b34^2*b4^2*b56*b6*b7^2 - b34^2*b4^2*b6^4 + 2*b34^2* + b4^2*b6^2*b7^2 + b34^2*b56^2*b6^2*b7^2 + 2*b34^2*b56*b6^3*b7^2 + b34^2*b6^4*b7^2 - 2*b34*b4^3*b56^2*b6^2 + 2*b34*b4^3*b56^2*b7^2 + - 4*b34*b4^3*b56*b6^3 + 4*b34*b4^3*b56*b6*b7^2 - 2*b34*b4^3*b6^4 + 4*b34*b4^3*b6^2*b7^2 - b4^4*b56^2*b6^2 + b4^4*b56^2*b7^2 - 2 + *b4^4*b56*b6^3 + 2*b4^4*b56*b6*b7^2 - b4^4*b6^4 + 2*b4^4*b6^2*b7^2)*x^3 + (b2^2*b34^2*b4^2*b56^2*b6^2 - b2^2*b34^2*b4^2*b56^2*b7 + ^2 + 2*b2^2*b34^2*b4^2*b56*b6^3 - 2*b2^2*b34^2*b4^2*b56*b6*b7^2 + b2^2*b34^2*b4^2*b6^4 - 2*b2^2*b34^2*b4^2*b6^2*b7^2 - b2^2*b34^ + 2*b56^2*b6^2*b7^2 - 2*b2^2*b34^2*b56*b6^3*b7^2 - b2^2*b34^2*b6^4*b7^2 + 2*b2^2*b34*b4^3*b56^2*b6^2 - 2*b2^2*b34*b4^3*b56^2*b7^2 + + 4*b2^2*b34*b4^3*b56*b6^3 - 4*b2^2*b34*b4^3*b56*b6*b7^2 + 2*b2^2*b34*b4^3*b6^4 - 4*b2^2*b34*b4^3*b6^2*b7^2 - 2*b2^2*b34*b4*b56^ + 2*b6^2*b7^2 - 4*b2^2*b34*b4*b56*b6^3*b7^2 - 2*b2^2*b34*b4*b6^4*b7^2 + b2^2*b4^4*b56^2*b6^2 - b2^2*b4^4*b56^2*b7^2 + 2*b2^2*b4^4* + b56*b6^3 - 2*b2^2*b4^4*b56*b6*b7^2 + b2^2*b4^4*b6^4 - 2*b2^2*b4^4*b6^2*b7^2 - 2*b2^2*b4^2*b56^2*b6^2*b7^2 - 4*b2^2*b4^2*b56*b6^3 + *b7^2 - 2*b2^2*b4^2*b6^4*b7^2)*x^2 + (b2^2*b34^2*b4^2*b56^2*b6^2*b7^2 + 2*b2^2*b34^2*b4^2*b56*b6^3*b7^2 + b2^2*b34^2*b4^2*b6^4*b + 7^2 + 2*b2^2*b34*b4^3*b56^2*b6^2*b7^2 + 4*b2^2*b34*b4^3*b56*b6^3*b7^2 + 2*b2^2*b34*b4^3*b6^4*b7^2 + b2^2*b4^4*b56^2*b6^2*b7^2 + + 2*b2^2*b4^4*b56*b6^3*b7^2 + b2^2*b4^4*b6^4*b7^2)*x diff --git a/test/book/test.jl b/test/book/test.jl index 66c6c73b85ae..89a396f3e49a 100644 --- a/test/book/test.jl +++ b/test/book/test.jl @@ -5,16 +5,13 @@ broken = [ # non-stable: "specialized/joswig-kastner-lorenz-confirmable-workflows/versioninfo.jlcon", - # output changed in oscar master? TODO check + adapt - "specialized/decker-schmitt-invariant-theory/gleason.jlcon", - - # output changes? - "specialized/decker-schmitt-invariant-theory/cox_ring.jlcon", - # backtrace err "introduction/introduction/julia.jlcon", "introduction/introduction/julia2.jlcon", "introduction/introduction/julia3.jlcon", + + # broken with recent changes ... + "specialized/bies-turner-string-theory-applications/SU5-2.jlcon", ] skipped = [ # sometimes very slow: 4000-30000s From 12112cc219bb67a4a5317471b8866cd768d76707 Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Wed, 10 Apr 2024 23:44:35 +0200 Subject: [PATCH 21/30] booktest: put code inside testset block, allow running from test_module --- test/book/test.jl | 354 +++++++++++++++++++++++----------------------- 1 file changed, 180 insertions(+), 174 deletions(-) diff --git a/test/book/test.jl b/test/book/test.jl index 89a396f3e49a..c145dc2008be 100644 --- a/test/book/test.jl +++ b/test/book/test.jl @@ -1,202 +1,206 @@ -broken = [ - # Something broken in Oscar - "specialized/breuer-nebe-parker-orthogonal-discriminants/expl_syl.jlcon", +using Oscar - # non-stable: - "specialized/joswig-kastner-lorenz-confirmable-workflows/versioninfo.jlcon", +using DeepDiffs +using REPL +using Pkg +using Test +isdefined(Main, :FakeTerminals) || include(joinpath(pkgdir(REPL),"test","FakeTerminals.jl")) - # backtrace err - "introduction/introduction/julia.jlcon", - "introduction/introduction/julia2.jlcon", - "introduction/introduction/julia3.jlcon", +@testset "OscarBookExamples" verbose=true begin - # broken with recent changes ... - "specialized/bies-turner-string-theory-applications/SU5-2.jlcon", - ] -skipped = [ - # sometimes very slow: 4000-30000s - "specialized/brandhorst-zach-fibration-hopping/vinberg_2.jlcon", - # very slow: 24000s - "cornerstones/number-theory/cohenlenstra.jlcon", - # ultra slow: time unknown - "specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_yz.jlcon", + broken = [ + # Something broken in Oscar + "specialized/breuer-nebe-parker-orthogonal-discriminants/expl_syl.jlcon", - # somewhat slow (~300s) - "cornerstones/polyhedral-geometry/ch-benchmark.jlcon", - "specialized/brandhorst-zach-fibration-hopping/vinberg_3.jlcon", - ] + # non-stable: + "specialized/joswig-kastner-lorenz-confirmable-workflows/versioninfo.jlcon", -dispsize = (40, 130) + # backtrace err + "introduction/introduction/julia.jlcon", + "introduction/introduction/julia2.jlcon", + "introduction/introduction/julia3.jlcon", -using Oscar + # broken with recent changes ... to be fixed on master soon + "specialized/bies-turner-string-theory-applications/SU5-2.jlcon", + "cornerstones/groups/explSL25.jlcon", + "cornerstones/number-theory/galoismod.jlcon", + ] + skipped = [ + # sometimes very slow: 4000-30000s + "specialized/brandhorst-zach-fibration-hopping/vinberg_2.jlcon", + # very slow: 24000s + "cornerstones/number-theory/cohenlenstra.jlcon", + # ultra slow: time unknown + "specialized/markwig-ristau-schleis-faithful-tropicalization/eliminate_yz.jlcon", -using REPL -using Pkg -using Test -isdefined(Main, :FakeTerminals) || include(joinpath(pkgdir(REPL),"test","FakeTerminals.jl")) + # somewhat slow (~300s) + "cornerstones/polyhedral-geometry/ch-benchmark.jlcon", + "specialized/brandhorst-zach-fibration-hopping/vinberg_3.jlcon", + ] + + dispsize = (40, 130) -# this is run on both sample and output -function normalize_repl_output(s::AbstractString) - result = string(s) - lafter = length(result) - lbefore = lafter+1 - while lafter < lbefore - lbefore = lafter - result = replace(result, r"^ "m => "") - result = strip(result) - result = replace(result, r"julia>$"s => "") - # canonicalize numbered anonymous functions - result = replace(result, r"^\s*(?:#\d+)?(.* \(generic function with ).*\n"m => s"\1\n") - # remove timings - result = replace(result, r"^\s*[0-9\.]+ seconds \(.* allocations: .*\)$"m => "\n") - # this removes the package version slug, filename and linenumber - result = replace(result, r" @ \w* ?~/\.julia/packages/(?:Nemo|Hecke|AbstractAlgebra|Polymake)/\K[\w\d]+/.*\.jl:\d+"m => "") + + # this is run on both sample and output + function normalize_repl_output(s::AbstractString) + result = string(s) lafter = length(result) + lbefore = lafter+1 + while lafter < lbefore + lbefore = lafter + result = replace(result, r"^ "m => "") + result = strip(result) + result = replace(result, r"julia>$"s => "") + # canonicalize numbered anonymous functions + result = replace(result, r"^\s*(?:#\d+)?(.* \(generic function with ).*\n"m => s"\1\n") + # remove timings + result = replace(result, r"^\s*[0-9\.]+ seconds \(.* allocations: .*\)$"m => "\n") + # this removes the package version slug, filename and linenumber + result = replace(result, r" @ \w* ?~/\.julia/packages/(?:Nemo|Hecke|AbstractAlgebra|Polymake)/\K[\w\d]+/.*\.jl:\d+"m => "") + lafter = length(result) + end + return strip(result) end - return strip(result) -end -function sanitize_input(s::AbstractString) - result = s - result = normalize_repl_output(result) - return result -end + function sanitize_input(s::AbstractString) + result = s + result = normalize_repl_output(result) + return result + end -# this is only applied to the output -function sanitize_output(s::AbstractString) - result = s - lafter = length(result) - lbefore = lafter+1 - while lafter < lbefore - lbefore = lafter - # remove control characters: - # kill line including previous line (move_up) - result = replace(result, r"^.*\n.*?\e\[1A\r\e\[0K"m=>"") - # kill line - result = replace(result, r"^.*(?"") - # move right - result = replace(result, r"\r\e\[\d+C"=>"") - # empty line with \r - result = replace(result, r"^\r\r\n"m=>"") + # this is only applied to the output + function sanitize_output(s::AbstractString) + result = s + lafter = length(result) + lbefore = lafter+1 + while lafter < lbefore + lbefore = lafter + # remove control characters: + # kill line including previous line (move_up) + result = replace(result, r"^.*\n.*?\e\[1A\r\e\[0K"m=>"") + # kill line + result = replace(result, r"^.*(?"") + # move right + result = replace(result, r"\r\e\[\d+C"=>"") + # empty line with \r + result = replace(result, r"^\r\r\n"m=>"") - # remove mockdule from prompt-prefix - result = replace(result, r"\(Main\.__\d+\) julia>"m => "julia>") + # remove mockdule from prompt-prefix + result = replace(result, r"\(Main\.__\d+\) julia>"m => "julia>") - # replace weird duplicated non-comments - result = replace(result, r"^(#.*)\n\1$"m => s"\1") + # replace weird duplicated non-comments + result = replace(result, r"^(#.*)\n\1$"m => s"\1") - # remove end marker - result = replace(result, "\n\njulia> println(\"\\nEND_BLOCK\");" => "") - lafter = length(result) + # remove end marker + result = replace(result, "\n\njulia> println(\"\\nEND_BLOCK\");" => "") + lafter = length(result) + end + result = normalize_repl_output(result) + return result end - result = normalize_repl_output(result) - return result -end -function get_preamble(modstr::String) - return """ + function get_preamble(modstr::String) + return """ REPL.activate($modstr); using Base.MainInclude: ans using Oscar; eval(Oscar.doctestsetup()); println("\\nEND_PREAMBLE"); """ -end + end -struct MockREPLHelper - mockdule::Module - stdin_write::IO - out_stream::IOContext - input::Pipe - output::Pipe - err::Pipe - repltask + struct MockREPLHelper + mockdule::Module + stdin_write::IO + out_stream::IOContext + input::Pipe + output::Pipe + err::Pipe + repltask - function MockREPLHelper(prefix::AbstractString) - sym = Symbol("__", lstrip(string(gensym()), '#')) - mockdule = Module(sym) - # make it accessible from Main - setproperty!(Main, sym, mockdule) - Core.eval(mockdule, :(eval(x) = Core.eval($(mockdule), x))) - Core.eval(mockdule, :(include(x) = Base.include($(mockdule), abspath(x)))) + function MockREPLHelper(prefix::AbstractString) + sym = Symbol("__", lstrip(string(gensym()), '#')) + mockdule = Module(sym) + # make it accessible from Main + setproperty!(Main, sym, mockdule) + Core.eval(mockdule, :(eval(x) = Core.eval($(mockdule), x))) + Core.eval(mockdule, :(include(x) = Base.include($(mockdule), abspath(x)))) - input = Pipe() - output = Pipe() - err = Pipe() - Base.link_pipe!(input, reader_supports_async=true, writer_supports_async=true) - Base.link_pipe!(output, reader_supports_async=true, writer_supports_async=true) - Base.link_pipe!(err, reader_supports_async=true, writer_supports_async=true) - stdin_write = input.in - out_stream = IOContext(output.in, :displaysize=>dispsize) - options = REPL.Options(confirm_exit=false, hascolor=false) - repl = REPL.LineEditREPL(FakeTerminals.FakeTerminal(input.out, out_stream, err.in, options.hascolor), options.hascolor, false) - repl.options = options - Base.active_repl = repl - repltask = @async begin - REPL.run_repl(repl) - end - preout = redirect_stdout(out_stream) do - preamble_task = @async write(stdin_write, get_preamble(string(mockdule))) - wait(preamble_task) - readuntil(output.out, "\nEND_PREAMBLE\n") - end - # crude error checking, but using `err` doesn't seem to work here - if occursin("ERROR", preout) - error("Error in preamble for $prefix:\n$preout") - end + input = Pipe() + output = Pipe() + err = Pipe() + Base.link_pipe!(input, reader_supports_async=true, writer_supports_async=true) + Base.link_pipe!(output, reader_supports_async=true, writer_supports_async=true) + Base.link_pipe!(err, reader_supports_async=true, writer_supports_async=true) + stdin_write = input.in + out_stream = IOContext(output.in, :displaysize=>dispsize) + options = REPL.Options(confirm_exit=false, hascolor=false) + repl = REPL.LineEditREPL(FakeTerminals.FakeTerminal(input.out, out_stream, err.in, options.hascolor), options.hascolor, false) + repl.options = options + Base.active_repl = repl + repltask = @async begin + REPL.run_repl(repl) + end + preout = redirect_stdout(out_stream) do + preamble_task = @async write(stdin_write, get_preamble(string(mockdule))) + wait(preamble_task) + readuntil(output.out, "\nEND_PREAMBLE\n") + end + # crude error checking, but using `err` doesn't seem to work here + if occursin("ERROR", preout) + error("Error in preamble for $prefix:\n$preout") + end - return new(mockdule, stdin_write, out_stream, input, output, err, repltask) + return new(mockdule, stdin_write, out_stream, input, output, err, repltask) + end end -end - -function close_repl(mockrepl::MockREPLHelper) - input_task = @async write(mockrepl.stdin_write, "\x04") - wait(input_task) - wait(mockrepl.repltask) - close(mockrepl.output) -end -function run_repl_string(mockrepl::MockREPLHelper, s::AbstractString; jlcon_mode=true) - input_string = s - if jlcon_mode - input_string = "\e[200~$s\e[201~" - end - REPL.activate(mockrepl.mockdule) - result = redirect_stdout(mockrepl.out_stream) do - input_task = @async begin - write(mockrepl.stdin_write, input_string) - write(mockrepl.stdin_write, """\nprintln("\\nEND_BLOCK");\n""") - end + function close_repl(mockrepl::MockREPLHelper) + input_task = @async write(mockrepl.stdin_write, "\x04") wait(input_task) - readuntil(mockrepl.output.out, "\nEND_BLOCK") + wait(mockrepl.repltask) + close(mockrepl.output) end - REPL.activate(Main) - return sanitize_output(result) -end -function test_chapter(chapter::String="") - println("Running OscarBook-Examples\n") + function run_repl_string(mockrepl::MockREPLHelper, s::AbstractString; jlcon_mode=true) + input_string = s + if jlcon_mode + input_string = "\e[200~$s\e[201~" + end + REPL.activate(mockrepl.mockdule) + result = redirect_stdout(mockrepl.out_stream) do + input_task = @async begin + write(mockrepl.stdin_write, input_string) + write(mockrepl.stdin_write, """\nprintln("\\nEND_BLOCK");\n""") + end + wait(input_task) + readuntil(mockrepl.output.out, "\nEND_BLOCK") + end + REPL.activate(Main) + return sanitize_output(result) + end - # add overlay project for plots - custom_load_path = [] - copy!(custom_load_path, Base.DEFAULT_LOAD_PATH) - curdir = pwd() - act_proj = dirname(Base.active_project()) - try - plots = mktempdir() - Pkg.activate(plots; io=devnull) - Pkg.add("Plots"; io=devnull) - Pkg.activate("$act_proj"; io=devnull) - pushfirst!(custom_load_path, plots) + function test_chapter(chapter::String="") + # add overlay project for plots + custom_load_path = [] + copy!(custom_load_path, Base.DEFAULT_LOAD_PATH) + curdir = pwd() + act_proj = dirname(Base.active_project()) + osc_proj = dirname(Base.identify_package_env("Oscar")[2]) + try + plots = mktempdir() + Pkg.activate(plots; io=devnull) + Pkg.add("Plots"; io=devnull) + Pkg.activate("$act_proj"; io=devnull) + pushfirst!(custom_load_path, plots) - oefile = joinpath(Oscar.oscardir, "test/book/ordered_examples.json") - ordered_examples = load(oefile) - if length(chapter) > 0 - ordered_examples = Dict("$chapter" => ordered_examples[chapter]) - end - withenv("LINES" => dispsize[1], "COLUMNS" => dispsize[2], "DISPLAY" => "") do - @testset "OscarBookExamples" verbose=true begin + oefile = joinpath(Oscar.oscardir, "test/book/ordered_examples.json") + ordered_examples = load(oefile) + if length(chapter) > 0 + ordered_examples = Dict("$chapter" => ordered_examples[chapter]) + end + withenv("LINES" => dispsize[1], "COLUMNS" => dispsize[2], "DISPLAY" => "") do for (chapter, example_list) in ordered_examples cd(curdir) @testset "$chapter" verbose=true begin @@ -211,8 +215,6 @@ function test_chapter(chapter::String="") # and run it from temp dir temp = mktempdir() Pkg.activate(temp; io=devnull) - osc_proj = dirname(Base.identify_package_env("Oscar")[2]) - #Pkg.develop(path=osc_proj; io=devnull) pushfirst!(LOAD_PATH, "$osc_proj") cp(auxmain,joinpath(temp, "main.jl")) cd(temp) @@ -240,7 +242,7 @@ function test_chapter(chapter::String="") content = sanitize_input(content) computed = run_repl_string(mockrepl, content) res = @test normalize_repl_output(content) == computed broken=(full_file in broken) - if res isa Test.Fail && isdefined(Main, :deepdiff) + if res isa Test.Fail println(deepdiff(normalize_repl_output(content),computed)) end elseif filetype == :jl @@ -260,13 +262,17 @@ function test_chapter(chapter::String="") end end end + finally + # restore some state + Main.REPL.activate(Main) + Pkg.activate("$act_proj"; io=devnull) + cd(curdir) + copy!(LOAD_PATH, Base.DEFAULT_LOAD_PATH) end - finally - # restore some state - Main.REPL.activate(Main) - Pkg.activate("$act_proj"; io=devnull) - cd(curdir) - copy!(LOAD_PATH, Base.DEFAULT_LOAD_PATH) + nothing end - nothing + + # test all chapters + test_chapter() + end From 6df9a039bae0ddeac4f54617a37e119006fe07b5 Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Wed, 10 Apr 2024 23:46:34 +0200 Subject: [PATCH 22/30] booktest: remove su5-2 from broken --- test/book/test.jl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/book/test.jl b/test/book/test.jl index c145dc2008be..82934cfdf320 100644 --- a/test/book/test.jl +++ b/test/book/test.jl @@ -20,9 +20,7 @@ isdefined(Main, :FakeTerminals) || include(joinpath(pkgdir(REPL),"test","FakeTer "introduction/introduction/julia2.jlcon", "introduction/introduction/julia3.jlcon", - # broken with recent changes ... to be fixed on master soon - "specialized/bies-turner-string-theory-applications/SU5-2.jlcon", - "cornerstones/groups/explSL25.jlcon", + # broken with recent changes in hecke, needs new hecke release "cornerstones/number-theory/galoismod.jlcon", ] skipped = [ From 063445c4c48ef1a96130ca36e85ff65575ead45b Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Fri, 12 Apr 2024 16:40:58 +0200 Subject: [PATCH 23/30] booktests: move two currently broken tests to skipped to avoid sudden failures when these are fixed --- test/book/test.jl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/book/test.jl b/test/book/test.jl index 82934cfdf320..7216e91a6a5d 100644 --- a/test/book/test.jl +++ b/test/book/test.jl @@ -9,9 +9,6 @@ isdefined(Main, :FakeTerminals) || include(joinpath(pkgdir(REPL),"test","FakeTer @testset "OscarBookExamples" verbose=true begin broken = [ - # Something broken in Oscar - "specialized/breuer-nebe-parker-orthogonal-discriminants/expl_syl.jlcon", - # non-stable: "specialized/joswig-kastner-lorenz-confirmable-workflows/versioninfo.jlcon", @@ -19,11 +16,16 @@ isdefined(Main, :FakeTerminals) || include(joinpath(pkgdir(REPL),"test","FakeTer "introduction/introduction/julia.jlcon", "introduction/introduction/julia2.jlcon", "introduction/introduction/julia3.jlcon", - - # broken with recent changes in hecke, needs new hecke release - "cornerstones/number-theory/galoismod.jlcon", ] skipped = [ + # Something broken, probably needs some updated GAP packages + "specialized/breuer-nebe-parker-orthogonal-discriminants/expl_syl.jlcon", + + # needs new hecke release + "cornerstones/number-theory/galoismod.jlcon", + + # these are skipped because they slow down the tests too much: + # sometimes very slow: 4000-30000s "specialized/brandhorst-zach-fibration-hopping/vinberg_2.jlcon", # very slow: 24000s From 114ab123a158b1fd92e11bc2d6dfb3438d556fd6 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 12 Apr 2024 14:36:12 +0200 Subject: [PATCH 24/30] README.md: update citation info once more (#3600) [skip ci] (cherry picked from commit 68728ce5dd8ff01eeb7c144836c7a4f31c1ad677) --- CITATION.cff | 5 +++-- README.md | 13 +++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index eb5db594e2ea..721eb7efbef4 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -31,6 +31,7 @@ preferred-citation: given-names: "Max" - family-names: "Joswig" given-names: "Michael" - title: The Computer Algebra System OSCAR. Algorithms and Examples + title: "The Computer Algebra System OSCAR: Algorithms and Examples" year: 2024 - + publisher: + name: "Springer" diff --git a/README.md b/README.md index db2476bc8d4c..547ba7344c2a 100644 --- a/README.md +++ b/README.md @@ -120,9 +120,12 @@ pm::Array > If you have used OSCAR in the preparation of a paper please cite it as described below: [OSCAR] - OSCAR -- Open Source Computer Algebra Research system, Version 1.0.0, The OSCAR Team, 2024. (https://www.oscar-system.org) + OSCAR -- Open Source Computer Algebra Research system, Version 1.0.0, + The OSCAR Team, 2024. (https://www.oscar-system.org) [OSCAR-book] - Wolfram Decker, Christian Eder, Claus Fieker, Max Horn, Michael Joswig, The Computer Algebra System OSCAR. Algorithms and Examples, 2024. + Wolfram Decker, Christian Eder, Claus Fieker, Max Horn, Michael Joswig, eds. + The Computer Algebra System OSCAR: Algorithms and Examples, + Algorithms and Computation in Mathematics, Springer, 2024. If you are using BibTeX, you can use the following BibTeX entries: @@ -135,10 +138,12 @@ If you are using BibTeX, you can use the following BibTeX entries: url = {https://www.oscar-system.org}, } - @Book{OSCAR-book, + @book{OSCAR-book, editor = {Decker, Wolfram and Eder, Christian and Fieker, Claus and Horn, Max and Joswig, Michael}, - title = {{The Computer Algebra System OSCAR. Algorithms and Examples}}, + title = {The {C}omputer {A}lgebra {S}ystem {OSCAR}: {A}lgorithms and {E}xamples}, year = {2024}, + publisher = {Springer}, + series = {Algorithms and {C}omputation in {M}athematics}, } ## Funding From 0bb6d1af678274f772e8ab64c1631a5087072e4c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 12 Apr 2024 14:35:16 +0200 Subject: [PATCH 25/30] Fix links to people in Kaiserslautern (#3597) (cherry picked from commit c0bd7ba44705f500886d6db5fc47e6a603019286) --- docs/src/AlgebraicGeometry/Curves/ProjectivePlaneCurves.md | 2 +- docs/src/AlgebraicGeometry/Miscellaneous/miscellaneous.md | 2 +- docs/src/AlgebraicGeometry/Schemes/intro.md | 2 +- docs/src/AlgebraicGeometry/Surfaces/K3Surfaces.md | 2 +- docs/src/AlgebraicGeometry/Surfaces/SurfacesP4.md | 2 +- docs/src/AlgebraicGeometry/ToricVarieties/ToricSchemes.md | 2 +- docs/src/CommutativeAlgebra/intro.md | 2 +- docs/src/Fields/intro.md | 4 ++-- docs/src/Groups/intro.md | 2 +- docs/src/InvariantTheory/intro.md | 4 ++-- docs/src/LinearAlgebra/intro.md | 2 +- docs/src/NoncommutativeAlgebra/intro.md | 2 +- docs/src/NumberTheory/intro.md | 2 +- docs/src/Rings/intro.md | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/src/AlgebraicGeometry/Curves/ProjectivePlaneCurves.md b/docs/src/AlgebraicGeometry/Curves/ProjectivePlaneCurves.md index f536ff2153ae..8e3257c6cefa 100644 --- a/docs/src/AlgebraicGeometry/Curves/ProjectivePlaneCurves.md +++ b/docs/src/AlgebraicGeometry/Curves/ProjectivePlaneCurves.md @@ -94,7 +94,7 @@ parametrization(C::ProjectivePlaneCurve{QQField}) Please direct questions about this part of OSCAR to the following people: * [Janko Böhm](https://www.mathematik.uni-kl.de/~boehm/), -* [Wolfram Decker](https://www.mathematik.uni-kl.de/en/agag/people/head/prof-dr-wolfram-decker/seite). +* [Wolfram Decker](https://math.rptu.de/en/wgs/agag/people/head/decker). You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack). diff --git a/docs/src/AlgebraicGeometry/Miscellaneous/miscellaneous.md b/docs/src/AlgebraicGeometry/Miscellaneous/miscellaneous.md index 99b30e03ae59..e3fd25fcf0f4 100644 --- a/docs/src/AlgebraicGeometry/Miscellaneous/miscellaneous.md +++ b/docs/src/AlgebraicGeometry/Miscellaneous/miscellaneous.md @@ -17,7 +17,7 @@ grassmann_pluecker_ideal ## Contact Please direct questions about this part of OSCAR to the following people: -* [Wolfram Decker](https://www.mathematik.uni-kl.de/en/agag/people/head/prof-dr-wolfram-decker). +* [Wolfram Decker](https://math.rptu.de/en/wgs/agag/people/head/decker). You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack). diff --git a/docs/src/AlgebraicGeometry/Schemes/intro.md b/docs/src/AlgebraicGeometry/Schemes/intro.md index aeb7daf081a3..12ff8e9b5ca5 100644 --- a/docs/src/AlgebraicGeometry/Schemes/intro.md +++ b/docs/src/AlgebraicGeometry/Schemes/intro.md @@ -20,7 +20,7 @@ This project is work-in-progress. Please direct questions about this part of OSCAR to the following people: * [Simon Brandhorst](https://www.math.uni-sb.de/ag/brandhorst/index.php?lang=en). * [Anne Frühbis-Krüger](https://uol.de/anne-fruehbis-krueger), -* [Matthias Zach](https://www.mathematik.uni-kl.de/en/agag/people/members), +* [Matthias Zach](https://math.rptu.de/en/wgs/agag/people/members), You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack). diff --git a/docs/src/AlgebraicGeometry/Surfaces/K3Surfaces.md b/docs/src/AlgebraicGeometry/Surfaces/K3Surfaces.md index 825b3446a6b4..e965b8504dce 100644 --- a/docs/src/AlgebraicGeometry/Surfaces/K3Surfaces.md +++ b/docs/src/AlgebraicGeometry/Surfaces/K3Surfaces.md @@ -36,7 +36,7 @@ has_zero_entropy Please direct questions about this part of OSCAR to the following people: * [Simon Brandhorst](https://www.math.uni-sb.de/ag/brandhorst/index.php?lang=en). -* [Matthias Zach](https://www.mathematik.uni-kl.de/en/agag/people/members), +* [Matthias Zach](https://math.rptu.de/en/wgs/agag/people/members), You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack). diff --git a/docs/src/AlgebraicGeometry/Surfaces/SurfacesP4.md b/docs/src/AlgebraicGeometry/Surfaces/SurfacesP4.md index 2bf7915d7920..675e8d65dab2 100644 --- a/docs/src/AlgebraicGeometry/Surfaces/SurfacesP4.md +++ b/docs/src/AlgebraicGeometry/Surfaces/SurfacesP4.md @@ -341,7 +341,7 @@ elliptic_d12_pi14_ss_inf() ## Contact Please direct questions about this part of OSCAR to the following people: -* [Wolfram Decker](https://www.mathematik.uni-kl.de/en/agag/people/head/prof-dr-wolfram-decker). +* [Wolfram Decker](https://math.rptu.de/en/wgs/agag/people/head/decker). You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack). diff --git a/docs/src/AlgebraicGeometry/ToricVarieties/ToricSchemes.md b/docs/src/AlgebraicGeometry/ToricVarieties/ToricSchemes.md index 5da988117b0c..5264ea771f18 100644 --- a/docs/src/AlgebraicGeometry/ToricVarieties/ToricSchemes.md +++ b/docs/src/AlgebraicGeometry/ToricVarieties/ToricSchemes.md @@ -34,7 +34,7 @@ forget_toric_structure(X::NormalToricVariety) Please direct questions about this part of OSCAR to the following people: * [Martin Bies](https://martinbies.github.io/), -* [Matthias Zach](https://www.mathematik.uni-kl.de/en/agag/people/members/seite). +* [Matthias Zach](https://math.rptu.de/en/wgs/agag/people/members). You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack). diff --git a/docs/src/CommutativeAlgebra/intro.md b/docs/src/CommutativeAlgebra/intro.md index 04a15106d85e..4927dd41dccf 100644 --- a/docs/src/CommutativeAlgebra/intro.md +++ b/docs/src/CommutativeAlgebra/intro.md @@ -44,7 +44,7 @@ General textbooks offering details on theory and algorithms include: ## Contact Please direct questions about this part of OSCAR to the following people: -* [Wolfram Decker](https://www.mathematik.uni-kl.de/en/agag/people/head/prof-dr-wolfram-decker). +* [Wolfram Decker](https://math.rptu.de/en/wgs/agag/people/head/decker). You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack). diff --git a/docs/src/Fields/intro.md b/docs/src/Fields/intro.md index df5748c28ac8..1b90cecbdfb3 100644 --- a/docs/src/Fields/intro.md +++ b/docs/src/Fields/intro.md @@ -28,9 +28,9 @@ General textbooks offering details on theory and algorithms include: ## Contact Please direct questions about this part of OSCAR to the following people: -* [Claus Fieker](https://www.mathematik.uni-kl.de/en/agag/people/head/prof-dr-claus-fieker), +* [Claus Fieker](https://math.rptu.de/en/wgs/agag/people/head/fieker), * [Tommy Hofmann](https://www.thofma.com/), -* [Max Horn](https://www.mathematik.uni-kl.de/en/agag/people/head/prof-dr-max-horn). +* [Max Horn](https://math.rptu.de/en/wgs/agag/people/head/prof-dr-max-horn). You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack). diff --git a/docs/src/Groups/intro.md b/docs/src/Groups/intro.md index fce4ed4f5fc2..95fdbd2de6e5 100644 --- a/docs/src/Groups/intro.md +++ b/docs/src/Groups/intro.md @@ -24,7 +24,7 @@ General textbooks offering details on theory and algorithms include: Please direct questions about this part of OSCAR to the following people: * [Thomas Breuer](https://www.math.rwth-aachen.de/homes/Thomas.Breuer/), -* [Max Horn](https://www.mathematik.uni-kl.de/en/agag/people/head/prof-dr-max-horn). +* [Max Horn](https://math.rptu.de/en/wgs/agag/people/head/prof-dr-max-horn). You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack). diff --git a/docs/src/InvariantTheory/intro.md b/docs/src/InvariantTheory/intro.md index 837b32c46b65..574a3ed2f76f 100644 --- a/docs/src/InvariantTheory/intro.md +++ b/docs/src/InvariantTheory/intro.md @@ -65,8 +65,8 @@ provide details on theory and algorithms as well as references. ## Contact Please direct questions about this part of OSCAR to the following people: -* [Wolfram Decker](https://www.mathematik.uni-kl.de/en/agag/people/head/prof-dr-wolfram-decker), -* [Max Horn](https://www.mathematik.uni-kl.de/en/agag/people/head/prof-dr-max-horn), +* [Wolfram Decker](https://math.rptu.de/en/wgs/agag/people/head/decker), +* [Max Horn](https://math.rptu.de/en/wgs/agag/people/head/prof-dr-max-horn), * [Johannes Schmitt](https://joschmitt.eu/). You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack). diff --git a/docs/src/LinearAlgebra/intro.md b/docs/src/LinearAlgebra/intro.md index 3892e8ed6dc2..50e46e9f7825 100644 --- a/docs/src/LinearAlgebra/intro.md +++ b/docs/src/LinearAlgebra/intro.md @@ -20,7 +20,7 @@ General textbooks offering details on theory and algorithms include: ## Contact Please direct questions about this part of OSCAR to the following people: -* [Claus Fieker](https://www.mathematik.uni-kl.de/en/agag/people/head/prof-dr-claus-fieker), +* [Claus Fieker](https://math.rptu.de/en/wgs/agag/people/head/fieker), * [Tommy Hofmann](https://www.thofma.com/). You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack). diff --git a/docs/src/NoncommutativeAlgebra/intro.md b/docs/src/NoncommutativeAlgebra/intro.md index ed39549552e9..440b885e48a6 100644 --- a/docs/src/NoncommutativeAlgebra/intro.md +++ b/docs/src/NoncommutativeAlgebra/intro.md @@ -29,7 +29,7 @@ offer details on theory and algorithms. ## Contact Please direct questions about this part of OSCAR to the following people: -* [Wolfram Decker](https://www.mathematik.uni-kl.de/en/agag/people/head/prof-dr-wolfram-decker). +* [Wolfram Decker](https://math.rptu.de/en/wgs/agag/people/head/decker). You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack). diff --git a/docs/src/NumberTheory/intro.md b/docs/src/NumberTheory/intro.md index 0dccdf1c8230..eb66ec9e2c0f 100644 --- a/docs/src/NumberTheory/intro.md +++ b/docs/src/NumberTheory/intro.md @@ -18,7 +18,7 @@ General textbooks offering details on theory and algorithms include: ## Contact Please direct questions about this part of OSCAR to the following people: -* [Claus Fieker](https://www.mathematik.uni-kl.de/en/agag/people/head/prof-dr-claus-fieker), +* [Claus Fieker](https://math.rptu.de/en/wgs/agag/people/head/fieker), * [Tommy Hofmann](https://www.thofma.com/). You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack). diff --git a/docs/src/Rings/intro.md b/docs/src/Rings/intro.md index 21f6ea3c7e9b..11f10f8388f3 100644 --- a/docs/src/Rings/intro.md +++ b/docs/src/Rings/intro.md @@ -21,7 +21,7 @@ General textbooks offering details on theory and algorithms include: ## Contact Please direct questions about this part of OSCAR to the following people: -* [Claus Fieker](https://www.mathematik.uni-kl.de/en/agag/people/head/prof-dr-claus-fieker), +* [Claus Fieker](https://math.rptu.de/en/wgs/agag/people/head/fieker), * [Tommy Hofmann](https://www.thofma.com/). You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack). From 399ed1e3c0ef4bcc58bb6097bb9989927c651970 Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Fri, 12 Apr 2024 17:33:30 +0200 Subject: [PATCH 26/30] booktests: remove galoismod from skipped tests --- test/book/test.jl | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/book/test.jl b/test/book/test.jl index 7216e91a6a5d..35010121a0b0 100644 --- a/test/book/test.jl +++ b/test/book/test.jl @@ -21,9 +21,6 @@ isdefined(Main, :FakeTerminals) || include(joinpath(pkgdir(REPL),"test","FakeTer # Something broken, probably needs some updated GAP packages "specialized/breuer-nebe-parker-orthogonal-discriminants/expl_syl.jlcon", - # needs new hecke release - "cornerstones/number-theory/galoismod.jlcon", - # these are skipped because they slow down the tests too much: # sometimes very slow: 4000-30000s From b32e73eff39ed2537a2a55916eff99eeb3c5b37f Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Fri, 12 Apr 2024 19:44:11 +0200 Subject: [PATCH 27/30] booktest: re-adjust seed to make output correspond to the book again --- test/book/cornerstones/number-theory/galoismod.jlcon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/book/cornerstones/number-theory/galoismod.jlcon b/test/book/cornerstones/number-theory/galoismod.jlcon index 6e46fdcb4463..1e8d5e58cdcc 100644 --- a/test/book/cornerstones/number-theory/galoismod.jlcon +++ b/test/book/cornerstones/number-theory/galoismod.jlcon @@ -1,4 +1,4 @@ -julia> Oscar.randseed!(3371100); +julia> Oscar.randseed!(7360734); julia> Qx, x = QQ["x"]; From 1ca3fc48bfe3c68ca033a47e4b48ea4f9cab33cf Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Tue, 16 Apr 2024 08:33:29 +0200 Subject: [PATCH 28/30] booktests: clear verbosity levels before running each chapter (#3612) (cherry picked from commit 3f86b80d875bf744a139202a2ccc612dfb90e873) --- test/book/test.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/book/test.jl b/test/book/test.jl index 35010121a0b0..d8ffb25fa51f 100644 --- a/test/book/test.jl +++ b/test/book/test.jl @@ -205,6 +205,9 @@ isdefined(Main, :FakeTerminals) || include(joinpath(pkgdir(REPL),"test","FakeTer mockrepl = MockREPLHelper(chapter) println(" created mockrepl: $(mockrepl.mockdule)") + # clear verbosity levels before each chapter + empty!(Hecke.VERBOSE_LOOKUP) + copy!(LOAD_PATH, custom_load_path) auxmain = joinpath(Oscar.oscardir, "test/book", chapter, "auxiliary_code", "main.jl") if isfile(auxmain) From 899c5f34397e820bd26eeab9e7441fa2715b365b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 17 Apr 2024 11:20:17 +0200 Subject: [PATCH 29/30] Use a new OSCAR email address on our domain (#3596) (cherry picked from commit 3c638a54fca699845884ff518ae0f70b115508a8) --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 6a1a2424860b..913a42c7b710 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Oscar" uuid = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" -authors = ["The OSCAR Team "] +authors = ["The OSCAR Team "] version = "1.0.0" [deps] From d1caf3fdc370bbdd3fabec48d0933fd99e32e216 Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Wed, 17 Apr 2024 11:48:01 +0200 Subject: [PATCH 30/30] Version 1.0.1 --- Project.toml | 2 +- README.md | 6 +++--- gap/OscarInterface/PackageInfo.g | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index 913a42c7b710..25df4f8a01e4 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Oscar" uuid = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" authors = ["The OSCAR Team "] -version = "1.0.0" +version = "1.0.1" [deps] AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" diff --git a/README.md b/README.md index 547ba7344c2a..7ef276c0a44c 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ julia> using Oscar / _ \ / ___| / ___| / \ | _ \ | Combining ANTIC, GAP, Polymake, Singular | | | |\___ \| | / _ \ | |_) | | Type "?Oscar" for more information | |_| | ___) | |___ / ___ \| _ < | Manual: https://docs.oscar-system.org - \___/ |____/ \____/_/ \_\_| \_\ | Version 1.0.0 + \___/ |____/ \____/_/ \_\_| \_\ | Version 1.0.1 julia> k, a = quadratic_field(-5) (Imaginary quadratic field defined by x^2 + 5, sqrt(-5)) @@ -120,7 +120,7 @@ pm::Array > If you have used OSCAR in the preparation of a paper please cite it as described below: [OSCAR] - OSCAR -- Open Source Computer Algebra Research system, Version 1.0.0, + OSCAR -- Open Source Computer Algebra Research system, Version 1.0.1, The OSCAR Team, 2024. (https://www.oscar-system.org) [OSCAR-book] Wolfram Decker, Christian Eder, Claus Fieker, Max Horn, Michael Joswig, eds. @@ -133,7 +133,7 @@ If you are using BibTeX, you can use the following BibTeX entries: key = {OSCAR}, organization = {The OSCAR Team}, title = {OSCAR -- Open Source Computer Algebra Research system, - Version 1.0.0}, + Version 1.0.1}, year = {2024}, url = {https://www.oscar-system.org}, } diff --git a/gap/OscarInterface/PackageInfo.g b/gap/OscarInterface/PackageInfo.g index 8899f26ec1ff..54c1a6dcba9b 100644 --- a/gap/OscarInterface/PackageInfo.g +++ b/gap/OscarInterface/PackageInfo.g @@ -10,8 +10,8 @@ SetPackageInfo( rec( PackageName := "OscarInterface", Subtitle := "GAP interface to OSCAR", -Version := "1.0.0", -Date := "01/03/2024", # dd/mm/yyyy format +Version := "1.0.1", +Date := "17/04/2024", # dd/mm/yyyy format License := "GPL-2.0-or-later", Persons := [