-
-
Notifications
You must be signed in to change notification settings - Fork 519
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
Variables versus variable indices #35523
Comments
+1, and while at it, should also fix this inconsistency between
|
What should these methods do for elements of |
|
Good idea! Do you have a preference between deprecated one in favor of the other? keeping both? |
What would be a problem with |
From a quick |
Yes, but:
|
I use I'd be in favour of removing this inconsistency, see https://groups.google.com/g/sage-devel/c/-CVdz6H7dTc/m/_x1px4bHAgAJ and #34120 |
as part of sagemath#35523 ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. URL: sagemath#38942 Reported by: Frédéric Chapoton Reviewer(s): Kwankyu Lee
as part of sagemath#35523 ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. URL: sagemath#38942 Reported by: Frédéric Chapoton Reviewer(s): Kwankyu Lee
Is there an existing issue for this?
Problem Description
The variables in a polynomial ring are conveniently indexed by
0
,1
, ...,n-1
and one would like to use these indices rather than variables (or variable names) in algorithms. However getting access to this indexing is currently cumbersome and inefficientProposed Solution
We propose to implement two new methods on elements of a category with an (indexed) basis
Object.is_gen()
: return whether theObject
is a generator. This method is already available on univariate polynomials. We propose to additionally deprecateMultivariatePolynomial.is_generator()
in favor ofis_gen
.Object.gen_index()
: return the index of the generator ifObject
is a generator and raises aValueError
otherwise.We additionally propose to implement a method on all (multivariate) polynomials
Polynomial.variable_indices()
: list of indices of variables occurring in the polynomial (similar toPolynomial.variables()
)One should check for consistency on objects that already have their own conventions (such as symmetric functions, infinite polynomial ring, polynomials, multivariate polynomials, ...)
Alternatives Considered
None
Additional Information
This came out from a discussion relative to
PolynomialSequence
in #35518The text was updated successfully, but these errors were encountered: