Skip to content

utility package for dealing with partitions, Young tableaux and such

License

Notifications You must be signed in to change notification settings

simeonschaub/YoungTableaux.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YoungTableaux

Stable Dev Build Status Coverage

See the demo here

Young Tableaux can be constructed as follows:

julia> using YoungTableaux

julia> YoungTableau([[1, 3, 4], [2, 5], [6]])
3×3 YoungTableau{Int64}
┌───┬───┬───┐
│ 134 │
├───┼───┼───┘
│ 25 │
├───┼───┘
│ 6 │
└───┘

Alternatively they can also be constructed from a permutation:

julia> π = [4, 6, 3, 8, 1, 2, 7, 5]
8-element Vector{Int64}:
 4
 6
 3
 8
 1
 2
 7
 5

julia> P, Q = rs_pair(π)
(YoungTableau{Int64}([[1, 2, 5], [3, 6, 7], [4, 8]]), YoungTableau{Int64}([[1, 2, 4], [3, 6, 7], [5, 8]]))

julia> P
3×3 YoungTableau{Int64}
┌───┬───┬───┐
│ 125 │
├───┼───┼───┤
│ 367 │
├───┼───┼───┘
│ 48 │
└───┴───┘

julia> Q
3×3 YoungTableau{Int64}
┌───┬───┬───┐
│ 124 │
├───┼───┼───┤
│ 367 │
├───┼───┼───┘
│ 58 │
└───┴───┘

Broadcasting works just like with arrays!

julia> P .+ Q
3×3 YoungTableau{Int64}
┌────┬────┬────┐
│  249 │
├────┼────┼────┤
│  61214 │
├────┼────┼────┘
│  916 │
└────┴────┘

Partitions are just like Young Tableaux, but without entries. When iterating a partition only true is returned. Indices of the square can be computed using eachindex.

julia> Partition([3, 3, 2])
3×3 Partition
┌───┬───┬───┐
│   │   │   │
├───┼───┼───┤
│   │   │   │
├───┼───┼───┘
│   │   │
└───┴───┘

julia> eachindex(Partition([3, 3, 2]))
3×3 YoungTableaux.EachIndexOf{Partition}
┌─────┬─────┬─────┐
│ 1,11,21,3 │
├─────┼─────┼─────┤
│ 2,12,22,3 │
├─────┼─────┼─────┘
│ 3,13,2 │
└─────┴─────┘

The partition corresponding to a Young Tableaux can be requested using shape, which will return a lazy wrapper:

julia> shape(P)
3×3 YoungTableaux.PartitionOf{YoungTableau{Int64}}
┌───┬───┬───┐
│   │   │   │
├───┼───┼───┤
│   │   │   │
├───┼───┼───┘
│   │   │
└───┴───┘

Addition and substraction work as defined in Macdonald: "Symmetric Functions and Hall Polynomials"

julia> shape(P) - Partition([2, 1])
3×3 SkewPartition
┌───┬───┬───┐
│   │   │ * │
├───┼───┼───┤
│   │ ** │
├───┼───┼───┘
│ ** │
└───┴───┘

julia> shape(P) + Partition([2, 1])
3×5 Partition
┌───┬───┬───┬───┬───┐
│   │   │   │   │   │
├───┼───┼───┼───┼───┘
│   │   │   │   │
├───┼───┼───┴───┘
│   │   │
└───┴───┘

There is also initial support for conjugating diagrams using the adjoint operator like with regular matrices. It is currently implemented lazily but this may be subject to change.

julia> P'
3×3 YoungTableaux.ConjugateDiagram{Int64, YoungTableau{Int64}}
┌───┬───┬───┐
│ 134 │
├───┼───┼───┤
│ 268 │
├───┼───┼───┘
│ 57 │
└───┴───┘