# phyloToricLinears -- compute the linear invariants of a group-based phylogenetic model

## Synopsis

• Usage:
phyloToricLinears(T,M)
phyloToricLinears(n,E,M)
• Inputs:
• T, an instance of the type LeafTree,
• n, an integer, the number of leaves
• E, a list, the internal edges of the tree, given by one part of the bipartition on leaves
• M, an instance of the type Model,
• Optional inputs:
• QRing => ..., default value null, optional argument to specify Fourier coordinate ring
• Random => ..., default value false
• Outputs:
• a list, a generating set of the linear invariants

## Description

For models such as Jukes-Cantor (JCmodel) and Kimura 2-parameter (K2Pmodel), multiple variables in the Fourier coordinates may map to the same monomial under the monomial map that defines the toric variety of the model. These equivalencies give rise to linear relations in the space of Fourier coordinates.

The number of linear invariants is the codimension of the smallest linear subspace in which the toric variety of the model is contained.

The optional argument QRing can be passed the ring of Fourier coordinates. Otherwise the function will create a new ring.

 i1 : T = leafTree(3,{}) o1 = {{0, 1, 2}, {set {0}, set {1}, set {2}}} o1 : LeafTree i2 : S = qRing(T, K2Pmodel) o2 = S o2 : PolynomialRing i3 : phyloToricLinears(T, K2Pmodel, QRing=>S) o3 = {q - q , q - q , q - q , q - q , 1,2,3 1,3,2 2,1,3 3,1,2 2,3,1 3,2,1 2,2,0 3,3,0 ------------------------------------------------------------------------ q - q , q - q } 2,0,2 3,0,3 0,2,2 0,3,3 o3 : List