Word ThRightNormalForm::getShortWord( ) const { Word result; Permutation omega = Permutation::getHalfTwistPermutation( getRank( ) ); int power = getPower( ); if( power<0 ) { const list< Permutation >& decomp = getDecomposition( ); list<Permutation>:: const_iterator it = decomp.begin( ); for( int j=0 ; it!=decomp.end( ) ; ++it, ++j ) { int n = j - decomp.size( ) - power; if( n<0 ) { vector< int > gd = (*it).geodesic(); for( size_t t=0 ; t<gd.size() ; ++t ) result.push_back( gd[t]+1 ); } else { Permutation p = ( n%2 == 1 ? (*it).inverse() * omega : omega * (*it).inverse() ); vector<int> gd = p.geodesic(); for( int t=gd.size( )-1 ; t>=0 ; --t ) result.push_back( -gd[t]-1 ); } } Word omega_w = Word(omega.geodesicWord( )); omega_w = -omega_w; for( int j=decomp.size( ) ; j<-power ; ++j ) result = omega_w*result; } else result = getWord( ); return result; }
Word ThLeftNormalForm::getReducedWord() const { if (theOmegaPower >= 0 || theDecomposition.size() == 0) return getWord(); const auto p = -theOmegaPower; const auto d = theDecomposition.size(); const auto a = p < d ? p : d; Word result; // 1. Process omega const Permutation omega = Permutation::getHalfTwistPermutation(theRank); Word omegaWord = Word(omega.geodesicWord()); omegaWord = -omegaWord; result = omegaWord.power(p - a); // 2. Cancel omega^-1 with positive permutations auto it = theDecomposition.begin(); for (int i = 0; i < a; ++i, ++it) { auto perm = (-(*it)) * omega; if ((a - i - 1) % 2 != 0) perm = perm.flip(); result *= -Word(perm.geodesicWord()); } // 3. process the rest of positive permutations for (; it != theDecomposition.end(); ++it) { result *= Word((*it).geodesicWord()); } return result; }
Word ThLeftNormalForm::getWord() const { Word result; // A. Take care of Deltas if( theOmegaPower!=0 ) { const Permutation omega = Permutation::getHalfTwistPermutation( theRank ); Word omegaWord = Word(omega.geodesicWord()); if( theOmegaPower<0 ) omegaWord = -omegaWord; result = omegaWord.power(abs(theOmegaPower)); } // B. Take care of permutation braids for (const auto &d : theDecomposition) { result *= Word(d.geodesicWord()); } return result; }
Word ThLeftNormalForm::getReducedWord2() const { if (theOmegaPower >= 0 || theDecomposition.size() == 0) return getWord(); const auto p = -theOmegaPower; const auto d = theDecomposition.size(); auto a = p < d ? p : d; Word result; // 1. Process omega const Permutation omega = Permutation::getHalfTwistPermutation(theRank); Word omegaWord = Word(omega.geodesicWord()); omegaWord = -omegaWord; result = omegaWord.power(p - a); // 2. Sort permutations and find the cut_value vector<int> sizes; for (const auto &perm : getDecomposition()) sizes.push_back(perm.geodesic().size()); sort(sizes.begin(), sizes.end(), [](const int &lhs, const int &rhs) { return lhs > rhs; }); const int cut_value = sizes[a - 1]; // 3. Cancel omega^-1 with positive permutations for (auto it = theDecomposition.begin(); it != theDecomposition.end(); ++it) { auto perm = *it; if (a > 0 && perm.geodesic().size() >= cut_value) { perm = (-perm) * omega; if ((--a) % 2 != 0) perm = perm.flip(); result *= -Word(perm.geodesicWord()); } else { if (a % 2 != 0) perm = perm.flip(); result *= Word(perm.geodesicWord()); } } return result; }