The function DuplicateFreeList in GAP, which is the same a the function Unique, takes a list and returns all the elements of that list with duplicates removed. My problem is that this function checks for duplicates using =, whereas I want to remove duplicates in a list up to isomorphism. Is there a GAP function like DuplicateFreeList that removes duplicates using an arbitrary binary true/false function? Or if not is there a slick way to write a wrapper around DuplicateFreeList which modifies the = operator?
2026-03-27 00:02:02.1774569722
Is there a function more general that DuplicateFreeList() in GAP?
111 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
There is no such function, but given how pathetic the actual code for
Uniqueis, it is not hard to write such a function:(takes a list and an equality test function that returns
trueorfalsewhen given two objects as arguments. That isUniqueByFunction(list,\=);has the same effect asUnique(list);.)Caveat: On a list of length $n$ you will be doing $n(n-1)$ isomorphism tests, each of which often is expensive. In practice you thus most often want to partition the list according to suitable isomorphism invariants first and then run the tests only within each cell.