This isn't appropriate for an assertion but should we be checking this and explicitly giving an error if the argument isn't a permutation? Is this a case where checking that is very cheap compared to the actual computation that's being done? If so, it may be worth adding the check.