Let $X$ be a set of vertices and $\mathcal{R} = \{R_0 = \operatorname{id}_X, R_1, \dots, R_D\}$ a set of symmetric relations partitioning $X^2$.
$(X, \mathcal{R})$ is said to be a $D$-class association scheme if there exist numbers $p^h_{ij}$ ($0 \le h, i, j \le D$) such that, for any $x, y \in X$,
$$ x \ R_h \ y \Rightarrow |\{z \in X \;|\; x \ R_i \ z \ R_j \ y\}| = p^h_{ij} $$
Let $A_i$ be the binary matrix corresponding to the relation $R_i$ ($0 \le i \le D$).
The vector space $\mathcal{M}$ over $\mathbb{R}$ spanned by $A_i$ ($0 \le i \le D$) is called the Bose-Mesner algebra.
$\mathcal{M}$ has a second basis $\{E_0, E_1, \dots, E_D\}$ consisting of projectors to the common eigenspaces of $A_i$ ($0 \le i \le D$).
There are nonnegative constants $q^h_{ij}$, called Krein parameters, such that
$$ E_i \circ E_j = {1 \over |X|} \sum_{h=0}^d q^h_{ij} E_h , $$ where $\circ$ is the entrywise matrix product.
%display latex
import drg
p = [[[1, 0, 0, 0], [0, 6, 0, 0], [0, 0, 3, 0], [0, 0, 0, 6]],
[[0, 1, 0, 0], [1, 2, 1, 2], [0, 1, 0, 2], [0, 2, 2, 2]],
[[0, 0, 1, 0], [0, 2, 0, 4], [1, 0, 2, 0], [0, 4, 0, 2]],
[[0, 0, 0, 1], [0, 2, 2, 2], [0, 2, 0, 1], [1, 2, 1, 2]]]
scheme = drg.ASParameters(p)
scheme.kreinParameters()
If $p^h_{ij} \ne 0$ (resp. $q^h_{ij} \ne 0$) implies $|i-j| \le h \le i+j$, then the association scheme is said to be metric (resp. cometric).
The parameters of a metric association scheme can be determined from the intersection array
$$ \{b_0, b_1, \dots, b_{D-1}; c_1, c_2, \dots, c_D\} \quad (b_i = p^i_{1,i+1}, c_i = p^i_{1,i-1}). $$
$$ {b^0, b^_1, \dots, b^{D-1}; c^_1, c^2, \dots, c^_D} \quad (b^_i = q^i{1,i+1}, c^i = q^i{1,i-1}). $$
from drg import DRGParameters
syl = DRGParameters([5, 4, 2], [1, 1, 4])
syl
syl.order()
from drg import QPolyParameters
q225 = QPolyParameters([24, 20, 36/11], [1, 30/11, 24])
q225
q225.order()
syl.pTable()
syl.kreinParameters()
syl.distancePartition()
syl.distancePartition(1)
Let us define a one-parametric family of intersection arrays.
r = var("r")
f = DRGParameters([2*r^2*(2*r+1), (2*r-1)*(2*r^2+r+1), 2*r^2], [1, 2*r^2, r*(4*r^2-1)])
f
f1 = f.subs(r == 1)
f1
The parameters of f1
are known to uniquely determine the Hamming scheme $H(3, 3)$.
f2 = f.subs(r == 2)
f2
A parameter set is called feasible if it passes all known existence conditions.
Let us verify that $H(3, 3)$ is feasible.
f1.check_feasible()
No error has occured, since all existence conditions are met.
Let us now check whether the second member of the family is feasible.
f2.check_feasible()
In this case, nonexistence has been shown by matching the parameters against a list of nonexistent families.
q225.check_quadruples()
Integer linear programming has been used to find solutions to multiple systems of linear Diophantine equations, eliminating inconsistent solutions.