Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Use Sage integers in results
Browse files Browse the repository at this point in the history
  • Loading branch information
antonio-rojas committed Feb 21, 2021
1 parent 26f7f26 commit 627192a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/sage/libs/lrcalc/lrcalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,11 @@
from sage.combinat.skew_tableau import SkewTableaux
from sage.combinat.skew_partition import SkewPartition
from sage.combinat.words.word import Word
from sage.rings.integer import Integer
import lrcalc

def _lrcalc_dict_to_sage(result):
return dict({_Partitions(i):k for i,k in result.items()})
return dict({_Partitions(i):Integer(k) for i,k in result.items()})

def lrcoef_unsafe(outer, inner1, inner2):
r"""
Expand Down Expand Up @@ -227,7 +228,7 @@ def lrcoef_unsafe(outer, inner1, inner2):
sage: lrcoef_unsafe([2,1,1,1,1], [2,1], [2,1])
0
"""
return lrcalc.lrcoef(outer, inner1, inner2)
return Integer(lrcalc.lrcoef(outer, inner1, inner2))


def lrcoef(outer, inner1, inner2):
Expand Down Expand Up @@ -404,7 +405,7 @@ def coprod(part, all=0):
[(([1, 1], [1]), 1), (([2], [1]), 1), (([2, 1], []), 1)]
"""
result = lrcalc.coprod(part, all)
return dict({tuple(_Partitions(j) for j in i):k for i,k in result.items()})
return dict({tuple(_Partitions(j) for j in i):Integer(k) for i,k in result.items()})


def mult_schubert(w1, w2, rank=0):
Expand Down Expand Up @@ -437,7 +438,7 @@ def mult_schubert(w1, w2, rank=0):
([7, 3, 4, 1, 2, 5, 6], 1), ([7, 4, 2, 1, 3, 5, 6], 1)]
"""
result = lrcalc.schubmult(w1, w2, rank)
return dict({Permutation(list(i)):k for i,k in result.items()})
return dict({Permutation(list(i)):Integer(k) for i,k in result.items()})


def lrskew(outer, inner, weight=None, maxrows=-1):
Expand Down

0 comments on commit 627192a

Please sign in to comment.