1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%%
3%%  curve_isomorphism.tex       Documentation
4%%
5%%  This file contains the documentation of the class
6%%              curve_isomorphism
7%%
8%%  Copyright   (c)   1998   by  LiDIA group
9%%
10%%  Authors: Nigel Smart, John Cremona
11%%
12
13\newcommand{\iso}{\mathit{iso}}
14
15
16%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17
18\NAME
19
20\code{curve_isomorphism< S, T >} \dotfill class for holding isomorphisms between different
21elliptic curves.
22
23
24%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25
26\ABSTRACT
27
28Assume that we have given two elliptic curves \code{elliptic_curve< S > $E_1$} and
29\code{elliptic_curve< T > $E_2$}.  This class constructs, if possible, an explicit isomorphism
30between them.  This allows the user to map points from one curve to the other and back again.
31
32
33%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34
35\DESCRIPTION
36
37An isomorphism between two elliptic curves is a transformation of the variables of the form $x =
38u^2 x'+ r$ and $y =u^3 y' + s u^2 x' + t$.  The classes \code{S} and \code{T} require certain
39conditions to be met.  To see what these are consult the file \path{LiDIA/curve_isomorphism.h}
40
41
42%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43
44\CONS
45
46\begin{fcode}{ct}{curve_isomorphism< S, T >}{const elliptic_curve< S > & $E_1$,
47    const elliptic_curve< T > & $E_2$}%
48  constructs an explicit isomorphism between the two elliptic curves $E_1$ and $E_2$.  If the
49  curves are not isomorphic then the \LEH is called.
50\end{fcode}
51
52\begin{fcode}{ct}{curve_isomorphism< S, T >}{const curve_isomorphism< S, T > & $\iso$}
53  copy constructor.
54\end{fcode}
55
56\begin{fcode}{ct}{curve_isomorphism< S, T >}{const elliptic_curve < S > & $E_1$,
57    const elliptic_curve< T > & $E_2$, const S & $u$, const S & $r$, const S & $s$, const S & $t$}%
58  This constructor is used when the isomorphism is already known, however it does not check that
59  it is valid.
60\end{fcode}
61
62\begin{fcode}{dt}{~curve_isomorphism< S, T >}{}
63\end{fcode}
64
65
66%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67
68\ASGN
69
70The operator \code{=} is overloaded.  For efficiency we also have the function.
71
72\begin{fcode}{void}{init}{const elliptic_curve< S > & $E_1$,
73    const elliptic_curve< T > & $E_2$, const S & $u$, const S & $r$, const S & $s$, const S & $t$}%
74  As the similar constructor above.
75\end{fcode}
76
77
78%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79
80\HIGH
81
82\begin{fcode}{int}{are_isomorphic}{const elliptic_curve < S > & $E_1$, const elliptic_curve < T > & $E_2$}
83  returns 1 if and only if the two curves are isomorphic.
84\end{fcode}
85
86\begin{fcode}{int}{are_isomorphic} {const elliptic_curve< S > & $E_1$,
87    const elliptic_curve< T > & $E_2$, curve_isomorphism< S, T > & $\iso$}%
88  returns 1 if and only if the two curves are isomorphic, the explicit isomorphism is returned
89  in $\iso$.
90\end{fcode}
91
92\begin{fcode}{elliptic_curve< S >}{make_isomorphic_curve} {const elliptic_curve< T > & $E_2$, S & $u$,
93    S & $r$, S & $s$, S & $t$}%
94  constructs the elliptic curve $E_1$ over \code{S}, which is the isomorphic image of $E_2$
95  under the isomorphism $[u,r,s,t]$.
96\end{fcode}
97
98Let $\iso$ denote an object of type \code{curve_isomorphism< S, T >}.
99
100\begin{cfcode}{point< T >}{$\iso$.map}{const point< S > & $P$}
101  find the image of the point $P \in E_1$ on $E_2$.
102\end{cfcode}
103
104\begin{cfcode}{point < S >}{$\iso$.inverse}{const point< T > & $P$}
105  find the image of the point $P \in E_2$ on $E_1$.
106\end{cfcode}
107
108\begin{cfcode}{void}{$\iso$.invert}{S & $u$, S & $r$, S & $s$, S & $t$}
109  $[u,r,s,t]$ become the inverse isomorphism to that represented by $\iso$.
110\end{cfcode}
111
112\begin{cfcode}{S}{$\iso$.get_scale_factor}{}
113  returns $u$.
114\end{cfcode}
115
116\begin{cfcode}{int}{$\iso$.is_unimodular}{}
117  tests whether $u$ is equal to one.
118\end{cfcode}
119
120\begin{cfcode}{int}{$\iso$.is_identity}{}
121  tests whether $\iso$ is the identity isomorphism.
122\end{cfcode}
123
124\begin{fcode}{void}{minimal_model}{elliptic_curve< bigint > & $E_{\textsf{min}}$,
125    elliptic_curve< bigrational > & $E_R$, curve_isomorphism< bigrational, bigint > & $\iso$}%
126  constructs the minimal model of the elliptic curve $E_R$ and assigns it to $E_{\textsf{min}}$.
127  The explicit isomorphism is returned via the variable $\iso$.  Note at present to use this
128  function you need to include the file \path{LiDIA/minimal_model.h}.
129\end{fcode}
130
131
132%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
133
134\IO
135
136Only the \code{ostream} operator \code{<<} has been overloaded.
137
138
139%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140
141\EXAMPLES
142
143\begin{quote}
144\begin{verbatim}
145#include <LiDIA/elliptic_curve_bigint.h>
146#include <LiDIA/elliptic_curve.h>
147#include <LiDIA/point_bigint.h>
148#include <LiDIA/curve_isomorphism.h>
149
150int main()
151{
152    elliptic_curve< bigrational > Er1(1,2,3,4,5);
153    elliptic_curve< bigrational > Er2(6,0,24,16,320);
154    elliptic_curve< bigint >      Ei(1,2,3,4,5);
155    cout << Er1 << "  " << Er2 << "  " << Ei << endl;
156
157    curve_isomorphism< bigrational, bigint > iso1(Er1,Ei);
158    curve_isomorphism< bigrational, bigint > iso2(Er2,Ei);
159    curve_isomorphism< bigrational, bigrational > iso3(Er1,Er2);
160
161    cout << iso1 << "\n" << iso2 << "\n" << iso3 << "\n" << endl;
162
163    point< bigint > Pi(2,3,Ei);
164
165    cout << Pi << endl;
166
167    point< bigrational > Pr1=iso1.inverse(Pi);
168    point< bigrational > Pr2=iso2.inverse(Pi);
169
170    cout << Pr1 << "  " << Pr1.on_curve() << endl;
171    cout << Pr2 << "  " << Pr2.on_curve() << endl;
172
173    point< bigint > twoPi=Pi+Pi;
174    point< bigrational > twoPr1=Pr1+Pr1;
175    point< bigrational > twoPr2=Pr2+Pr2;
176
177    cout << "Test One\n";
178    cout << twoPi << endl;
179    cout << iso1.map(twoPr1) << endl;
180    cout << iso2.map(twoPr2) << endl;
181
182    cout << "Test Two\n";
183    cout << twoPr1 << endl;
184    cout << iso1.inverse(twoPi) << endl;
185    cout << iso3.inverse(twoPr2) << endl;
186
187    cout << "Test Three\n";
188    cout << twoPr2 << endl;
189    cout << iso2.inverse(twoPi) << endl;
190    cout << iso3.map(twoPr1) << endl;
191
192    return 0;
193}
194\end{verbatim}
195\end{quote}
196
197See also the file
198\path{LiDIA/src/templates/elliptic_curves/ec_rationals/minimal_model_appl.cc}.
199
200
201%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
202
203\SEEALSO
204
205\SEE{elliptic_curve< T >},
206\SEE{point< T >},
207\SEE{elliptic_curve< bigint >},
208\SEE{point< bigint >}.
209
210
211%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
212
213\AUTHOR
214
215John Cremona, Nigel Smart.
216
217