in reply to Re: sort function and parity of the permutation.
in thread sort function and parity of the permutation.
Thank you for this question.
I want to do computations in anticommutative algebras (ab=-ba). This anticommutativity guarantees that all elements are nilpotent (a^2=0). In order to know if two elements are the same, I wanted to order them, keeping track of permutations, the compare them stringwise (abc=cab). My main problem was to compute products (i.e string concatenations) then sorting them and multipliying by the parity for the sort permutation.
Thanks to your question, i realized that i was doing too much. If I have two ordered monomials 'abde' and 'chk', i can count for each letter of the first, how many leters for the second are smaller than it. That way i can easily keep track for parity.
But then I realized something cooler. If my algebra has N (ordered) generators (a1,..,an), i can represent each monomial(basis) with a number between 0 and 2^(n+1)-1 by taking its binary representation.
Thanks for all the help guys.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: sort function and parity of the permutation.
by BrowserUk (Patriarch) on Feb 15, 2011 at 18:11 UTC | |
by Gavin (Archbishop) on Feb 16, 2011 at 08:14 UTC |