-
Notifications
You must be signed in to change notification settings - Fork 133
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
Assign each GAP object a *unique* isomorphism from/to OSCAR #2330
Conversation
how and when are objects deleted? |
Good question. To be honest, I have no idea. But I guess, the same problem already exists for |
Please note, that for some other types of inputs, the wished for behaviour already exists. For example: julia> FO = cyclotomic_field(5)[1]
Cyclotomic field of order 5
julia> FG = codomain(Oscar.iso_oscar_gap(FO))
GAP: CF(5)
julia> FO2 = codomain(Oscar.iso_gap_oscar(FG))
Cyclotomic field of order 5
julia> FO2 == FO
true This should create exactly the same (maybe problematic, I don't know) references as |
On Fri, Apr 28, 2023 at 08:12:25AM -0700, Lars Göttgens wrote:
Please note, that for some other types of inputs, the wished for behaviour already exists. For example:
```julia
julia> FO = cyclotomic_field(5)[1]
Cyclotomic field of order 5
julia> FG = codomain(Oscar.iso_oscar_gap(FO))
GAP: CF(5)
julia> FO2 = codomain(Oscar.iso_gap_oscar(FG))
Cyclotomic field of order 5
julia> FO2 == FO
true
```
This should create exactly the same (maybe problematic, I don't know) references as `Oscar.iso_oscar_gap(oscar_obj)` after the proposed change. Or is there something I am missing?
I don't know - and please, accept this as well as a question for
@ThomasBreuer and @fingolfin
Maybe it's done using WeakDicts - or maybe not...
… --
Reply to this email directly or view it on GitHub:
#2330 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
The following happens with the current Oscar/GAP.
The function Thus we do not have a unique Oscar object that belongs to a given GAP object. |
Two more remarks:
|
As Thomas already pointed out, there is no problem with object retention here, as we are not using a global cache: just a pointer in object Thomas also points out that for some objects, due to the way things are on the GAP side, we still won't be quite in the situation that everything is unique, as e.g. GAP code is often careless when it comes to finite fields, and instead of passing around a finite field, it just passes around the size of that field, and assumes that describes the field uniquely (spoiler: it doesn't in general, and that has lead to us uncovering and fixing a bunch of bugs in GAP). Anyway, that means GAP code will call Anyway, I don't think that's an actual problem or concern for this PR. First off, it is meant for "heavier" objects such as Lie algebras where we generally don't have this issue at all. Secondly, even in cases where this issue exists, well, we are not worse off with the change than we are right now... |
Following the remark by @fingolfin:
I get this:
The Thus we can set the inverse of the newly constructed map in the codomain |
Co-authored-by: Max Horn <[email protected]>
Let's see if this breaks anything more than before. |
The assertion fails at multiple points in the test-suite. |
In addition to my previous comment: |
I think the problem this PR tries to address is unsolvable as there is no 1-to-1 correspondence of OSCAR types and GAP types. If there is no objection from @ThomasBreuer or @fingolfin, I would close this in the near future as a failed attempt. |
Fine by me |
This has been brought up by @fingolfin in #2207 (comment).
Currently, there are cases, where computing an isomorphism from an OSCAR object to GAP and then one from its codomain (a GAP object) to OSCAR gives a different object than we started from. For example:
Whenever a
Oscar.iso_gap_oscar
is created, it is cached as an attribute of the domain (a GAP object).This PR would add the additional behaviour, that when a GAP object is created as the codomain of
Oscar.iso_oscar_gap
, this isomorphism (to be correct its inverse) is put into the cache of that GAP object. For the above example, this will lead totrue
in the last line.Please see this PR as an opportunity to write your opinion and discuss. If you are in favor of this change, I will add some corresponding tests as well.
Pinging @fingolfin and @ThomasBreuer for their opinion.