-
Notifications
You must be signed in to change notification settings - Fork 262
Add generic Ore polynomial module #2299
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
base: main
Are you sure you want to change the base?
Conversation
On Saturday, 12 April 2025 Ricardo Buring wrote:
> +typedef enum {
+ ORE_OPERATOR_DERIVATIVE,
+ ORE_OPERATOR_EULER_DERIVATIVE,
+ /* TODO: Shift operator, etc. */
+}
+ore_operator_t;
I named this enum (and the value prefix) improperly. What should the
name be?
Maybe gr_ore_poly_which_operator, for consistency with
gr_which_structure?
…--
Marc
|
Some/most of the arithmetic/setter methods ( I'm not sure what I did wrong since I did put them in the method table. Edit: Never mind, I put some |
4cfe741
to
c5d790c
Compare
So, working with Ore polynomials over say R[x], one might indeed want to do mixed operations with operands from either R or R[x]. The term "scalar" being ambiguous, instead of adding many extra methods, perhaps just define |
I don't see the need for |
Most of the one-line trivial methods could go in a single file. |
Yes, this is the right way to do it. The way |
I reorganized the code to collect the wrapper functions in one file, and applied all the other suggestions above. I removed all the methods with Let me know if this needs any further changes. |
Looks good. The only thing missing is documentation. |
e5ac464
to
6323582
Compare
Something that doesn't seem to be well specified in the documentation is the generator name (set_gen_name / string conversion methods). If I'm in |
In fact, shouldn't the generator x (given as an element of the base ring) be a parameter to the Ore polynomial ring constructor? In general, the base ring could be something multivariate. |
I updated the context and constructor to include an index of a generator of the base ring, and (hopefully) clarified the documentation. I think the restriction to generators of the base ring (rather than elements of the base ring) is reasonable, and e.g. in the univariate case it saves the user from having to define a variable that will probably never be used (e.g. multiplication by the variable will be replaced by a shift). Let me know if this is alright. |
5b16adc
to
ee4d57a
Compare
On Tuesday, 29 April 2025 Ricardo Buring wrote:
@rburing requested your review on: flintlib/flint#2299 Add generic Ore
polynomial module.
Sure, I can take a look, but maybe not before next week. Thanks for your
work on this!
|
Another question: How should the |
Either add a |
|
||
/* This is mostly a copy of src/gr_poly/test/t-set_str.c */ | ||
|
||
TEST_FUNCTION_START(gr_ore_poly_set_str, state) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be good to test that expressions like "Dx*x"
either are correctly converted or correctly return GR_UNABLE
.
There are definitely cases where one wants to work with derivations like x²·d/dx or operators relative to a generator of the base ring of the base ring, but they can probably be handled by a future “Ore twist as function pointer” mechanism. |
Btw, what do you think about calling (σ,δ) the “(Ore) twist” instead of the “(Ore) operator”? I suppose “twist” would more properly refer to σ alone, but that would avoid some overloading of the word “operator”. |
I'm also wondering if just |
47a2ff7
to
e8fedc5
Compare
Thanks for the extensive feedback @mezzarobba, I think it looks better now. What do you think about using the name @fredrik-johansson Should I keep |
I think the |
Sounds good too. I think I would call d/dx |
This contains only the basic structure so far, such as memory management, additive arithmetic, and multiplication from the left by an element of the base ring.
This contains only the basic structure so far, such as memory management, additive arithmetic, and multiplication from the left by an element of the base ring.
Feedback welcome!
We would like to use this data type as input to differential equation solvers, so we don't need the multiplicative structure initially, though it would be nice to have it in the future.
Multiplicative operations (to be defined later) depend on the Ore context object, so I figured that all operations should take the Ore context as input, to make the interface uniform. So now the interface looks like
gr_mpoly
, and the basic operations implemented so far callgr_poly
methods.Since the base ring will typically be polynomial, shouldgr_ore_poly_scalar_mul
andGR_ORE_POLY_ELEM_CTX
be named differently? Maybe usingbase
/BASE
?I also tried to make the module "optional" in the sense thatgr_mpoly
is, let me know if I missed something in this regard.cc @mezzarobba