-
Notifications
You must be signed in to change notification settings - Fork 33
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
Making Singular.LibTropical.tropicalVariety
usable
#807
Comments
Also, I'm happy to drop the optional |
From slack:
See also See also https://discourse.julialang.org/t/singular-jl-polynomial-ring-over-a-polynomial-ring/110839/2 |
Thanks, that seems to have worked, I know get an expected error in the return:
Is there a way to teach Singular.jl how to deal with this "unrecognized object with Singular type number 545"? I guess cannot just make it into a
That way, I can wrap |
I don't want to stop you from any work, but this might be highly non-trivial.
Yes, I think you can execute arbitrary things with https://oscar-system.github.io/Singular.jl/dev/caller/#Global-Interpreter-Variables and set the global variables to something that you could then digest on the julia side. |
I just realised that Singular has no function that returns the incidence matrix of a fan, meaning which maximal cones contain which rays (this is essential for reconstructing the fan in OSCAR). So the easiest option would probably be parsing the string of a Singular fan, which does contain said information:
|
This sounds horrible |
It's a good band-aid. The only other two alternatives are patching |
Why can't you write a little Singular glue code which returns the desired data and then invoke that from OSCAR? |
Because I would have to change gfanlib itself, Singular's interface to gfanlib, and make OSCAR use the latest master version of Singular (the latter of which I don't know how). And this issue is time-critical. |
Why would you have to change gfanlib? You surely can write a Singular function calling gfanlib and converting the output into a format that Singular.jl can read. Then just load that code and call that function in Oscar. |
Because the class I will still have to make some changes to Singular's interface to gfanlib to make that functionality available in the interpreter, and make OSCAR depend on the latest master version of Singular. |
I just rediscovered this issue. @hannes14 there doesn't seem to be a Looking at the Singular source code, there seems to be a C global And diving a bit deeper, this seems to be the C++ code which computes a "tropical variety" just given an ideal (with multiple variants of this code in poly g = I->m[0];
...
try
{
tropicalStrategy currentStrategy(I,currRing);
std::set<gfan::ZCone> maxCones = tropicalVariety(g,currRing,¤tStrategy);
res->rtyp = fanID;
res->data = (char*) toZFan(maxCones,currentStrategy.getExpectedAmbientDimension());
return FALSE;
}
catch (const std::exception& ex)
{
Werror("ERROR: %s",ex.what());
return TRUE;
} where static gfan::ZFan* toZFan(std::set<gfan::ZCone> maxCones, int d)
{
gfan::ZFan* zf = new gfan::ZFan(d);
for (std::set<gfan::ZCone>::iterator sigma = maxCones.begin(); sigma!=maxCones.end(); sigma++)
zf->insert(*sigma);
return zf;
} So now I wonder if it would make even more sense to directly expose the |
That largely depends on how difficult it is to implement it. I personally don't have any long-term plans on using Singular's |
Ah OK! If you plan to rewrite all that that code in the coming months anyway, then I don't think it makes sense to worry about a better way to call it. |
I am trying to make
Singular.LibTropical.tropicalVariety
usable for small examples. Can anybody point me in the right direction where to start?In Singular, the function takes as input an
ideal
and an optionalnumber
and returns afan
:Two things need to be done:
Singular.LibTropical.tropicalVariety
callable from juliaCurrently I am still stuck at 1:
Any help would be much appreciated!
The text was updated successfully, but these errors were encountered: