# Revision history [back]

### How to solve the error: AttributeError: 'sage.rings.function_field.function_field_element.FunctionFieldElement_rational' object has no attribute 'series'

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)

 2 None slelievre 17654 ●22 ●160 ●348 http://carva.org/samue...

### How to solve the error: AttributeError: 'sage.rings.function_field.function_field_element.FunctionFieldElement_rational' object has no attribute 'series'

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)

 3 None slelievre 17654 ●22 ●160 ●348 http://carva.org/samue...

### How AttributeError: '...FunctionFieldElement_rational' object has no attribute 'series'

Using t2.series(z, 23) to solve compute the error: Taylor series of a rational function, I obtain the following error:

AttributeError: 'sage.rings.function_field.function_field_element.FunctionFieldElement_rational' object has no attribute 'series' 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''series'


In the following codes, diCartan, CartanMatrix diCartan, CartanMatrix are some number and integer matrix respectively. respectively.

Thank you very much.

def QuantumCartanMatrixIJ(i,j,z, QuantumCartanMatrixIJ(i, j, z, typ, rank):
di=diCartan(i,typ,rank)
cij=CartanMatrix(typ,rank)[i-1,j-1]
di = diCartan(i, typ, rank)
cij = CartanMatrix(typ, rank)[i - 1, j - 1]
if i==j:
r=z^di+z^(-di)
i == j:
r = z^di + z^-di
elif i!=j:
r=(z^(cij)-z^(-cij))/(z-1/z)

r=simplify(r)
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, r = matrix(K, rank, rank)
for i in range(1,rank+1):
range(1, rank + 1):
for j in range(1,rank+1):
r[i-1,j-1]=QuantumCartanMatrixIJ(i,j,z, range(1, rank + 1):
r[i - 1, j - 1] = QuantumCartanMatrixIJ(i, j, z, typ, rank)
return r

typ='G'
rank=2
tau=[1,2]
typ = 'G'
rank = 2
tau = [1,2]
var('z')
XiValue=[-5, XiValue = [-5, 0]
print(CartanMatrix(typ,rank))
qm=QuantumCartanMatrix(z, print(CartanMatrix(typ, rank))
qm = QuantumCartanMatrix(z, typ, rank)
qm

t1=qm.inverse()
t1 = qm.inverse()
print(t1)
i=1
j=2
t2=t1[i-1,j-1]
i = 1
j = 2
t2 = t1[i - 1, j - 1]
print(t2)
t2.series(z, 23)


### AttributeError: '...FunctionFieldElement_rational' object has no attribute 'series'

Using t2.series(z, 23) to compute the Taylor series of a rational function, I obtain the following 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 diCartan(i, typ, rank):
n=rank
r=1
if typ=='B' and i<rank:
r=2
elif typ=='C' and i==rank:
r=2
elif typ=='F' and i<3:
r=2
elif typ=='G' and i==1:
r=3

return r

def Xi(i, type, rank):
r=XiValue[i-1]

return r

def CartanMatrix(typ, rank):
r = Matrix(rank, rank)
n = rank
for i in range(n):
if i + 1 <= n-1:
r[i, i + 1] = -1
if 0 <= i - 1:
r[i, i - 1] = -1
r[i, i] = 2

if typ == 'C' or typ == 2:
r[n-1, n - 2] = -2
elif typ == 'B' or typ == 3:
r[n - 2, n-1] = -2
elif typ == 'D' or typ == 4:
if n == 2:
r[0, 1] = 0
r[1, 0] = 0
elif 3 <= n:
r[n - 3, n - 2] = -1
r[n - 3, n-1] = -1
r[n - 2, n - 3] = -1
r[n-1, n - 3] = -1
r[n - 2, n-1] = 0
r[n-1, n - 2] = 0
elif typ == 'E' or typ == 5:
for k in [[2, 4], [4, 2]]:
r[k[0], k[1]] = -1
for k in [[3, 4], [4, 3]]:
r[k[0], k[1]] = 0
elif typ == 'F' or typ == 6:
r[1, 2] = -2
elif typ == 'G' or typ == 7:
r[1, 0] = -3

return r

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)


### AttributeError: '...FunctionFieldElement_rational' object has no attribute 'series'

Using t2.series(z, 23) to compute the Taylor series of a rational function, I obtain the following 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 diCartan(i, typ, rank):
n=rank
r=1
if typ=='B' and i<rank:
r=2
elif typ=='C' and i==rank:
r=2
elif typ=='F' and i<3:
r=2
elif typ=='G' and i==1:
r=3

return r

def Xi(i, type, rank):
r=XiValue[i-1]

return r

def CartanMatrix(typ, rank):
r = Matrix(rank, rank)
n = rank
for i in range(n):
if i + 1 <= n-1:
r[i, i + 1] = -1
if 0 <= i - 1:
r[i, i - 1] = -1
r[i, i] = 2

if typ == 'C' or typ == 2:
r[n-1, n - 2] = -2
elif typ == 'B' or typ == 3:
r[n - 2, n-1] = -2
elif typ == 'D' or typ == 4:
if n == 2:
r[0, 1] = 0
r[1, 0] = 0
elif 3 <= n:
r[n - 3, n - 2] = -1
r[n - 3, n-1] = -1
r[n - 2, n - 3] = -1
r[n-1, n - 3] = -1
r[n - 2, n-1] = 0
r[n-1, n - 2] = 0
elif typ == 'E' or typ == 5:
for k in [[2, 4], [4, 2]]:
r[k[0], k[1]] = -1
for k in [[3, 4], [4, 3]]:
r[k[0], k[1]] = 0
elif typ == 'F' or typ == 6:
r[1, 2] = -2
elif typ == 'G' or typ == 7:
r[1, 0] = -3

return r

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)