# phyloToricRandom -- compute a random invariant of a group-based phylogenetic model

## Synopsis

• Usage:
phyloToricRandom(T,M)
phyloToricRandom(n,E,M)
• Inputs:
• T, an instance of the type LeafTree,
• 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,
• Optional inputs:
• QRing => ..., default value null, optional argument to specify Fourier coordinate ring
• Outputs:
• , a randomly selected binomial invariant

## Description

This function computes a random invariant of a group-based phylogenetic tree model using the toric fiber product structure.

With equal probability the algorithm decides to return a linear, quadratic, or higher degree binomial. It then selects one of these at random (but uniformity is not guaranteed).

This is a much more efficient way to produce a single generator than listing all of them, which is useful for Monte Carlo random walk algorithms.

 i1 : phyloToricRandom(4,{{0,1}},CFNmodel) o1 = - q q + q q 0,0,1,1 1,1,0,0 0,0,0,0 1,1,1,1 o1 : QQ[q , q , q , q , q , q , q , q ] 0,0,0,0 0,0,1,1 0,1,0,1 0,1,1,0 1,0,0,1 1,0,1,0 1,1,0,0 1,1,1,1

## Caveat

We currently do not guarantee a uniform distribution on the generators, even after the choice of linear, quadratic or higher degree.