Skip to content

Making Singular.LibTropical.tropicalVariety usable #807

@YueRen

Description

@YueRen

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 optional number and returns a fan:

                     SINGULAR                                 /  Development
 A Computer Algebra System for Polynomial Computations       /   version 4.4.0
                                                           0<
 by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann     \   Apr 2024
FB Mathematik der Universitaet, D-67653 Kaiserslautern        \
> LIB "tropical.lib";
[...]
> ring r = 0,(a,b,c,d,e,f,g,h,i,j),dp;
> ideal I = bf-ah-ce, bg-ai-de, cg-aj-df, ci-bj-dh, fi-ej-gh;
> tropicalVariety(I); # function in tropical.lib
_application PolyhedralFan
_version 2.2
_type PolyhedralFan

AMBIENT_DIM
10

DIM
7

LINEALITY_DIM
5

RAYS
-3 1 1 1 1 1 1 -1 -1 -1	# 0
-1 -1 1 1 -1 1 1 1 1 -3	# 1
-1 1 -1 1 1 -1 1 1 -3 1	# 2
-1 1 1 -1 1 1 -1 -3 1 1	# 3
1 -3 1 1 1 -1 -1 1 1 -1	# 4
1 -1 -1 1 1 1 -3 -1 1 1	# 5
1 -1 1 -1 1 -3 1 1 -1 1	# 6
1 1 -3 1 -1 1 -1 1 -1 1	# 7
1 1 -1 -1 -3 1 1 1 1 -1	# 8
1 1 1 -3 -1 -1 1 -1 1 1	# 9

[...]

MAXIMAL_CONES
{0 1}	# Dimension 7
{0 2}
{0 3}
{1 4}
{1 8}
{2 6}
{3 5}
{2 7}
{3 9}
{4 5}
{4 6}
{5 7}
{6 9}
{7 8}
{8 9}

Two things need to be done:

  1. make Singular.LibTropical.tropicalVariety callable from julia
  2. make OSCAR understand the return value

Currently I am still stuck at 1:

julia> R,(a,b,c,d,e,f,g,h,i,j) = QQ["a","b","c","d","e","f","g","h","i","j"];

julia> I = ideal([b*f-a*h-c*e, b*g-a*i-d*e, c*g-a*j-d*f, c*i-b*j-d*h, f*i-e*j-g*h]);

julia> Singular.LibTropical.tropicalVariety(I)
ERROR: unrecognized argument Ideal (-a*h + b*f - c*e, -a*i + b*g - d*e, -a*j + c*g - d*f, -b*j + c*i - d*h, -e*j + f*i - g*h)
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] prepare_argument(x::MPolyIdeal{QQMPolyRingElem})
   @ Singular ~/.julia/packages/Singular/C3EMh/src/caller.jl:358
 [3] (::Singular.var"#226#227")(i::MPolyIdeal{QQMPolyRingElem})
   @ Singular ./none:0
 [4] iterate
   @ ./generator.jl:47 [inlined]
 [5] collect(itr::Base.Generator{Tuple{MPolyIdeal{QQMPolyRingElem}}, Singular.var"#226#227"})
   @ Base ./array.jl:834
 [6] low_level_caller(lib::String, name::String, args::MPolyIdeal{QQMPolyRingElem})
   @ Singular ~/.julia/packages/Singular/C3EMh/src/caller.jl:389
 [7] tropicalVariety(args::MPolyIdeal{QQMPolyRingElem})
   @ Singular.LibTropical ~/.julia/packages/Singular/C3EMh/src/Meta.jl:44
 [8] top-level scope
   @ REPL[6]:1

Any help would be much appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions