TITLE: Is this naive test to tell whether a complex elliptic curve has complex multiplication effective?
QUESTION [9 upvotes]: I have a question about a naive test to tell whether a complex elliptic curve $E$ has complex multiplication.
Recall that the endomorphism ring $End(E)$ of $E$ is isomorphic to either $\mathbb{Z}$ or an order in an imaginary quadratic field $K$. In the latter case we say that $E$ has CM by $K$.
Suppose that we are given an elliptic curve over $\mathbb{C}$, say $$E: y^2=x^3+17x^2-19.$$ One wants to know if there is an imaginary quadratic field $K$ for which $E$ has CM by $K$.
Let $j(E)$ be the j-invariant of our elliptic curve (for example, the above curve has j-invariant $\frac{6179217664}{363641}$) and recall that the j-invariant, viewed as a modular function, gives a surjective map from the upper half plane to $\mathbb{C}$. Let $\omega$ be any element in the preimage of $j(E)$. We now define a second elliptic curve: $$E_\omega: y^2=4x^3-g_2(\omega)-g_3(\omega),$$ where $g_2=60G_4$ and $g_3=140G_6$ are multiples of the appropriate Eisenstein series. Both of these elliptic curves are defined over $\mathbb{C}$ and have the same j-invariant. They are therefore isogenous. It is known that the elliptic curve $E_\omega$ is isomorphic to the complex torus $\mathbb{C}/\Lambda_\omega$ where $\Lambda_\omega=\mathbb{Z}+\mathbb{Z}\omega$. 
It is easy to show that $\mathbb{C}/\Lambda_\omega$ has CM by some imaginary quadratic field if and only if $\omega$ is an imaginary, quadratic number. In this case the endomorphism ring of $\mathbb{C}/\Lambda_\omega$ will be an order in the field $\mathbb{Q}(\omega)$.
This suggests a test for CM: given an elliptic curve $E$ defined over $\mathbb{C}$ with j-invariant $j(E)$, find a preimage of $j(E)$ under the modular function $j:\mathbb{H}\rightarrow\mathbb{C}$ and determine whether or nor the preimage generates an imaginary quadratic extension of $\mathbb{Q}$. 
Now for my question: can this test actually be performed? Wikipedia tells me that the inverse of the j-invariant can be computed in terms of hypergeometric functions, but I don't know if one could use this inverse to determine whether a given j-invariant was associated to a curve with CM.

REPLY [2 votes]: Unlike Pete Clark, I have not spent any real time working on this sort of problem, so you should take all of this with a heavy grain of salt. But I think this algorithm is quite reasonable as a way to rule out CM, although it would be diffciult to use it to prove CM exists. EDIT: As FC points out, this algorithm only finds the lattices of the form $\mathcal{O}_K$, not the lattices of the form $I$ where $I$ is an ideal in $\mathcal{O}_K$. The latter may not even have real $j$-invariant. I don't see a way to get around this.
Here is how I would do it: Start with your $j$ invariant, $j_0$. If it is not real, the curve does not have CM . If $j_0$ is real, compute $\tau$ such that $j(\tau) = j_0$ and such that $\tau$ is in
$$\{ i t: t \geq 1 \} \cup \{ z : |z|=1, \ 0 \leq \Re(z) \leq 1/2 \} \cup \{ 1/2 + i t: t \geq \sqrt{3}/2 \}.$$
I'll describe the case where $\tau$ is on the imaginary axis; the other cases are similar. Here is the point which no one has made yet: The pure imaginary $it$ generates an imaginary order  if and only if $t^2$ is an integer. So we only need to perform the computation with enough precision to determine whether $t$ is an integer. Of course, a floating point computation can never be known to converge to an integer, but it will very soon either do so or clearly fail to do so.