# Revision history [back]

This seems to be a bug - please report it at https://github.com/sagemath/sage/issues

Meanwhile, you can use the following workaround that manually lifts elements from the residue field to K:

to_K = lambda b: sum(K(t)*z^k for k,t in enumerate(b))
sum(new_residue_symbol(to_K(a),P,N) for a in P.residue_field())


This seems to be a bug - please report it at https://github.com/sagemath/sage/issues

Meanwhile, you can use the following workaround that manually lifts elements from the residue field to - replace KK(a).residue_symbol(P,N): with K(a.polynomial()).residue_symbol(P,N).

to_K = lambda b: sum(K(t)*z^k for k,t in enumerate(b))
sum(new_residue_symbol(to_K(a),P,N) for a in P.residue_field())


This seems to be a bug - please report it at https://github.com/sagemath/sage/issues

Meanwhile, you can use the following workaround - replace K(a).residue_symbol(P,N) with K(a.polynomial()).residue_symbol(P,N).workaround:

def new_residue_symbol(a,P,N):
a = K(a.polynomial())
return K(a).residue_symbol(P,N) if a not in P else 0


This seems to be a bug - please report it at https://github.com/sagemath/sage/issues

Meanwhile, you can use the following workaround:

def new_residue_symbol(a,P,N):
a = K(a.polynomial())
return K(a).residue_symbol(P,N) a.residue_symbol(P,N) if a not in P else 0


This seems to be UPDATED. Per clarifications from DaveWitteMorris the code should use not a.is_zero() instead of a bug - please report it at https://github.com/sagemath/sage/issues



Meanwhile, you can use the following workaround:not in P, and a.parent().lift_map()(a) instead of K(a):

def new_residue_symbol(a,P,N):
a Ka = K(a.polynomial())
a.parent().lift_map()(a)
return a.residue_symbol(P,N) Ka.residue_symbol(P,N) if a not in P a.is_zero() else 0