Ask Your Question

Matthieu Deneufchâtel's profile - activity

2019-10-10 22:57:44 +0100 received badge  Notable Question (source)
2019-01-31 12:02:36 +0100 received badge  Popular Question (source)
2018-05-06 01:26:13 +0100 received badge  Popular Question (source)
2015-10-18 17:58:43 +0100 received badge  Taxonomist
2015-09-17 00:11:20 +0100 received badge  Popular Question (source)
2012-02-01 14:04:47 +0100 received badge  Great Question (source)
2012-01-31 17:47:45 +0100 received badge  Good Question (source)
2012-01-30 13:12:52 +0100 received badge  Nice Question (source)
2012-01-30 12:42:01 +0100 received badge  Student (source)
2012-01-30 09:52:06 +0100 asked a question How to make my code available

I wrote some functions and would like to make them available. I don't really want to integrate them into Sage, because I think it is too complicated for me. I also doubt that these functions are interesting for so many people that it is worth adding them to the standard libraries.

Is there a way to "publish" my code as it is now to get some feedback and advice ?

2012-01-30 09:45:18 +0100 answered a question sage and nohup

My code works without nohup. I don't why, but I could not make it work with it, so I used the screen command and was able to do what I want. Thanks for your answer anyway.

2012-01-14 08:37:45 +0100 asked a question sage and nohup

Does anyone understand why the code below, saved in the file input.txt, does not work when it is run with the command

nohup sage < input.txt > output.txt &

(Of course, I use * for the product but it does not appear properly here)?

import sage.combinat.lyndon_word as LW

from sage.combinat.words.shuffle_product import ShuffleProduct_w1w2 as SP

from sage.combinat.free_module import CombinatorialFreeModule as CFM

F=CFM(QQ, ['a','b'])

R.<a,b>=FreeAlgebra(QQ,2)

Module=CombinatorialFreeModule(F.base_ring(),R)

def TP_free_algebra(w1,w2):
  if type(w1)==Integer:
    if type(w2)==Integer:
      return w1*w2*tensor((Module.basis()[1],Module.basis()[1]))
    else:
      L2=list(w2)
      result=0
      for i in L2:
        result+=w1*i[0]*tensor((Module.basis()[1],Module.basis()[i[1]]))    
      return result
  else:
    if type(w2)==Integer:
      L1=list(w1)
      result=0
      for i in L1:
        result+=w2*i[0]*tensor((Module.basis()[i[1]],Module.basis()[1]))    
      return result
    else:
      L1=list(w1)
      L2=list(w2)
      result=0
      for i in L1:
        for j in L2:
          result+=i[0]*j[0]*tensor((Module.basis()[i[1]],Module.basis()[j[1]]))
      return result

TP_free_algebra(Word('a'),Word('b'))
2011-12-31 11:26:07 +0100 commented answer free algebra and indexed letters

Thanks, that helps !

2011-12-30 12:41:57 +0100 asked a question free algebra and indexed letters

I try to work with a Combinatorial Free Module with basis a set of Words over an alphabet of indexed letters (y1,y2,...). For example, I define

from sage.combinat.free_module import CombinatorialFreeModule as CFM Mots=Words(['y1','y2','y3','y4','y5','y6','y7','y8']) Module=CFM(QQ,Mots)

But I have some problems with the letters. For example :

mot=Word('y1') sage: mot word: y1 sage: mot in Mots False

Is there a way to cure this problem ?

2011-12-29 07:39:25 +0100 asked a question Free algebra over infinite alphabet

Is it possible to work with a free algebra over an infinite alphabet ? Or to define an Infinite ring of non-commutative polynomials ? I need one of these structures to work with the quasi shuffle product.