-
-
Notifications
You must be signed in to change notification settings - Fork 559
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
Let the TestSuite
test that the construction of a parent returns the parent
#15223
Comments
comment:1
I did not run the full test suite yet, but I already detected several bugs in Until now, I found:
|
comment:2
And I am to blame for a third problem, that is actually fairly similar to the second problem mentioned above. It is in my thematic tutorial on categories and coercion.
Consequence: When trying to reconstruct P using the construction functor, the "unimportant" argument is missing, and hence I have to think how to solve this. |
Branch: u/SimonKing/ticket/15223 |
comment:4
Is it really needed that Anyway, using the construction functor for multivariate polynomial rings is plain wrong. We have two options:
If we go for None, then we would have problems to do fancy constructions starting with a boolean polynomial ring: There would be no pushout constructions. I wonder if we need pushout constructions. If we go for a new construction functor, I'd suggest to modify quotient functors. After all, it is a quotient in a particular implementation. And looking at the second problem, it seems to be a general problem with quotient functors: Sometimes we want to add more information on a quotient, such as "the quotient shall belong to the category of fields" or, "the quotient shall be implemented as a boolean polynomial ring". So, we should invent a general scheme to load the quotient functor with this additional information. |
comment:5
By the way, the branch that I uploaded fixes all doctests, except for the three issues described in the previous posts (boolean polynomial rings, quotients that are pushed into a sub-category of the default, and the stuff that I wrote in the thematic tutorial). |
comment:6
The quotient functors ( I think it would be possible to store further arguments in an attribute, say,
Then, one should also make the |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Commit: |
comment:8
In the current commit, I fix the example in the thematic tutorial by making the construction functor aware of the additional arguments that were originally used to construct the parent. It works, and I think a similar idea would work for quotient functors. |
comment:10
I just added Nicolas to this ticket, since it relates not only with coercion (this is the component of this ticket) but also with categories. In a nutshell: If P is a parent, then The contract is that While we are at it, I thought one could improve And something else that I want to improve with the Hence, I think it would make sense to be more precise when choosing the domain and codomain of the functor. Today, I experimented with this idea: If Q is a quotient, and But when running the tests, it turns out that this is too narrow: Sometimes, we want to apply the quotient functor F to a ring over a different base ring. This makes me think of the following: Would it make sense to introduce a method of categories For example, for Nicolas, do you think it would hurt to introduce such method here? |
comment:11
Replying to @simon-king-jena:
Isn't that going to be a problem?
After this isn't the category of |
comment:12
Replying to @simon-king-jena:
This sounds like a good idea indeed! I would tend to put the test in It would make sense as well for the test to accept the case where
This does not seem directly related to this ticket. Could this easily
This seems like a sensible method; so if you have a use for it, go Cheers, |
comment:13
Replying to @nbruin:
It is:
No, it doesn't (to my surprise, I actually thought they should be recognised as equal now):
No, it is not UniqueRepresentation:
|
comment:14
Replying to @nthiery:
I am not so sure about this.
But if it is (partially) about implementation, then I believe its place is not in
Probably better. I am actually not sure if it would be a good idea to modify the quotient functor in that way.
Not sure yet. |
comment:15
And now I realise that I use git, and I have no idea how to pick some part of the changeset of my last commit, and move it to a different branch. |
comment:16
Hi Simon, I am not sure how to just take a part of your last commit, but you can do the following: This probably doesn't do exactly what you want, but it might be a start. |
comment:17
Replying to @sagetrac-jkeitel:
Thank you! I had already started before your answer came. That's to say, I have stored Since I didn't push the "wrong" commit to trac (in particular, clearly no other branch on trac will use my wrong commit), I guess it is ok to do |
comment:18
Replying to @simon-king-jena:
That doesn't tell the entire story, though:
so perhaps the object isn't really UniqueRepresentation but the system tries to implement the semantics via a factory. So I think you're seeing exactly the problem I was afraid of:
so after this we do have two functionally equivalent copies of the same ring: Allowing categories to be refined on "global" (uniqueified) objects implies that the
|
comment:19
Should specifying the category even be allowed anyway? What can be achieved by doing so? You can get horrible nonsense:
Of course if you do this, you're just asking for the insanity. Normally everything is fine:
But it does mean that if |
comment:20
Replying to @nbruin:
And that's why I think it is a good idea that all given arguments, including the category, are taken into the cache key of the factory. That way, it won't matter if you put a non-field into the category of fields, because you are still able to create a "sane" version of the same ring.
I don't think so. And in any case, it should be on a different ticket. |
comment:21
Hm. But the more I think about it...: In the
Note the comment: The aim is to let
I see the following options:
Further ways to go? In any case, there should be a new ticket. |
comment:22
Replying to @simon-king-jena:
How embarrassing! I just used I hope #9138 gives a rationale... |
comment:23
So, this yields to the question: Why has it been a "todo"? Nicolas, did you added this "todo"? |
comment:24
It seems that it became "todo" in #8562. And there is a discussion here. It seems indeed that in this discussion there was an agreement that
What do I conclude from this?
And I am stuck with the following questions:
Suggested way to proceed
|
Dependencies: #15229 |
comment:25
I have opened #15229 for the new problems. |
comment:114
To fix failures like the one in Do we already have a forgetful functor somewhere that can take care of such things by composing? |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:116
Replying to @mkoeppe:
Minimal example:
|
comment:117
To fix the failures in |
comment:119
Thank you. Sorry for taking a week to get to this. So the problem is the extension of the free Zinbiel algebra to the infinite number of variables but the |
comment:120
Replying to @mkoeppe:
Sort of, there is the |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:122
Proposing to take care of the remaining failures in a follow-up ticket. |
Changed author from Simon King, Matthias Koeppe, Marc Mezzarobba to Simon King, Matthias Koeppe, Marc Mezzarobba, Travis Scrimshaw |
comment:123
I am happy with that and the rest of the changes. Anyone else have any objections? |
Reviewer: Travis Scrimshaw |
comment:124
Replying to @tscrim:
No, I was going to make the same suggestion as Matthias. |
comment:125
Replying to @tscrim:
For completeness, I have reviewed your changes to the Zinbiel construction functor. |
Changed reviewer from Travis Scrimshaw to Travis Scrimshaw, Matthias Koeppe |
comment:126
Follow-up in #30574 |
comment:127
Is #30507 really a dependency? If not, we should remove it so this gets picked up into Sage. |
comment:128
It isn't - thanks for catching this |
Changed dependencies from #30507 to none |
Changed branch from public/ticket/15223 to |
Changed commit from |
Andrey told me about the following problem. When he implemented toric lattices, he inherited a
.construction()
method from general lattices. Consequence: If he tried to add elements of two different toric lattices, then Sage applied a pushout construction and added the two elements after pushing them toZZ^2
, which was not what he wanted.His solution was, I think, the correct one: He overloaded the
.construction()
method, so that it now returnsNone
.Update: A similar problem also showed up in #30360.
Suggestion: Introduce a test of the
TestSuite
of a parent P, that will complain if P.construction() returns a pairF, O
such thatF(O)!=P
.I think this test should be put into
(Update 9.2:sage.structure.parent.Parent
sage.categories.sets_cat
), because this is where.construction()
is defined in the first place.CC: @novoselt @nthiery @sagetrac-sage-combinat @tscrim @fchapoton @mwageringel @kwankyu @dkrenn
Component: coercion
Keywords: construction functor, test suite, sd53
Author: Simon King, Matthias Koeppe, Marc Mezzarobba, Travis Scrimshaw
Branch:
29e2ce0
Reviewer: Travis Scrimshaw, Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/15223
The text was updated successfully, but these errors were encountered: