Copy of cyclotomic

125 days ago by daviddaved

w = var('w') 
       
z = var('z') 
       
z = w^3 
       
f = function('cfraction',w,z) 
       
f(w) = (w+1/w)*(z-1/z)/(w-1/w) 
       
f(10); "coefficients of the reduced form" 
       
1020201/1000
'coefficients of the reduced form'
1020201/1000
'coefficients of the reduced form'
f(w) = (w^2+1/w^2)*(z-1/z)/(w^2-1/w^2)+1/f(w) 
       
f(10); "coefficients of the reduced form" 
       
1020405040201/1020201000
'coefficients of the reduced form'
1020405040201/1020201000
'coefficients of the reduced form'
factor(f) 
       
w |--> (w^12 + 2*w^10 + 4*w^8 + 5*w^6 + 4*w^4 + 2*w^2 + 1)/((w^2 +
1)*(w^2 - w + 1)*(w^2 + w + 1)*w^3)
w |--> (w^12 + 2*w^10 + 4*w^8 + 5*w^6 + 4*w^4 + 2*w^2 + 1)/((w^2 + 1)*(w^2 - w + 1)*(w^2 + w + 1)*w^3)
f(w) = (w^3+1/w^3)*(z-1/z)/(w^3-1/w^3)+1/f(w) 
       
f(w) 
       
1/((w^2 + 1/w^2)*(w^3 - 1/w^3)/(w^2 - 1/w^2) + (w - 1/w)/((w + 1/w)*(w^3
- 1/w^3))) + w^3 + 1/w^3
1/((w^2 + 1/w^2)*(w^3 - 1/w^3)/(w^2 - 1/w^2) + (w - 1/w)/((w + 1/w)*(w^3 - 1/w^3))) + w^3 + 1/w^3
f(10) 
       
1020407080807040201/1020405040201000
1020407080807040201/1020405040201000
f(w) = (w^4+1/w^4)*(z-1/z)/(w^4-1/w^4)+1/f(w) 
       
"f(10) gives the reduced form" 
       
'f(10) gives the reduced form'
'f(10) gives the reduced form'
h = function('h',w) 
       
x = var('x'); y = var('y'); p = function('Laurent',x,y) 
       
f(w) = (w^5+1/w^5)*(z-1/z)/(w^5-1/w^5)+1/f(w) 
       
p = x^6*(x^4+1)*y^3-2*x^4*(x^4+x^2+1)*y+2*x^2*(x^4+x^2+1)/y-(x^4+1)/y^3; "assumed form in the proof" 
       
'assumed form in the proof'
'assumed form in the proof'
f(w) = (w^6+1/w^6)*(z-1/z)/(w^6-1/w^6)+1/f(w) 
       
p(10,10^5)/p(10,10^4) 
       
1020407101417181817141007040201/1020407101213121007040201000
1020407101417181817141007040201/1020407101213121007040201000
f(10); "coefficients match" 
       
1020407101417181817141007040201/1020407101213121007040201000
'coefficients match'
1020407101417181817141007040201/1020407101213121007040201000
'coefficients match'
h(w)=(1+w)*(1+w^2)*(1+w^3)*(1+w^4)/(1-w)/(1-w^2)/(1-w^3)/(1-w^4)/(1-w^5) 
       
f(w) = (w^7+1/w^7)*(z-1/z)/(w^7-1/w^7)+1/f(w) 
       
p(10,10^7)/p(10,10^6); "coefficients match" 
       
1020407101419242831323231282419141007040201/1020407101419222425242219141\
007040201000
'coefficients match'
1020407101419242831323231282419141007040201/1020407101419222425242219141007040201000
'coefficients match'
f(10) 
       
1020407101419242831323231282419141007040201/1020407101419222425242219141\
007040201000
1020407101419242831323231282419141007040201/1020407101419222425242219141007040201000
factor(f) 
       
