Polymake.jl icon indicating copy to clipboard operation
Polymake.jl copied to clipboard

Matroid.COLOOPS property not found

Open FGlazov opened this issue 4 years ago • 3 comments

Asking for the COLOOPS of a matroid results in an error. Doing

julia> using Oscar
julia> m = Polymake.matroid.uniform_matroid(2,2);
julia> m.COLOOPS

results in the following error.

Exception occured at Polymake side:
unknown property Matroid::COLOOPS at /home/fedor/.julia/artifacts/398add9dbaf26c0295d73370854a014022eb4e4c/share/polymake/perllib/Polymake/Core/BigObjectType.pm line 432.

It is possible to recover the coloops using m.DUAL.LOOPS instead.

In polymake, doing

polytope > application 'matroid';
matroid > $m = uniform_matroid(2,2);
matroid > print $m->COLOOPS;

gives the expected output of {0, 1}.

FGlazov avatar Nov 24 '21 15:11 FGlazov

COLOOPS is not a real property but a user_method that acts as a fake property which in the perl shell looks like a property but gets translated differently in the Polymake.jl interface. This is unfortunately somewhat confusing ...

You can call it this way:

julia> using Oscar
julia> m = Polymake.matroid.uniform_matroid(2,2);
julia> Polymake.matroid.coloops(m)
pm::Set<long, pm::operations::cmp>
{0 1}

benlorenz avatar Nov 24 '21 15:11 benlorenz

Ok! Thanks, that snippet worked for me.

Perhaps it would be a good idea to point out in the polymake documentation that it is a fake property? At the moment, the polymake documentation doesn't do a good job here: https://polymake.org/doku.php/documentation/latest/matroid/matroid#coloops

And probably for all the other fake properties as well... in a way it's kind of a minefield, where two properties in the documentation act differently inside Polymake.jl

FGlazov avatar Nov 24 '21 17:11 FGlazov

I don't think the polymake documentation is the best place for this as this was done on purpose to be hidden to the (polymake-)user. We can try if it is possible to allow those to be retrieved also via the property syntax in julia with some extra magic during code-generation.

benlorenz avatar Nov 26 '21 14:11 benlorenz