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

## Synopsis

• Usage:
L = phyloToricLinears(T,M)
L = phyloToricLinears(n,E,M)
• Inputs:
• T, an instance of the type LeafTree, A tree
• n, an integer, The number of leaves
• E, an instance of the type LeafTree, The internal edges of the tree, given by one part of the bipartition on leaves
• M, an instance of the type Model, The model (CNFmodel, JCmodel, etc)
• Optional inputs:
• Outputs:
• L, 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