1 | initial version |

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())
```

2 | No.2 Revision |

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 ~~K~~K(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())
```

3 | No.3 Revision |

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

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

with `K(a.polynomial()).residue_symbol(P,N)`

.

```
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
```

4 | No.4 Revision |

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

5 | No.5 Revision |

~~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

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.