Error realize()-ing a Harnack curve defined via its dual subdivision

Questions and problems about using polymake go here.
CharlesArnal
Posts: 12
Joined: 16 Feb 2022, 16:43

Error realize()-ing a Harnack curve defined via its dual subdivision

Postby CharlesArnal » 06 Aug 2022, 23:27

Dear all,

I tried to define a patchwork using its dual subdivision, as shown at the end of the tutorial https://polymake.org/doku.php/user_guid ... /patchwork .

My code is as follows :

Code: Select all

my $dual_sub = new fan::SubdivisionOfPoints(POINTS=>[[1, 2, 0, 0],[1, 1, 0, 1],[1, 0, 0, 2],[1, 1, 1, 0],[1, 0, 1, 1],[1, 0, 2, 0]],MAXIMAL_CELLS=>[[3, 4, 5],[1, 3, 4],[1, 2, 4],[0, 1, 3]]); my $h2 = new Hypersurface<Min>(DUAL_SUBDIVISION=>$dual_sub); my $h2_pw = $h2->PATCHWORK(SIGNS=>[0, 1, 0, 1, 1, 0]); my $h2_pw_r = $h2_pw->realize();
Including the last line always results in the following error message :
polymake: ERROR: "/usr/local/share/polymake/perllib/Polymake/Core/BigObjectType.pm", line 1017: Can't locate object method "code" via package "0" (perhaps you forgot to load "0"?)
As a comparison, the dual subdivision I am defining above and the associated signs are those of a Harnack curve of degree 2 (unless I have made a very dumb mistake), as can be checked with the following code (that runs without any problem) :

Code: Select all

my $h1 = harnack_curve(2); my $h1_pw1 = $h1->PATCHWORK; print $h1->DUAL_SUBDIVISION->POINTS; print "\n"; print $h1->DUAL_SUBDIVISION->MAXIMAL_CELLS; print "\n"; print $h1_pw1->SIGNS; print "\n"; my $h1_pw_r = $h1_pw1->realize();
I am using polymake version 4.1 on Windows Subsystem Linux - however, I get the same error message when I try running those same commands in Polymake in a Box https://polymake.org/doku.php/boxdoc .

What causes this problem ? Is it because there is no canonical embedding of the hypersurface in the real/projective space ?

Thank you very much for your time !

Best regards,

Charles Arnal

P.S. :
A short side question : I think I have noticed that when defining a hypersurface as above with a dual subdivision, the POINTS of the triangulation need to be its vertices (in other words, there cannot be points in POINTS that are e.g. in the interior of a maximal cell) - otherwise, some signs in SIGNS are ignored.
This can be seen in the following code :

Code: Select all

my $dual_sub = new fan::SubdivisionOfPoints(POINTS=>[[1, 2, 0, 0],[1, 1, 0, 1],[1, 0, 0, 2],[1, 1, 1, 0],[1, 0, 1, 1],[1, 0, 2, 0]], MAXIMAL_CELLS=>[[0,2,5]]); my $h2 = new Hypersurface<Min>(DUAL_SUBDIVISION=>$dual_sub); my $h2_pw = $h2->PATCHWORK(SIGNS=>[0, 0, 0, 0, 0, 0]);
Only the first 3 signs seem to matter (I guess they are re-mapped to the vertices of the triangulation, and the last 3 are ignored). Michael Joswig had told me in a previous conversation that when defining a hypersurface with COEFFICIENTS and MONOMIALS, the MONOMIALS need to not be redundant - I assume the same principle applies here ?

User avatar
joswig
Main Author
Posts: 288
Joined: 24 Dec 2010, 11:10

Re: Error realize()-ing a Harnack curve defined via its dual subdivision

Postby joswig » 08 Aug 2022, 13:50

There are two "issues" here which come together:

(1) As you already assumed there are no canonical embeddings (defined). Hence that operation cannot be done by polymake.

(2) Due to the combination of a very general abstract framework (implemented in a standard programming language; here: perl) used by / implemented in polymake, it is next to impossible to get out meaningful error messages.

You made the situation worse for yourself by debugging a script, rather than interactive command line code. There are subtle differences.

Let us look at the example you mentioned. Here I am using the shell!

Code: Select all

> application "tropical"; > $moae = new fan::SubdivisionOfPoints(POINTS=>[[1,4,0,0],[1,0,4,0],[1,0,0,4],[1,2,1,1],[1,1,2,1],[1,1,1,2]], MAXIMAL_CELLS=>[[0,1,3],[0,2,5],[0,3,5],[1,2,4],[1,3,4],[2,4,5],[3,4,5]]); > $h2 = new Hypersurface<Min>(DUAL_SUBDIVISION=>$moae); > $h2_pw = $h2->PATCHWORK(SIGNS=>[0,0,0,1,1,0]);
All of this is totally fine. Then I do:

Code: Select all

> $h2_pw->realize(); could not provide all required input properties
That is slightly better than the error that you got (but far from perfect; see above). It just means that the properties of your Hypersurface object required in that function cannot be inferred from the input. The reason: no canonical embedding defined.

Your script tries to say the same, but for some super-technical reasons it is not possible to notify the user with the more meaningful error message shown above.

Just to show that everything is totally fine: here is a computation (continued from the example) which does not depend on an embedding:

Code: Select all

> print $h2_pw->BETTI_NUMBERS_Z2; 3 3
So, long story short, there is nothing wrong at all in your code or in polymake. Except for the fact that it is difficult to understand that polymake only wants to tell you that this is an undefined operation.

I hope this helps.

PS: I am giving more detailed information here since I can see that you put in a lot of effort into your code and working with polymake. So I thought it would be helpful for you to learn more about that.

CharlesArnal
Posts: 12
Joined: 16 Feb 2022, 16:43

Re: Error realize()-ing a Harnack curve defined via its dual subdivision

Postby CharlesArnal » 11 Aug 2022, 23:05

Ok, thank you very much for your clear answer and additional explanations!

Best regards,

Charles


Return to “Helpdesk”