Re: [sage-combinat-devel] Free Algebra Element

2013-04-10 Thread Matthieu Deneufchatel
I doubt this has ever worked:
In fact, my message was not clear. I test if type(a*b) == 
sage.algebras.free_algebra_element.FreeAlgebraElement
With older versions, type(a*b) == 
sage.algebras.free_algebra_element.FreeAlgebraElement 

which is not the case anymore.
But your advice is good, thanks !
Matthieu




 De : Nicolas M. Thiery nicolas.thi...@u-psud.fr
À : sage-combinat-devel@googlegroups.com 
Envoyé le : Mercredi 10 avril 2013 15h33
Objet : Re: [sage-combinat-devel] Free Algebra Element
 
    Bonjour Matthieu,

On Wed, Apr 10, 2013 at 02:15:20PM +0100, Matthieu Deneufchatel wrote:
    Do I miss something or is there a bug :
    sage: R.a,b=FreeAlgebra(QQ,2)
    sage: a*b
    a*b
    sage: type(a*b)
    class
    
'sage.algebras.free_algebra_element.FreeAlgebra_generic_with_category.element_class'
    sage:
    
type(a*b)==sage.algebras.free_algebra_element.FreeAlgebra_generic_with_category.element_class
    ---
    AttributeError                            Traceback (most recent call
    last)
 
    /home/deneufchatel/ipython console in module()
 
    AttributeError: 'module' object has no attribute
    'FreeAlgebra_generic_with_category'

    The same code used to give something consistent with older versions of
    Sage (4.8 ?).

I doubt this has ever worked: the class
FreeAlgebra_generic_with_category is generated on the fly to add
generic code from the categories to the code of FreeAlgebra and
FreeAlgebraElement. For details, see:

    
http://www.sagemath.org/doc/reference/categories/sage/categories/category.html

On the other hand you can do something like:

    sage: type(a*b) == R.element_class

Cheers,
                Nicolas
--
Nicolas M. Thiéry Isil nthi...@users.sf.net
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-combinat-devel] Free Algebra Element

2013-04-10 Thread Nicolas M. Thiery
On Wed, Apr 10, 2013 at 06:05:35PM +0100, Matthieu Deneufchatel wrote:
I doubt this has ever worked:
In fact, my message was not clear. I test if type(a*b) ==
sage.algebras.free_algebra_element.FreeAlgebraElement
With older versions, type(a*b) ==
sage.algebras.free_algebra_element.FreeAlgebraElement
which is not the case anymore.

Ok, this makes sense! So what has changed in Sage is that FreeAlgebra
now uses categories which was not the case before.

Note that the following still holds:

sage: isinstance(a*b, sage.algebras.free_algebra_element.FreeAlgebraElement)

Cheers,
Nicolas
--
Nicolas M. Thiéry Isil nthi...@users.sf.net
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.