I am trying to use the function t2.series(z, 23) to compute Taylor series of a rational function. But I obtained an error:
AttributeError: 'sage.rings.function_field.function_field_element.FunctionFieldElement_rational' object has no attribute 'series'
In the following codes, diCartan, CartanMatrix are some number and integer matrix respectively.
Thank you very much.
def QuantumCartanMatrixIJ(i,j,z, typ, rank):
di=diCartan(i,typ,rank)
cij=CartanMatrix(typ,rank)[i-1,j-1]
if i==j:
r=z^di+z^(-di)
elif i!=j:
r=(z^(cij)-z^(-cij))/(z-1/z)
r=simplify(r)
return r
def QuantumCartanMatrix(z, typ, rank):
K.<z> = FunctionField(QQ)
r=matrix(K, rank, rank)
for i in range(1,rank+1):
for j in range(1,rank+1):
r[i-1,j-1]=QuantumCartanMatrixIJ(i,j,z, typ, rank)
return r
typ='G'
rank=2
tau=[1,2]
var('z')
XiValue=[-5, 0]
print(CartanMatrix(typ,rank))
qm=QuantumCartanMatrix(z, typ, rank)
qm
t1=qm.inverse()
print(t1)
i=1
j=2
t2=t1[i-1,j-1]
print(t2)
t2.series(z, 23)