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

Adv/algebraic shifting #4260

Open
wants to merge 156 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
a915b16
init algebraic shifting
antonydellavecchia Dec 14, 2023
1071a38
copied from template
antonydellavecchia Dec 14, 2023
087ae2e
copied from template
antonydellavecchia Dec 14, 2023
be2a95a
concrete function
antonydellavecchia Dec 15, 2023
6e4b8c7
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia Dec 15, 2023
b794172
fix for creating simplicial cmplex from from graph incidence matrix
antonydellavecchia Dec 18, 2023
190d486
use sparse matrices
antonydellavecchia Dec 19, 2023
324eee8
computes correct result for octohedron
antonydellavecchia Dec 19, 2023
960fb0d
fixed function use
antonydellavecchia Dec 19, 2023
5c6a3ae
started on delta_sym
antonydellavecchia Dec 20, 2023
e3f3301
some progress on delta sym
antonydellavecchia Dec 21, 2023
40175f8
ext and sym shifting work, return algebras still neds work
antonydellavecchia Jan 8, 2024
ddd84b5
updtes to delta_sym
antonydellavecchia Jan 8, 2024
dccec99
added field for sym shift
antonydellavecchia Jan 10, 2024
295fcff
fixed apply on facets
antonydellavecchia Jan 10, 2024
27c72c0
delta_sym bug fixed
antonydellavecchia Jan 10, 2024
a4ec502
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia Jan 11, 2024
398d1f9
added fix for delta_sym with finite fields
antonydellavecchia Jan 16, 2024
3762f5a
Revert "added fix for delta_sym with finite fields"
antonydellavecchia Jan 17, 2024
33d59f3
name changes
antonydellavecchia Jan 24, 2024
f7be618
Merge branch 'master' into adv/algebraic-shifting
antonydellavecchia Feb 12, 2024
be99cbd
optional change_of_basis
antonydellavecchia Feb 13, 2024
163b843
fix regression
antonydellavecchia Feb 14, 2024
02c134f
added some comments
antonydellavecchia Feb 14, 2024
2676d27
Merge remote-tracking branch 'origin/adv/algebraic-shifting' into adv…
antonydellavecchia Feb 14, 2024
79bced6
cond fix
antonydellavecchia Feb 14, 2024
251ceaa
adds comments
antonydellavecchia Feb 20, 2024
0555133
starting tests
antonydellavecchia Feb 20, 2024
60a8433
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia Feb 20, 2024
f614998
oscar updates
antonydellavecchia Feb 20, 2024
0acf283
Merge remote-tracking branch 'origin/adv/algebraic-shifting' into adv…
antonydellavecchia Feb 20, 2024
619bf4f
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia Feb 21, 2024
e05fb2f
fixes change of basis matrix
antonydellavecchia Feb 22, 2024
3d57d24
fix for exterior shift
antonydellavecchia Feb 22, 2024
f4b6d44
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia Feb 22, 2024
56f50f1
update for n_vertices
antonydellavecchia Feb 22, 2024
6a70d42
needed for serialization of results
antonydellavecchia Feb 22, 2024
d503bc7
Merge remote-tracking branch 'origin/adv/algebraic-shifting' into adv…
antonydellavecchia Feb 29, 2024
3eaa0a9
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia Mar 1, 2024
07bcbd9
fixes loading polymake simplicial complex and other types
antonydellavecchia Mar 1, 2024
c351250
adds test case
antonydellavecchia Mar 1, 2024
41de5bc
removing unnecessary else
antonydellavecchia Mar 1, 2024
8fdc000
fix test
antonydellavecchia Mar 1, 2024
17aaf37
Merge branch 'adv/fix-load-polymake-regression' into adv/algebraic-sh…
antonydellavecchia Mar 1, 2024
c642360
allow change of basis to be generic + comment about sort
antonydellavecchia Mar 4, 2024
8adf1ea
adds some functions for simplicial complexes from polymake
antonydellavecchia Mar 4, 2024
712c461
Merge remote-tracking branch 'origin/adv/add-simplicial-complex-funct…
antonydellavecchia Mar 4, 2024
6f70071
get rid of monomial sort
antonydellavecchia Mar 5, 2024
538200e
Merge remote-tracking branch 'origin/adv/algebraic-shifting' into adv…
antonydellavecchia Mar 5, 2024
393962a
cleans up symmetric shift a bit
antonydellavecchia Mar 5, 2024
e740219
adds gb details to stanley reisner ideal
antonydellavecchia Mar 5, 2024
c3257b9
Merge branch 'adv/stanley-reisner-ideal-gens' into adv/algebraic-shif…
antonydellavecchia Mar 5, 2024
e46d1ef
symmetric shift working over finite characteristic
antonydellavecchia Mar 5, 2024
df8279e
set description on john solid files
antonydellavecchia Mar 6, 2024
bbb4e65
Revert "set description on john solid files"
antonydellavecchia Mar 6, 2024
4f56b91
updates for symmetric shift
antonydellavecchia Mar 6, 2024
d17cfab
adds functionality for automorphisms of simplicial complexes
antonydellavecchia Mar 7, 2024
29d9d02
adds docs + missing docs for the other recently added functions
antonydellavecchia Mar 7, 2024
2ac35f7
Merge branch 'adv/simplicial-complex-automorphisms' into adv/algebrai…
antonydellavecchia Mar 7, 2024
9c22f09
adjustments to the docs
antonydellavecchia Mar 7, 2024
c9f806b
Merge branch 'adv/simplicial-complex-automorphisms' into adv/algebrai…
antonydellavecchia Mar 7, 2024
592f7c0
adds n_facets + uses combinatorial symmetries from polymake
antonydellavecchia Mar 7, 2024
9bb2050
Merge branch 'adv/simplicial-complex-automorphisms' into adv/algebrai…
antonydellavecchia Mar 7, 2024
5acb531
acts on_simplicial_complex
antonydellavecchia Mar 7, 2024
b5f056a
Merge branch 'adv/simplicial-complex-automorphisms' into adv/algebrai…
antonydellavecchia Mar 7, 2024
e74d373
fixes for docstrings
antonydellavecchia Mar 11, 2024
fa7f6f4
warning
antonydellavecchia Mar 13, 2024
a3615ed
Merge remote-tracking branch 'origin/adv/algebraic-shifting' into adv…
antonydellavecchia Mar 19, 2024
dda15a7
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia Mar 19, 2024
ca8ce7d
Merge branch 'adv/simplicial-complex-automorphisms' into adv/algebrai…
antonydellavecchia Mar 19, 2024
f49653f
fixes require check
antonydellavecchia Mar 19, 2024
c5b0452
Merge remote-tracking branch 'origin/adv/simplicial-complex-automorph…
antonydellavecchia Mar 19, 2024
6b9f758
Merge remote-tracking branch 'origin/adv/algebraic-shifting' into adv…
antonydellavecchia Apr 5, 2024
b8a634e
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia Apr 11, 2024
613cce7
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia Apr 16, 2024
c181c48
Merge remote-tracking branch 'origin/adv/algebraic-shifting' into adv…
antonydellavecchia May 6, 2024
1addc98
add missing vertices
antonydellavecchia May 6, 2024
3ad606c
Merge remote-tracking branch 'origin/adv/algebraic-shifting' into adv…
antonydellavecchia May 6, 2024
412c5d7
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia May 22, 2024
8d47534
Merge branch 'master' into adv/algebraic-shifting
antonydellavecchia May 22, 2024
a7e9da7
Merge remote-tracking branch 'origin/adv/aut-simplicial-complex' into…
antonydellavecchia May 27, 2024
a0c97fe
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia May 29, 2024
201f470
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia May 29, 2024
a82180c
simplicial product
antonydellavecchia Aug 5, 2024
d61a096
added link_subcomplex
antonydellavecchia Aug 9, 2024
cf34850
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia Aug 13, 2024
14b61a1
reduce over quotients
antonydellavecchia Aug 20, 2024
d28bfb6
barycentric sub div
antonydellavecchia Aug 26, 2024
58e6cfe
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia Aug 27, 2024
33e463b
json -> JSON3.write
antonydellavecchia Aug 29, 2024
2c9a717
Update src/Serialization/main.jl
benlorenz Aug 29, 2024
a1a5a8a
fixes upgrade scripts
antonydellavecchia Aug 30, 2024
caa5530
Update src/Serialization/main.jl
antonydellavecchia Aug 30, 2024
c8b9570
use io instead of string
antonydellavecchia Sep 9, 2024
96fcaf0
typo
antonydellavecchia Sep 9, 2024
f6dbf42
Merge remote-tracking branch 'origin/master' into adv/load-polymake-b…
antonydellavecchia Sep 9, 2024
13b1e26
fix arguments to deserializer_open
antonydellavecchia Sep 9, 2024
973d9e8
remove white space
antonydellavecchia Sep 10, 2024
1089ccb
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia Sep 10, 2024
307ad1b
Merge remote-tracking branch 'origin/adv/load-polymake-bugfix' into a…
antonydellavecchia Sep 10, 2024
00e1ffb
no need for key when serializing weyl group
antonydellavecchia Sep 10, 2024
00cb3fc
root system uses ref
antonydellavecchia Sep 10, 2024
db194db
Merge branch 'adv/weyl-group-serialize' into adv/algebraic-shifting
antonydellavecchia Sep 10, 2024
944ac0c
unifiying the exterior shift function
antonydellavecchia Oct 10, 2024
c6fccd5
things are starting to work
antonydellavecchia Oct 14, 2024
50be74b
partial shift graph
antonydellavecchia Oct 22, 2024
fd089a7
tests passing
antonydellavecchia Oct 23, 2024
ca861b0
still need partial graph vertices to work properly
antonydellavecchia Oct 23, 2024
a5a434b
tests passing and correct for partial shift graph
antonydellavecchia Oct 24, 2024
eda808f
comparing speed with old code
antonydellavecchia Oct 24, 2024
f50ecc7
still trying to not count things twice
antonydellavecchia Oct 24, 2024
07187d7
started docs
antonydellavecchia Oct 25, 2024
9373abe
more docs
antonydellavecchia Oct 25, 2024
deb41d7
working as it should now
antonydellavecchia Oct 29, 2024
8b226a6
progress on docs
antonydellavecchia Oct 29, 2024
6a625a2
Merge remote-tracking branch 'origin/master' into adv/algebraic-shift…
antonydellavecchia Oct 29, 2024
901dc91
adds is_shifted
antonydellavecchia Oct 29, 2024
dbf2651
docs almost done
antonydellavecchia Oct 29, 2024
043f979
added progress meter + finished docs
antonydellavecchia Oct 30, 2024
7675df2
algebraic shifting: doc additions/fixes
micjoswig Oct 30, 2024
c63d5ea
Update docs/oscar_references.bib
antonydellavecchia Oct 31, 2024
405a195
bibtool formatting
antonydellavecchia Oct 31, 2024
1f9a2c5
Merge remote-tracking branch 'origin/adv/algebraic-shifting' into adv…
antonydellavecchia Oct 31, 2024
b8e8a00
removed tabs
antonydellavecchia Oct 31, 2024
dc6cbcb
added some docs to simplicial complex functions
antonydellavecchia Oct 31, 2024
4968376
Update experimental/LieAlgebras/src/serialization.jl
antonydellavecchia Oct 31, 2024
4ef8766
Apply suggestions from code review
antonydellavecchia Oct 31, 2024
bf7f71c
create isomorphisms between weyl group and perm group
antonydellavecchia Oct 31, 2024
a4f0127
missing line from docs
antonydellavecchia Oct 31, 2024
1afd25b
Merge remote-tracking branch 'origin/adv/algebraic-shifting' into adv…
antonydellavecchia Oct 31, 2024
e552dfb
fixes to bib refs
antonydellavecchia Oct 31, 2024
0087948
removes the use of perm for weyl group elements
antonydellavecchia Oct 31, 2024
4edfdee
fixed to docs
antonydellavecchia Oct 31, 2024
37d40a2
speed up from using transpose
antonydellavecchia Oct 31, 2024
7553c5a
using transpose isn't quite right
antonydellavecchia Oct 31, 2024
70fc86a
creates isomorphism only once when finding vertices + constructing graph
antonydellavecchia Oct 31, 2024
6207e4b
fixes some regressions
antonydellavecchia Oct 31, 2024
b3610b7
fix for empty grpah
antonydellavecchia Nov 1, 2024
687c369
suppres progress bar in doc strings
antonydellavecchia Nov 1, 2024
0b138c3
Merge branch 'master' into adv/algebraic-shifting
antonydellavecchia Nov 1, 2024
6a0dc54
fixes for merge
antonydellavecchia Nov 1, 2024
4ebc610
Merge branch 'master' into adv/algebraic-shifting
antonydellavecchia Nov 1, 2024
f8a4532
remove permutation matrix function
antonydellavecchia Nov 1, 2024
39f66a3
suppress progress bar in docs
antonydellavecchia Nov 4, 2024
c2f1c3e
fix _set_to_zero
antonydellavecchia Nov 4, 2024
79a12f1
fixes white space
antonydellavecchia Nov 4, 2024
7f5444a
fixes for parallel and oscar tests
antonydellavecchia Nov 4, 2024
d687d4e
docs for kwargs
antonydellavecchia Nov 4, 2024
2005a79
typo
antonydellavecchia Nov 4, 2024
87bfbd7
shifting docs: ref to arXiv:2410.24044 added
micjoswig Nov 26, 2024
61f14d7
Merge remote-tracking branch 'origin/master' into adv/algebraic-shifting
antonydellavecchia Nov 26, 2024
a0feef6
bibtool on references
antonydellavecchia Nov 26, 2024
4d81445
Apply suggestions from code review
antonydellavecchia Nov 27, 2024
3dee71b
fixes for doctests
antonydellavecchia Nov 27, 2024
49e9bbb
Merge remote-tracking branch 'origin/adv/algebraic-shifting' into adv…
antonydellavecchia Nov 27, 2024
052b305
fix doctest
antonydellavecchia Nov 27, 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
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Polymake = "d720cf60-89b5-51f5-aff5-213f193123e7"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Copy link
Member

Choose a reason for hiding this comment

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

Why is this dependency added? I see no code using it?

Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RandomExtensions = "fb686558-2515-59ef-acaa-46db3789a887"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Expand All @@ -37,6 +38,7 @@ Markdown = "1.6"
Nemo = "0.47.1"
Pkg = "1.6"
Polymake = "0.11.20"
ProgressMeter = "1.10.2"
Random = "1.6"
RandomExtensions = "0.4.3"
Serialization = "1.6"
Expand Down
26 changes: 26 additions & 0 deletions docs/oscar_references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,14 @@ @Book{Cut04
doi = {10.1090/gsm/063}
}

@Article{D-VJL24,
author = {Della Vecchia, Antony and Joswig, Michael and Lenzen, Fabian},
title = {Partial Algebraic Shifting},
year = {2024},
eprint = {2410.24044},
archiveprefix = {arXiv}
}

@InCollection{DE02,
author = {Decker, Wolfram and Eisenbud, David},
title = {Sheaf algorithms using the exterior algebra},
Expand Down Expand Up @@ -1722,6 +1730,24 @@ @Article{Kah10
doi = {10.1007/s10463-010-0290-9}
}

@InProceedings{Kal02,
author = {Kalai, Gil},
title = {Algebraic shifting},
editor = {Hibi, Takayuki},
booktitle = {Computational commutative algebra and combinatorics},
series = {Advanced Studies in Pure Mathematics},
number = {33},
publisher = {Mathematical Society of Japan},
pages = {121--163},
year = {2002},
doi = {10.2969/aspm/03310121},
venue = {Osaka},
eventdate = {1999},
shortseries = {Adv. Stud. Pure Math.},
shortpublisher= {Math. Soc. Japan},
location = {Tokyo}
}

@Article{Kem02,
author = {Kemper, Gregor},
title = {The calculation of radical ideals in positive characteristic},
Expand Down
10 changes: 10 additions & 0 deletions experimental/AlgebraicShifting/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Algebraic Shifting

## Aims

This package grew out of an ongoing project of Antony Della Vecchia, Michael Joswig and Fabian Lenzen on [Partial Algebraic Shifting](https://arxiv.org/abs/2410.24044).
Part of this project is the development of new methods for algebraic shifting; these are implemented here.

## Status

Full and partial shifting in the exterior algebra fully functional.
8 changes: 8 additions & 0 deletions experimental/AlgebraicShifting/docs/doc.main
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
"Algebraic Shifting" => [
"introduction.md",
"exterior_shifting.md",
"partial_shift_graph.md"
]
]

24 changes: 24 additions & 0 deletions experimental/AlgebraicShifting/docs/src/exterior_shifting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
```@meta
CurrentModule = Oscar
DocTestSetup = Oscar.doctestsetup()
```

# Exterior Shifting

## Uniform Hypergraphs
```@docs
uniform_hypergraph
```

## Matrix Constructions

```@docs
generic_unipotent_matrix
rothe_matrix
compound_matrix
```

## Exterior (Partial) Shifting
```@docs
exterior_shift
```
29 changes: 29 additions & 0 deletions experimental/AlgebraicShifting/docs/src/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
```@meta
CurrentModule = Oscar
DocTestSetup = Oscar.doctestsetup()
```


# Introduction

Algebraic shifting is a widely applicable method for converting a uniform hypergraph $S$ into another hypergraph, $\Delta(S)$, which is somehow simpler but still retains key properties of $S$.
Often this is applied to simplicial complexes, where each layer of $(k-1)$-faces forms a $k$-uniform hypergraph.

Here we focus on full and partial algebraic shifting in the exterior algebra.
For general background on the subject we refer to [Kal02](@cite); for details concerning the implementation see [D-VJL24](@cite).


## Status

This part of OSCAR is in an experimental state; please see [Adding new projects to experimental](@ref) for what this means.

## Contact

Please direct questions about this part of OSCAR to the following people:
* [Antony Della Vecchia](https://antonydellavecchia.github.io)
* [Michael Joswig](https://page.math.tu-berlin.de/~joswig/)


You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack).

Alternatively, you can [raise an issue on github](https://www.oscar-system.org/community/#how-to-report-issues).
12 changes: 12 additions & 0 deletions experimental/AlgebraicShifting/docs/src/partial_shift_graph.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```@meta
CurrentModule = Oscar
DocTestSetup = Oscar.doctestsetup()
```

# Partial Shift Graph

```@docs
partial_shift_graph_vertices
partial_shift_graph
contracted_partial_shift_graph
```
119 changes: 119 additions & 0 deletions experimental/AlgebraicShifting/src/AlgebraicShifting.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
include("UniformHypergraph.jl")
include("PartialShift.jl")
include("PartialShiftGraph.jl")

export UniformHypergraph

export compound_matrix
export contracted_partial_shift_graph
export exterior_shift
export face_size
export generic_unipotent_matrix
export partial_shift_graph
export partial_shift_graph_vertices
export rothe_matrix
export uniform_hypergraph

function independent_columns(A::MatElem)
col_indices = Int[]
row_index = 1
row_bound = nrows(A)
for col_index in 1:ncols(A)
if !is_zero(A[row_index, col_index])
push!(col_indices, col_index)
row_index += 1
end
row_index > row_bound && break
end
return col_indices
end


"""
symmetric_shift(F::Field, K::SimplicialComplex)

Returns the symmetric shift of `K`

see survey on algebraic shifting Gil Kalai (properly cite at some point)
Copy link
Member

Choose a reason for hiding this comment

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

Resolve this TODO? But also OK to defer it to a follow-up PR, but then I'd recommend to at least make it easily grepable, e.g.

Suggested change
see survey on algebraic shifting Gil Kalai (properly cite at some point)
See survey on algebraic shifting Gil Kalai (TODO: properly cite at some point)

"""
function symmetric_shift(F::Field, K::SimplicialComplex;

Check warning on line 39 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L39

Added line #L39 was not covered by tests
Copy link
Member

Choose a reason for hiding this comment

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

This function has zero tests right now. Perhaps add a jldoctest with a simple example?

change_of_basis::T = nothing) where T <: Union{Nothing, MatElem}

n = n_vertices(K)
is_generic = false
if isnothing(change_of_basis)
is_generic = true

Check warning on line 45 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L42-L45

Added lines #L42 - L45 were not covered by tests
# generic change of basis
Fy, y = polynomial_ring(F, :y => (1:n, 1:n))
Copy link
Member

Choose a reason for hiding this comment

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

Rings created internally should have caching disabled. Please also in all the other places (user facing examples e.g. in docstrings don't need it)

Suggested change
Fy, y = polynomial_ring(F, :y => (1:n, 1:n))
Fy, y = polynomial_ring(F, :y => (1:n, 1:n); cached=false)

change_of_basis = matrix(Fy, hcat(y))
matrix_base = Fy

Check warning on line 49 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L47-L49

Added lines #L47 - L49 were not covered by tests
else
matrix_base = base_ring(change_of_basis)
if matrix_base isa MPolyRing
is_generic = true

Check warning on line 53 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L51-L53

Added lines #L51 - L53 were not covered by tests
end
end

Rx, x = polynomial_ring(matrix_base, n)

Check warning on line 57 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L57

Added line #L57 was not covered by tests
# the generators of the stanley reisner ideal are combinations of [x_1, ..., x_n]
R_K, _ = stanley_reisner_ring(Rx, K)

Check warning on line 59 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L59

Added line #L59 was not covered by tests

# the computation is a over the field of fractions Fyx
# we use a different ring to generate monomial_basis, coefficients need to be a field,
# but we want to avoid using fraction field of Ry during row reduction
mb_ring, z = graded_polynomial_ring(F, n)

Check warning on line 64 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L64

Added line #L64 was not covered by tests


input_faces = apply_on_faces(K) do (dim_face, faces)
r = dim_face + 1

Check warning on line 68 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L67-L68

Added lines #L67 - L68 were not covered by tests

mb = reverse(monomial_basis(mb_ring, r))
A = Vector{elem_type(matrix_base)}[]
mb_exponents = first.(collect.(exponents.(mb))) # gets monomial exponents

Check warning on line 72 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L70-L72

Added lines #L70 - L72 were not covered by tests

for b in mb

Check warning on line 74 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L74

Added line #L74 was not covered by tests
# need to compare with some alternatives
transformed_monomial = evaluate(b, change_of_basis * gens(R_K))

Check warning on line 76 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L76

Added line #L76 was not covered by tests

# we need to iterate through exponents here since the functions terms, coefficients or exponents
# do not return 0 terms and we need to make sure the generic col aligns with the others
# this is needed for the case when the field has finite characteristic
# we use the lift because currently there is no function for get the coeff of
# a MPolyQuoRingElem, which means we also need to check if it's zero before adding the coefficient
col = [

Check warning on line 83 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L83

Added line #L83 was not covered by tests
!is_zero(R_K(monomial(Rx, e))) ? coeff(lift(transformed_monomial), e) : matrix_base(0)
for e in mb_exponents]

push!(A, col)
end

Check warning on line 88 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L87-L88

Added lines #L87 - L88 were not covered by tests

C = matrix(matrix_base, reduce(hcat, A))

Check warning on line 90 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L90

Added line #L90 was not covered by tests

if is_generic
Oscar.ModStdQt.ref_ff_rc!(C)

Check warning on line 93 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L92-L93

Added lines #L92 - L93 were not covered by tests
else
rref!(C)

Check warning on line 95 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L95

Added line #L95 was not covered by tests
end

smallest_basis_el = z[r]^r
smallest_index = findfirst(a -> a == smallest_basis_el, mb)
col_indices = filter(x -> x >= smallest_index, independent_columns(C))
monomial_exponents = first.(exponents.(mb[col_indices]))

Check warning on line 101 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L98-L101

Added lines #L98 - L101 were not covered by tests

shifted_sets = Vector{Int}[]
for me in monomial_exponents
shifted_set = Int[]
index_count = 1
for (i, e) in enumerate(me)
for j in 1:e
push!(shifted_set, i - (r - index_count))
index_count += 1
end
end
push!(shifted_sets, shifted_set)
end
return shifted_sets

Check warning on line 115 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L103-L115

Added lines #L103 - L115 were not covered by tests
end

return simplicial_complex(input_faces)

Check warning on line 118 in experimental/AlgebraicShifting/src/AlgebraicShifting.jl

View check run for this annotation

Codecov / codecov/patch

experimental/AlgebraicShifting/src/AlgebraicShifting.jl#L118

Added line #L118 was not covered by tests
end
Loading
Loading