-
Notifications
You must be signed in to change notification settings - Fork 176
Add experimental support for wreath Macdonald polynomials #4797
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
5af3bb8
rough push of the wreath macs
Rhylx 1dc6d77
moved to experimental
Rhylx 979622e
swap of README's
Rhylx 99b12f3
added types and renamed file
Rhylx bf45de1
compiles and runs
Rhylx dfaf004
improvements
Rhylx a4375bb
Merge remote-tracking branch 'upstream/master'
Rhylx 294fa49
removed Chevie dependency
Rhylx 37242b4
syntax and tests
Rhylx c83c8d8
test restructed
Rhylx 77c6751
added doc
2c091c2
changed name, and parent externalized
2a7b6a5
Merge branch 'master' into master
lgoettgens e49d78a
better parent handling
5bdb268
Merge branch 'master' of ssh://github.com/RaphaelPaegelow/Oscar.jl
61e8185
Apply suggestions from code review
lgoettgens d273c56
Merge branch 'master' into master
lgoettgens 54af942
implemented remarks
27928ff
merging conflict resolved
c50d359
Apply suggestions from code review
fingolfin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Wreath Macdonald polynomials | ||
|
|
||
| The main purpose of this code is to compute the wreath Macdonald polynomials in the Schur basis. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| [ | ||
| "Wreath Macdonald polynomials" => [ | ||
| "introduction.md", | ||
| ] | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| ```@meta | ||
| CurrentModule = Oscar | ||
| CollapsedDocStrings = true | ||
| DocTestSetup = Oscar.doctestsetup() | ||
| ``` | ||
|
|
||
| # Wreath Macdonald polynomials | ||
|
|
||
| The existence, integrality and positivity of wreath Macdonald polynomials | ||
| has been conjectured by Haiman [Hai02](@cite) and proved by Bezrukavnikov | ||
| and Finkelberg [BF14](@cite). When ``r=1``, wreath Macdonald polynomials are | ||
| equal to the Haiman-Macdonald polynomials, used to prove the Macdonald positivity conjecture. | ||
|
|
||
| Here we have implemented an algorithm computing the wreath Macdonald | ||
| polynomials as defined in the survey by Orr and Shimozono on this topic [OS23](@cite). | ||
|
|
||
| Wreath Macdonald polynomials depend on two parameters. The first parameter is | ||
| an ``r``-multipartition of ``n``. The second parameter is an element of the affine Weyl group | ||
| of type ``A^{(1)}_{r-1}`` which is isomorphic to the semi-direct product of the finite Weyl group | ||
| of type ``A_{r-1}`` (the symmetric group on ``r`` letters) and of the coroot lattice of type ``A_{r-1}``. | ||
| The element of the coroot lattice is given in the canonical basis. It is then the sublattice | ||
| of ``\mathbb{Z}^r`` of elements summing up to zero. | ||
|
|
||
| ```@docs | ||
| wreath_macdonald_polynomial | ||
| wreath_macdonald_polynomials | ||
| ``` | ||
|
|
||
| Compare the following computation with Example 3.15 in [OS23](@cite). | ||
|
|
||
| ```jldoctest | ||
| julia> collect(multipartitions(1,3)) | ||
| 3-element Vector{Multipartition{Int64}}: | ||
| Partition{Int64}[[], [], [1]] | ||
| Partition{Int64}[[], [1], []] | ||
| Partition{Int64}[[1], [], []] | ||
|
|
||
| julia> wreath_macdonald_polynomials(1,3,cperm(1:3),[0,1,-1])[[3, 2, 1],[3, 2, 1]] | ||
| [1 q^2 q] | ||
| [1 t q] | ||
| [1 t t^2] | ||
| ``` |
255 changes: 255 additions & 0 deletions
255
experimental/WreathMacdonaldpols/src/WreathMacdonaldpols.jl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,255 @@ | ||
| # I would like to credit Dario Mathiä who produced an initial version of the following code | ||
|
|
||
| export wreath_macdonald_polynomials, wreath_macdonald_polynomial | ||
|
|
||
| # Tools | ||
|
|
||
| # Computes the b-invariant | ||
| function b1(lambda::Vector{Int}) | ||
| return sum((i-1)*l_i for (i, l_i) in enumerate(lambda); init=0) | ||
| end | ||
|
|
||
| # Computes the b-invariant of a multipartition | ||
| function b_inv(lbb::Multipartition) | ||
| return b1(map(sum,lbb)) + length(lbb)*sum(lambda -> b1(data(lambda)),lbb) | ||
| end | ||
|
|
||
| function beta_number_to_partition(beta::Vector{Int}) | ||
| lb=Int[] | ||
| for j in 1:length(beta) | ||
| nbholes=beta[j]-beta[1]-(j-1) | ||
| if nbholes >= 1 | ||
| pushfirst!(lb, nbholes) | ||
| end | ||
| end | ||
| return partition(lb) | ||
| end | ||
|
|
||
| # Computes the core associated to the coroot | ||
| #The charge of the core is equal to the coroot | ||
| #in the canonical basis (e_i) of Z^I. | ||
| function core(coroot::Vector{Int},r::Int) | ||
| beta=Int[] | ||
| m=minimum(coroot) | ||
| M=maximum(coroot) | ||
| beta=[k*r+(j-1) for k in m:M for j in 1:r if k <= coroot[j]] | ||
| return beta_number_to_partition(beta) | ||
| end | ||
|
|
||
| #Inspired by Sagemath's algorithm to obtain a partition from core and quotient | ||
| #Be careful: it is not the usual quotient but the one defined in [Gordon 2008] | ||
| function tau_om(lbb::Multipartition, wperm::PermGroupElem, coroot::Vector{Int}) | ||
| r=length(lbb) | ||
| w0=perm([r-i for i in 0:(r-1)]) #cf Remark 3.5 Orr and Shimozono | ||
| lbb_perm=multipartition(permuted(lbb.mp,wperm*w0)) | ||
| gamma=core(coroot,r) | ||
| lg=length(gamma) | ||
| k=r*maximum(length(lbb_perm[i]) for i in 1:r) + lg | ||
| v=[[gamma[i]-(i-1) for i in 1:lg]; [-i for i in lg:(k-1)]] | ||
| w=[[x for x in v if mod((x-i),r) == 0] for i in 1:r] | ||
| new_w=Int[] | ||
| for i in 1:r | ||
| lw=length(w[i]) | ||
| lq=length(lbb_perm[i]) | ||
| append!(new_w, w[i][1:lq] + r*lbb_perm[i]) | ||
| append!(new_w, w[i][lq+1:lw]) | ||
| end | ||
| sort!(new_w,rev=true) | ||
| new_w=[new_w[i]+(i-1) for i in 1:length(new_w)] | ||
| filter!(x-> x!=0,new_w) | ||
| return partition(new_w) | ||
| end | ||
|
|
||
| #Reoders the CharTable | ||
| function reorder(charTirr::Matrix, Modules::Vector{Multipartition{Int}}, mps::Vector{Multipartition{Int}}) | ||
| new_ord=indexin(mps,Modules) | ||
| return charTirr[new_ord,:] | ||
| end | ||
|
|
||
| #Tools from representation theory | ||
|
|
||
| # Computes the fake degree of a multipartition cf. Ste89 Thm 5.3 and Prop. 3.3.2 Haiman cdm | ||
| function fake_deg(lbb::Multipartition, Q::FracField{T}, var::T) where {T <: MPolyRingElem} | ||
| r=length(lbb) | ||
| n=sum(lbb) | ||
| res=Q(1) | ||
| for p in 1:n | ||
| res=res*(1-var^(r*p)) | ||
| end | ||
| for lambda in lbb | ||
| for i in 1:length(lambda) | ||
| for j in 1:lambda[i] | ||
| hookfactor=(Q(1)-var^(r*(1+lambda[i]+count(>=(j),lambda)-j-i))) | ||
| res=res//hookfactor | ||
| end | ||
| end | ||
| end | ||
| res=res*var^b_inv(lbb) | ||
| return res | ||
| end | ||
|
|
||
| # computes C_Delta defined in PhD relation (1.45) | ||
| function C_Delta(r::Int, n::Int, Q::FracField{T}, var::T, mps::Vector{Multipartition{Int}}) where {T <: MPolyRingElem} | ||
| charTable=character_table_complex_reflection_group(r,1,n) | ||
| charTirr=[charTable[i,j] for i in 1:nrows(charTable), j in 1:ncols(charTable)] | ||
| Modules=[multipartition([lbb...]) for lbb in class_parameters(charTable)] | ||
| l=length(Modules) | ||
| charTirr=reorder(charTirr,Modules,mps) | ||
| charTirrT=solve_init(matrix(Q,transpose(charTirr))) | ||
| rows=zero_matrix(Q,l,0) | ||
| for i in 1:l | ||
| col=zero_matrix(Q,l,1) | ||
| for j in 1:l | ||
| v=matrix(Q,l,1,map(k->charTirr[i,k]*charTirr[j,k],1:l)) | ||
| x=solve(charTirrT,v,side=:right) | ||
| col=col+fake_deg(mps[j],Q,var)*x | ||
| end | ||
| rows=hcat(rows,col) | ||
| end | ||
| return rows | ||
| end | ||
|
|
||
| # computes the character of the simple representations of the Cherednik algebra. | ||
| function C_L(r::Int, n::Int, Q::FracField{T}, var::T, mps::Vector{Multipartition{Int}}) where {T <: MPolyRingElem} | ||
| C_D=C_Delta(r,n,Q,var,mps) | ||
| d = [var^b_inv(mp)//fake_deg(mp,Q,var) for mp in mps] | ||
| diag=diagonal_matrix(Q,d) | ||
| return diag * C_D | ||
| end | ||
|
|
||
| function bigger_ord(lbb::Multipartition, wperm::PermGroupElem, coroot::Vector{Int}, mps::Vector{Multipartition{Int}}) | ||
| r=length(lbb) | ||
| n=sum(lbb) | ||
| lbbquot=tau_om(lbb,wperm,coroot) | ||
| res=map(x->x,Iterators.filter(x-> dominates(tau_om(x,wperm,coroot),lbbquot),mps)) | ||
| return res | ||
| end | ||
|
|
||
| function smaller_ord(lbb::Multipartition, wperm::PermGroupElem, coroot::Vector{Int}, mps::Vector{Multipartition{Int}}) | ||
| r=length(lbb) | ||
| n=sum(lbb) | ||
| lbbquot=tau_om(lbb,wperm,coroot) | ||
| res=map(x->x,Iterators.filter(x-> dominates(lbbquot,tau_om(x,wperm,coroot)),mps)) | ||
| return res | ||
| end | ||
|
|
||
| @doc raw""" | ||
| wreath_macdonald_polynomials(n::Int, | ||
| r::Int, | ||
| wperm::PermGroupElem, | ||
| coroot::Vector{Int}; | ||
| parent::MPolyRing{<:QQAbFieldElem}= | ||
| polynomial_ring(abelian_closure(QQ)[1], [:q,:t];cached=true)[1]) | ||
|
|
||
| Given two integers `n` and `r` and an element of the affine Weyl group of type ``A^{(1)}_{r-1}`` | ||
| (seen as the semi-direct product of the symmetric group on `r` letters with the coroot lattice | ||
| of the finite type ``A_{r-1}``), this function returns the square matrix of coefficients of the wreath | ||
| Macdonald polynomials associated with all multipartitions of size `n` and length `r` in the standard | ||
| Schur basis of multisymmetric functions. Each row of this matrix is a wreath Macdonald polynomial. | ||
| Here is an example of how to use it: | ||
|
|
||
| ```jldoctest | ||
| julia> wreath_macdonald_polynomials(1,3,cperm(1:3),[0,1,-1]) | ||
| [t^2 t 1] | ||
| [ q t 1] | ||
| [ q q^2 1] | ||
| ``` | ||
| """ | ||
| function wreath_macdonald_polynomials(n::Int, | ||
| r::Int, | ||
| wperm::PermGroupElem, | ||
| coroot::Vector{Int}; | ||
| parent::MPolyRing{<:QQAbFieldElem}= | ||
| polynomial_ring(abelian_closure(QQ)[1], [:q,:t];cached=true)[1]) | ||
|
|
||
| Q = fraction_field(parent) | ||
| q,t = gens(parent) | ||
|
|
||
| mps=collect(multipartitions(n,r)) | ||
| l=length(mps) | ||
|
|
||
| c_L=C_L(r,n,Q,t,mps) | ||
| c_L_q=map_entries(f->numerator(f)(0,q)//denominator(f)(0,q),c_L) | ||
| c_L_tinv=map_entries(f->numerator(f)(0,1//t)//denominator(f)(0,1//t),c_L) | ||
|
|
||
| rows=[] | ||
| for lbb in mps | ||
| smallers=smaller_ord(lbb, wperm, coroot,mps) #tinv | ||
| biggers=bigger_ord(lbb, wperm, coroot,mps) #q | ||
| smaller_indices=sort!(indexin(smallers,mps)) | ||
| bigger_indices=sort!(indexin(biggers,mps)) | ||
| sub_smaller_tinv=vcat(map(i->c_L_tinv[i:i,:],smaller_indices)...) | ||
| sub_bigger_q=vcat(map(i->c_L_q[i:i,:],bigger_indices)...) | ||
| M=vcat(sub_smaller_tinv,sub_bigger_q) | ||
| B=kernel(M, side=:left) | ||
| rows=vcat(rows,B[1,1:length(smaller_indices)]*sub_smaller_tinv) | ||
| end | ||
| c_L_qt = matrix(Q,l,l,rows) | ||
|
|
||
| triv=[partition([n])] | ||
| for i in 2:r | ||
| push!(triv,partition([])) | ||
| end | ||
| triv=multipartition(triv) | ||
| index_triv=findfirst(x-> x==triv,mps) | ||
| d=[1//c_L_qt[i,index_triv] for i in 1:l] | ||
| diag=diagonal_matrix(Q,d) | ||
| c_L_qt_H=diag*c_L_qt | ||
| return c_L_qt_H | ||
| end | ||
|
|
||
| @doc raw""" | ||
| wreath_macdonald_polynomial(lbb::Multipartition, | ||
| wperm::PermGroupElem, | ||
| coroot::Vector{Int}; | ||
| parent::MPolyRing{<:QQAbFieldElem}= | ||
| polynomial_ring(abelian_closure(QQ)[1], [:q,:t];cached=true)[1]) | ||
|
|
||
| Given a multipartition `lbb` of size ``n`` and length ``r`` and an element of the affine Weyl group of type ``A^{(1)}_{r-1}`` | ||
| (seen as the semi-direct product of the symmetric group on ``r`` letters with the coroot lattice | ||
| of the finite type ``A_{r-1}``), this function returns the coefficients of the wreath Macdonald polynomial | ||
| associated with `lbb` and the affine Weyl group element in the standard Schur basis of multisymmetric functions. Here is an example of how to use it: | ||
|
|
||
| ```jldoctest | ||
| julia> wreath_macdonald_polynomial(multipartition([[1],[],[]]),cperm(1:3),[0,1,-1]) | ||
| [q q^2 1] | ||
| ``` | ||
| """ | ||
| function wreath_macdonald_polynomial(lbb::Multipartition, | ||
| wperm::PermGroupElem, | ||
| coroot::Vector{Int}; | ||
| parent::MPolyRing{<:QQAbFieldElem}= | ||
| polynomial_ring(abelian_closure(QQ)[1], [:q,:t];cached=true)[1]) | ||
|
|
||
| Q = fraction_field(parent) | ||
| q,t = gens(parent) | ||
|
|
||
| r=length(lbb) | ||
| n=sum(lbb) | ||
| mps=collect(multipartitions(n,r)) | ||
| l=length(mps) | ||
|
|
||
| c_L=C_L(r,n,Q,t,mps) | ||
| c_L_q=map_entries(f->numerator(f)(0,q)//denominator(f)(0,q),c_L) | ||
| c_L_tinv=map_entries(f->numerator(f)(0,1//t)//denominator(f)(0,1//t),c_L) | ||
|
|
||
| smallers=smaller_ord(lbb, wperm, coroot,mps) #tinv | ||
| biggers=bigger_ord(lbb, wperm, coroot,mps) #q | ||
| smaller_indices=sort!(indexin(smallers,mps)) | ||
| bigger_indices=sort!(indexin(biggers,mps)) | ||
| sub_smaller_tinv=vcat(map(i->c_L_tinv[i:i,:],smaller_indices)...) | ||
| sub_bigger_q=vcat(map(i->c_L_q[i:i,:],bigger_indices)...) | ||
| M=vcat(sub_smaller_tinv,sub_bigger_q) | ||
| B=kernel(M, side=:left) | ||
| row=B[1,1:length(smaller_indices)]*sub_smaller_tinv | ||
| c_L_qt = matrix(Q,1,l,row) | ||
|
|
||
| triv=[partition([n])] | ||
| for i in 2:r | ||
| push!(triv,partition([])) | ||
| end | ||
| triv=multipartition(triv) | ||
| index_triv=findfirst(x-> x==triv,mps) | ||
| c_L_qt_H=1//c_L_qt[index_triv]*c_L_qt | ||
| return c_L_qt_H | ||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| @testset "wreath macdonald polynomials" begin | ||
| K,_ = abelian_closure(QQ) | ||
| parent, = polynomial_ring(K, [:q,:t], cached=false) | ||
| Q = fraction_field(parent) | ||
| (q,t) = gens(parent) | ||
|
|
||
| result_p1 = matrix(Q,[t^2 t 1; q t 1; q q^2 1]) | ||
| @test result_p1 == wreath_macdonald_polynomials(1,3,(@perm 3 (1,2,3)),[0,1,-1];parent) | ||
|
|
||
| result_p2 =matrix(Q,[[1//q^4, 1//q, (q^3 + 1)//q^3, 1//q^2, q, (q^3 + 1)//q^2, (q^3 + 1)//q, 1, q^3], | ||
| [t//q^3, t^3//q^4, (q*t + t^3)//q^3, t//q, t^3//q^2, (q^2*t + t^2)//q^3, (q^2*t + t^2)//q^2, 1, t^2//q], | ||
| [1//(q^2*t), 1//(q^2*t), (q + t^2)//(q^2*t), t//q, t//q, (q^2 + t)//(q^2*t), (q*t + 1)//q, 1, 1], | ||
| [1//t^2, q//t^4, (q + t^2)//t^2, t^2, q, (q + t^2)//t^3, (q + t^2)//t, 1, q//t^2], | ||
| [1//t^2, t, t^3 + 1, t^2, t^5, (t^3 + 1)//t, t^4 + t, 1, t^3], | ||
| [1//q, t, q*t + 1, q, q^2*t, (q^2 + t)//q, q^2 + t, 1, q*t], | ||
| [1//t^2, 1//t^2, (q + t^2)//t^2, q, q, 2//t, (q + t^2)//t, 1, 1], | ||
| [q//t, q^4//t, (q^5 + q^2)//t, q^3//t, q^6//t, (q^3 + q*t)//t, (q^4 + q^2*t)//t, 1, q^3], | ||
| [1//t^2, 1//q, (q + t^2)//t^2, q^2//t^2, q, (q + t^2)//(q*t), (q + t^2)//t, 1, t^2//q]]) | ||
| @test result_p2 == wreath_macdonald_polynomials(2,3,(@perm 3 ()),[1,-1,0];parent) | ||
|
|
||
| result_p3 = matrix(Q,[q^2 t q^3 + q*t q^4 q^2*t (q^2 + t)//q q^2 + t 1 t//q^2]) | ||
| @test result_p3 == wreath_macdonald_polynomial(multipartition([[1,1],[],[]]),(@perm 3 (1,2,3)), [0,1,-1];parent) | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.