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

Symmetric Function bases with coefficient ring QQ provide incorrect functions for negative indices #39328

Open
2 tasks done
Spamakin opened this issue Jan 14, 2025 · 3 comments
Labels

Comments

@Spamakin
Copy link

Spamakin commented Jan 14, 2025

Steps To Reproduce

Running the following will reproduce the issues

sage: R = SymmetricFunctions(QQ)
sage: e = R.elementary()
sage: h = R.homogeneous()
sage: p = R.powersum()
sage: # all of the following should be zero but are not
sage: e([-1]).expand(2)
-1
sage: h([-1]).expand(2)
-1
sage: s([-1]).expand(2)
-1
sage: # all of the following should be zero but are not
sage: s = R.schur()
sage: m = R.monomial()
sage: s([-1]).expand(2)
-1
sage: m([-1]).expand(2)
-1

Expected Behavior

Elementary symmetric functions, homogeneous complete symmetric functions, and powersum symmetric functions which are enumerated by non-negative integers k should be 0 when considering k < 0.

Schur polynomials and monomial symmetric functions which are enumerated by partitions with parts consisting of non-negative integers should also be 0 when the partitions have parts < 0. Perhaps in this case they should be undefined.

Actual Behavior

As seen in the interpreter code above, various symmetric functions that should be 0 are not.

Additional Information

It is common knowledge the partitions of an integer n have parts which are all non-negative. A quick inspection of the definitions of elementary, complete homogeneous, and power-sum symmetric polynomials shows that plugging in zero to the indexing variable yields empty sums which justifies that they should be zero as well.

EDIT: As remarked in the below discussion, all of the functions behave as expected when working in the coefficient rings ZZ, RR, and CC and throw errors.

One consequence is that the following code implementing the Jacobi-Trudi identity returns incorrect polynomials:

sage: def jacobi_trudi_homog(R, P):
....:     h = R.homogeneous()
....:     l = len(P)
....:     M = [[ _ for _ in range(l)] for _ in range(l)]
....:     for i in range(l):
....:         for j in range(l):
....:             M[i][j] = h([P[i] - i + j])
....:     mat = matrix(M)
....:     return mat

Environment

  • OS: Debian 12
  • Sage Version: 10.4
  • Python Version: 3.11.2

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
@mantepse
Copy link
Collaborator

mantepse commented Jan 15, 2025

The trouble is, I think, that QQ([-5]) gives -5.

This is done in

elif isinstance(x, list) and len(x) == 1:
self.__set_value(x[0], base)

and it looks fishy to me. Note that ZZ does not do this.

@Spamakin
Copy link
Author

Spamakin commented Jan 15, 2025

Good catch, I also think this seems to be an issue with QQ specifically. Reproducing the issue with coefficients in CC, RR, and ZZ all work as one would expect. I have amended the title and original post to reflect this.

@Spamakin Spamakin changed the title Symmetric Function bases provide incorrect functions for negative indices Symmetric Function bases with coefficient ring QQ provide incorrect functions for negative indices Jan 16, 2025
@user202729
Copy link
Contributor

Note that

sage: QQ[I]([1, 2])
2*I + 1

Since QQ is a number field this may not be unexpected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants