I fixed the first error (AttributeError: 'FreeAlgebra_generic_with_
category.element_class' object has no attribute '_element_list')
but would still like to figure out the second two errors to further
automate the free algebra generation.


On Sun, Jul 27, 2014 at 11:40 PM, Stephen Kauffman <strangerl...@gmail.com>
wrote:

> Thanks for your help but I think I need more. I've written some code for a
> somewhat general case of n orthogonal generators and an arbitrary diagonal
> metric and I think I've generated the correct 16x16 matrices for my n=4
> case. When I finish running the .sage file and return to sage I execute
>
> F = PRGA.monoid()
> MyStr=str(PRGA.gens())
> MyStr=MyStr[1:len(MyStr)-1]
> exec MyStr+' = F.gens()'
> ST.<g0,g1,g2,g3>=FreeAlgebraQuotient(PRGA,MyList6,mats)
> ST
>   Free algebra quotient on 4 generators ('g0', 'g1', 'g2', 'g3') and
> dimension 16 over Rational Field
>
> but when I do
>
> g3*g3 # or ST.gen(3)*ST.gen(3)
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "_sage_input_9.py", line 10, in <module>
>     exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
> -*-\\n" +
> _support_.preparse_worksheet_cell(base64.b64decode("ZzMqZzM="),globals())+"\\n");
> execfile(os.path.abspath("___code___.py"))
>   File "", line 1, in <module>
>
>   File "/tmp/tmpnhv5ev/___code___.py", line 2, in <module>
>     exec compile(u'g3*g3
>   File "", line 1, in <module>
>
>   File "element.pyx", line 1710, in
> sage.structure.element.RingElement.__mul__ (sage/structure/element.c:15287)
>   File "element.pyx", line 1717, in
> sage.structure.element.RingElement._mul_ (sage/structure/element.c:15414)
>   File
> "/home/anonymous/sage-6.2/local/lib/python2.7/site-packages/sage/algebras/free_algebra_quotient_element.py",
> line 255, in _mul_
>     if c != 0: z.__vector += monomial_product(A,c*u,B[i])
>   File
> "/home/anonymous/sage-6.2/local/lib/python2.7/site-packages/sage/algebras/free_algebra_quotient_element.py",
> line 245, in monomial_product
>     for (j,k) in m._element_list:
>   File "element.pyx", line 344, in
> sage.structure.element.Element.__getattr__ (sage/structure/element.c:4022)
>   File "misc.pyx", line 251, in
> sage.structure.misc.getattr_from_other_class (sage/structure/misc.c:1687)
> AttributeError: 'FreeAlgebra_generic_with_category.element_class' object
> has no attribute '_element_list'
>
> Further when I try to automate with the generated string MyStr='g0, g1,
> g2, g3' and within the .sage file
>
> exec 'ST.<'+MyStr+'> = FreeAlgebraQuotient(PRGA,MyList6,mats)'
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "_sage_input_13.py", line 10, in <module>
>     exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
> -*-\\n" +
> _support_.preparse_worksheet_cell(base64.b64decode("ZXhlYyAnU1QuPCcrTXlTdHIrJz4gPSBGcmVlQWxnZWJyYVF1b3RpZW50KFBSR0EsTXlMaXN0NixtYXRzKSc="),globals())+"\\n");
> execfile(os.path.abspath("___code___.py"))
>   File "", line 1, in <module>
>
>   File "/tmp/tmpLPtPyL/___code___.py", line 2, in <module>
>     exec compile(u"exec 'ST.<'+MyStr+'> =
> FreeAlgebraQuotient(PRGA,MyList6,mats)'" + '\n', '', 'single')
>   File "", line 1, in <module>
>
>   File "<string>", line 1
>     ST.<g0, g1, g2, g3> = FreeAlgebraQuotient(PRGA,MyList6,mats)
>        ^
> SyntaxError: invalid syntax
>
> If I try:
>
> ST=FreeAlgebraQuotient(PRGA,MyList6,mats, names='g0, g1, g2, g3') # or
> anything else I try in names
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "_sage_input_7.py", line 10, in <module>
>     exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
> -*-\\n" +
> _support_.preparse_worksheet_cell(base64.b64decode("U1Q9RnJlZUFsZ2VicmFRdW90aWVudChQUkdBLE15TGlzdDYsbWF0cywgbmFtZXM9J2cwLCBnMSwgZzIsIGczJykKI2V4ZWMgJ1NULjwnK015U3RyKyc+ID0gRnJlZUFsZ2VicmFRdW90aWVudChQUkdBLE15TGlzdDYsbWF0cyknCmV4ZWMgTXlTdHIrJyA9IFNULmdlbnMoKSc="),globals())+"\\n");
> execfile(os.path.abspath("___code___.py"))
>   File "", line 1, in <module>
>
>   File "/tmp/tmprvEfNn/___code___.py", line 2, in <module>
>     ST=FreeAlgebraQuotient(PRGA,MyList6,mats, names='g0, g1, g2, g3')
>   File "classcall_metaclass.pyx", line 330, in
> sage.misc.classcall_metaclass.ClasscallMetaclass.__call__
> (sage/misc/classcall_metaclass.c:1282)
>   File
> "/home/anonymous/sage-6.2/local/lib/python2.7/site-packages/sage/algebras/free_algebra_quotient.py",
> line 74, in __classcall__
>     tuple(new_mats), tuple(names))
>   File "cachefunc.pyx", line 1077, in
> sage.misc.cachefunc.WeakCachedFunction.__call__ (sage/misc/cachefunc.c:6486)
>   File
> "/home/anonymous/sage-6.2/local/lib/python2.7/site-packages/sage/structure/unique_representation.py",
> line 1021, in __classcall__
>     instance = typecall(cls, *args, **options)
>   File "classcall_metaclass.pyx", line 518, in
> sage.misc.classcall_metaclass.typecall
> (sage/misc/classcall_metaclass.c:1665)
>   File
> "/home/anonymous/sage-6.2/local/lib/python2.7/site-packages/sage/algebras/free_algebra_quotient.py",
> line 143, in __init__
>     Algebra.__init__(self, R, names, normalize=True)
>   File "ring.pyx", line 2135, in sage.rings.ring.Algebra.__init__
> (sage/rings/ring.c:13719)
>   File "ring.pyx", line 176, in sage.rings.ring.Ring.__init__
> (sage/rings/ring.c:2370)
>   File "parent.pyx", line 357, in sage.structure.parent.Parent.__init__
> (sage/structure/parent.c:4393)
>   File "parent_gens.pyx", line 332, in
> sage.structure.parent_gens.ParentWithGens._assign_names
> (sage/structure/parent_gens.c:3682)
>   File "parent_gens.pyx", line 207, in
> sage.structure.parent_gens.normalize_names
> (sage/structure/parent_gens.c:2762)
>   File "parent_gens.pyx", line 148, in
> sage.structure.parent_gens._certify_names
> (sage/structure/parent_gens.c:2325)
> ValueError: first letter of variable name must be a letter
>
>
> On Sat, Jul 26, 2014 at 10:17 PM, Nils Bruin <nbr...@sfu.ca> wrote:
>
>> On Saturday, July 26, 2014 12:21:38 PM UTC-7, Stephen Kauffman wrote:
>>>
>>> TypeError: unsupported operand parent(s) for '*': 'Vector space of
>>> dimension 16 over Rational Field' and 'Full MatrixSpace of 8 by 8 dense
>>> matrices over Integer
>>> Ring'
>>>
>>> The error that you're getting is because there's a dimension mismatch in
>> the data you specify. "mons" is supposed to be a QQ-vector space basis of
>> your algebra (16 dimensional in your case) and mats is supposed to give the
>> linear transformations that multiplying by, resp., g0,g1,g2,g3 give. Thus,
>> G0 is supposed to have as rows the elements
>>
>> [m*g0 for m in mons]
>>
>> written out as coordinates wrt. mons.
>>
>> In particular, "mats" should consist of 16x16 matrices. The constructor
>> should have done a sanity check and given you an error earlier.
>>
>> In particular, this routine does NOT represent an algebra by a free ring
>> modulo some ideal, but basically via structure constants (it saves you some
>> work because you only have to specify the endomorphisms for the algebra
>> generators of the free algebra, not for all the elements of mons).
>>
>> You can probably work out what the 4 16x16 matrices are quite easily.
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "sage-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to sage-support+unsubscr...@googlegroups.com.
>> To post to this group, send email to sage-support@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sage-support.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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

Reply via email to