application: atint

a-tint is an application for polymake (see http://polymake.mathematik.tu-darmstadt.de). It aims to implement algorithmic aspects of tropical intersection theory. Tropical varieties are realized as weighted polyhedral complexes. This project is part of and financed by the DFG Priority Project SPP 1489 (see also http://www.computeralgebra.de/index.php) For more information see https://bitbucket.org/hampe/atint/


imports from: common, graph
uses: fan, group, matroid, polytope, topaz

Objects

  •  

    A special case of a rational function, a tropical polynomial (using either min or max)

    derived from: RationalFunction

    Properties of MinMaxFunction

    •  
      •  
        CONSTANT_COEFFICIENTS: common::Vector<Rational>

        A vector of the constant coefficients of the function. The i-th entry is the constant term of the function represented by the i-th row of LINEAR_COEFFICIENTS.

      •  
        DOMAIN_DIMENSION: common::Int

        The dimension n of the domain Rn of the function. Is equal to the columns of LINEAR_COEFFICIENTS

      •  
        FUNCTION_MATRIX: common::Matrix<Rational, NonSymmetric>

        This is simply the concatenation of LINEAR_COEFFICIENTS and CONSTANT_COEFFICIENTS

      •  
        INPUT_STRING: common::String

        The syntax for STRING in pseudo-regex is the following (after deleting any whitespace): "(min|max)(\(|\{)(SUM)+(,SUM)*(\)|\})" where SUM = "(TERM)+([\+\-](TERM))*" where TERM = (RAT)|(RAT[:alpha:][^\+,\)]*) where RAT is any string that can be parsed to a polymake Rational and does not contain any letters. To make this more comprehensible: STRING takes anything of the form min(...) or max(...) (or min{...}, max{...}), where ... is a comma-separated list of strings of the form a + bx + cy + ... , where a,b,c are rational numbers and x,y are variables. Any string that starts with a letter and does not contain "+" or "," can be a variable. Such a sum can contain several such terms for the same variable and they need not be in any order. A term can be of the form "3x", "3*x", but "x3" will be interpreted as 1 * "x3". Coefficients should not contain letters, i.e. 3E10*x would be interpreted as 3 * "E10*x". Empty terms are allowed. If no INPUT_VARS are given, MinMaxFunction will recognize the dimension of the domain from the number of variables and will assign the variables to the standard basis vectors by sorting them alphabetically. E.g. INPUT_STRING=>"min(x+2z,3+z)",INPUT_VARS=>["x","y","z"] is a different function than INPUT_STRING=>"min(x+2z,3+z)", since the second is the function f:R² -> R, (a,b) -> min(a+2b,3+b) and the first is f: R³->R, (a,b,c)->min(a+2c,3+c) If however, INPUT_VARS is given, the parser will *ignore* any terms containing variables that are not defined in INPUT_VARS. The variables will be assigned to the standard basis vectors in order of their appearance in INPUT_VARS. E.g. INPUT_STRING=>"min(x+2c,3+x)",INPUT_VARS=>["x","y"] will give the function f:R²->R, (a,b) -> min(a,3+a) Note that ANY whitespace in INPUT_STRING is ignored, as well as any brackets '(',')' besides the ones enclosing the function list.

      •  
        INPUT_VARS: common::Array<String>

        A list of strings that are variables. Any string that starts with a letter (i.e. [a-zA-Z]) and does not contain '+' or ',' can be a variable. Illegal variable names will not cause an error, but the parser will not detect them in INPUT_STRING, so their coefficients will be 0. If you assign a value to this, only terms with variables in this array will be parsed. Note that ANY whitespace in a variable name will be ignored. The i-th element of this array will be assigned to the i-th standard basis vector. You might want to use input_vars for defining this property.

      •  
        LINEAR_COEFFICIENTS: common::Matrix<Rational, NonSymmetric>

        A matrix of the linear coefficients of the functions. Each row corresponds to a linear function within the min or max and the entry in column j is the coefficient of variable x_j

      •  
        NORMAL_FAN: WeightedComplex

        This computes the normal fan of the polytope conv( (c_i,a_i) ) in Q^{n+1}, where the function is max/min(a_i*x + c_i,i=1,..,k) with a_i in Q^n and c_i in Q. (For min it actually computes the negative of the normal fan)

      •  
        STANDARD_FORM: common::String

        This will give a nice string representation of the function, where all variables are of the form 'x_i', i = 1,..,DOMAIN_DIMENSION. There are no redundancies and terms are sorted in ascending alphabetic order of their variable, with the constant term at the end

      •  
        USES_MIN: common::Bool

        Indicates whether this function uses min (TRUE) or max (FALSE). The default (if you directly give a coefficient matrix, but not this value) is FALSE

    User Methods of MinMaxFunction

    •  
      •  
        linearityDomains () → WeightedComplex

        This computes the (homogenized version of the) domains of linearity of the function. More precisely, it computes the normal fan of the polytope defined by this function in the following way: If the standard form reads max(a_i*x + c_i,i=1,..,k) with a_i in Q^n and c_i in Q, then the polytope is conv( (c_i,a_i) ) in Q^{n+1} (in homog. coordinates its actually in n+2 coordinates). In fact, this simply returns the property DOMAIN. It is kept for backwards compatibility.

      •  
        pow (k) → MinMaxFunction

        Does the same as pow for RationalFunction, i.e. returns the same function but with a given internal power

        Parameters
        Intk
        The new power of this function, i.e. using it in a divisorial expression will be interpretes as applying it k times
        Returns
        MinMaxFunction
      •  
        valueAt (point) → Rational

        Computes the value of this function at a given point. If the point has dimension DOMAIN_DIMENSION, it simply computes the value. If it has dimension DOMAIN_DIMENSION +1, it assumes the point is given in homogeneous coordinates (i.e. the first coordinate should be one or zero, this is not checked, however) and computes the function value of the last DOMAIN_DIMENSION coordinates.

        Parameters
        Vector<Rational>point
        Returns
        Rational
        The function value at the given point.
    •  
      •  
        reduce () → MinMaxFunction

        Takes a MinMaxFunction and reduces its terms to the necessary ones. That means it computes the newton polytope and returns a function that has only terms corresponding to the vertices.

        Returns
        MinMaxFunction
        The reduced version of the function
  •  

    This represents a morphism as a "rational function to Rn", i.e. it is given via its DOMAIN and RAY_VALUES and LIN_VALUES now lying in some Rn instead of R. The user has to take care that the function is locally linear, this is not checked in any way.

    Properties of Morphism

    •  
      •  
        DOMAIN: WeightedComplex

        This property describes the domain of the morphism. I.e. the morphism is defined on this complex and is locally affine integral linear. It is of type WeightedComplex, but actually only the basic geometric properties RAYS/CMPLX_RAYS,MAXIMAL_CONES/CMPLX_MAXIMAL_CONES,LINEALITY_SPACE and USES_HOMOGENEOUS_C are of any interest. Further properties are ignored and can be omitted during generation.

      •  
        IS_GLOBAL: common::Bool

        Is TRUE, iff the morphism is a global affine linear integral map In this case, the morphism's description can be read off from the properties MATRIX and TRANSLATE. Setting any of these properties during initialization will make this TRUE by default.

      •  
        LIN_VALUES: common::Matrix<Rational, NonSymmetric>

        The vector in row i describes the function value (slope) of DOMAIN->LINEALITY_SPACE->row(i)

      •  
        MATRIX: common::Matrix<Rational, NonSymmetric>

        If the morphism is a global affine linear map x |-> Ax+v, i.e. IS_GLOBAL is or should be true, then this contains the matrix A (in non-homog. coordinates). If TRANSLATE is set, but this property is not set, then it is the identity by default.

      •  
        RAY_VALUES: common::Matrix<Rational, NonSymmetric>

        The vector at row i describes the function value of ray DOMAIN->CMPLX_RAYS->row(i). More precisely, if the corresponding ray is a vertex, it describes its function value. If it is a directional ray, it describes the slope on that ray.

      •  
        TRANSLATE: common::Vector<Rational>

        If the morphism is a global affine linear map x |-> Ax+v, i.e. IS_GLOBAL is or should be true, then this contains the translation vector v (in non-homog. coordinates). If MATRIX is set, but this property is not set, then it is the zero vector by default.

    User Methods of Morphism

    •  
      •  
        after (g) → Morphism

        Computes the composition of this morphism with another morphism. The other morphism should either be global and surjective or its image should be contained in the DOMAIN of this morphism

        Parameters
        Morphismg
        Another morphism.
        Returns
        Morphism
        The composition "this after g" (The converse composition is computed using "before")
      •  
        before (g) → Morphism

        Computes the composition of another morphism with this morphism. This morphism should either be global and surjective or its image should be contained in the DOMAIN of the other morphism

        Parameters
        Morphismg
        Another morphism.
        Returns
        Morphism
        The composition "g after this" (The converse composition is computed using "after")
      •  
        homogenize ()

        If the domain of the function is in homogeneous coordinates, it returns the function. Otherwise it homogenizes the domain and assigns the value (0,..,0) to the additional vertex at the origin

      •  
        restrict (f, domain) → Morphism

        Restricts a morphism / rational function to a given domain (which should be contained in the DOMAIN of the function)

        Parameters
        Morphismf
        (or RationalFunction) The function to be restricted
        WeightedComplexdomain
        The domain to which the function should be restricted
        Returns
        Morphism
        or RationalFunction The restricted function
    •  
      •  
        BB_VISUAL ()

        Visualizes the domain of the morphism. Works exactly as BB_VISUAL of WeightedComplex, but has additional option @options

        Options
        StringFunctionLabels
        If set to "show", textual function representations are diplayed on cones. False by default
        option list:Visual::WeightedComplex::FunctionDecorations
  •  

    An n-marked rational curve, identified by its SETS, i.e. its partitions of {1,...,n} and its COEFFS, i.e. the length of the corresponding edge

    Properties of RationalCurve

    •  
      •  
        COEFFS: common::Vector<Rational>

        A list of positive rational coefficients. The list should have the same length as SETS and contain only entries > 0. The i-th entry then gives the length of the bounded edge defined by the i-th partition. If you're not sure if all your coefficients are > 0, use INPUT_SETS and INPUT_COEFFS instead. Note that the zero curve (i.e. no bounded edges, only leaves) is represented by one empty set with corresponding lenghth 0.

      •  
        N_LEAVES: common::Int

        The number of leaves of the rational curve.

      •  
        SETS: common::IncidenceMatrix<NonSymmetric>

        A list of partitions of [n] that define the tree of the curve: For each bounded edge we have the corresponding partition of the n leaves. These should be irredundant. If you want to input a possibly redundant list, use INPUT_SETS and INPUT_COEFFS instead. The number of marked leaves should always be given by N_LEAVES. The sets are subsets of {1,...,n} (NOT {0,..,n-1}!) Note that the zero curve (i.e. no bounded edges, only leaves) is represented by one empty set with corresponding lenghth 0.

    •  
      •  
        GRAPH: graph::Graph<Undirected>

        Contains the abstract graph (non-metric) corresponding to the curve. All unbounded leaves are modelled as bounded edges. The vertices at the ends of the "leaves" are always the first N_LEAVES vertices.

      •  
        GRAPH_EDGE_LENGTHS: common::Vector<Rational>

        Contains the lengths of the edges of GRAPH that represent bounded edges of the curve. The coefficients appear in the order that the corr. edges appear in EDGES.

      •  
        NODES_BY_LEAVES: common::IncidenceMatrix<NonSymmetric>

        This incidence matrix gives a list of the vertices of the curve Each row corresponds to a vertex and contains as a set the [[LEAVES] that are attached to that vertex (again, counting from 1!)

      •  
        NODES_BY_SETS: common::IncidenceMatrix<NonSymmetric>

        This incidence matrix gives a list of the vertices of the curve Each row corresponds to a vertex and contains as a set the row indices of the SETS that correspond to edges attached to that vertex

      •  
        NODE_DEGREES: common::Vector<Int>

        This gives a list of the vertices of the curve in terms of their valences They appear in the same order as in NODES_BY_LEAVES or NODES_BY_SETS

    •  
      •  
        INPUT_COEFFS: common::Vector<Rational>

        Same as COEFFS, except that entries may be <=0. This should have the same length as INPUT_SETS.

      •  
        INPUT_SETS: common::IncidenceMatrix<NonSymmetric>

        Same as SETS, except that sets may appear several times.

      •  
        INPUT_STRING: common::String

        This property can also be used to define a rational curve: A linear combination of partitions is given as a string, using the following syntax: A partition is given as a subset of {1,..,n} and written as a comma-separated list of leaf indices in round brackets, e.g. "(1,2,5)" A linear combination can be created using rational numbers, "+","+" and "-" in the obvious way, e.g. "2*(1,2,5) + 1*(3,4,7) - 2(1,2) (The "*" is optional) Of course, each set should contain at least two elements. If you don't specify N_LEAVES, it is set to be the largest leaf index occuring in the sets. Partitions needn't be irredundant and coefficients can be any rational number. If the resulting element is not in the moduli space, an error is thrown.

    User Methods of RationalCurve

    •  
      •  
        matroid_vector () → Vector<Rational>

        Computes the coordinates of the curve in the moduli space given in matroid coordinates. In the isomorphism of the metric curve space and the moduli coordinates the last leaf is considered as the special leaf

      •  
        metric_vector ()

        Returns the (n over 2) metric vector of the rational n-marked curve

    •  
      •  
        VISUAL ()

        Visualizes a RationalCurve object. This visualization uses the VISUAL method of its GRAPH, so it accepts all the options of Visual::Graph::decorations. In addition it has another option @options

        Options
        StringLengthLabels
        If "hidden", the edges are not labelled with their lengths. Any other text is ignored. Not set to "hidden" by default.
        option list:Visual::RationalCurve::decorations
  •  

    A rational function on a polyhedral complex. It is given by its DOMAIN, a WeightedComplex and values on this domain, i.e. RAY_VALUES and LIN_VALUES

    Properties of RationalFunction

    •  
      •  
        DOMAIN: WeightedComplex

        This property describes the linearity domains of the function. I.e. the function is affine integral linear on each maximal cone of DOMAIN. It is of type WeightedComplex, but actually only the basic geometric properties RAYS/CMPLX_RAYS,MAXIMAL_CONES/CMPLX_MAXIMAL_CONES,LINEALITY_SPACE and USES_HOMOGENEOUS_C are of any interest. Further properties are ignored and can be omitted upon generation.

      •  
        LIN_VALUES: common::Vector<Rational>

        The value at index i describes the function value of DOMAIN->LINEALITY_SPACE->row(i)

      •  
        POWER: common::Int

        This property describes how many times a function should be applied, if it occurs in a divisor term E.g. if you create a MinMaxFunction f and you set its POWER property to 2, a call to divisor(X,f) actually computes f*f*X

      •  
        RAY_VALUES: common::Vector<Rational>

        The value at index i describes the function value of ray DOMAIN->CMPLX_RAYS->row(i). More precisely, if the corresponding ray is a vertex, it describes its function value. If it is a directional ray, it describes the slope on that ray.

    User Methods of RationalFunction

    •  
      •  
        homogenize ()

        If the domain of the function is in homogeneous coordinates, it returns the function. Otherwise it homogenizes the domain and assigns the value 0 to the additional vertex at the origin

      •  
        pow (k) → Returns

        This creates a RationalFunction from this one, simply by changing the power

        Parameters
        Intk
        Returns
        Returns
        the function f with a power set to k. Note that the original power of f is ignored.
    •  
      •  
        BB_VISUAL ()

        Visualizes the domain of the function. Works exactly as BB_VISUAL of WeightedComplex, but has additional option @options

        Options
        StringFunctionLabels
        If set to "show", textual function representations are diplayed on cones. False by default
        option list:Visual::WeightedComplex::FunctionDecorations
  •  

    A weighted complex, derived from fan::PolyhedralFan. Complexes are realized by using homogeneous coordinates (i.e. adding a 1 to the front of all vertices and a 0 to all rays) and setting USES_HOMOGENEOUS_C to true

    derived from: fan::PolyhedralFan<Rational>

    Properties of WeightedComplex

    •  
      •  
        INPUT_HOM_LINEALITY: common::Matrix<Rational, NonSymmetric>

        USE IS NOT RECOMMENDED, since TROPICAL_WEIGHTS are always given with respect to MAXIMAL_CONES anyway. A matrix of generators of the lineality space, but in homogeneous coordinates (i.e. x0 should be 0, otherwise this throws an error). This should be used *instead of* INPUT_LINEALITY / LINEALITY_SPACE

      •  
        INPUT_HOM_RAYS: common::Matrix<Rational, NonSymmetric>

        USE IS NOT RECOMMENDED, since TROPICAL_WEIGHTS are always given with respect to MAXIMAL_CONES anyway. A matrix of the rays of the fan. This should be used *instead of* INPUT_RAYS, if the coordinates of the fan should be interpreted as homogeneous coordinates and the fan as the complex at x0 = 1. The input rays are normalized to x0 = 1 and the fan is then initialized with the normalized rays as INPUT_RAYS. INPUT_CONES can be combined with this as usual. If your rays are already homogenized and you are sure they are also your rays, you can directly put this into RAYS and manually set USES_HOMOGENEOUS_C=>TRUE

    •  
      •  
        IS_UNIMODULAR: common::Bool

        This property is not computed anywhere but should be set to TRUE by the user upon initialization, if all cones of the fan are unimodular in the sense that ANY linearly independent subset of their rays generates the lattice of the cone. Note that this property is only considered if USES_HOMOGENEOUS_C is false. If USES_HOMOGENEOUS_C is true, this property is implicitly assumed to be false. If this property is TRUE, LATTICE_GENERATORS and LATTICE_BASES can be computed much faster.

      •  
        LATTICE_BASES: common::IncidenceMatrix<NonSymmetric>

        This incidence matrix gives a lattice basis for each maximal cone. More precisely it gives a lattice basis whose span contains the lattice of the maximal cone. Row i corresponds to cone i and gives lattice generator indices referring to LATTICE_GENERATORS If this property is computed via rules, it does indeed give a lattice basis for the cone lattice, but when it is computed during an operation like refinement or divisor it will in general be larger. If this property exists, lattice normals might be computed faster. If you create a variety with the property IS_UNIMODULAR set to TRUE, then this will simply be a copy of MAXIMAL_CONES

      •  
        LATTICE_GENERATORS: common::Matrix<Integer, NonSymmetric>

        This is an irredundant list of all lattice generators of all maximal cones If this property exists, lattice normals might be computed faster If you create a variety with the property IS_UNIMODULAR set to TRUE, then this will simply be a copy of RAYS (made primitive integer)

      •  
        LATTICE_NORMALS: common::Map<Int, Map<Int, Vector<Integer>>>

        A list of lattice normal vectors. They are associated to the faces and maximal cones in the following way: For codimension one face i and adjacent maximal cone j, the element LATTICE_NORMALS->{i}->{j} is the corresp. lattice normal vector. There is a convenience method lattice_normal(i,j) If USES_HOMOGENEOUS_C is TRUE, this actually computes a lattice normal of the cone (face i)\cap {x0 =1} wrt the cone (maximal cone j) \cap {x0=1} to ensure that the normal is of the form (0,...) If there is a LOCAL_RESTRICTION, only lattice normals for compatible codim one faces are computed (naturally, since CODIM_1_FACES only contains those)

      •  
        LATTICE_NORMAL_FCT_VECTOR: common::Map<Int, Map<Int, Vector<Rational>>>

        For each lattice normal vector, this gives a vector of length (number of rays) + (lineality dim.), such that if a rational function is given by values on the rays and lin space generators, the value of the corresponding normal LATTICE_NORMALS->{i}->{j} can be computed by multiplying the function value vector with the vector LATTICE_NORMAL_FCT_VECTOR->{i}->{j}. This is done in the following way: If this fan does not use homogeneous coordinates, it computes a representation of the lattice normal in the generating system consisting of the rays of MAXIMAL_CONES->row(j) and the generators of the lineality space. It then inserts the coefficients of the representation at the right position. If the fan uses homog. coordinates, however, we use a different generating system (and indices refer to CMPLX_RAYS) <(r_i-r_0)_i>0, s_j, l_k>, where r_0 is the ray of the maximal cone with the lowest index in CMPLX_RAYS, such that it fulfills x0 = 1, r_i are the remaining rays with x0 = 1, ordered according to their index in CMPLX_RAYS, s_j are the rays of the cone with x0 = 0 and l_k are the lineality space generators. We will then store the coefficients a_i of (r_i - r_0) at the index of r_i, then - sum(a_i) at the index of r_0 and the remaining coefficients at the appropriate places. In particular, the value of a lattice normal under a rational function can be computed simply by taking the scalar product of RAY_VALUES | LIN_VALUES with ist FCT_VECTOR

      •  
        LATTICE_NORMAL_SUM: common::Matrix<Rational, NonSymmetric>

        Rows of this matrix correspond to CODIM_1_FACES, and each row contains the weighted sum: sum_{cone > codim-1-face}( weight(cone) * LATTICE_NORMALS->{codim-1-face}->{cone})

      •  
        LATTICE_NORMAL_SUM_FCT_VECTOR: common::Matrix<Rational, NonSymmetric>

        Rows of this matrix correspond to CODIM_1_FACES (or CMPLX_CODIM_1_FACES in the homog. case), and each row contains a function vector for the corresponding row of LATTICE_NORMAL_SUM. This function vector is computed in the same way as described under LATTICE_NORMAL_FCT_VECTOR. Note that for any codim-1-faces at which the complex is not balanced, the corresponding row is a zero row If a face is balanced can be checked under BALANCED_FACES.

    •  
      •  
        CMPLX_AMBIENT_DIM: common::Int

        Returns the ambient dimension of the polyhedral complex. In the case of non-homogeneous coordinates, this is just FAN_AMBIENT_DIM, otherwise FAN_AMBIENT_DIM-1

      •  
        CMPLX_CODIMENSION: common::Int

        Returns the codimension of the polyhedral complex in its ambient vector space. More precisely, this value is equal to CMPLX_AMBIENT_DIM - CMPLX_DIM

      •  
        CMPLX_CODIM_1_FACES: common::IncidenceMatrix<NonSymmetric>

        An incidence matrix describing which codim 1 cone in the complex at x0 = 1 is generated by which rays. Each row corresponds to a codimension one cone (More precisely, the i-th element represents the same codim 1 cone as the i-th element of CODIM_1_FACES). The indices in a row refer to rows of CMPLX_RAYS, i.e. the cone cone described by the i-th element is generated by the rays corresponding to these row indices. If the fan does not use homogeneous coordinates, it is just a copy of CODIM_1_FACES.

      •  
        CMPLX_CONES: common::IncidenceMatrix<NonSymmetric>

        This incidence matrix describes the complete polyhedral complex, i.e. it contains all faces of the polyhedral complex

      •  
        CMPLX_CONVERSION_VECTOR: common::Vector<Int>

        A vector with an entry for each row in CMPLX_RAYS. More precisely, the i-th entry gives the row index of the ray in RAYS that is equal to the i-th row of CMPLX_RAYS.

      •  
        CMPLX_DIM: common::Int

        Returns the dimension of the polyhedral complex. In the case of non-homogeneous coordinates, this is just DIM, otherwise DIM-1. When computing this property, it is assumed that the complex is pure.

      •  
        CMPLX_MAXIMAL_CONES: common::IncidenceMatrix<NonSymmetric>

        An incidence matrix describing which maximal cone in the complex at x0 = 1 is generated by which rays. Each row corresponds to a maximal cone (More precisely, the i-th element represents the same maximal cone as the i-th element of MAXIMAL_CONES). The indices in a row refer to rows of CMPLX_RAYS, i.e. the maximal cone described by the i-th element is generated by the rays corresponding to these row indices. If the fan does not use homogeneous coordinates, it is just a copy of MAXIMAL_CONES

      •  
        CMPLX_RAYS: common::Matrix<Rational, NonSymmetric>

        If the fan does not use homogeneous coordinates, this is just a copy of RAYS and actually needn't be requested. Otherwise this computes a matrix of rays of the complex obtained by intersecting the fan with {x0 = 1}. More precisely, each ray r from RAYS occurs as a row in this matrix... - once, if r_0 = 1 - k times, if r_0 = 0 and k is the number of equivalence classes of maximal cones containing r with respect to the following relation: Two maximal cones m, m' containing r are equivalent, if they are equal or there exists a sequence of maximal cones m = m_1,...m_r = m', such that r is contained in each m_i and each intersection m_i cap m_i+1 contains at least one ray s with s_0 = 1. The reason for this is that, when specifying a piecewise affine linear function on a polyhedral complex, the same directional ray with x0 = 0 might be assigned two different values, if it is contained in two "non-connected" maximal cones (where connectedness is to be understood as described above). If there is a LOCAL_RESTRICTION the above equivalence relation is changed in such a way that the affine ray s with s_0 = 1 that must be contained in the intersection of two subsequent cones must be a compatible ray

      •  
        CODIM_1_FACES: common::IncidenceMatrix<NonSymmetric>

        An incidence matrix of all codimension one faces. Each row is a face and column indices refer to RAYS. If the fan uses homogeneous coordinates, only those faces that intersect {x0 = 1} are listed here. If there is a LOCAL_RESTRICTION, only compatible codimension one faces are kept.

      •  
        CODIM_1_IN_MAXIMAL_CONES: common::IncidenceMatrix<NonSymmetric>

        An incidence matrix indicating which codim 1 faces are contained in which maximal cone. Rows refer to (rows of) CODIM_1_FACES, columns to (rows of) MAXIMAL_CONES

      •  
        DIRECTIONAL_RAYS: common::Set<Int>

        Computes the subset of row indices of RAYS, such that the corresponding rows describe a directional ray of the complex. This set contains all row indices if USES_HOMOGENEOUS_C is false and is the complement of VERTICES

      •  
        LOCAL_RESTRICTION: common::IncidenceMatrix<NonSymmetric>

        This contains a list of sets of ray indices (referring to RAYS). All of these sets should describe cones of the polyhedral complex (though not necessarily maximal ones). A cone is now called compatible with this property, if contains one of these cones If this list is not empty, all computations will be done only on (or around) compatible cones. The documentation of each property will explain in what way this restriction is enforced. If this list is empty or not defined, there is no restriction. Careful: The implementation assumes that ALL maximal cones are compatible. If in doubt, you can create a complex with a local restriction from a given complex by using one of the "local_..." creation methods This list is assumed to be irredundant, i.e. there are no doubles (though this should not break anything, it is simply less efficient). It is, however, possible that one element is a subset of another.

      •  
        USES_HOMOGENEOUS_C: common::Bool

        Indicates whethere this fan's coordinates should be interpreted as affine coordinates or as homogeneous coordinates. In the latter case the fan would actually represent the polyhedral complex that comes from intersecting the fan (in affine coordinates) with the affine hyperplane x0 = 1. This property should not be set manually. It will be set as true, if INPUT_HOM_RAYS or INPUT_HOM_LINEALITY are used and to false, if INPUT_RAYS or INPUT_LINEALITY are used.

      •  
        VERTICES: common::Set<Int>

        Computes the subset of row indices of RAYS, such that the corresponding rows describe a vertex of the complex. This set is empty if USES_HOMOGENEOUS_C is false and is the complement of DIRECTIONAL_RAYS

    •  
      •  
        BALANCED_FACES: common::Vector<Bool>

        A vector whose entries correspond to the rows of CODIM_1_FACES. The i-th entry is true, if and only if the complex is balanced at that face

      •  
        DEGREE: common::Integer

        The degree of the tropical variety, i.e. the weight of the intersection product with an appropriate tropical linear space.

      •  
        IS_BALANCED: common::Bool

        Indicates whether the fan is balanced with the given TROPICAL_WEIGHTS. If there is a LOCAL_RESTRICTION, this will only be checked at the compatible codim one faces.

      •  
        IS_IRREDUCIBLE: common::Bool

        Whether this complex is irreducible.

      •  
        TROPICAL_WEIGHTS: common::Vector<Integer>

        Vector of (integer) weights for maximal cones. Indices refer to (the rows of) MAXIMAL_CONES Note that, if the fan only consists of a lineality space, it specifies the weight of the single empty maximal cone

      •  
        WEIGHT_CONE: polytope::Cone<Rational>

        The intersection of WEIGHT_SPACE with the positive orthant.

      •  
        WEIGHT_SPACE: common::Matrix<Integer, NonSymmetric>

        A Z-basis (as rows) for the space of weight distributions on this tropical cycle making it balanced (i.e. this cycle is irreducible, if and only if WEIGHT_SPACE has only one row and the gcd of TROPICAL_WEIGHTS is 1.

      •  
        WEIGHT_SYSTEM: common::Matrix<Rational, NonSymmetric>

        The dual of WEIGHT_SPACE.

    •  
      •  
        GLUING_FACES: common::Map<Set<Int>, Set<Int>>

        Not used at the moment

    User Methods of WeightedComplex

    •  
      •  
        lattice_normal (i, j) → The

        Convenience method, returns LATTICE_NORMALS->{i}->{j}

        Parameters
        Inti
        The index of the facet
        Intj
        The index of the maximal cone
        Returns
        The
        lattice normal vector of cone j wrt. facet i
    •  
      •  
        dehomogenize ()

        Assuming that this weighted complex is actually a fan, given in homogeneous coordinates, it will convert it to non-homogeneous coordinates. This will return an error, if the complex has more than one vertex. Local restriction is also adapted.

      •  
        homogenize () → If

        Transforms the fan into homogeneous coordinates

        Returns
        If
        this fan uses homog. coordinates, returns the fan itself, Otherwise it will replace the ray matrix by the following matrix: [0,ray] for any ray of the original fan and one affine ray [1,0,...0] appended. In MAXIMAL_CONES all get the additional affine ray and TROPICAL WEIGHTS is simply copied. Local restriction is adapted as well.
    •  
      •  
        invert () → WeightedComplex

        Takes a WeightedComplex and multiplies all rays / vertices with -1.

        Returns
        WeightedComplex
        w The inverted complex
    •  
    •  
      •  
        BB_VISUAL ()

        Displays a (possibly weighted) polyhedral complex by intersecting it with a bounding box. This bounding box is either defined by the vertices of the complex and the option "BoundingDistance" or explicitly given by "BoundingBox" and by setting "BoundingMode" to "absolute" @options

        Options
        StringWeightLabels
        If "hidden", no weight labels are displayed. Not hidden by default.
        StringCoordLabels
        If "show", coordinate labels are displayed at vertices. Hidden by default.
        StringBoundingMode
        Can be "relative" (intersects with the bounding box returned by the method boundingBox(BoundingDistance)) or "absolute" (intersects with the given BoundingBox). "relative" by default.
        RationalBoundingDistance
        The distance parameter for relative bounding mode
        Matrix<Rational>BoundingBox
        The bounding parameter for absolute bounding mode
        option list:Visual::WeightedComplex::BoundingDecorations
      •  
        boundingBox (distance) → Matrix<Rational>

        Takes a tropical variety and a (positive) Rational as input and computes the relative bounding box of the visualization with the Rational as BoundingDistance. I.e. will compute for each coordinate the minimum and maximum over all vertices and then add/substract the parameter distance. This is returned as a matrix. (see also the description of BB_VISUAL),

        Parameters
        Rationaldistance
        The distance of the bounding box from the affine part of the variety (Can also be a standard perl number type)
        Returns
        Matrix<Rational>
        A 2xCMPLX_AMBIENT_DIM-matrix specifying the bounding box (it can be used as input for BoundingBox in BB_VISUAL)
      •  
        CMPLX_VISUAL ()

        DEPRECATED. Use BB_VISUAL instead. Displays a weighted polyhedral complex in ambient dimension up to 3 (4 in homog. coordinates) by visualizing all its cells in the following way: For each cell, every directional ray is added to every affine ray (which is only the origin in the non-homog. case) and the resulting polytope is displayed. The visualization has the following options: @options

        Options
        RationalDirScale
        A rational number with which the directional rays are multiplied before added to the affine rays
        StringWeightLabels
        if set to "hidden", the labels indicating the weights are hidden
        StringCoordLabels
        If set to "show", the labels indicating the vertex coordinates are displayed, otherwise they are not. Note that this is expensive and significantly increases computation time.
        option list:Visual::WeightedComplex::decorations

User Functions

  •  
    •  
      curve_graph_from_metric (v) → An

      Takes a vector from Q^(n over 2) that describes an n-marked rational abstract curve as a distance vector between its leaves. It then computes the graph of the curve corresponding to this vector.

      Parameters
      Vector<Rational>v
      A vector of length (n over 2). Its entries are interpreted as the distances d(i,j) ordered lexicographically according to i,j. However, they need not be positive, as long as v is equivalent to a proper metric modulo leaf lengths.
      Returns
      An
      array containing first the graph::Graph and then a Vector<Rational>, containing the lengths of the bounded edges (in the order they appear in EDGES)
    •  
      insert_leaves (curve, nodes)

      Takes a RationalCurve and a list of node indices. Then inserts additional leaves (starting from N_LEAVES+1) at these nodes and returns the resulting RationalCurve object

      Parameters
      RationalCurvecurve
      A RationalCurve object
      Vector<Int>nodes
      A list of node indices of the curve
    •  
      rational_curve_embedding (delta, type) → WeightedComplex

      This function creates an embedding of a rational tropical curve using a given abstract curve and degree

      Parameters
      Matrix<Rational>delta
      The degree of the curve in non-homogeneous coordinates. The number of rows should correspond to the number of leaves of type and the number of columns is the dimension of the space in which the curve should be realized
      RationalCurvetype
      An abstract rational curve
      Returns
      WeightedComplex
      The corresponding embedded complex, weighted with 1. The position of the curve is determined by the first node, which is always placed at the origin
    •  
      rational_curve_from_cone (X, n_leaves, coneIndex) → RationalCurve

      This takes a weighted complex X that is supposed to be of the form M_0,n x Y for some Y (It assumes that M_0,n occupies the first coordinates) and an index of a maximal cone of that complex. It then computes a rational curve corresponding to an interior point of that cone (ignoring the second component Y)

      Parameters
      WeightedComplexX
      A weighted complex of the form M_0,n x Y
      Intn_leaves
      The n in M_0,n. Needed to determine the dimension of the M_0,n component
      IntconeIndex
      The index of the maximal cone
      Returns
      RationalCurve
      c The curve corresponding to an interior point
    •  
      rational_curve_from_metric (v) → RationalCurve

      Takes a vector from Q^(n over 2) that describes an n-marked rational abstract curve as a distance vector between its leaves. It then computes the curve corresponding to this vector.

      Parameters
      Vector<Rational>v
      A vector of length (n over 2). Its entries are interpreted as the distances d(i,j) ordered lexicographically according to i,j. However, they need not be positive, as long as v is equivalent to a proper metric modulo leaf lengths.
      Returns
      RationalCurve
    •  
      rational_curve_from_moduli (v) → RationalCurve

      Takes a vector from Q^((n over 2) - n) that lies in M_0,n (in its matroid coordinates and computes the corresponding rational curve. In the isomorphism of the metric curve space and the moduli coordinates the last leaf is considered as the special leaf

      Parameters
      Vector<Rational>v
      A vector in the moduli space
      Returns
      RationalCurve
    •  
      rational_curve_from_rays (rays, uses_homog) → RationalCurve

      This takes a matrix of rays of a given cone that is supposed to lie in a moduli space M_0,n and computes the rational curve corresponding to an interior point. More precisely, if there are k vertices in homogeneous coordinates, it computes 1/k * (sum of these vertices), then it adds each directional ray. It then returns the curve corresponding to this point

      Parameters
      Matrix<Rational>rays
      The rays of the cone, in homog. or non-homog. coordinates.
      Booluses_homog
      Whether the rays are given in homog. coordinates False by default
      Returns
      RationalCurve
      c The curve corresponding to an interior point
    •  
      rational_curve_list_from_metric (m) → RationalCurve

      Takes a matrix whose rows are metrics of rational n-marked curves. Returns a list, where the i-th element is the curve corr. to the i-th row in the matrix

      Parameters
      Matrix<Rational>m
      Returns
      RationalCurve
      : An array of RationalCurves
    •  
      rational_curve_list_from_moduli (m) → RationalCurve

      Takes a matrix whose rows are elements in the moduli space M_0,n in matroid coordinates. Returns a list, where the i-th element is the curve corr. to the i-th row in the matrix

      Parameters
      Matrix<Rational>m
      Returns
      RationalCurve
      : An array of RationalCurves
    •  
      sum_curves (An, v) → RationalCurve

      This function takes a vector of coefficients a_i and a list of RationalCurves c_i and computes sum(a_i * c_i). In particular, it also checks, whether the result lies in M_0,n. If not, it returns undef

      Parameters
      RationalCurveAn
      arbitrary list of RationalCurve objects
      Vector<Rational>v
      A list of coefficients. Superfluous coefficients are ignored, missing ones replaced by +1(!)
      Returns
      RationalCurve
      The linear combination of the curves defined by the coefficients or undef, if the result is not in M_0,n. The history of the operation is kept in INPUT_SETS and INPUT_COEFFS
    •  
      testFourPointCondition (v) → Int

      Takes a metric vector in Q^{(n over 2)} and checks whether it fulfills the four-point condition, i.e. whether it lies in M_0,n. More precisely it only needs to be equivalent to such a vector

      Parameters
      Vector<Rational>v
      The vector to be checked
      Returns
      Int
      A quadruple (array) of indices, where the four-point condition is violated or an empty list, if the vector is indeed in M_0,n
  •  
    •  
      affineTransformation (complex, translate, matrix) → WeightedComplex

      Takes a polyhedral complex and applies an affine linear transformation, given by a translate vector and a matrix. The method assumes the function is bijective (on the complex) and preserves cones, i.e. it just applies the transformation to the rays and lineality space and leaves the cones and weights unchanged.

      Parameters
      WeightedComplexcomplex
      The complex to be transformed
      Vector<Rational>translate
      A vector whose dimension should be equal to the column dimension of the transformation matrix
      Matrix<Integer>matrix
      An integer matrix
      Returns
      WeightedComplex
      The transformed complex, in homogeneous coordinates
    •  
      coarsen (complex) → WeightedComplex

      Takes a tropical variety on which a coarsest polyhedral structure exists and computes this structure.

      Parameters
      WeightedComplexcomplex
      A tropical variety which has a unique coarsest polyhedral structre
      Returns
      WeightedComplex
      The corresponding coarse complex
    •  
      fan_decomposition (complex) → perl::ListReturn

      Take a polyhedral complex and returns a list of all the local vertex fans, i.e. for each affine ray r, the list contains the fan Star_complex(r) (in non-homogeneous coordinates) If the complex has a non-trivial LOCAL_RESTRICTION, only the local fans at compatible vertices are computed

      Parameters
      WeightedComplexcomplex
      A tropical variety
      Returns
      perl::ListReturn
      A list of WeightedComplex objects in non-homogeneous coordinates. The i-th complex corresponds to the i-th affine ray ( vertex). If the complex is not in homogeneous coordinates, the list contains just the complex itself
    •  
      insert_rays (F, R) → WeightedComplex

      Takes a polyhedral fan wihtout lineality and a list of rays and triangulates the fan such that it contains these rays

      Parameters
      WeightedComplexF
      A polyhedral fan (i.e. USES_HOMOGENEOUS_C = FALSE), possibly with weights but with no lineality space
      Matrix<Rational>R
      A list of normalized rays (as row vectors), which will be added to the fan
      Returns
      WeightedComplex
      A triangulation of F that contains all the original rays of F plus the ones in R
    •  
      intersect_complete_fan ()

      DEPRECATED. Use intersect_container instead.

    •  
      intersect_container (fan, container, forceLatticeComputation) → WeightedComplex

      Takes two fans and computes the intersection of both. The function relies on the fact that the latter fan contains the first fan to compute the refinement correctly The function copies TROPICAL_WEIGHTS and LATTICE_BASES if they exist

      Parameters
      WeightedComplexfan
      An arbitrary weighted polyhedral fan
      fan::PolyhedralFancontainer
      A polyhedral fan containing the first one (as a set)
      BoolforceLatticeComputation
      Whether the properties LATTICE_BASES and LATTICE_GENERATORS of fan should be computed before refining. False by default.
      Returns
      WeightedComplex
      The intersection of both fans (whose support is equal to the support of fan). The resulting fan uses homogeneous coordinates if and only fan does. If fan has a property TROPICAL_WEIGHTS, the tropical weights of the refinement are also computed. If fan is zero-dimensional (i.e. a point), fan is returned.
    •  
      product_complex (A) → the

      Computes the cartesian product of a set of polyhedral fans. If any of them uses homogeneous coordinates, so will the result

      Parameters
      complexesA
      list of WeightedComplex objects
      Returns
      the
      cartesian product of the complexes. If any of the complexes use homogeneous coordinates, so does the result. If any of the complexex carries weights, the result carries the sum of the weights of its factors (Complexes without weights are treated as complexes with weight 1). If you want to compute the properties LATTICE_BASES and LATTICE_GENERATORS as cartesian products of the corr. properties of the complexes, use product_complex_lattice instead.
    •  
      product_complex_lattice (A) → the

      Computes the cartesian product of a set of polyhedral fans. If any of them uses homogeneous coordinates, so will the result

      Parameters
      complexesA
      list of WeightedComplex objects
      Returns
      the
      cartesian product of the complexes. If any of the complexes use homogeneous coordinates, so does the result. If any of the complexex carries weights, the result carries the sum of the weights of its factors (Complexes without weights are treated as complexes with weight 1). This function will precompute the properties LATTICE_BASES and LATTICE_GENERATORS for all complexes and the result will have the corr. properties set to the cartesian product of these
    •  
      recession_fan (complex) → WeightedComplex

      Computes the recession fan of a tropical variety. WARNING: This is a highly experimental function. If it works at all, it is likely to take a very long time.

      Parameters
      WeightedComplexcomplex
      A tropical variety. If it is a fan, the complex itself is returned
      Returns
      WeightedComplex
      A tropical fan, the recession fan of the complex
    •  
      skeleton_complex (fan, k, preserveRays) → The

      Takes a polyhedral complex and computes the k-skeleton. Will return an empty fan, if k is larger then the dimension of the given complex or smaller than 0.

      Parameters
      WeightedComplexfan
      A fan (or polyhedral complex)
      Intk
      The dimension of the skeleton that should be computed
      BoolpreserveRays
      When true, the function assumes that all rays of the fan remain in the k-skeleton, so it just copies the RAYS, instead of computing an irredundant list. This property can always be set to true, if fan is not in homogeneous coordinates or if the corresponding complex at x0 = 1 only has vertices. By default, this property is false.
      Returns
      The
      k-skeleton of the fan (or complex, if USES_HOMOGENEOUS_C is true)
    •  
      triangulateFan (F) → WeightedComplex

      Takes a polyhedral fan and computes a triangulation

      Parameters
      WeightedComplexF
      A polyhedral fan (i.e. USES_HOMOGENEOUS_C = FALSE), possibly with weights
      Returns
      WeightedComplex
      A simplicial refinement of F
    •  
      wfan (fan, homog) → WeightedComplex

      This function takes a fan::PolyhedralFan and converts it into a WeightedComplex object.

      Parameters
      fan::PolyhedralFanfan
      The fan to be converted
      Boolhomog
      Whether the fan is to be interpreted in homogeneous coordinates
      Returns
      WeightedComplex
      A complex with no weights but with the same geometry as fan.
  •  
    •  
      check_cycle_equality (X, Y, check_weights) → Bool

      This takes two pure-dimensional polyhedral complexes and checks if they are equal i.e. if they have the same lineality space, the same rays (modulo lineality space) and the same cones. Optionally, it can also check if the weights are equal

      Parameters
      WeightedComplexX
      A weighted complex
      WeightedComplexY
      A weighted complex
      Boolcheck_weights
      Whether the algorithm should check for equality of weights. This parameter is optional and true by default
      Returns
      Bool
      Whether the cycles are equal
    •  
      contains_point (complex, point) → bool

      Takes a weighted complex and a point and computed whether that point lies in the complex

      Parameters
      perl::Objectcomplex
      A weighted complex
      Vector<Rational>point
      An arbitrary vector in the same ambient dimension as complex
      Returns
      bool
      Whether the point lies in the support of complex
    •  
      is_zerocycle (c) → Bool

      Checks whether a cycle is the 0 cycle

      Parameters
      WeightedComplexc
      Returns
      Bool
  •  
    •  
      halfspace_complex (constant, equation) → WeightedComplex

      Creates the halfspace complex defined by an rational vector g and a rational b, i.e. the complex consisting of the two maximal cones g >= a and g <= a

      Parameters
      Rationalconstant
      The constant translation a
      Vector<Rational>equation
      The defining equation g
      Returns
      WeightedComplex
      The resultin halfspace complex
    •  
      linear_nspace (n, weight) → WeightedComplex

      Creates the tropical variety R^n as a single lineality space with a given weight

      Parameters
      intn
      The dimension of the linear space
      intweight
      The weight of the linear space (1, if none is given)
      Returns
      WeightedComplex
      The resulting fan object in non-homog. coordinates
    •  
      linear_space_by_basis (rowspace, weight) → WeightedComplex

      Creates a tropical variety consisting of a single linear space defined by a matrix and assigns it a given weight.

      Parameters
      Matrix<Rational>rowspace
      A matrix whose rows span the lineality space of the fan (hence the whole fan) and which are assumed to be linearly independent. If you are not sure of this, call linear_space_by_matrix instead.
      intweight
      The weight of the linear space (1, if none is given)
      Returns
      WeightedComplex
      The resulting fan object in non-homog. coordinates
    •  
      linear_space_by_matrix (rowspace, weight) → WeightedComplex

      Creates a tropical variety consisting of a single linear space defined by a matrix and assigns it a given weight.

      Parameters
      Matrix<Rational>rowspace
      A matrix whose rows span the lineality space of the fan (hence the whole fan). If you already know that your rows are a basis, call linear_space_by_basis instead.
      intweight
      The weight of the linear space (1, if none is given)
      Returns
      WeightedComplex
      The resulting fan object in non-homog. coordinates
    •  
      point_variety (point, weight) → WeightedComplex

      Takes an n-dimensional vector and creates a subdivision of R^n into 2^n orthants with apex at the given vertex. This can for example be used to subdivide a given variety such that a certain vertex is contained in its polyhedral structure by intersecting with this variety

      Parameters
      Vector<Rational>point
      The apex of the variety in homogeneous coordinates
      Intweight
      Optional. All cones will have this weight. 1 by default
      Returns
      WeightedComplex
      The variety described above
    •  
      tropical_cube (n, k) → WeightedComplex

      Creates the tropical cube T^n_k, i.e. the tropical variety obtained by glueing together the 2^n L^n_k obtained by applying all possible sign changes, such that the vertices form the k-skeleton of the n-dimensional cube Alternatively, T^n_k can be seen as max(1,x_1,...,x_n,-x_1,...,-x_n)^(n-k) * R^n

      Parameters
      Intn
      The ambient dimension
      Intk
      The dimension of the cube
      Returns
      WeightedComplex
      cube
    •  
      tropical_lnk (n, k) → WeightedComplex

      Creates the linear tropical space L^n_k. This tropical fan is defined in the following way: As rays we take -e_i,i=1,...,n, where e_i is the i-th standard basis vector of R^n and e_0 = e_1 + ... + e_n. As maximal cones we take the cones generated by rays {e_i, i in S}, where S runs over all k-element subsets of {0,..,n}.

      Parameters
      Intn
      The ambient dimension of the fan.
      Intk
      The dimension of the fan (should be smaller equal n, otherwise an error is thrown).
      Returns
      WeightedComplex
      A PolyhedralFan object representing L^n_k
    •  
      zero_cycle ()

      Returns the zero cycle, i.e. a weighted complex with no rays and cones

  •  
    •  
      divisor (X, f, k) → WeightedComplex

      Takes as input a tropical variety X , a rational function f and optionally a positive integer k. It then computes f^k * X Note that this still produces a meaningful result, if the WeightedComplex is not balanced: The "divisor" of a given function is computed by taking all codim-1-faces, at which the complex is balanced and computing weights there.

      Parameters
      WeightedComplexX
      A tropical variety
      RationalFunctionf
      A rational function, defined on a DOMAIN that contains X. It can be in non-homog. coordinates, even if X is in homog. coordinates, but then its AMBIENT_DIM has to be equal to X->AMBIENT_DIM. Otherwise you will have to homogenize the function first.
      Intk
      Optional. A positive integer. Note that if k is given, this will actually ignore f->POWER. Is 1 by default.
      Returns
      WeightedComplex
      The divisor f^k * X. It is given in homogeneous coordinates, if and only if: Either X is already in homogeneous coordinates or f is defined on a homogeneous DOMAIN (which is implicitly the case for ALL MinMaxFunctions)
    •  
      divisorByPLF (fan, A) → The

      NOTE: Deprecated. Use divisor(..) instead Computes the divisor of a MinMaxFunction on a given tropical variety. The result will be in homogeneous coordinates, whether the tropical variety uses them or not. The function should be given on the affine coordinates of the variety, NOT the homogeneous ones.

      Parameters
      WeightedComplexfan
      A tropical variety, on which the divisor is computed
      MinMaxFunctionA
      function whose DOMAIN should be equal to the affine coordinate space of the variety, i.e. AMBIENT_DIM-1, if the variety uses homogeneous coordinates, AMBIENT_DIM otherwise.
      Returns
      The
      corresponding divisor as a tropical variety in homogeneous coordinates.
    •  
      divisorByValue (A, An) → The

      NOTE: Deprecated. Use divisor(...) or divisor_nr(...) in conjunction with function_value instead Takes as input a tropical fan / tropical variety and an array of rational values. The array length should coincide with the number of CMPLX_RAYS of the fan plus the dimension of the lineality space and will be interpreted as a rational function, where each value has been assigned to the rays given by $fan->CMPLX_RAYS and to the generators given by $fan->LINEALITY_SPACE (in that order). Missing values will be filled up by 0's, superfluous ones will be ignored. The function will then compute the corresponding Weil divisor and return it as a tropical variety given as a fan. The fan uses homogeneous coordinates, if and only the input fan does. Note that this still produces a meaningful result, if the WeightedComplex is not balanced: The "divisor" of a given function is computed by taking all codim-1-faces, at which the complex is balanced and computing weights there.

      Parameters
      WeightedComplexA
      tropical variety on which the divisor is computed.
      valuesAn
      array of rational values that define an integer affine map on the fan.
      Returns
      The
      divisor of the function defined by values on the given fan, as a tropical variety.
    •  
      divisor_list (X, A) → WeightedComplex

      Takes as input a tropical variety and an arbitrarily long list of RationalFunction objects f_1,...,f_k. It will # then compute f_k^a_k * ... * f_1^a_1 * X, where a_i = f_i->POWER

      Parameters
      WeightedComplexX
      RationalFunctionA
      list f_1,...,f_k
      Returns
      WeightedComplex
      The divisor f_k * ... * f_1 * X. It is in homogeneous coordinates, if and only if: Either X is in homog. coordinates or one of the functions is defined on a homogeneous domain.
    •  
      divisor_list_nr ()

      Works exactly as divisor_list(WeightedComplex;RationalFunction,...). Should be called ONLY,when every occuring function f is defined on a DOMAIN equal to X (in the sense that all properties like RAYS, MAXIMAL_CONES, etc. agree. Being equal as varieties is not sufficient). In this case this function will in general be faster.

    •  
      divisor_nr ()

      Works exactly as divisor(WeightedComplex, RationalFunction;Int). Should be called ONLY, when the function f is defined on a DOMAIN equal to X (in the sense that all properties like RAYS, MAXIMAL_CONES, etc. agree. Being equal as varieties is not sufficient). In this case this function will in general be faster.

    •  
      piecewise_divisor (F, cones, coefficients) → WeightedComplex

      Computes a divisor of a linear sum of certain piecewise polynomials on a simplicial fan.

      Parameters
      WeightedComplexF
      A simplicial fan without lineality space in non-homog. coordinates
      IncidenceMatrixcones
      A list of cones of F (not maximal, but all of the same dimension). Each cone t corresponds to a piecewise polynomial psi_t, defined by subsequently applying the rational functions that are 1 one exactly one ray of t and 0 elsewhere.
      Vector<Integer>coefficients
      A list of coefficients a_t corresponding to the cones.
      Returns
      WeightedComplex
      The divisor sum_t a_t psi_t * F
    •  
      random_minmaxdivisor (ambient_dim, equations, upperCoeffBound, onlyFunction) → MinMaxFunction

      Creates a divisor of a random MinMaxFunction (in n-space) with integer coefficients. By default this uses maximum for the function. It returns an array containing the function created and its divisor in n-space.

      Parameters
      intambient_dim
      The ambient dimension of the divisor
      intequations
      The number of equations to use
      intupperCoeffBound
      The upper bound of the coefficients (All coefficients are positive)
      BoolonlyFunction
      If true, only the random function is returned and the divisor is not computed. FALSE by default.
      Returns
      MinMaxFunction
      if onlyFunction is TRUE, otherwise an array containing first the function, then the divisor
  •  
    •  
      variety_from_gfan (path) → WeightedComplex

      This takes as input the name of a file containing a fan with or without multiplicities in standard gfan output (not xml!) and parses it into a tropical variety

      Parameters
      Stringpath
      The file name
      Returns
      WeightedComplex
  •  
    •  
      hurwitz_cycle (k, degree, points) → WeightedComplex

      This function computes the Hurwitz cycle H_k(x), x = (x_1,...,x_n)

      Parameters
      Intk
      The dimension of the Hurwitz cycle, i.e. the number of moving vertices
      Vector<Int>degree
      The degree x. Should add up to 0
      Vector<Rational>points
      Optional. Should have length n-3-k. Gives the images of the fixed vertices (besides 0). If not given all fixed vertices are mapped to 0 and the function computes the recession fan of H_k(x)
      Returns
      WeightedComplex
      H_k(x), in homogeneous coordinates
    •  
      hurwitz_graph (cycle) → graph::Graph

      Takes as input a hurwitz curve and computes the corresponding graph object Directional rays are modeled as terminal vertices. Each vertex (including directional rays) is labeled with its combinatorial type

      Parameters
      WeightedComplexcycle
      A Hurwitz curve object (or any one-dimensional cycle in M_0,n)
      Returns
      graph::Graph
    •  
      hurwitz_pair (k, degree, points, list) → An

      This function computes hurwitz_subdivision and hurwitz_cycle at the same time, returning the result in an array

      Parameters
      Intk
      The dimension of the Hurwitz cycle, i.e. the number of moving vertices
      Vector<Int>degree
      The degree x. Should add up to 0
      Vector<Rational>points
      Optional. Should have length n-3-k. Gives the images of the fixed vertices (besides 0). If not given all fixed vertices are mapped to 0 and the function computes the subdivision of M_0,n containing the recession fan of H_k(x)
      RationalCurvelist
      Optional. A list of rational curves. If given, the computation will be performed locally around the given combinatorial types.
      Returns
      An
      array, containing first the subdivision of M_0,n, then the Hurwitz cycle
    •  
      hurwitz_subdivision (k, degree, points) → WeightedComplex

      This function computes a subdivision of M_0,n containing the Hurwitz cycle H_k(x), x = (x_1,...,x_n) as a subfan. If k = n-4, this subdivision is the unique coarsest subdivision fulfilling this property

      Parameters
      Intk
      The dimension of the Hurwitz cycle, i.e. the number of moving vertices
      Vector<Int>degree
      The degree x. Should add up to 0
      Vector<Rational>points
      Optional. Should have length n-3-k. Gives the images of the fixed vertices (besides 0). If not given all fixed vertices are mapped to 0 and the function computes the subdivision of M_0,n containing the recession fan of H_k(x)
      Returns
      WeightedComplex
      A subdivision of M_0,n, in homogeneous coordinates
  •  
    •  
      gcdext (a, b, s, t) → Integer

      Computes the gcd of a and b and returns it. s and t are set such that gcd(a,b) = s * a + t * b This is just a wrapper for the GMP's gcdext method

      Parameters
      Integera
      first argument of gcd(,)
      Integerb
      second argument of gcd(,)
      Integers
      coefficient of a (will be set)
      Integert
      coefficient of b (will be set)
      Returns
      Integer
    •  
      latticeBasis (cone) → Matrix<Integer>

      Takes a cone and computes a Z-basis of the vector space spanned by the cone, returned as row vectors of a matrix

      Parameters
      polytope::Conecone
      A cone for which a Z-basis is to be computed
      Returns
      Matrix<Integer>
    •  
      latticeNormal (taumatrix, sigmamatrix, additionalRay) → Vector

      Takes two matrices whose rows define the dual of the linear span of cone tau and sigma. Assuming that tau is a codimension one face of sigma, computes a representative of the primitive lattice normal vector of sigma with respect to tau

      Parameters
      Matrixtaumatrix
      a codimension one face of sigma, given as a matrix defining its linear span
      Matrixsigmamatrix
      an arbitrary cone, given as a matrix defining its linear span
      VectoradditionalRay
      A ray that is contained in sigma, but not in tau. Used to calculate proper orientation of the normal vector.
      Returns
      Vector
    •  
      latticeNormalByCone (tau, sigma) → Vector

      Assuming that tau is a codimension one face of sigma, computes a representative of the primitive lattice normal vector of sigma with respect to tau

      Parameters
      polytope::Conetau
      a codimension one face of tau, given as a cone
      polytope::Conesigma
      an arbitrary cone
      Returns
      Vector
    •  
      lattice_index (m) → Integer

      This computes the index of a lattice of rank n in Z^n

      Parameters
      Matrix<Integer>m
      A list of (row) generators of the lattice. The matrix must have full column rank, otherwise an error is thrown
      Returns
      Integer
      The index of the lattice
    •  
      randomInteger (max_arg, n) → Array<Integer>

      Returns n random integers in the range 0.. (max_arg-1),inclusive Note that this algorithm is not optimal for real randomness: If you change the range parameter and then change it back, you will usually get the exact same sequence as the first time

      Parameters
      intmax_arg
      The upper bound for the random integers
      intn
      The number of integers to be created
      Returns
      Array<Integer>
  •  
    •  
      cycle_intersection (X, Y) → WeightedComplex

      DEPRECATED: Use intersect(...) Computes the intersection product of two tropical cycles in a common ambient vector space V.

      Parameters
      WeightedComplexX
      The first tropical variety
      WeightedComplexY
      The second tropical variety. Should have the same actual ambient dimension (homogeneous coordinates don't count) as X.
      Returns
      WeightedComplex
      Z The intersection product X*Y in V = R^n, where n is the ambient dimension of X and Y. The result has homogeneous coordinates in any case
    •  
      degree (complex) → Int

      Computes the property DEGREE of a tropical variety as the degree of the 0-dimensional complex obtained when intersecting the variety with an appropriate linear space L^n_k

      Parameters
      WeightedComplexcomplex
      Returns
      Int
    •  
      diagonal_functions (n) → MinMaxFunction

      Produces the rational functions that cut out the diagonal of the vector space R^n.

      Parameters
      Intn
      Them dimension of the vector space (and the number of functions)
      Returns
      MinMaxFunction
      A list of the functions (max(x_n,y_n),...,max(x_1,y_1)), where x_i is the coordinate function in the first part of the cartesian product R^n x R^n and y_i is the coordinate function of the second half.
    •  
      diagonal_unk (n, k) → RationalFunction

      Computes a list of functions that cut out the diagonal on B(Unk) x B(Unk)

      Parameters
      Intn
      The ambient dimension of B(Unk)
      Intk
      The dimension of B(Unk)
      Returns
      RationalFunction
      An array of functions, cutting out the diagonal
    •  
      intersect (X, Y) → WeightedComplex

      Computes the intersection product of two tropical cycles in R^n

      Parameters
      WeightedComplexX
      A tropical cycle
      WeightedComplexY
      A tropical cycle, living in the same space as X
      Returns
      WeightedComplex
      The intersection product, always in homogeneous coordinates
    •  
      intersect_by_diagonal (X, Y, liftLineality, Verbose, A) → WeightedComplex

      Computes an intersection product of two tropical cycles by using a prescribed list of rational functions cutting out the diagonal

      Parameters
      WeightedComplexX
      A tropical cycle
      WeightedComplexY
      A tropical cycle living in the same ambient space
      BoolliftLineality
      Whether both cycles have to be lifted into an ambient space of one dimension higher. If true, this will be done by adding a zero at the end of RAYS and LINEALITY_SPACE and adding the LINEALITY generator (1,..,1). After computation, this additional coordinate will be stripped
      BoolVerbose
      Whether some progress information should be printed
      RationalFunctionA
      list of rational functions cutting out the diagonal. These will be applied to the cartesian product X x Y
      Returns
      WeightedComplex
      The intersection product defined via the diagonal functions
    •  
      intersect_in_lnk (X, Y, k, verbose) → WeightedComplex

      # Computes the intersection product of two cycles living in L^n_k

      Parameters
      WeightedComplexX
      A cycle in L^n_k
      WeightedComplexY
      A cycle in L^n_k
      Intk
      The dimension k of the ambient L^n_k
      Boolverbose
      Optional. Whether some progress information should be printed
      Returns
      WeightedComplex
      The intersection product of X and Y in B(U_n,k)
    •  
      intersect_in_unk (X, Y, k, verbose) → WeightedComplex

      Computes the intersection product of two cycles living in the bergman fan B(U_n,k) (given in max-coordinates)

      Parameters
      WeightedComplexX
      A cycle in B(U_n,k)
      WeightedComplexY
      A cycle in B(U_n,k)
      Intk
      The dimension k of the ambient U_n,k
      Boolverbose
      Optional. Whether some progress information should be printed
      Returns
      WeightedComplex
      The intersection product of X and Y in B(U_n,k)
    •  
      matroid_intersection_by_flats (X, Y, M) → WeightedComplex

      Computes an intersection product of two cycles in a bergman fan

      Parameters
      WeightedComplexX
      A tropical cycle living either in B(M) or B(M)/L, where L = <(1,...,1)>
      WeightedComplexY
      A tropical cycle, also living in B(M) or B(M)/L (both cycles should of course live in the same fan)
      matroid::MatroidM
      A matroid. X and Y live in B(M) or B(M)/L. The function will detect automatically which of these cases applies
      Returns
      WeightedComplex
      The intersection product of X and Y in B(M) (possibly mod L)
    •  
      minkowski_multiplicity (X, Y) → Integer

      Computes the minkowski multiplicity of two fans, i.e. it computes the unique weight of the Minkowski sum X + (-Y). More precisely: If the sum is not full-dimensional, it returns 0. Otherwise it runs over all pairs of cones whose Minkowski sum contains a generic vector and adds the product of their weight times the lattice index of the sum of the lattices.

      Parameters
      WeightedComplexX
      A tropical fan
      WeightedComplexY
      A tropical fan, living in the same space as X
      Returns
      Integer
      The Minkowski multiplicity
  •  
    •  
      cutting_functions (F, weight_aim) → Matrix<Rational>

      Takes a weighted complex and a list of desired weights on its codimension one faces and computes all possible rational functions on (this subdivision of ) the complex

      Parameters
      WeightedComplexF
      A tropical variety
      Vector<Integer>weight_aim
      A list of weights, whose length should be equal to the number of CODIM_1_FACES. Gives the desired weight on each codimension one face
      Returns
      Matrix<Rational>
      The space of rational functions defined on this particular subdivision. Each row is a generator. The columns correspond to values on CMPLX_RAYS and LINEALITY_SPACE, except the last one, which is either 0 (then this function cuts out zero and can be added to any solution) or non-zero (then normalizing this entry to -1 gives a function cutting out the desired weights on the codimension one skeleton
    •  
      simplicial_diagonal_system ()

      This function computes the inhomogeneous version of simplicial_piecewise_system in the sense that it computes the result of the above mentioned function (i.e. which coefficients for the piecewise polynomials yield the zero divisor) and adds another column at the end where only the entries corresponding to the diagonal cones are 1, the rest is zero. This can be seen as asking for a solution to the system that cuts out the diagonal (all solutions whose last entry is 1)

    •  
      simplicial_piecewise_system (F) → Matrix<Rational>

      This function takes a d-dimensional simplicial fan F and computes the linear system defined in the following way: For each d-dimensional cone t in the diagonal subdivision of FxF, let psi_t be the piecewise polynomial defined by subsequently applying the rational functions that are 1 one exactly one ray of t and 0 elsewhere. Now for which coefficients a_t is sum_t a_t psi_t * (FxF) = 0?

      Parameters
      WeightedComplexF
      A simplicial fan without lineality space in non-homog. coordinates
      Returns
      Matrix<Rational>
      The above mentioned linear system. The rows are equations, the columns correspond to d-dimensional cones of FxF in the order given by skeleton_complex(simplicial_with_diagonal(F), d,TRUE)
    •  
      simplicial_with_diagonal (F) → WeightedComplex

      This function takes a simplicial fan F (in non-homog. coordinates and without lineality space) and computes the coarsest subdivision of F x F containing all diagonal rays (r,r)

      Parameters
      WeightedComplexF
      A simplicial fan without lineality space in non-homog. coordinates
      Returns
      WeightedComplex
      The product complex FxF subdivided such that it contains all diagonal rays
  •  
    •  
      computeMatrixBases (m) → IncidenceMatrix

      Computes a list of sets of column indices of a matrix such that the corresponding column sets form a basis of the column space

      Parameters
      Matrix<Rational>m
      Returns
      IncidenceMatrix
      A list of all bases
    •  
      computeMatrixColoops (m) → Set<int>

      Computes a list of column indices of a matrix such that the corresponding columns are contained in every column basis of the column space. Is equal to the intersection of all sets returned by computeMatrixBases

      Parameters
      Matrix<Rational>m
      Returns
      Set<int>
      A list of all coloops
    •  
      linearRepresentation (v, generators) → Vector

      Takes a vector v and a matrix with column dimension equal to the dimension of v. Assuming that v is in the row span of the matrix, it computes one(!) possible representation of v in these generators

      Parameters
      Vectorv
      The vector supposed to be contained in the row span of the generators
      Matrixgenerators
      A set of row vectors whose linear span should contain v
      Returns
      Vector
      A vector (a1,..,an) such that v = (a1,...,an) * generators. It returns a vector of dimension 0, if v is not in the span of the generators. An error is thrown if the dimensions of v and the generators mismatch
    •  
      lllHNF (matrix, tfmatrix, kdim) → Matrix

      Computes a row HNF of an integer matrix A It returns the normal form and stores the unimodular transformation matrix and the kernel dimension of the transposed matrix in the last two parameters. The algorithm is the LLL-based HNF alg. by Havas, Majevski, Matthews

      Parameters
      Matrix<Integer>matrix
      the matrix for which the transformation is computed
      Matrix<Integer>tfmatrix
      The matrix that will contain the transformation matrix, i.e. tfmatrix * matrix = lllHNF(matrix)
      Integerkdim
      This will be set to dim Ker(A^T) (This is needed for lattice normal computation)
      Returns
      Matrix
    •  
      lllHNF (matrix) → Matrix<Integer>

      Does exactly the same as lllHNF(Matrix,Matrix,Integer), except that it only returns the normal form and not the transformation matrix and the transposed kernel dimension

      Parameters
      Matrix<Integer>matrix
      the matrix for which the transformation is computed
      Returns
      Matrix<Integer>
      The HNF of matrix
  •  
    •  
      local_codim_1 (complex, face) → WeightedComplex

      This takes a weighted complex and an index of one of its codimension one faces (The index is in CODIM_1_FACES) and computes the complex locally restricted to that face

      Parameters
      WeightedComplexcomplex
      An arbitrary weighted complex
      Intface
      An index of a face in CODIM_1_FACES
      Returns
      WeightedComplex
      The complex locally restricted to the given face
    •  
      local_point (complex, v) → WeightedComplex

      This takes a weighted complex and an arbitrary vertex in homogeneous coordinates that is supposed to lie in the support of the complex It then refines the complex such that the vertex is a cell in the polyhedral structure and returns the complex localized at this vertex

      Parameters
      WeightedComplexcomplex
      An arbitrary weighted complex
      Vector<Rational>v
      A vertex in homogeneous coordinates. It should lie in the support of the complex (otherwise an error is thrown)
      Returns
      WeightedComplex
      The complex localized at the vertex
    •  
      local_ray (complex, ray) → WeightedComplex

      This takes a weighted complex and an index of one of its vertices or rays (the index is to be understood in RAYS) It then localizes the variety at this vertex / ray. The index should never correspond to a directional ray in a complex, since this would not be a cone

      Parameters
      WeightedComplexcomplex
      An arbitrary weighted complex
      Intray
      The index of a ray/vertex in RAYS
      Returns
      WeightedComplex
      The complex locally restricted to the given ray/vertex
    •  
      local_restrict (complex, cones) → WeightedComplex

      This takes a tropical variety and an IncidenceMatrix describing a set of cones (not necessarily maximal ones) of this variety. It will then create a variety that contains all compatible maximal cones and is locally restricted to the given cone set.

      Parameters
      WeightedComplexcomplex
      An arbitrary weighted complex
      IncidenceMatrixcones
      A set of cones, indices refer to RAYS
      Returns
      WeightedComplex
      The same complex, locally restricted to the given cones
  •  
    •  
      bergman_fan (m, modOutLineality, projectionCoordinate) → The

      Creates the bergman fan of a given matroid fan. This is much slower than using bergman_fan_matroid. The difference in output is that is always gives the coarsest polyhedral structure (but this can also be achieved by calling coarsen(...) after creation).

      Parameters
      matroid::Matroidm
      A matroid
      BoolmodOutLineality
      Optional argument. If set to TRUE, the lineality space is divided out before returning the fan. The next parameter specifies the exact modalities of the division. By default, this parameter is set to FALSE
      intprojectionCoordinate
      Optional argument. An integer in {0,..,n-1}, where n is the number of elements of the matroid. If modOutLineality is set to TRUE, the standard basis vector with index projectionCoordinate is mapped to minus the sum of the remaining standard basis vectors to mod out the lineality space. By default, this is the last coordinate n-1.
      Returns
      The
      bergman fan of the given matroid in non-homog. coordinates
    •  
      bergman_fan_flats (m, mod_out_lineality) → WeightedComplex

      This function computes the bergman fan of a matroid in the subdivision associated to its lattice of flats. In particular it computes all flats and all maximal chains of flats. Hence this function is terribly inefficient and should only be used with comparatively small matroids

      Parameters
      matroid::Matroidm
      Any matroid
      Boolmod_out_lineality
      Optional. Whether the lineality space should be modded out by setting the last coordinate to be the sum of the remaining ones. True by default.
      Returns
      WeightedComplex
      The bergman fan B(m) in its flat subdivision
    •  
      bergman_fan_linear (m, modOutLineality, projectionCoordinate) → The

      Uses an algorithm by Felipe Rincón to compute the bergman fan of a linear matroid

      Parameters
      Matrix<Rational>m
      Any rational matrix
      BoolmodOutLineality
      Optional argument. If set to TRUE, the lineality space is divided out before returning the fan. The next parameter specifies the exact modalities of the division. By default, this parameter is set to FALSE
      intprojectionCoordinate
      Optional argument. An integer in {0,..,n-1}, where n is the number of elements of the matroid. If modOutLineality is set to TRUE, the standard basis vector with index projectionCoordinate is mapped to minus the sum of the remaining standard basis vectors to mod out the lineality space. By default, this is the last coordinate n-1.
      Returns
      The
      bergman fan of the given matroid in non-homog. coordinates. This algorithm uses min-convention, so the rays are given as (0,1) - vectors
    •  
      bergman_fan_matroid (m, modOutLineality, projectionCoordinate) → The

      Uses an algorithm by Felipe Rincón to compute the bergman fan of a general matroid

      Parameters
      matroid::Matroidm
      Any matroid
      BoolmodOutLineality
      Optional argument. If set to TRUE, the lineality space is divided out before returning the fan. The next parameter specifies the exact modalities of the division. By default, this parameter is set to FALSE
      intprojectionCoordinate
      Optional argument. An integer in {0,..,n-1}, where n is the number of elements of the matroid. If modOutLineality is set to TRUE, the standard basis vector with index projectionCoordinate is mapped to minus the sum of the remaining standard basis vectors to mod out the lineality space. By default, this is the last coordinate n-1.
      Returns
      The
      bergman fan of the given matroid in non-homog. coordinates. This algorithm uses min-convention, so the rays are given as (0,1) - vectors
  •  
    •  
      add_minmax_functions (f, g, reduce) → MinMaxFunction

      Computes the sum of two MinMaxFunctions that are supposed to have the same USES_MIN property. You can also simply use '+' instead.

      Parameters
      MinMaxFunctionf
      An arbitrary MinMaxFunction
      MinMaxFunctiong
      A MinMaxFunction such that f->USES_MIN == g->USES_MIN and is defined on the same domain.
      Boolreduce
      Optional. False by default. If true, the function reduces the amount of terms by computing vertices of the newton polytope of the sum
      Returns
      MinMaxFunction
      The sum of both functions.
    •  
      function_mult (f, r) → RationalFunction

      This function takes a RationalFunction f and a Rational value r and returns the RationalFunction r*f. You can also use the operator '*' instead.

    •  
      function_point (v) → RationalFunction

      This takes a vector v = (v_1,...,v_n) in R^n and returns the list of rational functions max(v_i,x_i), i.e. a list of functions cutting out that point in R^n.

      Parameters
      Vector<Rational>v
      A vector in R^n (in non-homog. coordinates!)
      Returns
      RationalFunction
      An array of RationalFunction objects, which cut out v in R^n
    •  
      function_value (X, An) → RationalFunction

      This creates a RationalFunction by directly defining it on the rays of a given domain. It is simply shorter then using the constructor.

      Parameters
      WeightedComplexX
      The DOMAIN of the function
      RationalAn
      arbitrarily long list of function values. It should be as long as X->CMPXL_RAYS->rows + X->LINEALITY_DIM. Function values will be assigned in this order (first rays, then linspace). Superfluous values are ignored, missing ones replaced by zero
      Returns
      RationalFunction
    •  
      input_vars (A) → Array<String>

      Creates an array of strings from a single string by separating along commas. This can be used as a convenience function to pass a list of variables to INPUT_VARS of MinMaxFunction, e.g. ...INPUT_VARS=>input_vars("x,y,z")

      Parameters
      StringA
      single string containing a comma-separated list of variable names
      Returns
      Array<String>
      The list of the variable names
    •  
      projection_map (n, s) → Morphism

      This creates a linear projection from R^n to a given set of coordinates

      Parameters
      Intn
      The dimension of the domain
      Set<Int>s
      The set of coordinates to which this map should project (starting the count at 0)
      Returns
      Morphism
      The corresponding projection as a global linear map
    •  
      projection_map (n, m) → Morphism

      This computes the projection from R^n to R^m (for m < n) onto the first m coordinates

      Parameters
      Intn
      Dimension of domain
      Intm
      Dimension of image
      Returns
      Morphism
      The corresponding projection
    •  
      pull_back (f, phi) → RationalFunction

      Computes the pull back of a rational function (or a list of rational functions) along a morphism

      Parameters
      Morphismf
      A morphism
      RationalFunctionphi
      A rational function whose DOMAIN contains the image of f (or a list of RationalFunction objects)
      Returns
      RationalFunction
      The pull-back of phi along f. If a list of functions was given, it returns an array with the pull-backs of these functions
    •  
      scale_minmax_function (f, a) → MinMaxFunction

      Scales a MinMaxFunction by a given Rational a. You can also use the '*' operator.

      Parameters
      MinMaxFunctionf
      An arbitrary MinMaxFunction
      Rationala
      A scalar values
      Returns
      MinMaxFunction
      The scaled function
  •  
    •  
      count_mn_cones (n, k) → Integer

      Computes the number of k-dimensional cones of the tropical moduli space M_0,n

      Parameters
      Intn
      The number of leaves. Should be >= 3
      Intk
      The number of bounded edges. This argument is optional and n-3 by default
      Returns
      Integer
      The number of k-dimensional cones of M_0,n
    •  
      count_mn_rays (n) → Integer

      Computes the number of rays of the tropical moduli space M_0,n

      Parameters
      intn
      The number of leaves. Should be >= 3
      Returns
      Integer
      The number of rays
    •  
      evaluation_map (n, r, Delta, i) → Morphism

      This creates the i-th evaluation function on M_0,n^(lab)(R^r,Delta) (which is actually realized as M_0,(n+|Delta|) x R^r)

      Parameters
      Intn
      The number of marked points
      Intr
      The dimension of the embedding space
      Matrix<Rational>Delta
      The directions of the unbounded edges (given as row vectors)
      Inti
      The index of the marked point that should be evaluated. i should lie in between 1 and n Note that the i-th marked point is realized as the |Delta|+i-th leaf in M_0,(n+|Delta|) and that the R^r - coordinate is interpreted as the position of the n-th leaf. In particular, ev_n is just the projection to the R^r-coordinates
      Returns
      Morphism
      ev_i. Its domain is the ambient space of the moduli space in matroid coordinates cross R^r
    •  
      evaluation_map (n, r, d, i) → Morphism

      This creates the i-th evaluation function on M_0,n^(lab)(R^r,d) (which is actually realized as M_0,(n+d(r+1)) x R^r) This is the same as calling the function evaluation_map(Int,Int,Matrix<Rational>,Int) with the standard d-fold degree as matrix

      Parameters
      Intn
      The number of marked points
      Intr
      The dimension of the embedding space
      Intd
      The degree of the embedding. The direction matrix will be the standard d-fold directions (first (1,...1), then the inverted unit vectors)
      Inti
      The index of the marked point that should be evaluated. i should lie in between 1 and n
      Returns
      Morphism
      ev_i. Its domain is the ambient space of the moduli space in matroid coordinates cross R^r
    •  
      forgetful_map (n, S) → Morphism

      This computes the forgetful map from the moduli space M_0,n to M_0,(n-|S|)

      Parameters
      Intn
      The number of leaves in the moduli space M_0,n
      Set<Int>S
      The set of leaves to be forgotten. Should be a subset of (1,..,n)
      Returns
      Morphism
      The forgetful map. It will identify the remaining leaves i_1,..,i_(n-|S|) with the leaves of M_0,(n-|S|) in order of their size
    •  
      local_m0n (A) → WeightedComplex

      Computes the moduli space M_0,n locally around a given list of combinatorial types. More precisely: It computes the weighted complex consisting of all maximal cones containing any of the given combinatorial types and localizes at these types This should only be used for curves of small codimension. What the function actually does, is that it combinatorially computes the cartesian products of M_0,v's, where v runs over the possible valences of vertices in the curves For max(v) <= 8 this should terminate in a reasonable time (depending on the number of curves) The coordinates are the same that would be produced by the function tropical_m0n

      Parameters
      RationalCurveA
      list of rational curves (preferrably in the same M_0,n)
      Returns
      WeightedComplex
      The local complex
    •  
      moduliDimensionFromLength (k) → Int

      Takes a positive length (of a vector) and assumes it is of the form (n over 2) It then computes n

      Parameters
      Intk
      The length = (n over 2)
      Returns
      Int
      n. If k is not of the form (n over 2), an error is thrown.
    •  
      psi_class (n, i) → WeightedComplex

      Computes the i-th psi class in the moduli space of n-marked rational tropical curves M_0,n

      Parameters
      Intn
      The number of leaves in M_0,n
      Inti
      The leaf for which we want to compute the psi class ( in 1,..,n )
      Returns
      WeightedComplex
      The corresponding psi class
    •  
      psi_product (n, exponents) → WeightedComplex

      Computes a product of psi classes psi_1^k_1 * ... * psi_n^k_n on the moduli space of rational n-marked tropical curves M_0,n

      Parameters
      Intn
      The number of leaves in M_0,n
      Vector<Int>exponents
      The exponents of the psi classes k_1,..,k_n. If the vector does not have length n or if some entries are negative, an error is thrown
      Returns
      WeightedComplex
      The corresponding psi class divisor
    •  
      tropical_m0n (n) → WeightedComplex

      Creates the moduli space of abstract rational n-marked curves. Its coordinates are given as the coordinates of the bergman fan of the matroid of the complete graph on n-1 nodes (but not computed as such) The lineality space (1,..,1) is modded out by setting the last coordinate equal to minus the sum of the others The isomorphism to the space of curve metrics is obtained by choosing the last leaf as special leaf

      Parameters
      Intn
      The number of leaves. Should be at least 4
      Returns
      WeightedComplex
      The tropical moduli space M_0,n

Common Option Lists

  •  
    Visual::RationalCurve::decorations

    Visualization options for RationalCurve->VISUAL

    imports from: Visual::Graph::decorations, Visual::Wire::decorations, Visual::PointSet::decorations

    Options
    StringLengthLabels
    if set to "hidden", the labels indicating the lengths are hidden
  •  
    Visual::WeightedComplex::BoundingDecorations

    Some options only used for BB_VISUAL

    imports from: Visual::WeightedComplex::decorations, Visual::Polygons::decorations, Visual::PointSet::decorations

    Options
    Flexible<Rational>BoundingDistance
    The distance of the border of the bounding box from the smallest box containing the affine points of the complex. This is only relevant, if BoundingMode is "relative"
    Matrix<Rational>BoundingBox
    A fixed bounding box, determined by two row vectors that specify two of its vertices (on "on top" and one "at the bottom"). Is only relevant, if BoundingMode is "absolute"
    StringBoundingMode
    If set to "relative", the function determines the smallest possible box containing all affine points of the complex and then enlarges the box by BoundingDistance to all sides. If set to "absolute", BoundingBox must be specified and the complex will be intersected with that box. By default this is set to "relative".
    Array<String>ConeLabels
    A list of strings to be displayed as labels for the maximal cones. If this is empty, the weight labels (if present and not suppressed by WeightLabels=>"hidden") are displayed
  •  
    Visual::WeightedComplex::decorations

    A set of basic visualization options for CMPLX_VISUAL and BB_VISUAL

    imports from: Visual::Polygons::decorations, Visual::PointSet::decorations

    Options
    Flexible<Rational>DirScale
    length of the directional rays
    StringWeightLabels
    if set to "hidden", the labels indicating the weights are hidden
    StringCoordLabels
    If set to "show", the labels indicating the vertex coordinates are displayed, otherwise they are not. Note that this is expensive and significantly increases computation time. String If set to "pinned", the weight labels are computed in such a way that they stick to the cells when the complex is exploded. Note that this is expensive and significantly increases computation time. WeightLabelStyle => "",
  •  
    Visual::WeightedComplex::FunctionDecorations

    Visualization options for RationalFunction/Morphism->BB_VISUAL

    imports from: Visual::WeightedComplex::BoundingDecorations, Visual::WeightedComplex::decorations, Visual::Polygons::decorations, Visual::PointSet::decorations

    Options
    StringFunctionLabels
    , if set to "show", the function labels indicatingt the affine linear representation of each function on each cone are computed