representationMultiplicity(tal,p,charTable)
representationMultiplicity(tal,p)
Since the given group $H$ is a subgroup of $S_n$, the restrictions of the Specht modules to $H$ are also $H$modules. The number of copies of the trivial representation of $H$ in each of these modules can be found by the formula for the inner product for characters applied to the characters of the previous modules.
$\frac{1}{H}\sum_{C \in Cl(H)} CX_\lambda(\sigma_c)$
$Cl(H)$ is the set of conjugacy classes of $H$, $C$ is the size of the conjugacy class and $\sigma_c$ is a representative of the conjugacy class $C$ and $X$ is the character of the representation.
Therefore it is necessary to calculate the cardinality of each conjugacy class. This is done by checking the conjugacy class of each element in the group. For the following example a subgroup of $S_6$ isomorphic to $S_4$ is taken.


For the given group a tally with the size of each conjugacy class must be provided. This tally is inputted to the representationMultiplicityMethod

The number of secondary invariants is equal to the index of the group $[S_6:H] = 30$. We check that this is true by calculating the number of trivial representations of $H$ in each irreducible representation of $S_6$. We take into account that there are multiple copies of each representation by multiplying the values with the number of copies which is given by the hookLengthFormula.



The submodules where the multiplicity is zero will not be taken into account when applying the secondaryInvariants algorithm. The character table can be inputted to the method as well. This is made to avoid calculating the same character table for every partition of $n$. Example charTable = characterTable 6 time multi2 = hashTable apply (partis, p> p=> representationMultiplicity(tal,p,charTable))
The object representationMultiplicity is a method function.