Jacobi sum of power residue symbol in Sagemath

123 Views Asked by At

I’m computing Jacobi sum of power residue symbol as follows:

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

def Jacobi(P,N,j):
    return sum(new_residue_symbol(a,P,N)^j*new_residue_symbol(1-a,P,N)^j for a in (1..P.norm()))

N=3
x=polygen(ZZ,'x')
K.<z>=CyclotomicField(N)
p=-4-3*z
P = K.ideal(p)
Jacobi(P,N,1)

Note:$13$ is splits into two prime ideals in $\mathbb{Q}(\zeta_3)$ . One of them is $\mathfrak{p}=(-4-3\zeta_3)$.

The output is -3*z - 4 . This is correct. Then let’s change values. Let $N=5, p=7$:

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

def Jacobi(P,N,j):
    return sum(new_residue_symbol(a,P,N)^j*new_residue_symbol(1-a,P,N)^j for a in (1..P.norm()))


N=5
x=polygen(ZZ,'x')
K.<z>=CyclotomicField(N)
p=7
P = K.ideal(p)
Jacobi(P,N,1)

Note:$p=7$ is inert in $\mathbb{Q}(\zeta_5)$ i.e. inertia degree is $f=4$. So $\mathbb{Z}[\zeta_5]/(p)\cong \mathbb{F}_{7^4}$ is finite field with order $q=7^4$.

The output is 1715$=5*7^3$.But this is weird since absolute value of the Jacobi sum must be $\sqrt{q}=7^2$. Where is wrong?

1

There are 1 best solutions below

0
On

As DaveWitteMorris tell me here, the following code is now temporary answer:

def new_residue_symbol(a,P,N):
    if not a.is_zero():
        return a.parent().lift_map()(a).residue_symbol(P,N)
    else:
        return 0

def Jacobi(P,N,i,j):
    return sum(new_residue_symbol(a,P,N)^i*new_residue_symbol(1-a,P,N)^j for a in P.residue_field())

N=5
K.<z>=CyclotomicField(N)
p=7
P =(K.ideal(p).factor())[0][0]#P is prime ideal above p
Jacobi(P,N,1,1)

Then the output is $49(=\sqrt{q})$.