4
$\begingroup$

Let $K$ be a number field, $x \in \mathcal{O}_K$, and $\mathfrak{p} $ a prime of $K$. I want to find out using sage whether or not the reduction of $x$ modulo $\mathfrak{p}$ is a square in the invertible elements of the residue field at $\mathfrak{p}$.

A primitive way to do this would be to test if $x^{(q-1)/2}-1$ is divisible by $\mathfrak{p}$, but that's too slow. I tried to find a way to reduce $x$ to an element of the quotient, but couldn't.

I could code all the functionality manually, but I'd prefer not to do that.

Can anybody suggest an efficient way to do this using sage?

  • 1
    @ Eugene: residue_symbol fits the bill perfectly, thanks.2012-07-05

0 Answers 0