ch.9 problem.P5

373 days ago by g1.kjiwon

a,b,c,d=var('a,b,c,d') A=matrix([[a,b], [c,d]]) AT=A.transpose() print A+AT 
       
Traceback (click to the left of this block for traceback)
...
ValueError: variable names must be alphanumeric, but one is '[a, b]'
which is not.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_70.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("YSxiLGMsZD12YXIoJ2EsYixjLGQnKSAgICAKQT1tYXRyaXgoUVFbW2EsYl0sIFtjLGRdXSkKQVQ9QS50cmFuc3Bvc2UoKQpwcmludCBBK0FU"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmp_qGeZR/___code___.py", line 3, in <module>
    A=matrix(QQ[[a,b], [c,d]])
  File "ring.pyx", line 301, in sage.rings.ring.Ring.__getitem__ (sage/rings/ring.c:3386)
  File "/root/sage-5.8/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 480, in PolynomialRing
    R = _multi_variate(base_ring, names, n, sparse, order, implementation)
  File "/root/sage-5.8/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 577, in _multi_variate
    names = normalize_names(n, names)
  File "parent_gens.pyx", line 207, in sage.structure.parent_gens.normalize_names (sage/structure/parent_gens.c:2477)
  File "parent_gens.pyx", line 146, in sage.structure.parent_gens._certify_names (sage/structure/parent_gens.c:2006)
ValueError: variable names must be alphanumeric, but one is '[a, b]' which is not.
M = MatrixSpace(ZZ,2,2) h(A)=[A+AT] T=linear_transformation(M,M,h,side='right') print T print T.kernel() print T.image() 
       
Traceback (click to the left of this block for traceback)
...
TypeError: first argument must be a matrix or a vector space, not Full
MatrixSpace of 2 by 2 dense matrices over Integer Ring
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_73.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("TSA9IE1hdHJpeFNwYWNlKFpaLDIsMikKaChBKT1bQStBVF0KVD1saW5lYXJfdHJhbnNmb3JtYXRpb24oTSxNLGgsc2lkZT0ncmlnaHQnKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpBUVDQf/___code___.py", line 5, in <module>
    exec compile(u"T=linear_transformation(M,M,h,side='right')" + '\n', '', 'single')
  File "", line 1, in <module>
    
  File "/root/sage-5.8/local/lib/python2.7/site-packages/sage/modules/vector_space_morphism.py", line 701, in linear_transformation
    raise TypeError('first argument must be a matrix or a vector space, not {0}'.format(arg0))
TypeError: first argument must be a matrix or a vector space, not Full MatrixSpace of 2 by 2 dense matrices over Integer Ring
 
       
A |--> [A + a     c]
[    b A + d]
Traceback (click to the left of this block for traceback)
...
AttributeError: 'sage.symbolic.expression.Expression' object has no
attribute 'kernel'
A |--> [A + a     c]
[    b A + d]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_74.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cHJpbnQgVApwcmludCBULmtlcm5lbCgpCnByaW50IFQuaW1hZ2UoKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpap9Fww/___code___.py", line 3, in <module>
    print T.kernel()
  File "element.pyx", line 344, in sage.structure.element.Element.__getattr__ (sage/structure/element.c:3637)
  File "misc.pyx", line 257, in sage.structure.misc.getattr_from_other_class (sage/structure/misc.c:1507)
AttributeError: 'sage.symbolic.expression.Expression' object has no attribute 'kernel'