w |--> (w^2 + 1)*(w^4 - w^2 + 1)*(w^24 + 2*w^22 + 4*w^20 + 6*w^18 +
8*w^16 + 10*w^14 + 11*w^12 + 10*w^10 + 8*w^8 + 6*w^6 + 4*w^4 + 2*w^2 +
1)/((w^4 - w^3 + w^2 - w + 1)*(w^4 + w^3 + w^2 + w + 1)*(w^16 + w^14 +
2*w^12 + 3*w^10 + 3*w^8 + 3*w^6 + 2*w^4 + w^2 + 1)*w^3)
w |--> (w^2 + 1)*(w^4 - w^2 + 1)*(w^24 + 2*w^22 + 4*w^20 + 6*w^18 + 8*w^16 + 10*w^14 + 11*w^12 + 10*w^10 + 8*w^8 + 6*w^6 + 4*w^4 + 2*w^2 + 1)/((w^4 - w^3 + w^2 - w + 1)*(w^4 + w^3 + w^2 + w + 1)*(w^16 + w^14 + 2*w^12 + 3*w^10 + 3*w^8 + 3*w^6 + 2*w^4 + w^2 + 1)*w^3)
numerical? 
       

No object 'numerical' currently defined.

No object 'numerical' currently defined.
q = function("q",x); q = x^6*(x^4+1)*(x^5)^3-2*x^4*(x^4+x^2+1)*(x^5)+2*x^2*(x^4+x^2+1)/(x^5)-(x^4+1)/(x^5)^3; 
       
f(w) = (w^8+1/w^8)*(z-1/z)/(w^8-1/w^8)+1/f(w) 
       
plot(CC(f(exp(i*pi/x)))) 
       
Traceback (click to the left of this block for traceback)
...
TypeError: Cannot evaluate symbolic expression to a numeric value.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_171.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cGxvdChDQyhmKGV4cChpKnBpL3gpKSkp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpVoqfcz/___code___.py", line 2, in <module>
    exec compile(u'plot(CC(f(exp(i*pi/x))))
  File "", line 1, in <module>
    
  File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/rings/complex_field.py", line 277, in __call__
    return Parent.__call__(self, x)
  File "parent.pyx", line 988, in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7326)
  File "coerce_maps.pyx", line 82, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3268)
  File "coerce_maps.pyx", line 77, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3171)
  File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/rings/complex_field.py", line 305, in _element_constructor_
    return x._complex_mpfr_field_( self )
  File "expression.pyx", line 933, in sage.symbolic.expression.Expression._complex_mpfr_field_ (sage/symbolic/expression.cpp:5451)
  File "expression.pyx", line 796, in sage.symbolic.expression.Expression._eval_self (sage/symbolic/expression.cpp:4912)
TypeError: Cannot evaluate symbolic expression to a numeric value.
factor(q) 
       
(x - 1)^3*(x + 1)^3*(x^2 + 1)*(x^2 - x + 1)*(x^2 + x + 1)*(x^4 - x^2 +
1)*(x^24 + 2*x^22 + 4*x^20 + 6*x^18 + 8*x^16 + 10*x^14 + 11*x^12 +
10*x^10 + 8*x^8 + 6*x^6 + 4*x^4 + 2*x^2 + 1)/x^15
(x - 1)^3*(x + 1)^3*(x^2 + 1)*(x^2 - x + 1)*(x^2 + x + 1)*(x^4 - x^2 + 1)*(x^24 + 2*x^22 + 4*x^20 + 6*x^18 + 8*x^16 + 10*x^14 + 11*x^12 + 10*x^10 + 8*x^8 + 6*x^6 + 4*x^4 + 2*x^2 + 1)/x^15
f(w) = (w^9+1/w^9)*(z-1/z)/(w^9-1/w^9)+1/f(w) 
       
CC(f(exp(i*pi/19))) 
       
1.00000000000000
1.00000000000000
p(10,10^9)/p(10,10^8); "coefficients match" 
       
1020407101419243037424649505049464237302419141007040201/1020407101419243\
035384041403835302419141007040201000
'coefficients match'
1020407101419243037424649505049464237302419141007040201/1020407101419243035384041403835302419141007040201000
'coefficients match'
f(10) 
       
1020407101419243037424649505049464237302419141007040201/1020407101419243\
035384041403835302419141007040201000
1020407101419243037424649505049464237302419141007040201/1020407101419243035384041403835302419141007040201000
f(w) = (w^10+1/w^10)*(z-1/z)/(w^10-1/w^10)+1/f(w) 
       
CC(f(exp(i*pi/21))) 
       
1.00000000000000
1.00000000000000
q(10) 
       
10000999999979798000000020201999999989999/1000000000000000
10000999999979798000000020201999999989999/1000000000000000
f(w) = (w^11+1/w^11)*(z-1/z)/(w^11-1/w^11)+1/f(w) 
       
f(w) = (w^12+1/w^12)*(z-1/z)/(w^12-1/w^12)+1/f(w) 
       
f(w) = (w^13+1/w^13)*(z-1/z)/(w^13-1/w^13)+1/f(w) 
       
CC(f(exp(i*pi/27))) 
       
1.00000000000000
1.00000000000000
f(10) 
       
340136047445515970510156494717260659164408417576420360098416044848374883\
4225690741744040428191389183131556011736928478743802680067/3401360474455\
159705101564879145397789615699042927076076377827763404203250856021461779\
6864711815601173692847874380268006700000
3401360474455159705101564947172606591644084175764203600984160448483748834225690741744040428191389183131556011736928478743802680067/34013604744551597051015648791453977896156990429270760763778277634042032508560214617796864711815601173692847874380268006700000
f(w) = (w^14+1/w^14)*(z-1/z)/(w^14-1/w^14)+1/f(w) 
       
f(w) = (w^15+1/w^15)*(z-1/z)/(w^15-1/w^15)+1/f(w) 
       
CC(f(exp(i*pi/31))) 
       
1.00000000000000
1.00000000000000
f(10) 
       
1020407101417181817141007040201/1020407101213121007040201000
1020407101417181817141007040201/1020407101213121007040201000
factor(f) 
       
w |--> (w^2 + 1)*(w^4 - w^2 + 1)*(w^24 + 2*w^22 + 4*w^20 + 6*w^18 +
8*w^16 + 10*w^14 + 11*w^12 + 10*w^10 + 8*w^8 + 6*w^6 + 4*w^4 + 2*w^2 +
1)/((w^4 - w^3 + w^2 - w + 1)*(w^4 + w^3 + w^2 + w + 1)*(w^16 + w^14 +
2*w^12 + 3*w^10 + 3*w^8 + 3*w^6 + 2*w^4 + w^2 + 1)*w^3)
w |--> (w^2 + 1)*(w^4 - w^2 + 1)*(w^24 + 2*w^22 + 4*w^20 + 6*w^18 + 8*w^16 + 10*w^14 + 11*w^12 + 10*w^10 + 8*w^8 + 6*w^6 + 4*w^4 + 2*w^2 + 1)/((w^4 - w^3 + w^2 - w + 1)*(w^4 + w^3 + w^2 + w + 1)*(w^16 + w^14 + 2*w^12 + 3*w^10 + 3*w^8 + 3*w^6 + 2*w^4 + w^2 + 1)*w^3)
g = function('g',x) 
       
x = var('x') 
       
g(x) = (1+x^2)/((1-x)^2*(1-x^3)) 
       
h(x) = derivative(g,4) 
       
h(0)/factorial(4) 
       
10
10
n = var('n') 
       
N = var('N') 
       
c = function('c',w) 
       
c(w,N) = c(w,N)/c(w,N-1) 
       
N = 6 
       
       
6
6
c(w) = sum(n*(n+1)*(w^(N+1-n)+w^(n-N-1)),n,1,N)/sum(n*(n+1)*(w^(N+1-n)+w^(n-N-1)),n,1,N-1) 
       
c(w) 
       
(w^12 + 3*w^11 + 6*w^10 + 10*w^9 + 15*w^8 + 21*w^7 + 21*w^5 + 15*w^4 +
10*w^3 + 6*w^2 + 3*w + 1)/(w^12 + 3*w^11 + 6*w^10 + 10*w^9 + 15*w^8 +
15*w^4 + 10*w^3 + 6*w^2 + 3*w + 1)
(w^12 + 3*w^11 + 6*w^10 + 10*w^9 + 15*w^8 + 21*w^7 + 21*w^5 + 15*w^4 + 10*w^3 + 6*w^2 + 3*w + 1)/(w^12 + 3*w^11 + 6*w^10 + 10*w^9 + 15*w^8 + 15*w^4 + 10*w^3 + 6*w^2 + 3*w + 1)
c(100) 
       
1030610152100211510060301/1030610150000001510060301
1030610152100211510060301/1030610150000001510060301
c(w) = sum(n*(n+1)*(w^(N+1-n)+w^(n-N-1)),n,1,N) 
       
c(w) 
       
2*(w^12 + 3*w^11 + 6*w^10 + 10*w^9 + 15*w^8 + 21*w^7 + 21*w^5 + 15*w^4 +
10*w^3 + 6*w^2 + 3*w + 1)/w^6
2*(w^12 + 3*w^11 + 6*w^10 + 10*w^9 + 15*w^8 + 21*w^7 + 21*w^5 + 15*w^4 + 10*w^3 + 6*w^2 + 3*w + 1)/w^6
c(100) 
       
1030610152100211510060301/500000000000
1030610152100211510060301/500000000000
[1/1, 2/1, 8/2, 42/6, 240/24, 1680/120] 
       
[1, 2, 4, 7, 10, 14]
[1, 2, 4, 7, 10, 14]
[1, 2, 4, 8, 14, 23, 36, 54, 78, 110, 151, 202, 266, 344, 438, 551, 684, 840,1022, 1232, 1473, 1748, 2060, 2412, 2808, 3251]-[1, 2, 4, 8, 14, 23, 36, 54, 78, 110, 151, 200, 260 ,330 ,408 ,495 ,588 ,684 ,782, 878, 967, 1046, 1112, 1160,1190, 1201] 
       
Traceback (click to the left of this block for traceback)
...
TypeError: unsupported operand type(s) for -: 'list' and 'list'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_95.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("WzEsIDIsIDQsIDgsIDE0LCAyMywgMzYsIDU0LCA3OCwgMTEwLCAxNTEsIDIwMiwgMjY2LCAzNDQsIDQzOCwgNTUxLCA2ODQsIDg0MCwxMDIyLCAxMjMyLCAxNDczLCAxNzQ4LCAyMDYwLCAyNDEyLCAyODA4LCAzMjUxXS1bMSwgMiwgNCwgOCwgMTQsIDIzLCAzNiwgNTQsIDc4LCAxMTAsIDE1MSwgMjAwLCAyNjAgLDMzMCAsNDA4ICw0OTUgLDU4OCAsNjg0ICw3ODIsIDg3OCwgOTY3LCAgIDEwNDYsIDExMTIsIDExNjAsMTE5MCwgMTIwMV0="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpejSTZk/___code___.py", line 3, in <module>
    exec compile(u'[_sage_const_1 , _sage_const_2 , _sage_const_4 , _sage_const_8 , _sage_const_14 , _sage_const_23 , _sage_const_36 , _sage_const_54 , _sage_const_78 , _sage_const_110 , _sage_const_151 , _sage_const_202 , _sage_const_266 , _sage_const_344 , _sage_const_438 , _sage_const_551 , _sage_const_684 , _sage_const_840 ,_sage_const_1022 , _sage_const_1232 , _sage_const_1473 , _sage_const_1748 , _sage_const_2060 , _sage_const_2412 , _sage_const_2808 , _sage_const_3251 ]-[_sage_const_1 , _sage_const_2 , _sage_const_4 , _sage_const_8 , _sage_const_14 , _sage_const_23 , _sage_const_36 , _sage_const_54 , _sage_const_78 , _sage_const_110 , _sage_const_151 , _sage_const_200 , _sage_const_260  ,_sage_const_330  ,_sage_const_408  ,_sage_const_495  ,_sage_const_588  ,_sage_const_684  ,_sage_const_782 , _sage_const_878 , _sage_const_967 ,   _sage_const_1046 , _sage_const_1112 , _sage_const_1160 ,_sage_const_1190 , _sage_const_1201 ]
  File "", line 1, in <module>
    
TypeError: unsupported operand type(s) for -: 'list' and 'list'
v1 = vector([1, 2, 4, 8, 14, 23, 36, 54, 78, 110, 151, 202, 266, 344, 438, 551, 684, 840,1022, 1232, 1473, 1748, 2060, 2412, 2808, 3251]);v1 
       
(1, 2, 4, 8, 14, 23, 36, 54, 78, 110, 151, 202, 266, 344, 438, 551, 684,
840, 1022, 1232, 1473, 1748, 2060, 2412, 2808, 3251)
(1, 2, 4, 8, 14, 23, 36, 54, 78, 110, 151, 202, 266, 344, 438, 551, 684, 840, 1022, 1232, 1473, 1748, 2060, 2412, 2808, 3251)
v2 = vector([1, 2, 4, 8, 14, 23, 36, 54, 78, 110, 151, 200, 260 ,330 ,408 ,495 ,588 ,684 ,782, 878, 967, 1046, 1112, 1160,1190, 1201]);v2 
       
(1, 2, 4, 8, 14, 23, 36, 54, 78, 110, 151, 200, 260, 330, 408, 495, 588,
684, 782, 878, 967, 1046, 1112, 1160, 1190, 1201)
(1, 2, 4, 8, 14, 23, 36, 54, 78, 110, 151, 200, 260, 330, 408, 495, 588, 684, 782, 878, 967, 1046, 1112, 1160, 1190, 1201)
v1-v2 
       
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6, 14, 30, 56, 96, 156, 240, 354,
506, 702, 948, 1252, 1618, 2050)
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6, 14, 30, 56, 96, 156, 240, 354, 506, 702, 948, 1252, 1618, 2050)
factor(1252) 
       
