Function: msfromell
Section: modular_symbols
C-Name: msfromell
Prototype: GD0,L,
Help: msfromell(E, {sign=0}): return the [M, x], where M is msinit(N,2)
 and x is the modular symbol in M attached to the elliptic curve E/Q.
Doc: Let $E/\Q$ be an elliptic curve of conductor $N$. For $\varepsilon =
 \pm1$, we define the (cuspidal, new) modular symbol $x^\varepsilon$ in
 $H^1_c(X_0(N),\Q)^\varepsilon$  attached to
 $E$. For all primes $p$ not dividing $N$ we have
 $T_p(x^\varepsilon) =  a_p x^\varepsilon$, where $a_p = p+1-\#E(\F_p)$.

 Let $\Omega^+ = \kbd{E.omega[1]}$ be the real period of $E$
 (integration of the N\'eron differential $dx/(2y+a_1x+a3)$ on the connected
 component of $E(\R)$, i.e.~the generator of $H_1(E,\Z)^+$) normalized by
 $\Omega^+>0$. Let $i\Omega^-$ the integral on a generator of $H_1(E,\Z)^-$ with
 $\Omega^- \in \R_{>0}$. If $c_\infty$ is the number of connected components of
 $E(\R)$, $\Omega^-$ is equal to $(-2/c_\infty) \times \kbd{imag(E.omega[2])}$.
 The complex modular symbol is defined by
 $$F: \delta \to  2i\pi \int_{\delta} f(z) dz$$
 The modular symbols $x^\varepsilon$ are normalized so that
 $ F = x^+ \Omega^+ + x^- i\Omega^-$. In particular, we have
 $$ x^+([0]-[\infty]) = L(E,1) / \Omega^+,$$
 which defines $x^{\pm}$ unless $L(E,1)=0$. Furthermore, for all fundamental
 discriminants $D$ such that $\varepsilon \cdot D > 0$, we also have
 $$\sum_{0\leq a<|D|} (D|a) x^\varepsilon([a/|D|]-[\infty])
    = L(E,(D|.),1) / \Omega^{\varepsilon},$$
 where $(D|.)$ is the Kronecker symbol. The period $\Omega^-$ is also
 $2/c_\infty \times$ the real period of the twist
 $E^{(-4)} = \kbd{elltwist(E,-4)}$.

 This function returns the pair $[M, x]$, where $M$ is
 \kbd{msinit}$(N,2)$ and $x$ is $x^{\var{sign}}$ as above when $\var{sign}=
 \pm1$, and $x = [x^+,x^-, L_E]$ when \var{sign} is $0$, where $L_E$
 is a matrix giving the canonical $\Z$-lattice attached to $E$ in the sense
 of \kbd{mslattice} applied to $\Q x^+ + \Q x^-$. Explicitly, it
 is generated by $(x^{+},x^{-})$ when $E(\R)$ has two connected components
 and by $(x^{+} - x^{-},2x^-)$ otherwise.

 The modular symbols $x^\pm$ are given as a \typ{COL} (in terms
 of the fixed basis of $\Hom_G(\Delta,\Q)$ chosen in $M$).
 \bprog
 ? E=ellinit([0,-1,1,-10,-20]);  \\ X_0(11)
 ? [M,xp]= msfromell(E,1);
 ? xp
 %3 = [1/5, -1/2, -1/2]~
 ? [M,x]= msfromell(E);
 ? x    \\  x^+, x^- and L_E
 %5 = [[1/5, -1/2, -1/2]~, [0, 1/2, -1/2]~, [1/5, 0; -1, 1; 0, -1]]
 ? p = 23; (mshecke(M,p) - ellap(E,p))*x[1]
 %6 = [0, 0, 0]~ \\ true at all primes, including p = 11; same for x[2]
 ? (mshecke(M,p) - ellap(E,p))*x[3] == 0
 %7 = 1
 @eprog

 \noindent Instead of a single curve $E$, one may use instead a vector
 of \emph{isogenous} curves. The function then returns $M$ and the
 vector of attached modular symbols.
