I found this question on this website, which gives a code that almost does what I want. Basically, I am looking for supersingular elliptic curves $E/\mathbb F_p$ that have endomorphisms of degree 3, 6 or (worst case) 9, such that those endomorphisms' kernel consists of points defined over $\mathbb F_p$. I thought about using Deuring correspondence to do so, by designing a suitable maximal quaternion order and then finding a corresponding elliptic curve. This is very close to what the code here does :
def j_with_embedding(p, q):
F = GF(p)
R.<x> = PolynomialRing(F)
K = QuadraticField(-q)
o = K.maximal_order()
d = o.discriminant()
H = hilbert_class_polynomial(d)
return R(H).roots(multiplicities=False)
so I tried to run it while keeping $q = 3$, but for the endomorphisms that I find, the condition that the kernel has only points in $\mathbb F_p$ is never satisfied. I guess this is because the criteria "E must have an endomorphism $\phi$ such that $\phi^2 = [-3]$" is too restrictive.
I thought about changing q = 3 for q = -3, but I get an error at the line
H = hilbert_class_polynomial(d)
which is
D (=12) must be negative
How can I adapt this code to get the j-invariants at the end ?
Thanks in advance :)