2^2 * 313
2^2 * 313
g(w) = w^60 + w^58 + 2*w^56+ 3*w^54 + 3*w^52 + 4*w^50 + 5*w^48 + 5*w^46 + 6*w^44 + 7*w^42 + 7*w^40+ 8*w^38 + 9*w^36 + 9*w^34 + 10*w^32 + 11*w^30 + 10*w^28 + 9*w^26 +9*w^24 + 8*w^22 + 7*w^20 + 7*w^18 + 6*w^16 + 5*w^14 + 5*w^12 + 4*w^10 +3*w^8 + 3*w^6 + 2*w^4 + w^2 + 1 
       
g(10) 
       
1010203030405050607070809091011100909080707060505040303020101
1010203030405050607070809091011100909080707060505040303020101
v = (([ 0.6751286432296377 + 0.6024647503290501 *i, 0.6751286432296377 - 0.6024647503290501 *i, -0.6751286432296383 + 0.6024647503290492 *i, -0.6751286432296383 - 0.6024647503290492 *i, -0.5721999190249955 + 0.8201141705078563 *i, -0.5721999190249955 - 0.8201141705078563 *i, 0.5721999190249956 + 0.8201141705078558 *i, 0.5721999190249956 - 0.8201141705078558 *i, 0.2844946999218996 + 0.9586776130255407 *i, 0.2844946999218996 - 0.9586776130255407 *i, -0.9623049253698638 + 0.39299026419899324 *i, -0.9623049253698638 - 0.39299026419899324 *i, -0.28449469992189935 + 0.958677613025541 *i, -0.28449469992189935 - 0.958677613025541 *i, 0.8906337425082941 + 0.36372087531230846 *i, 0.8906337425082941 - 0.36372087531230846 *i, 0.09863425610669373 + 0.9951237528680941 *i, 0.09863425610669373 - 0.9951237528680941 *i, -0.890633742508294 + 0.36372087531230896 *i, -0.890633742508294 - 0.36372087531230896 *i, -0.09863425610669377 + 0.9951237528680941 *i, -0.09863425610669377 - 0.9951237528680941 *i, 0.9623049253698632 + 0.39299026419899297 *i, 0.9623049253698632 - 0.39299026419899297 *i, -0.824572053515745 + 0.7358236112946291 *i, -0.824572053515745 - 0.7358236112946291 *i, 0.8245720535157457 + 0.7358236112946293 *i, 0.8245720535157457 - 0.7358236112946293 *i])) 
       
