Orbit count for simultaneous colorings (source code)

= Orbit count for simultaneous colorings

Suppose a finite <group> acts on two finite position sets $A$ and $B$. Color the first set using $r$ colors and the second using $s$ colors, with both colorings moved by the same group element. If $c_A(g)$ and $c_B(g)$ are the cycle counts of its two induced <permutations>, the number of simultaneous colorings fixed by $g$ is $r^{c_A(g)}s^{c_B(g)}$: each cycle must be monochromatic, and different cycles can be colored independently. <Burnside's lemma> therefore gives
$$
\frac1{|G|}\sum_{g\in G}r^{c_A(g)}s^{c_B(g)}
$$
for the number of orbits. When the two position actions are equivariantly identified, this simplifies to the usual coloring count with $rs$ combined colors. For example, a tetrahedron's face is paired with its opposite vertex, and this pairing commutes with every symmetry.