Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

experimental: Gröbner Walk #3821

Merged
merged 184 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
184 commits
Select commit Hold shift + click to select a range
8089589
Move Gröbner walk to experimental
ooinaruhugh Feb 15, 2024
9e31ce2
Phase out global infoLevel
ooinaruhugh Feb 15, 2024
86ad34b
Reformat docstring
ooinaruhugh Feb 15, 2024
cd6df31
Add GroebnerWalk as rudimentary experimental package
ooinaruhugh Mar 20, 2024
fa20268
Fix identation in docstring
ooinaruhugh Mar 20, 2024
a5c6eca
Fix doctest
ooinaruhugh Mar 20, 2024
b1166bd
Add problematic example that does not work (for now)
ooinaruhugh Mar 20, 2024
931ccdb
Rename verbosity_scope for this module
ooinaruhugh Mar 20, 2024
4272841
Change to getter
ooinaruhugh Mar 20, 2024
5822ed5
Phase out `global infoLevel`
ooinaruhugh Mar 20, 2024
795b1d4
Reduce redundant docstrings
ooinaruhugh Mar 21, 2024
a65b60b
Replace manual computation of maximum
ooinaruhugh Mar 21, 2024
6dfc46f
Add verbosity scope for `groebner_walk`
ooinaruhugh Mar 21, 2024
c5b7eee
Rework `initials` into `initial_form`
ooinaruhugh Mar 21, 2024
1c1eabb
Simplify `standard_step`
ooinaruhugh Mar 21, 2024
1374f3f
Reduce amount of Matrix<->MonomialOrdering conversions
ooinaruhugh Mar 21, 2024
7eec7d8
added lift comment
fpnowell Mar 25, 2024
30ad7e7
commented lift, interreduce and next_weight
fpnowell Mar 26, 2024
d524c8f
Add some exports
ooinaruhugh Mar 27, 2024
41ec234
Renaming
ooinaruhugh Mar 27, 2024
ee7195a
Add toy example
ooinaruhugh Mar 27, 2024
bca3691
Resolved questions
ooinaruhugh Mar 27, 2024
a7d0e08
added comments, examples and facet_preorder
fpnowell Apr 2, 2024
e0e164f
added folder new_generic_walk
fpnowell Apr 5, 2024
ddfeaf2
removed old dependencies
fpnowell Apr 5, 2024
b7a4db2
Make this thing standalone
ooinaruhugh Apr 16, 2024
f649eda
Change order of `groebner_walk` arguments to most likely to be set by…
ooinaruhugh Apr 17, 2024
c721bbd
Remove unused argument
ooinaruhugh Apr 17, 2024
149a4c0
Remove a `while true` loop
ooinaruhugh Apr 17, 2024
0b7bc5d
Import some stuff from OSCAR
ooinaruhugh Apr 17, 2024
119f367
Enable debug print
ooinaruhugh Apr 17, 2024
5458d20
Cleanup generic and perturbed walks
ooinaruhugh Apr 17, 2024
f871064
Add README.md
ooinaruhugh Apr 18, 2024
0a07f83
Move some Standard walk procedures to own file
ooinaruhugh Apr 18, 2024
6d5a136
Rename `difference_lead_tail` to `bounding_vectors`
ooinaruhugh Apr 18, 2024
bdba49b
Don't compute lead_exp twice(?)
ooinaruhugh Apr 18, 2024
b97b5b0
Move perturbed_walk
ooinaruhugh Apr 18, 2024
a2fe385
Move to `perturbed_walk.jl`
ooinaruhugh Apr 18, 2024
476f332
removed new_generic_walk, added markedGB generic walk
fpnowell Apr 19, 2024
dac4725
Remove `infoLevel`
ooinaruhugh Apr 19, 2024
939918f
Merge branch 'main' of github.com:ooinaruhugh/GroebnerWalk.jl
fpnowell Apr 19, 2024
a3c9829
Merge branch 'main' of github.com:ooinaruhugh/GroebnerWalk.jl
fpnowell Apr 19, 2024
383aee5
cleaning up
fpnowell Apr 19, 2024
c792aff
Clean up
fpnowell Apr 19, 2024
ebeebcc
Add a docstring
fpnowell Apr 19, 2024
43f0f93
Clean up
fpnowell Apr 19, 2024
89f39ec
Separate the files
ooinaruhugh Apr 19, 2024
536c237
Polish words
ooinaruhugh Apr 19, 2024
32b73ae
Add simple benchmark
ooinaruhugh Apr 19, 2024
99e87e4
Fix typo
ooinaruhugh Apr 19, 2024
895300d
Move agk4
ooinaruhugh Apr 19, 2024
e934701
Change benchmark
ooinaruhugh Apr 19, 2024
0ce1333
Cleanup
ooinaruhugh Apr 19, 2024
8586ab0
clean up: commented out new "divide"
fpnowell Apr 20, 2024
4f2b3b2
cleaning up, made lift_generic lighter
fpnowell Apr 20, 2024
d3fed20
Merge branch 'main'
fpnowell Apr 20, 2024
4b5c41e
Add LICENSE and README
ooinaruhugh Apr 21, 2024
8aa0cac
Clean up the benchmark code
ooinaruhugh Apr 21, 2024
b9bd2ff
Rename `markedGB` to `MarkedGröbnerBasis`
ooinaruhugh Apr 21, 2024
6d1e051
Cleanup
ooinaruhugh Apr 21, 2024
b8c2c61
Rename `markedGB` to `MarkedGroebnerBasis`
ooinaruhugh Apr 21, 2024
3a8adcb
Avoid unnecessary copies in `facet_initials`
ooinaruhugh Apr 21, 2024
bbe04e6
Change order of arguments in example
ooinaruhugh Apr 21, 2024
0cd5107
Speed up generic_walk!!
ooinaruhugh Apr 21, 2024
cdd99c0
Document code
ooinaruhugh Apr 21, 2024
d178fe3
Cleanup examples
ooinaruhugh Apr 21, 2024
9a1add4
Fix difference_lead_tail for good
ooinaruhugh Apr 21, 2024
b3e414c
Scale down difference_lead_tail vectors and get rid of the zero issue
ooinaruhugh Apr 21, 2024
f80ac77
Add debug output
ooinaruhugh Apr 21, 2024
d97564b
Touch `convert_bounding_vector`
ooinaruhugh Apr 21, 2024
2bd0827
Expect vector of polynomials in final step of `groebner_walk`
ooinaruhugh Apr 22, 2024
ae6597c
Return only the gens, not an entire Gröbner basis
ooinaruhugh Apr 22, 2024
eed5734
Rename `interreduce_walk` to `autoreduce`
ooinaruhugh Apr 22, 2024
c7353d8
Return `gens(G)`
ooinaruhugh Apr 22, 2024
628921c
Add examples
fpnowell Apr 22, 2024
00feffe
Push intermediate benchmarking results
ooinaruhugh Apr 22, 2024
73f188f
Add the benchmarks
ooinaruhugh Apr 23, 2024
7c78d04
Add some benchmarks
ooinaruhugh Apr 24, 2024
235c2dc
Move benchmarks
ooinaruhugh Apr 24, 2024
90ae694
Move examples around
ooinaruhugh Apr 24, 2024
5c5d01f
Edit README.md
ooinaruhugh Apr 24, 2024
e4c5ef9
Clean up examples
ooinaruhugh Apr 24, 2024
41dfa19
Fix typo
ooinaruhugh Apr 24, 2024
d106deb
Clean up exports
ooinaruhugh Apr 25, 2024
9881171
Clean up benchmarks
ooinaruhugh Apr 25, 2024
fa49ac6
Change `_normal_form` to use `MPolyBuildCtx`
ooinaruhugh Apr 25, 2024
070a8c8
Remove unnecessary if condition
ooinaruhugh Apr 25, 2024
6ab19dc
Add docstrings
ooinaruhugh Apr 25, 2024
3fbd844
Clean up
ooinaruhugh Apr 25, 2024
3237404
Add DOI to README.md
ooinaruhugh Apr 25, 2024
6430447
Add DOI to README.md
ooinaruhugh Apr 25, 2024
e5709d6
Bump version number
ooinaruhugh Apr 25, 2024
735c024
Change default perturbation degree to n
ooinaruhugh May 29, 2024
b1b033e
Fix perturbed walk, it actually perturbs now
ooinaruhugh May 29, 2024
534dc01
Change some argument types
ooinaruhugh May 29, 2024
4dfe318
Autoreduce returns a Groebner basis
ooinaruhugh May 29, 2024
7512437
Add some diagnostics printing to standard_walk
ooinaruhugh May 29, 2024
06712c8
Add perturbed_walk to benchmarks
ooinaruhugh May 29, 2024
4ffb2e4
Add diagnostic printing to generic_walk
ooinaruhugh May 29, 2024
8058a40
Add diagnostic printing to perturbed_walk
ooinaruhugh May 29, 2024
73e7cda
Remove redundant assignment
ooinaruhugh Jun 3, 2024
2adc1d3
Rename walk.jl to common.jl and clean up
ooinaruhugh Jun 3, 2024
2b34cbc
Clean up
ooinaruhugh Jun 3, 2024
df70101
Add comments for missing docstrings
ooinaruhugh Jun 3, 2024
3cd62f2
Bump to v1.0.1
ooinaruhugh Jun 3, 2024
aedf209
Remove redundant `exponent_vectors` function
ooinaruhugh Jun 3, 2024
fb4e777
Update docstrings
ooinaruhugh Jun 5, 2024
81ac28a
Make some iterations more readable
ooinaruhugh Jun 8, 2024
999418f
Remove old large tests
ooinaruhugh Jul 23, 2024
2c23b61
added standard walk tests
fpnowell Jul 23, 2024
8af2707
Fix errors from CI
ooinaruhugh Jul 23, 2024
4770760
Remove redundant runtests
ooinaruhugh Jul 23, 2024
916216f
Move definitions into testset
ooinaruhugh Jul 23, 2024
35bc3ff
Update experimental/GroebnerWalk/src/GroebnerWalk.jl
ooinaruhugh Jul 23, 2024
921cfca
Update experimental/GroebnerWalk/benchmark/agk.jl
ooinaruhugh Jul 23, 2024
21d1d27
Update experimental/GroebnerWalk/benchmark/cyclic.jl
ooinaruhugh Jul 23, 2024
0b70da0
Add newlines to end of file
ooinaruhugh Jul 23, 2024
5ea1f23
Add Manifest.toml for reproducibility of examples and benchmarks
ooinaruhugh Jul 23, 2024
7ddee42
Add 'experimental/GroebnerWalk/' from commit '5ea1f2321bd128cadc5e6e9…
ooinaruhugh Aug 2, 2024
950a1f9
Remove standalone Julia package files
ooinaruhugh Jun 5, 2024
d12ab9e
Remove standalone Julia package files
ooinaruhugh Jun 5, 2024
c8e6625
Move weight_ordering
ooinaruhugh Jul 23, 2024
0de61a3
Move weight_ordering
ooinaruhugh Jul 23, 2024
b13af3f
Change parameter type for weight_ordering to `<:IntegerUnion`
ooinaruhugh Jul 23, 2024
91e1ce1
Update common.jl
ooinaruhugh Jul 29, 2024
f4e192f
Update common.jl
ooinaruhugh Jul 29, 2024
0add3aa
Preliminary version of documentation
ooinaruhugh Jul 30, 2024
32c61e0
Preliminary version of documentation
ooinaruhugh Jul 30, 2024
5f0d7a6
Add citations
ooinaruhugh Jul 30, 2024
29c76c5
Add citations
ooinaruhugh Jul 30, 2024
e1ffd64
Update doctests
ooinaruhugh Jul 30, 2024
d622ad2
Update doctests
ooinaruhugh Jul 30, 2024
fc2a7dc
Rename is_same_groebner_cone
ooinaruhugh Jul 30, 2024
96e4a4d
Rename is_same_groebner_cone
ooinaruhugh Jul 30, 2024
654d999
Fix docstring
ooinaruhugh Jul 31, 2024
652d437
Fix docstring
ooinaruhugh Jul 31, 2024
890971f
Export groebner_walk from experimental module
ooinaruhugh Jul 29, 2024
ac2216a
Export groebner_walk from experimental module
ooinaruhugh Jul 29, 2024
c1afb3c
Make use of TropicalGeometry/groebner_lift
ooinaruhugh Jul 31, 2024
9a7ed94
Make use of TropicalGeometry/groebner_lift
ooinaruhugh Jul 31, 2024
191382f
Update generic_walk.jl
ooinaruhugh Jul 29, 2024
4c4556c
Update generic_walk.jl
ooinaruhugh Jul 29, 2024
b4b483f
Update generic_walk.jl
ooinaruhugh Jul 29, 2024
2377132
Update generic_walk.jl
ooinaruhugh Jul 29, 2024
26b3c3b
Add citations
ooinaruhugh Jul 30, 2024
571aa9d
Add citations
ooinaruhugh Jul 30, 2024
43010c7
Update generic_walk.jl
ooinaruhugh Jul 29, 2024
b141a8f
Update generic_walk.jl
ooinaruhugh Jul 29, 2024
239ad7b
Update markedGB.jl
ooinaruhugh Jul 29, 2024
394b200
Update markedGB.jl
ooinaruhugh Jul 29, 2024
fbd690b
Separate a statement
ooinaruhugh Jul 31, 2024
e6a5e83
Separate a statement
ooinaruhugh Jul 31, 2024
afcbbee
Remove 'using GroebnerWalk'
ooinaruhugh Aug 2, 2024
a628121
Remove 'using GroebnerWalk'
ooinaruhugh Aug 2, 2024
112be07
Add tests for generic_walk
ooinaruhugh Aug 2, 2024
f5a5558
Add tests for generic_walk
ooinaruhugh Aug 2, 2024
777e6d8
Modify benchmarks
ooinaruhugh Aug 2, 2024
d18672f
Modify benchmarks
ooinaruhugh Aug 2, 2024
66d0891
Move benchmark polynomial systems
ooinaruhugh Aug 2, 2024
2630f6c
Move benchmark polynomial systems
ooinaruhugh Aug 2, 2024
354ea0a
Remove thesisexamples
ooinaruhugh Aug 2, 2024
29b1ad4
Remove thesisexamples
ooinaruhugh Aug 2, 2024
014397a
Expose newell_patch
ooinaruhugh Aug 2, 2024
197d895
Expose newell_patch
ooinaruhugh Aug 2, 2024
396a30c
Update GroebnerWalk/README.md
ooinaruhugh Jul 31, 2024
0c0d5c6
Update GroebnerWalk/README.md
ooinaruhugh Jul 31, 2024
63889f5
Update README.md
ooinaruhugh Aug 2, 2024
6607667
Update README.md
ooinaruhugh Aug 2, 2024
4bf43f1
Update example to use exported ideal
ooinaruhugh Aug 2, 2024
32ae296
Update example to use exported ideal
ooinaruhugh Aug 2, 2024
bc596e2
Add newline at end of file
ooinaruhugh Aug 2, 2024
fd45cc0
Add newline at end of file
ooinaruhugh Aug 2, 2024
9f62667
Properly export newell_patch_with_orderings
ooinaruhugh Aug 2, 2024
37832b3
Properly export newell_patch_with_orderings
ooinaruhugh Aug 2, 2024
3ade7a5
Add documentation
ooinaruhugh Aug 3, 2024
5b81d11
Add documentation
ooinaruhugh Aug 3, 2024
6f4cfff
Better input sanitation
ooinaruhugh Aug 3, 2024
0428526
Better input sanitation
ooinaruhugh Aug 3, 2024
e7c1bb6
Add type parameter to MarkedGroebnerBasis
ooinaruhugh Aug 2, 2024
43234ef
Merge commit 'e7c1bb607d5f18cf87e81af12007d327aa840fc0' into kf/gwalk
ooinaruhugh Aug 3, 2024
2465ebe
Add missing type parameter for MarkedGroebnerBasis
ooinaruhugh Aug 4, 2024
074f160
Clean up benchmarks
ooinaruhugh Aug 4, 2024
e462768
Add documentation for a special ideal
ooinaruhugh Aug 4, 2024
c4d9d68
Fix missing docstring
ooinaruhugh Aug 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions docs/oscar_references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,30 @@ @Article{AG10
eprint = {0810.1148}
}