u = var('u') 
       
       
[0.675128643229638 + 0.602464750329050*I, 0.675128643229638 -
0.602464750329050*I, -0.675128643229638 + 0.602464750329049*I,
-0.675128643229638 - 0.602464750329049*I, -0.572199919024996 +
0.820114170507856*I, -0.572199919024996 - 0.820114170507856*I,
0.572199919024996 + 0.820114170507856*I, 0.572199919024996 -
0.820114170507856*I, 0.284494699921900 + 0.958677613025541*I,
0.284494699921900 - 0.958677613025541*I, -0.962304925369864 +
0.392990264198993*I, -0.962304925369864 - 0.392990264198993*I,
-0.284494699921899 + 0.958677613025541*I, -0.284494699921899 -
0.958677613025541*I, 0.890633742508294 + 0.363720875312308*I,
0.890633742508294 - 0.363720875312308*I, 0.0986342561066937 +
0.995123752868094*I, 0.0986342561066937 - 0.995123752868094*I,
-0.890633742508294 + 0.363720875312309*I, -0.890633742508294 -
0.363720875312309*I, -0.0986342561066938 + 0.995123752868094*I,
-0.0986342561066938 - 0.995123752868094*I, 0.962304925369863 +
0.392990264198993*I, 0.962304925369863 - 0.392990264198993*I,
-0.824572053515745 + 0.735823611294629*I, -0.824572053515745 -
0.735823611294629*I, 0.824572053515746 + 0.735823611294629*I,
0.824572053515746 - 0.735823611294629*I]
[0.675128643229638 + 0.602464750329050*I, 0.675128643229638 - 0.602464750329050*I, -0.675128643229638 + 0.602464750329049*I, -0.675128643229638 - 0.602464750329049*I, -0.572199919024996 + 0.820114170507856*I, -0.572199919024996 - 0.820114170507856*I, 0.572199919024996 + 0.820114170507856*I, 0.572199919024996 - 0.820114170507856*I, 0.284494699921900 + 0.958677613025541*I, 0.284494699921900 - 0.958677613025541*I, -0.962304925369864 + 0.392990264198993*I, -0.962304925369864 - 0.392990264198993*I, -0.284494699921899 + 0.958677613025541*I, -0.284494699921899 - 0.958677613025541*I, 0.890633742508294 + 0.363720875312308*I, 0.890633742508294 - 0.363720875312308*I, 0.0986342561066937 + 0.995123752868094*I, 0.0986342561066937 - 0.995123752868094*I, -0.890633742508294 + 0.363720875312309*I, -0.890633742508294 - 0.363720875312309*I, -0.0986342561066938 + 0.995123752868094*I, -0.0986342561066938 - 0.995123752868094*I, 0.962304925369863 + 0.392990264198993*I, 0.962304925369863 - 0.392990264198993*I, -0.824572053515745 + 0.735823611294629*I, -0.824572053515745 - 0.735823611294629*I, 0.824572053515746 + 0.735823611294629*I, 0.824572053515746 - 0.735823611294629*I]
v^2 
       
