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.In reply to Re^2: sort function and parity of the permutation.
by latejita
in thread sort function and parity of the permutation.
by latejita
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |