Open ChrisJefferson opened 2 weeks ago
I agree that illegal actions are an recurring issue of "errors between keyboard and chair".
There is already TestIdentityAction
that is used to map one point under the identity and catches situations of actions that are not well-defined. One could add more. The main problem I see is what tests to do in which situations, so that the tests do not impact performance.
NiceMonomorphism
that uses an action. Probably use PseudoRandom
.One cheap test would be for a fail
in `Permutation
(either image not found, or not a valid permutation and not throw an error about a list access a[fail] being illegal, but that an image wasn't found and that could mean that an action was ill defined.
A common mistake is for people to define ActionHomomorphisms which are not valid.
It isn't reasonable for us to test every ActionHomomorphism, but we could provide helper functions we can at least point people at. It might be possible in some cases where code fails to then run these to see if we can tell why it failed. There are two functions here, one that does a random check if 10,000 elements, and one that checks the full group (which will of course only work for small, finite, G and Omega).
I've had these pieces of code lying around for a while, I'm curious if anyone has any comments, before I polish them up and make a PR: