# phyloToricQuads -- compute the quadratic invariants of a group-based phylogenetic model

## Synopsis

• Usage:
phyloToricQuads(T,M)
phyloToricQuads(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 quadratic invariants

## Description

The quadratic invariants are also referred to as the edge invariants of the model.

Each Fourier coordinate corresponds to a consistent coloring of the edges of tree T. For any given internal edge e of T, the consistent colorings can be obtained by coloring two smaller graphs and gluing them along e. This corresponds to a fiber product on the corresponding toric varieties. The quadratic invariants naturally arise from this process by gluing a pair of colorings of one small graph to a pair of colorings of the other small graph in two different ways.

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

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