@InProceedings{AGK96,
author = {Amrhein, Beatrice and Gloor, Oliver and Küchlin, Wolfgang},
title = {Walking faster},
booktitle = {Design and Implementation of Symbolic Computation Systems},
series = {DISCO 1996},
address = {Heidelberg, Germany},
publisher = {Springer Berlin, Heidelberg},
pages = {150--161},
year = {1996},
doi = {10.1007/3-540-61697-7_14},
location = {Karlsruhe, Germany}
}

@Article{AGK97,
author = {Amrhein, Beatrice and Gloor, Oliver and Küchlin, Wolfgang},
title = {On the walk},
journal = {Theoretical Computer Science},
volume = {187},
number = {1},
pages = {179--202},
year = {1997},
doi = {10.1016/s0304-3975(97)00064-9}
}

@Article{AHK18,
author = {Adiprasito, Karim and Huh, June and Katz, Eric},
title = {Hodge theory for combinatorial geometries},
Expand Down Expand Up @@ -453,6 +477,27 @@ @Article{CHM98
doi = {10.1112/S1461157000000115}
}

@Article{CKM97,
author = {Collart, S. and Kalkbrener, M. and Mall, D.},
title = {Converting Bases with the Gröbner Walk},
journal = {Journal of Symbolic Computation},
volume = {24},
number = {3},
pages = {465--469},
year = {1997},
doi = {10.1006/jsco.1996.0145}
}

@Book{CLO05,
author = {Cox, David A. and Little, John and O'Shea, Donal},
title = {Using Algebraic Geometry},
series = {Graduate Texts in Mathematics},
volume = {185},
publisher = {Springer-Verlag},
year = {2005},
doi = {10.1007/b138611}
}

@Book{CLS11,
author = {Cox, David A. and Little, John B. and Schenck, Henry K.},
title = {Toric varieties},
Expand Down Expand Up @@ -910,6 +955,17 @@ @Article{FGLM93
doi = {10.1006/jsco.1993.1051}
}

@Article{FJLT07,
author = {Fukuda, K. and Jensen, A. N. and Lauritzen, N. and Thomas, R.},
title = {The generic Gröbner walk},
journal = {Journal of Symbolic Computation},
volume = {42},
number = {3},
pages = {298--312},
year = {2007},
doi = {10.1016/j.jsc.2006.09.004}
}

@Article{FJR17,
author = {Fan, Huijun and Jarvis, Tyler and Ruan, Yongbin},
title = {A mathematical theory of the gauged linear sigma model},
Expand All @@ -923,6 +979,18 @@ @Article{FJR17
doi = {10.2140/gt.2018.22.235}
}

@Article{FJT07,
author = {Fukuda, Komei and Jensen, Anders N. and Thomas, Rekha R.},
title = {Computing Groebner Fans},
journal = {Math. Comp.},
fjournal = {Mathematics of Computation},
volume = {76},
number = {260},
pages = {2189--2213},
year = {2007},
doi = {10.1090/S0025-5718-07-01986-2}
}

@InProceedings{FLINT,
bibkey = {FLINT},
author = {W. B. Hart},
Expand Down Expand Up @@ -2161,6 +2229,28 @@ @Article{Tay87
primaryclass = {math.GR}
}

@Article{Tra00,
author = {Tran, Quoc-Nam},
title = {A Fast Algorithm for Gröbner Basis Conversion and its Applications},
journal = {Journal of Symbolic Computation},
volume = {30},
number = {4},
pages = {451--467},
year = {2000},
doi = {10.1006/jsco.1999.0416}
}

@Article{Tra04,
author = {Tran, Quoc-Nam},
title = {Efficient Groebner walk conversion for implicitization of geometric objects},
journal = {Computer Aided Geometric Design},
volume = {21},
number = {9},
pages = {837--857},
year = {2004},
doi = {10.1016/j.cagd.2004.07.001}
}

@Misc{VE22,
author = {Vaughan-Lee, Michael and Eick, Bettina},
title = {SglPPow, Database of groups of prime-power order for some prime-powers, Version 2.3},
Expand Down
49 changes: 49 additions & 0 deletions experimental/GroebnerWalk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Gröbner walk

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11065978.svg)](https://doi.org/10.5281/zenodo.11065978)

`GroebnerWalk` provides implementations of Gröbner walk algorithms
for computing Gröbner bases over fields on top of Oscar.jl.

## Usage

This module provides the function `groebner_walk` as interface to the algorithms.
The following example demonstrates the usage. First, we define the ideal Oscar.jl.
```julia
using Oscar

R, (x,y) = QQ[:x, :y] # define ring ...
I = ideal([y^4+ x^3-x^2+x,x^4]) # ... and ideal
```
Then, we can pass the ideal to `groebner_walk` to calculate the Gröbner basis.

By default, `groebner_walk` starts with a Gröbner basis with respect to the default ordering on `R`
and converts this into a Gröbner basis with respect to the lexicographic ordering on `R`.
This is what the following code block accomplishes.
```julia
using Oscar

groebner_walk(I) # compute the Groebner basis
```
If one wants to specify `target` and `start` orderings explicitly, above function call needs to be written as follows.
```julia
groebner_walk(I, lex(R), default_ordering(R)) # compute the Groebner basis
```

Additionally, there are certain special ideals provided that are used for benchmarking
of this module.

## Status
At the moment, the standard walk by Collart, Kalkbrener and Mall (1997) and the generic walk by Fukuda et al. (2007) are implemented.

## Contacts
The library is maintained by Kamillo Ferry (kafe (at) kafe (dot) dev) and Francesco Nowell (francesconowell (at) gmail (dot) com).

## Acknowledgement
The current implementation is based on an implementation by Jordi Welp. We thank him for
laying the groundwork for this package.

## References
- Collart, S., M. Kalkbrener, and D. Mall. ‘Converting Bases with the Gröbner Walk’. Journal of Symbolic Computation 24, no. 3–4 (September 1997): 465–69. https://doi.org/10.1006/jsco.1996.0145.
- Fukuda, K., A. N. Jensen, N. Lauritzen, and R. Thomas. ‘The Generic Gröbner Walk’. Journal of Symbolic Computation 42, no. 3 (1 March 2007): 298–312. https://doi.org/10.1016/j.jsc.2006.09.004.

17 changes: 17 additions & 0 deletions experimental/GroebnerWalk/benchmark/agk.jl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concerning this benchmark and the others below: There is src/Rings/special_ideals.jl in which someone already has added the katsura-n examples. Maybe we can add your benchmarks there and remove these different files, I assume your benchmarks are also of interest to other developers/users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started adding the ideals to a special-ideals.jl in the experimental module. I will add the others with references, as soon as this is done I will move this to src/Rings/special_ideals.jl (in a future PR)

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Oscar

function agk4(k::Field)
R, (x,y,z,u,v) = polynomial_ring(k, ["x","y","z","u","v"])

Check warning on line 4 in experimental/GroebnerWalk/benchmark/agk.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/agk.jl#L3-L4

Added lines #L3 - L4 were not covered by tests

o1 = weight_ordering([1,1,1,0,0], degrevlex(R))
o2 = weight_ordering([0,0,0,1,1], degrevlex(R))

Check warning on line 7 in experimental/GroebnerWalk/benchmark/agk.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/agk.jl#L6-L7

Added lines #L6 - L7 were not covered by tests

F = [

Check warning on line 9 in experimental/GroebnerWalk/benchmark/agk.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/agk.jl#L9

Added line #L9 was not covered by tests
u + u^2 - 2*v - 2*u^2*v + 2*u*v^2 - x,
-6*u + 2*v + v^2 - 5*v^3 + 2*u*v^2 - 4*u^2*v^2 - y,
-2 + 2*u^2 + 6*v - 3*u^2*v^2 - z
]

return ideal(F), o2, o1

Check warning on line 15 in experimental/GroebnerWalk/benchmark/agk.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/agk.jl#L15

Added line #L15 was not covered by tests
end

65 changes: 65 additions & 0 deletions experimental/GroebnerWalk/benchmark/benchmarks.jl
ooinaruhugh marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
using Oscar

include("cyclic.jl")
include("katsura.jl")
include("agk.jl")
include("tran3.3.jl")

function benchmark(

Check warning on line 8 in experimental/GroebnerWalk/benchmark/benchmarks.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/benchmarks.jl#L8

Added line #L8 was not covered by tests
io,
name::String,
I::Ideal,
target::MonomialOrdering,
start::MonomialOrdering
)
print(io, name, ","); flush(io)
t = @elapsed groebner_walk($I, $target, $start; algorithm=:standard)
print(io, t, ","); flush(io)
t = @elapsed groebner_walk($I, $target, $start; algorithm=:generic)
print(io, t, ","); flush(io)
t = @elapsed groebner_walk($I, $target, $start; algorithm=:perturbed)
print(io, t, ","); flush(io)
t = @elapsed groebner_basis($I; ordering=$target)
println(io, t); flush(io)

Check warning on line 23 in experimental/GroebnerWalk/benchmark/benchmarks.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/benchmarks.jl#L15-L23

Added lines #L15 - L23 were not covered by tests
end

function print_header(io)
print(io, "name,standard_walk,generic_walk,perturbed_walk,buchberger\n")

Check warning on line 27 in experimental/GroebnerWalk/benchmark/benchmarks.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/benchmarks.jl#L26-L27

Added lines #L26 - L27 were not covered by tests
end

p = 11863279
Fp = GF(p)
open("results.csv", "a") do io
R, (x, y) = QQ[:x, :y]
I = ideal([y^4 + x^3 - x^2 + x, x^4])
benchmark(io, "simple", I, lex(R), default_ordering(R))

Check warning on line 35 in experimental/GroebnerWalk/benchmark/benchmarks.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/benchmarks.jl#L33-L35

Added lines #L33 - L35 were not covered by tests

benchmark(io, "cyclic5-QQ", cyclic5(QQ)...)
benchmark(io, "cyclic5-Fp", cyclic5(Fp)...)

Check warning on line 38 in experimental/GroebnerWalk/benchmark/benchmarks.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/benchmarks.jl#L37-L38

Added lines #L37 - L38 were not covered by tests

benchmark(io, "cyclic6-QQ", cyclic6(QQ)...)
benchmark(io, "cyclic6-Fp", cyclic6(Fp)...)

Check warning on line 41 in experimental/GroebnerWalk/benchmark/benchmarks.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/benchmarks.jl#L40-L41

Added lines #L40 - L41 were not covered by tests

I = katsura(6)
R = base_ring(I)
benchmark(io, "katsura6-QQ", I, lex(R), default_ordering(R))

Check warning on line 45 in experimental/GroebnerWalk/benchmark/benchmarks.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/benchmarks.jl#L43-L45

Added lines #L43 - L45 were not covered by tests

Ip = map(gens(I)) do f
change_coefficient_ring(Fp, f)

Check warning on line 48 in experimental/GroebnerWalk/benchmark/benchmarks.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/benchmarks.jl#L47-L48

Added lines #L47 - L48 were not covered by tests
end |> ideal
Rp = base_ring(Ip)
benchmark(io, "katsura6-Fp", Ip, lex(Rp), default_ordering(Rp))

Check warning on line 51 in experimental/GroebnerWalk/benchmark/benchmarks.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/benchmarks.jl#L50-L51

Added lines #L50 - L51 were not covered by tests

benchmark(io, "cyclic7-QQ", cyclic7(QQ)...)
benchmark(io, "cyclic7-Fp", cyclic7(Fp)...)

Check warning on line 54 in experimental/GroebnerWalk/benchmark/benchmarks.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/benchmarks.jl#L53-L54

Added lines #L53 - L54 were not covered by tests

benchmark(io, "agk4-QQ", agk4(QQ)...)
benchmark(io, "agk4-Fp", agk4(Fp)...)

Check warning on line 57 in experimental/GroebnerWalk/benchmark/benchmarks.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/benchmarks.jl#L56-L57

Added lines #L56 - L57 were not covered by tests

benchmark(io, "tran3.3-QQ", tran33(QQ)...)
benchmark(io, "tran3.3-Fp", tran33(Fp)...)

Check warning on line 60 in experimental/GroebnerWalk/benchmark/benchmarks.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/benchmarks.jl#L59-L60

Added lines #L59 - L60 were not covered by tests

benchmark(io, "newellp1-QQ", Oscar.newell_patch_with_orderings(QQ)...)
benchmark(io, "newellp1-Fp", Oscar.newell_patch_with_orderings(Fp)...)

Check warning on line 63 in experimental/GroebnerWalk/benchmark/benchmarks.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/benchmarks.jl#L62-L63

Added lines #L62 - L63 were not covered by tests
end

79 changes: 79 additions & 0 deletions experimental/GroebnerWalk/benchmark/cyclic.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
using Oscar

function cyclic5(k::Field=QQ)
R, (a,b,c,d,x) = k[:a,:b,:c,:d,:x]
F = [

Check warning on line 5 in experimental/GroebnerWalk/benchmark/cyclic.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/cyclic.jl#L3-L5

Added lines #L3 - L5 were not covered by tests
a + b + c + d + x,
a*b + b*c + c*d + d*x + x*a,
a*b*c + b*c*d + c*d*x + d*x*a + x*a*b,
a*b*c*d + b*c*d*x + c*d*x*a + d*x*a*b + x*a*b*c,
a*b*c*d*x - 1
]

return ideal(F), lex(R), default_ordering(R)

Check warning on line 13 in experimental/GroebnerWalk/benchmark/cyclic.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/cyclic.jl#L13

Added line #L13 was not covered by tests
end

function cyclic6(k::Field=QQ)
R, (z0,z1,z2,z3,z4,z5) = k[:z0,:z1,:z2,:z3,:z4,:z5]
F = [

Check warning on line 18 in experimental/GroebnerWalk/benchmark/cyclic.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/cyclic.jl#L16-L18

Added lines #L16 - L18 were not covered by tests
z0 + z1 + z2 + z3 + z4 + z5,
z0*z1 + z1*z2 + z2*z3 + z3*z4 + z4*z5 + z5*z0,
z0*z1*z2 + z1*z2*z3 + z2*z3*z4 + z3*z4*z5 + z4*z5*z0 + z5*z0*z1,
z0*z1*z2*z3 + z1*z2*z3*z4 + z2*z3*z4*z5 + z3*z4*z5*z0 + z4*z5*z0*z1
+ z5*z0*z1*z2,
z0*z1*z2*z3*z4 + z1*z2*z3*z4*z5 + z2*z3*z4*z5*z0 + z3*z4*z5*z0*z1
+ z4*z5*z0*z1*z2 + z5*z0*z1*z2*z3,
z0*z1*z2*z3*z4*z5 - 1
]

return ideal(F), lex(R), default_ordering(R)

Check warning on line 29 in experimental/GroebnerWalk/benchmark/cyclic.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/cyclic.jl#L29

Added line #L29 was not covered by tests
end

function cyclic7(k::Field=QQ)
R, (z0, z1, z2, z3, z4, z5, z6) = QQ[:z0, :z1, :z2, :z3, :z4, :z5, :z6]
F = [

Check warning on line 34 in experimental/GroebnerWalk/benchmark/cyclic.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/cyclic.jl#L32-L34

Added lines #L32 - L34 were not covered by tests
z0 + z1 + z2 + z3 + z4 + z5 + z6,
z0 * z1 + z1 * z2 + z2 * z3 + z3 * z4 + z4 * z5 + z5 * z6 + z6 * z0,
z0 * z1 * z2 + z1 * z2 * z3 + z2 * z3 * z4 + z3 * z4 * z5 + z4 * z5 * z6 + z5 * z6 * z0 + z6 * z0 * z1,
z0 * z1 * z2 * z3 + z1 * z2 * z3 * z4 + z2 * z3 * z4 * z5 + z3 * z4 * z5 * z6 + z4 * z5 * z6 * z0
+ z5 * z6 * z0 * z1 + z6 * z0 * z1 * z2,
z0 * z1 * z2 * z3 * z4 + z1 * z2 * z3 * z4 * z5 + z2 * z3 * z4 * z5 * z6 + z3 * z4 * z5 * z6 * z0
+ z4 * z5 * z6 * z0 * z1 + z5 * z6 * z0 * z1 * z2 + z6 * z0 * z1 * z2 * z3,
z0 * z1 * z2 * z3 * z4 * z5 + z1 * z2 * z3 * z4 * z5 * z6 + z2 * z3 * z4 * z5 * z6 * z0 + z3 * z4 * z5 * z6 * z0 * z1
+ z4 * z5 * z6 * z0 * z1 * z2 + z5 * z6 * z0 * z1 * z2 * z3 + z6 * z0 * z1 * z2 * z3 * z4,
z0 * z1 * z2 * z3 * z4 * z5 * z6 - 1
]

return ideal(F), lex(R), default_ordering(R)

Check warning on line 47 in experimental/GroebnerWalk/benchmark/cyclic.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/cyclic.jl#L47

Added line #L47 was not covered by tests
end

function cyclic8(k::Field=QQ)
R, (z0, z1, z2, z3, z4, z5, z6, z7) = k[:z0, :z1, :z2, :z3, :z4, :z5, :z6, :z7]

Check warning on line 51 in experimental/GroebnerWalk/benchmark/cyclic.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/cyclic.jl#L50-L51

Added lines #L50 - L51 were not covered by tests

F = [

Check warning on line 53 in experimental/GroebnerWalk/benchmark/cyclic.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/cyclic.jl#L53

Added line #L53 was not covered by tests
z0 + z1 + z2 + z3 + z4 + z5 + z6 + z7,

z0*z1 + z1*z2 + z2*z3 + z3*z4 + z4*z5 + z5*z6 + z6*z7 + z7*z0,

z0*z1*z2 + z1*z2*z3 + z2*z3*z4 + z3*z4*z5 + z4*z5*z6 + z5*z6*z7
+ z6*z7*z0 + z7*z0*z1,

z0*z1*z2*z3 + z1*z2*z3*z4 + z2*z3*z4*z5 + z3*z4*z5*z6 + z4*z5*z6*z7
+ z5*z6*z7*z0 + z6*z7*z0*z1 + z7*z0*z1*z2,

z0*z1*z2*z3*z4 + z1*z2*z3*z4*z5 + z2*z3*z4*z5*z6 + z3*z4*z5*z6*z7
+ z4*z5*z6*z7*z0 + z5*z6*z7*z0*z1 + z6*z7*z0*z1*z2 + z7*z0*z1*z2*z3,

z0*z1*z2*z3*z4*z5 + z1*z2*z3*z4*z5*z6 + z2*z3*z4*z5*z6*z7 + z3*z4*z5*z6*z7*z0
+ z4*z5*z6*z7*z0*z1 + z5*z6*z7*z0*z1*z2 + z6*z7*z0*z1*z2*z3 + z7*z0*z1*z2*z3*z4,

z0*z1*z2*z3*z4*z5*z6 + z1*z2*z3*z4*z5*z6*z7 + z2*z3*z4*z5*z6*z7*z0
+ z3*z4*z5*z6*z7*z0*z1 + z4*z5*z6*z7*z0*z1*z2 + z5*z6*z7*z0*z1*z2*z3
+ z6*z7*z0*z1*z2*z3*z4 + z7*z0*z1*z2*z3*z4*z5,

z0*z1*z2*z3*z4*z5*z6*z7 - 1
]

return ideal(F), lex(R), default_ordering(R)

Check warning on line 77 in experimental/GroebnerWalk/benchmark/cyclic.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/cyclic.jl#L77

Added line #L77 was not covered by tests
end

10 changes: 10 additions & 0 deletions experimental/GroebnerWalk/benchmark/tran3.3.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Oscar

function tran33(k::Field)
R, (x,y,z) = k[:x,:y,:z]

Check warning on line 4 in experimental/GroebnerWalk/benchmark/tran3.3.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/tran3.3.jl#L3-L4

Added lines #L3 - L4 were not covered by tests

F = [16 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2]

Check warning on line 6 in experimental/GroebnerWalk/benchmark/tran3.3.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/tran3.3.jl#L6

Added line #L6 was not covered by tests

return ideal(F), lex(R), default_ordering(R)

Check warning on line 8 in experimental/GroebnerWalk/benchmark/tran3.3.jl

View check run for this annotation

Codecov / codecov/patch

experimental/GroebnerWalk/benchmark/tran3.3.jl#L8

Added line #L8 was not covered by tests
end

6 changes: 6 additions & 0 deletions experimental/GroebnerWalk/docs/doc.main
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
"Gröbner walk" => [
"introduction.md",
"special-ideals.md"
]
]
22 changes: 22 additions & 0 deletions experimental/GroebnerWalk/docs/src/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```@meta
CurrentModule = Oscar
```

# Usage

The Gröbner walk is an approach to reduce the computational complexity of Gröbner basis computations as proposed by [AGK97](@cite).
These incarnations of the Gröbner walk refer to a family of algorithms that perform a reverse local search on the cones of the Gröbner fan.
Then, a Gröbner basis is calculated for each encountered cone while reusing the generators obtained from the previous cone.

The implemented algorithms may be accessed using the following function.

```@docs
groebner_walk(
I::MPolyIdeal,
target::MonomialOrdering = lex(base_ring(I)),
start::MonomialOrdering = default_ordering(base_ring(I));
perturbation_degree = ngens(base_ring(I)),
algorithm::Symbol = :standard
)
```

16 changes: 16 additions & 0 deletions experimental/GroebnerWalk/docs/src/special-ideals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```@meta
CurrentModule = Oscar
```

# Special ideals used for benchmarking

We bundle a couple of special ideals useful for benchmarking of the Gröbner walk.

```@docs
newell_patch(k::Union{QQField, QQBarFieldElem}, n::Int=1)
newell_patch(k::Field, n::Int=1)
```

```@docs
newell_patch_with_orderings(k::Field, n::Int=1)
```
Loading
Loading