diff r 5c0961ff033d sage/combinat/symmetric_group_algebra.py
a

b


412  412  e_cache = {} 
413  413  def e(tableau, star=0): 
414  414  """ 
 415  The unnormalized Young projection operator. 
 416  
415  417  EXAMPLES:: 
416  418  
417  419  sage: from sage.combinat.symmetric_group_algebra import e 
… 
… 

419  421  [1, 2] + [2, 1] 
420  422  sage: e([[1],[2]]) 
421  423  [1, 2]  [2, 1] 
 424  
 425  There are differing conventions for the order of the symmetrizers 
 426  and antisymmetrizers. This example illustrates our conventions:: 
 427  
 428  sage: e([[1,2],[3]]) 
 429  [1, 2, 3] + [2, 1, 3]  [3, 1, 2]  [3, 2, 1] 
422  430  """ 
423  431  t = Tableau(tableau) 
424  432  if star: 
… 
… 

428  436  permutation_options['mult'] = 'l2r' 
429  437  
430  438  if t in e_cache: 
431   res = e_cache[t] 
 439  res = e_cache[t] 
432  440  else: 
433   rs = t.row_stabilizer() 
434   cs = t.column_stabilizer() 
 441  rs = t.row_stabilizer().list() 
 442  cs = t.column_stabilizer().list() 
435  443  n = t.size() 
436  444  
437  445  QSn = SymmetricGroupAlgebra(QQ, n) 
 446  one = QQ(1) 
 447  P = permutation.Permutation 
438  448  
439   res = 0 
440   for h in rs: 
441   for v in cs: 
442   res += v.sign() * QSn( (h*v).list() ) 
 449  rd = dict((P(h), one) for h in rs) 
 450  sym = QSn._from_dict(rd) 
 451  
 452  cd = dict((P(v), v.sign()*one) for v in cs) 
 453  antisym = QSn._from_dict(cd) 
 454  
 455  res = antisym*sym 
 456  
443  457  e_cache[t] = res 
444  458  
445  459  permutation_options['mult'] = mult 
… 
… 

448  462  ehat_cache = {} 
449  463  def e_hat(tab, star=0): 
450  464  """ 
 465  The Young projection operator, an idempotent in the rational group algebra. 
 466  
451  467  EXAMPLES:: 
452  468  
453  469  sage: from sage.combinat.symmetric_group_algebra import e_hat 
… 
… 

455  471  1/6*[1, 2, 3] + 1/6*[1, 3, 2] + 1/6*[2, 1, 3] + 1/6*[2, 3, 1] + 1/6*[3, 1, 2] + 1/6*[3, 2, 1] 
456  472  sage: e_hat([[1],[2]]) 
457  473  1/2*[1, 2]  1/2*[2, 1] 
 474  
 475  There are differing conventions for the order of the symmetrizers 
 476  and antisymmetrizers. This example illustrates our conventions:: 
 477  
 478  sage: e_hat([[1,2],[3]]) 
 479  1/3*[1, 2, 3] + 1/3*[2, 1, 3]  1/3*[3, 1, 2]  1/3*[3, 2, 1] 
458  480  """ 
459  481  t = Tableau(tab) 
460  482  if star: 