Traceback (click to the left of this block for traceback)
...
TypeError: unsupported operand type(s) for ** or pow(): 'list' and 'int'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_19.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("dl4y"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpHNlV7d/___code___.py", line 3, in <module>
    exec compile(u'v**_sage_const_2 
  File "", line 1, in <module>
    
  File "integer.pyx", line 1871, in sage.rings.integer.Integer.__pow__ (sage/rings/integer.c:12477)
TypeError: unsupported operand type(s) for ** or pow(): 'list' and 'int'
       
[[2, 3], [1, 2]]
[[2, 3], [1, 2]]
M = MatrixSpace(CC,2,2) 
       
A = M([2,3,1,2]) 
       
det(A) 
       
1.00000000000000
1.00000000000000
A^(-1) 
       
[ 2.00000000000000 -3.00000000000000]
[-1.00000000000000  2.00000000000000]
[ 2.00000000000000 -3.00000000000000]
[-1.00000000000000  2.00000000000000]
A = M([1,1,1,w]) 
       
Traceback (click to the left of this block for traceback)
...
TypeError: Cannot evaluate symbolic expression to a numeric value.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_41.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("QSA9IE0oWzEsMSwxLHddKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpAdBlPy/___code___.py", line 3, in <module>
    exec compile(u'A = M([_sage_const_1 ,_sage_const_1 ,_sage_const_1 ,w])
  File "", line 1, in <module>
    
  File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/matrix/matrix_space.py", line 451, in __call__
    return self.matrix(entries, copy=copy, coerce=coerce, rows=rows)
  File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/matrix/matrix_space.py", line 1242, in matrix
    return self.__matrix_class(self, entries=x, copy=copy, coerce=coerce) 
  File "matrix_generic_dense.pyx", line 109, in sage.matrix.matrix_generic_dense.Matrix_generic_dense.__init__ (sage/matrix/matrix_generic_dense.c:2367)
  File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/rings/complex_field.py", line 277, in __call__
    return Parent.__call__(self, x)
  File "parent.pyx", line 988, in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7326)
  File "coerce_maps.pyx", line 82, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3268)
  File "coerce_maps.pyx", line 77, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3171)
  File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/rings/complex_field.py", line 305, in _element_constructor_
    return x._complex_mpfr_field_( self )
  File "expression.pyx", line 933, in sage.symbolic.expression.Expression._complex_mpfr_field_ (sage/symbolic/expression.cpp:5451)
  File "expression.pyx", line 796, in sage.symbolic.expression.Expression._eval_self (sage/symbolic/expression.cpp:4912)
TypeError: Cannot evaluate symbolic expression to a numeric value.
exp(A) 
       
[              1/2*(e^(2*sqrt(3)) + 1)*e^(-sqrt(3) + 2)
1/2*(sqrt(3)*e^(2*sqrt(3)) - sqrt(3))*e^(-sqrt(3) + 2)]
[1/6*(sqrt(3)*e^(2*sqrt(3)) - sqrt(3))*e^(-sqrt(3) + 2)              
1/2*(e^(2*sqrt(3)) + 1)*e^(-sqrt(3) + 2)]
[              1/2*(e^(2*sqrt(3)) + 1)*e^(-sqrt(3) + 2) 1/2*(sqrt(3)*e^(2*sqrt(3)) - sqrt(3))*e^(-sqrt(3) + 2)]
[1/6*(sqrt(3)*e^(2*sqrt(3)) - sqrt(3))*e^(-sqrt(3) + 2)               1/2*(e^(2*sqrt(3)) + 1)*e^(-sqrt(3) + 2)]
vector = MatrixSpace(CC,1,6) 
       
a = vector([1,2,3,4,5,6]) 
       
exp? 
       

File: /sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/functions/log.py

Type: <class ‘sage.functions.log.Function_exp’>

Definition: exp(x, coerce=True, hold=False, prec=None, dont_call_method_on_arg=False)

Docstring:

The exponential function, \exp(x) = e^x.

EXAMPLES:

sage: exp(-1)
e^(-1)
sage: exp(2)
e^2
sage: exp(2).n(100)
7.3890560989306502272304274606
sage: exp(x^2 + log(x))
e^(x^2 + log(x))
sage: exp(x^2 + log(x)).simplify()
x*e^(x^2)
sage: exp(2.5)
12.1824939607035
sage: exp(float(2.5))
12.182493960703473
sage: exp(RDF('2.5'))
12.1824939607

To prevent automatic evaluation, use the hold parameter:

sage: exp(I*pi,hold=True)
e^(I*pi)
sage: exp(0,hold=True)
e^0

To then evaluate again, we currently must use Maxima via sage.symbolic.expression.Expression.simplify():

sage: exp(0,hold=True).simplify()
1
sage: exp(pi*I/2)
I
sage: exp(pi*I)
-1
sage: exp(8*pi*I)
1
sage: exp(7*pi*I/2)
-I

TEST:

sage: latex(exp(x))
e^{x}
sage: latex(exp(sqrt(x)))
e^{\sqrt{x}}
sage: latex(exp)
\exp
sage: latex(exp(sqrt(x))^x)
\left(e^{\sqrt{x}}\right)^{x}
sage: latex(exp(sqrt(x)^x))
e^{\left(\sqrt{x}^{x}\right)}

Test conjugates:

sage: conjugate(exp(x))
e^conjugate(x)

Test simplifications when taking powers of exp, #7264:

sage: var('a,b,c,II')
(a, b, c, II)
sage: model_exp = exp(II)**a*(b)
sage: sol1_l={b: 5.0, a: 1.1}
sage: model_exp.subs(sol1_l)
5.00000000000000*(e^II)^1.10000000000000
sage: exp(3)^II*exp(x)
(e^3)^II*e^x
sage: exp(x)*exp(x)
e^(2*x)
sage: exp(x)*exp(a)
e^(a + x)
sage: exp(x)*exp(a)^2
e^(2*a + x)

Another instance of the same problem, #7394:

sage: 2*sqrt(e)
2*sqrt(e)

File: /sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/functions/log.py

Type: <class ‘sage.functions.log.Function_exp’>

Definition: exp(x, coerce=True, hold=False, prec=None, dont_call_method_on_arg=False)

Docstring:

The exponential function, \exp(x) = e^x.

EXAMPLES:

sage: exp(-1)
e^(-1)
sage: exp(2)
e^2
sage: exp(2).n(100)
7.3890560989306502272304274606
sage: exp(x^2 + log(x))
e^(x^2 + log(x))
sage: exp(x^2 + log(x)).simplify()
x*e^(x^2)
sage: exp(2.5)
12.1824939607035
sage: exp(float(2.5))
12.182493960703473
sage: exp(RDF('2.5'))
12.1824939607

To prevent automatic evaluation, use the hold parameter:

sage: exp(I*pi,hold=True)
e^(I*pi)
sage: exp(0,hold=True)
e^0

To then evaluate again, we currently must use Maxima via sage.symbolic.expression.Expression.simplify():

sage: exp(0,hold=True).simplify()
1
sage: exp(pi*I/2)
I
sage: exp(pi*I)
-1
sage: exp(8*pi*I)
1
sage: exp(7*pi*I/2)
-I

TEST:

sage: latex(exp(x))
e^{x}
sage: latex(exp(sqrt(x)))
e^{\sqrt{x}}
sage: latex(exp)
\exp
sage: latex(exp(sqrt(x))^x)
\left(e^{\sqrt{x}}\right)^{x}
sage: latex(exp(sqrt(x)^x))
e^{\left(\sqrt{x}^{x}\right)}

Test conjugates:

sage: conjugate(exp(x))
e^conjugate(x)

Test simplifications when taking powers of exp, #7264:

sage: var('a,b,c,II')
(a, b, c, II)
sage: model_exp = exp(II)**a*(b)
sage: sol1_l={b: 5.0, a: 1.1}
sage: model_exp.subs(sol1_l)
5.00000000000000*(e^II)^1.10000000000000
sage: exp(3)^II*exp(x)
(e^3)^II*e^x
sage: exp(x)*exp(x)
e^(2*x)
sage: exp(x)*exp(a)
e^(a + x)
sage: exp(x)*exp(a)^2
e^(2*a + x)

Another instance of the same problem, #7394:

sage: 2*sqrt(e)
2*sqrt(e)
e^a 
       
Traceback (click to the left of this block for traceback)
...
TypeError: mutable matrices are unhashable
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_94.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZV5h"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpKLbx4Q/___code___.py", line 2, in <module>
    exec compile(u'e**a
  File "", line 1, in <module>
    
  File "constants_c.pyx", line 256, in sage.symbolic.constants_c.E.__pow__ (sage/symbolic/constants_c.cpp:2143)
  File "expression.pyx", line 6005, in sage.symbolic.expression.Expression.exp (sage/symbolic/expression.cpp:22913)
  File "matrix_generic_dense.pyx", line 182, in sage.matrix.matrix_generic_dense.Matrix_generic_dense.__hash__ (sage/matrix/matrix_generic_dense.c:2856)
  File "matrix_dense.pyx", line 70, in sage.matrix.matrix_dense.Matrix_dense._hash (sage/matrix/matrix_dense.c:2039)
TypeError: mutable matrices are unhashable
g(w) = (w^2 + 1)*(w^4 + 1)*(w^12 + w^10 + 2*w^8 + 3*w^6 + 2*w^4 + w^2 + 1)/((w^12 + 2*w^10 + 4*w^8 + 5*w^6 + 4*w^4 + 2*w^2 + 1)*w^3)