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

Commit

Permalink
Incorporating comments from reviewers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Scrimshaw committed Feb 10, 2022
1 parent 3fdf528 commit 5ffa2f0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/sage/combinat/sf/schur.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from . import classical
import sage.libs.lrcalc.lrcalc as lrcalc
from sage.misc.misc_c import prod
from sage.data_structures.blas_dict import coerce_remove_zeros
from sage.data_structures.blas_dict import convert_remove_zeroes
from sage.rings.infinity import infinity
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.arith.misc import factorial
Expand Down Expand Up @@ -130,7 +130,7 @@ def product_on_basis(self, left, right):
sage: s[2,1]^2
s[2, 2, 1, 1] + s[2, 2, 2] + s[3, 1, 1, 1] + s[3, 3] + s[4, 1, 1] + s[4, 2]
"""
return self.element_class(self, coerce_remove_zeros(lrcalc.mult(left, right),
return self.element_class(self, convert_remove_zeroes(lrcalc.mult(left, right),
self.base_ring()))

def coproduct_on_basis(self, mu):
Expand Down Expand Up @@ -164,7 +164,7 @@ def coproduct_on_basis(self, mu):
1/2*s[] # s[2] + 1/2*s[1] # s[1] + 1/2*s[2] # s[]
"""
T = self.tensor_square()
return T.element_class(T, coerce_remove_zeros(lrcalc.coprod(mu, all=1),
return T.element_class(T, convert_remove_zeroes(lrcalc.coprod(mu, all=1),
self.base_ring()))

def _element_constructor_(self, x):
Expand Down
7 changes: 3 additions & 4 deletions src/sage/combinat/sf/sfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
from sage.combinat.free_module import CombinatorialFreeModule
from sage.matrix.constructor import matrix
from sage.misc.misc_c import prod
from sage.data_structures.blas_dict import coerce_remove_zeros, linear_combination
from sage.data_structures.blas_dict import convert_remove_zeroes, linear_combination
from copy import copy
from functools import reduce

Expand Down Expand Up @@ -729,7 +729,7 @@ def skew_schur(self, x):
s = self.realization_of().schur()
R = self.base_ring()
skewschur = lrcalc.skew(x[0], x[1])
return self(s.element_class(s, coerce_remove_zeros(skewschur, R)))
return self(s.element_class(s, convert_remove_zeroes(skewschur, R)))

def Eulerian(self, n, j, k=None):
"""
Expand Down Expand Up @@ -5280,10 +5280,9 @@ def skew_by(self, x):
if x not in Sym:
raise ValueError("x needs to be a symmetric function")
s = Sym.schur()
zero = s.zero()
R = parent.base_ring()
import sage.libs.lrcalc.lrcalc as lrcalc
ret = linear_combination((coerce_remove_zeros(lrcalc.skew(p1, p2), R), c1 * c2)
ret = linear_combination((convert_remove_zeroes(lrcalc.skew(p1, p2), R), c1 * c2)
for p1, c1 in s(self)._monomial_coefficients.items()
for p2, c2 in s(x)._monomial_coefficients.items()
if p1.contains(p2))
Expand Down
2 changes: 1 addition & 1 deletion src/sage/data_structures/blas_dict.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ cpdef dict linear_combination(dict_factor_iter, bint factor_on_left=*)
cpdef dict sum_of_monomials(monomials, scalar)
cpdef dict sum_of_terms(index_coeff_pairs)
cdef inline dict remove_zeros(dict D)
cpdef dict coerce_remove_zeros(dict D, R)
cpdef dict convert_remove_zeroes(dict D, R)

6 changes: 3 additions & 3 deletions src/sage/data_structures/blas_dict.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ cdef dict remove_zeros(dict D):
del D[index]
return D

cpdef dict coerce_remove_zeros(dict D, R):
cpdef dict convert_remove_zeroes(dict D, R):
"""
Remove all keys whose value is zero from ``D``
after coercing into the ring ``R``.
Expand All @@ -432,9 +432,9 @@ cpdef dict coerce_remove_zeros(dict D, R):
EXAMPLES::
sage: from sage.data_structures.blas_dict import coerce_remove_zeros
sage: from sage.data_structures.blas_dict import convert_remove_zeroes
sage: d = {1: -2, 2: -4, 3: -3}
sage: coerce_remove_zeros(d, GF(2))
sage: convert_remove_zeroes(d, GF(2))
{3: 1}
"""
cdef list for_removal = []
Expand Down

0 comments on commit 5ffa2f0

Please sign in to comment.