# qRing -- Constructs the ring of Fourier coordinates

## Synopsis

• Usage:
S = qRing(T,M)
S = qRing(n,M)
• Inputs:
• T, an instance of the type LeafTree, A tree
• n, an integer, The number of leaves
• M, an instance of the type Model, The model (CNFmodel, JCmodel, etc)
• Outputs:
• S, a ring, The ring of Fourier coordinates

## Description

The Fourier coordinates for a phylogenetic tree model have one coordinate for each "friendly coloring" of the tree T. A friendly coloring is an assignment of one of the group elements of the model M to each of the leaves of T such that the sum of all the group elements assigned is 0.

Each variable of the ring is indexed by a sequence representing a friendly coloring, with each element of the group represented by an integer between 0 and n-1 where n is the order of the group.

The variables use symbol q.

 ```i1 : qRing(4,CFNmodel) 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 o1 : PolynomialRing``` ```i2 : qRing(3,JCmodel) o2 = QQ[q , q , q , q , q , q , q , q , q , q , q , q , q , q , q , q ] 0,0,0 0,1,1 0,2,2 0,3,3 1,0,1 1,1,0 1,2,3 1,3,2 2,0,2 2,1,3 2,2,0 2,3,1 3,0,3 3,1,2 3,2,1 3,3,0 o2 : PolynomialRing```