### Build and Test eclib Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt Compile the eclib library using 'make', run checks with 'make check', and optionally install with 'make install'. ```bash make; make check; [make install] ``` -------------------------------- ### Setup Working Directory for Newforms Source: https://context7.com/johncremona/eclib/llms.txt Sets up a working directory and exports the newforms directory path for modular elliptic curve computations. ```bash # Setup working directory mkdir ~/g0n && cd ~/g0n mkdir newforms export NF_DIR=newforms ``` -------------------------------- ### Install eclib with Dependencies Source: https://context7.com/johncremona/eclib/llms.txt Build eclib from source, configuring with NTL and PARI paths. Optional flags enable FLINT or Boost. Can also build only mwrank. ```bash # Download and extract eclib wget https://github.com/JohnCremona/eclib/releases/download/v20230424/eclib-20230424.tar.bz2 tar jxf eclib-20230424.tar.bz2 cd eclib-20230424 # Configure with dependencies (adjust paths as needed) ./configure --with-pari=/usr/local --with-ntl=/usr/local # Optional: Enable FLINT for faster sparse matrix reduction ./configure --with-pari=/usr/local --with-ntl=/usr/local FLINT_LEVEL=2 # Optional: Enable Boost for parallel capabilities ./configure --with-pari=/usr/local --with-ntl=/usr/local --with-boost=/usr/local # Build only mwrank (faster) ./configure --disable-allprogs # Build, test, and install make make check sudo make install ``` -------------------------------- ### Point Search Example Source: https://context7.com/johncremona/eclib/llms.txt Demonstrates searching for points on an elliptic curve. Input specifies processing mode, curve coefficients, number of points, and max rank. ```bash echo "10 1 1 0 0 1 -79 342 0 -1" | point_search ``` -------------------------------- ### Build and Install eclib in Sage Source: https://github.com/johncremona/eclib/blob/master/doc/sage_packaging.txt Build the eclib package within Sage, ensuring checks are run for thorough testing. Alternatively, 'make eclib' can be used, but it bypasses eclib's internal checks. ```bash sage -i -c eclib ``` -------------------------------- ### Find Optimal Elliptic Curves with nfhpmcurve Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt Example of using the nfhpmcurve program, which utilizes both '+' and '-' modular symbol spaces to find optimal elliptic curves. The input is similar to nfhpcurve. ```bash echo 0 500 1 210 210 | nfhpmcurve ``` -------------------------------- ### Get Curve Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Computes the elliptic curve associated with a newform, given its periods and a specified method. ```cpp Curve getcurve(long i, int method, bigfloat& rperiod, int verbose=0); ``` -------------------------------- ### Recompute All Elliptic Curves Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt Example command to recompute all elliptic curves using nfhpmcurve with a range of levels and a specified number of a(p). This process can be time-consuming. ```bash echo 0 500 1 1 11 1000 | nfhpmcurve ``` -------------------------------- ### Get saturated generators Source: https://context7.com/johncremona/eclib/llms.txt After performing saturation, retrieve the resulting saturated generators using getgens(). These points form a basis for the saturated subgroup. ```cpp // Get the saturated generators vector sat_gens = sat.getgens(); ``` -------------------------------- ### Find Elliptic Curves with nfhpcurve Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt Example of using the nfhpcurve program to find elliptic curves of a specific conductor. The input format specifies verbosity, number of a(p) to consider, output to file, and the conductor level. ```bash echo 0 500 1 210 0 | nfhpcurve ``` -------------------------------- ### Set and get index bound Source: https://context7.com/johncremona/eclib/llms.txt Optionally set a specific index bound using set_index_bound(), or retrieve the automatically computed bound using get_index_bound(). The index bound relates to the saturation process. ```cpp // Set index bound (or let it be computed) sat.set_index_bound(); bigint ib = sat.get_index_bound(); cout << "Index bound: " << ib << endl; ``` -------------------------------- ### Get generators on integral minimal model Source: https://context7.com/johncremona/eclib/llms.txt Obtain the basis of the Mordell-Weil group on the integral minimal model of the curve using getpbasis(). The points are represented as Point objects. ```cpp // Get generators on integral minimal model vector pgens = td.getpbasis(); ``` -------------------------------- ### Configure eclib Build Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt Run the configure script to prepare the eclib library for building. Consult the README for non-default options. ```bash ./configure ``` -------------------------------- ### Get Periods Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Computes the periods of a newform using a specified method. 'i' is the index of the newform. ```cpp Cperiods getperiods(long i, int method=-1, int verbose=0); ``` -------------------------------- ### Get 2-Selmer rank Source: https://context7.com/johncremona/eclib/llms.txt Retrieve the rank of the 2-Selmer group using getselmer(). This is a component in determining the Mordell-Weil rank. ```cpp // Get 2-Selmer rank long sel = td.getselmer(); cout << "2-Selmer rank: " << sel << endl; ``` -------------------------------- ### Get Coordinates of a Symbol Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Returns the coordinates of a given symbol 's' in the homology basis. Requires the 'symb' type. ```cpp svec schain(const symb& s) ``` -------------------------------- ### Set up Working Directory for Modular Symbols Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt Create a working directory and a subdirectory for newform data, which is used by modular elliptic curve programs. ```bash mkdir ~/g0n cd ~/g0n mkdir newforms ``` -------------------------------- ### Configure Eclib with Profiling Source: https://github.com/johncremona/eclib/blob/master/how-to-profile.txt Configure the Eclib build with CXXFLAGS and LDFLAGS set for profiling. Ensure necessary libraries like FLINT and PARI are available at the specified paths. ```bash make clean CXXFLAGS='-pg' LDFLAGS='-pg -static' ./configure --prefix=$PWD --with-flint=/usr/local --with-pari=/usr/local make ``` -------------------------------- ### Get Number of Cuspidal Classes Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Returns the number of distinct cuspidal classes. Useful for understanding the structure of the cuspidal subspace. ```cpp long h1ncusps() ``` -------------------------------- ### Get Period Lattice Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Returns the complete period lattice of a newform, which is a pair of complex numbers defining the fundamental parallelogram of the lattice. ```cpp Cperiods getperiods() // return the period lattice ``` -------------------------------- ### Run Eclib Tests with Profiling Source: https://github.com/johncremona/eclib/blob/master/how-to-profile.txt Navigate to the tests directory and execute the 'tmanin' test program using 'libtool' with profiling enabled. This will generate a 'gmon.out' file for analysis. ```bash cd tests # or progs libtool --mode=execute ./tmanin ``` -------------------------------- ### Get Real Period Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Computes the least real part of a period for a given newform. Handles special cases where the result should be 0. ```cpp int get_real_period(long i, bigfloat& x, int verbose=0) const; ``` -------------------------------- ### Generate q-Expansion Coefficients (qexp) Source: https://context7.com/johncremona/eclib/llms.txt Generates q-expansion coefficients for newforms. This is useful for studying the series expansion of modular forms. ```bash # qexp: Generate q-expansion coefficients ``` -------------------------------- ### Get Whole Space Homology Dimension Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Returns the dimension of the entire homology space. Use for general homology space size. ```cpp long h1dim() ``` -------------------------------- ### Navigate to eclib Directory Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt Change the current directory to the unpacked eclib source code directory. ```bash cd eclib-20230424 ``` -------------------------------- ### Get Cuspidal Subspace Dimension Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Returns the dimension of the cuspidal subspace. Use when needing to know the size of the cuspidal part of the homology. ```cpp long h1cuspdim() ``` -------------------------------- ### Compute Newforms with eclib Source: https://context7.com/johncremona/eclib/llms.txt Demonstrates the creation and computation of weight 2 newforms using the newforms class. It covers initialization, computation from scratch or data files, accessing newform properties, and extending Hecke eigenvalues. ```cpp #include long level = 11; // Create newforms object newforms nf(level, 1, // plus: work in plus space (1), minus (-1), or full (0) 1, // cuspidal: restrict to cuspidal subspace 1 // verbose ); // Compute newforms from scratch nf.createfromscratch(50); // compute 50 Hecke eigenvalues // Or load from file if available nf.createfromdata(50, 1); // 1 = create from scratch if file missing // Number of newforms at this level long n1ds = nf.n1ds; cout << "Number of newforms at level " << level << ": " << n1ds << endl; // Access individual newforms for (int i = 0; i < n1ds; i++) { newform& f = nf.nflist[i]; // Sign of functional equation cout << "Newform " << (i+1) << ": sfe = " << f.sfe << endl; // Hecke eigenvalues cout << " First few a_p: "; for (int j = 0; j < 10 && j < f.aplist.size(); j++) { cout << f.aplist[j] << " "; } cout << endl; // Analytic rank f.compute_rank(); cout << " Analytic rank: " << f.rk << endl; // L-value L^(r)(f,1)/r! bigfloat Lval = f.special_value(); cout << " L-value: " << Lval << endl; } // Add more Hecke eigenvalues nf.addap(100); // extend to 100 primes // Sort newforms (LMFDB ordering) nf.sort(); // Output to file nf.output_to_file(); // Get periods of a newform Cperiods periods = nf.getperiods(0); // First newform // Get elliptic curve from newform bigfloat rperiod; Curve C = nf.getcurve(0, -1, rperiod, 1); // method=-1 for auto cout << "Curve: " << C << endl; ``` -------------------------------- ### Create Newforms from Scratch Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Initializes newforms by computing them using homology. 'ntp' specifies the number of eigenvalues to use for oldforms. ```cpp void createfromscratch(long ntp); ``` -------------------------------- ### Get Mordell-Weil rank Source: https://context7.com/johncremona/eclib/llms.txt Retrieve the lower bound of the Mordell-Weil rank using the getrank() method. This value is certain if getcertain() returns true. ```cpp // Get rank (lower bound if uncertain) long rank = td.getrank(); cout << "Rank: " << rank << endl; ``` -------------------------------- ### Get Coordinates of a Rational Modsym Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Returns the coordinates of a modular symbol {0, r} where r is a rational number. Use for rational inputs. ```cpp svec schain(const rational& r) ``` -------------------------------- ### Run Sage Doctests for eclib Source: https://github.com/johncremona/eclib/blob/master/doc/sage_packaging.txt Execute doctests for the eclib library within Sage to verify its integration and identify any necessary changes in Sage's elliptic curve schemes. ```bash sage -t --long src/sage/libs/eclib ``` ```bash sage -t --long src/sage/schemes/elliptic_curves ``` -------------------------------- ### Get generators on original model Source: https://context7.com/johncremona/eclib/llms.txt Retrieve the basis of the Mordell-Weil group on the original curve model using getbasis(). The points are represented as P2Point objects. ```cpp // Get generators on original model vector gens = td.getbasis(); for (const auto& P : gens) { cout << "Generator: " << P << endl; } ``` -------------------------------- ### Display Newform Data and Eigenvalues Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt This command first displays the output of './showdata 210' and then the output of './showeigs 210', providing a comprehensive view of newform data and associated eigenvalues. ```bash displays first the output of ./showdata 210 and then that of ./showeigs 210. ``` -------------------------------- ### Create and Manipulate Elliptic Curve Points Source: https://context7.com/johncremona/eclib/llms.txt Demonstrates creating Point objects from various coordinate systems and the point at infinity. Includes validation, arithmetic operations, and height computations. ```cpp #include // Create point at infinity Curvedata E(0, 0, 1, -79, 342, 1); Point O(&E); // Point at infinity // Create point from projective coordinates [X:Y:Z] Point P(&E, bigint(3), bigint(11), bigint(1)); // Create from affine coordinates (x, y) Point Q(&E, bigint(43), bigint(276)); // Create from P2Point P2Point p2(bigint(45), bigint(296), bigint(1)); Point R(&E, p2); // Check if point is valid (on curve) if (P.isvalid()) { cout << "P is on the curve" << endl; } // Point arithmetic Point sum = P + Q; // Addition Point diff = P - Q; // Subtraction Point neg = -P; // Negation Point dbl = P.twice(); // Doubling Point mult = 5 * P; // Scalar multiplication // Compound assignment Point T = P; T += Q; T -= R; // Check for point at infinity if (sum.is_zero()) { cout << "Sum is the identity" << endl; } // Compute canonical height bigfloat h = height(P); cout << "Canonical height: " << h << endl; // Real component of height bigfloat rh = realheight(P); // p-adic height component bigfloat ph = pheight(P, bigint(5)); // Height pairing bigfloat hp = height_pairing(P, Q); // Compute order of point (0 if infinite, -1 if not torsion) int ord = order(P); if (ord > 0) { cout << "P has order " << ord << endl; } // Get list of multiples when computing order vector multiples; int ord2 = order(P, multiples); // Check if torsion if (P.is_torsion()) { cout << "P is a torsion point" << endl; } // Division points: find Q such that m*Q = P vector divpts = P.division_points(2); // Good reduction checks if (P.has_good_reduction(5)) { cout << "P has good reduction at 5" << endl; } // Check good reduction at list of primes vector primes = {bigint(2), bigint(3), bigint(5)}; bigint bad_p; if (!P.has_good_reduction(primes, bad_p)) { cout << "Bad reduction at " << bad_p << endl; } // Transform point to different model bigint u(1), r(0), s(0), t(0); Curvedata E2(0, 0, 1, -79, 342, 0); Point P2 = transform(P, &E2, u, r, s, t); // Input/Output cout << P << endl; // Outputs [X:Y:Z] cin >> P; // Reads [X:Y:Z] ``` -------------------------------- ### Get Coordinates of a Cuspidal Symbol Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Returns the coordinates of a symbol represented by (c:d) in the cuspidal homology basis. Use for specific cuspidal symbol representations. ```cpp svec schaincd(long c, long d) ``` -------------------------------- ### Minimize and Reduce Integral Binary Quartics Source: https://context7.com/johncremona/eclib/llms.txt Explains the use of `reduce_quartics` for minimizing and reducing integral binary quartics. Input consists of coefficients, repeated until all are zero, outputting a minimal reduced quartic and its transformation matrix. ```bash # reduce_quartics: Minimize and reduce integral binary quartics # Input: coefficients (a,b,c,d,e), repeat until all 0 echo "1 2 3 4 5 12 -8 6 0 -3 0 0 0 0 0" | reduce_quartics # Output: minimal reduced quartic and transformation matrix ``` -------------------------------- ### Initialize saturator class Source: https://context7.com/johncremona/eclib/llms.txt Create a saturator object for a given elliptic curve. Parameters control the use of the EGR subgroup strategy and verbosity. ```cpp #include Curvedata E(0, 0, 1, -79, 342, 1); // Create saturator saturator sat(&E, 1, // egr: use EGR subgroup strategy (1=yes) 1 // verbose ); ``` -------------------------------- ### Get Cuspidal Cycle Coordinates Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Returns the coordinates of a cycle for the modular symbol {n, d} within the cuspidal homology. This function specifically targets cuspidal elements. ```cpp vec cycle(long n, long d) ``` -------------------------------- ### Download eclib Source Code Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt Use wget to download the latest release of the eclib library from GitHub. ```bash wget https://github.com/JohnCremona/eclib/releases/download/v20230424/eclib-20230424.tar.bz2 ``` -------------------------------- ### Get Coordinates of a Modsym {0, nn/dd} Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Returns the coordinates of a modular symbol {0, nn/dd} in the homology basis. Use for rational representations of modular symbols. ```cpp svec schain(long nn, long dd) ``` -------------------------------- ### Make Bases Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Constructs homology eigenvectors (bases) from lists of eigenvalues. ```cpp void makebases(); ``` -------------------------------- ### Initialize two_descent with Curvedata Source: https://context7.com/johncremona/eclib/llms.txt Initialize the two_descent class using a Curvedata object. The parameters control verbosity, whether to find points or only Selmer groups, and bounds for the descent process. ```cpp #include // From Curvedata (must be integral) Curvedata E(0, 0, 1, -79, 342, 1); two_descent td(&E, 1, // verbose (0-3) 0, // selmer_only (0=find points, 1=Selmer only) 20, // firstlim: bound on |x|+|z| 5, // secondlim: log height bound -1, // n_aux: auxiliary primes (-1=default) 1 // second_descent (for 2-torsion curves) ); ``` -------------------------------- ### List Curves with Labels and Coefficients Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt The 'h1clist' program lists curves with their labels, coefficients, and torsion information. This is used to create the 'curves*' files in the database. ```bash (a) h1clist: lists the curves with label, coefficients, rank torsion. Used to create the curves* files in the database (similar to Table 1 in my book). ``` -------------------------------- ### Get Mordell-Weil rank upper bound Source: https://context7.com/johncremona/eclib/llms.txt Obtain an upper bound for the Mordell-Weil rank from the Selmer group size using getrankbound(). This is useful when the exact rank is uncertain. ```cpp // Get rank bound (upper bound from Selmer group) long bound = td.getrankbound(); cout << "Rank bound: " << bound << endl; ``` -------------------------------- ### Compute Homology Spaces with eclib Source: https://context7.com/johncremona/eclib/llms.txt Illustrates the computation of spaces of modular symbols and Hecke operators using the homspace class. It covers creating homology spaces, querying dimensions, and obtaining Hecke and Atkin-Lehner operator matrices. ```cpp #include long level = 37; // Create homology space homspace H(level, 1, // plusflag: 1 for H_1^+, -1 for H_1^-, 0 for full 1, // cuspidal: 1 for cuspidal subspace 1 // verbose ); // Dimensions cout << "Dimension of H_1: " << H.h1dim() << endl; cout << "Dimension of cuspidal part: " << H.h1cuspdim() << endl; cout << "Number of cusps: " << H.h1ncusps() << endl; // Hecke operator matrices mat T2 = H.heckeop(2, 1); // T_2 on dual space mat T3 = H.heckeop(3, 1); // T_3 on dual space mat T5 = H.heckeop(5, 1); // T_5 on dual space cout << "T_2 matrix (dual):" << endl << T2 << endl; // Atkin-Lehner operators (for primes dividing level) mat W37 = H.wop(37, 1); // Fricke involution mat W = H.fricke(1); // Sparse matrix versions (more efficient for large levels) smat sT2 = H.s_heckeop(2, 1); // Hecke operator restricted to subspace subspace S; // assume this is a Hecke eigenspace mat T7_S = H.heckeop_restricted(7, S, 1); // Coordinates of modular symbols svec coords = H.coords(3, 11); // {0, 3/11} in terms of basis // Manin vector for point search vec mv = H.maninvector(5); // sum_{a mod 5} {0, a/5} // Twisted Manin vector vec mvt = H.manintwist(5); // sum_{a mod 5} chi(a){0, a/5} ``` -------------------------------- ### Get Elliptic Curve Lattice Function Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Determines the period lattice of an elliptic curve given its conductor and other parameters. It can identify the lattice structure based on provided real and imaginary period multiples. ```cpp int get_curve(long n, long fac, long maxnx, long maxny, const bigfloat& x0, const bigfloat& y0, long& nx, long& ny, int& type, int detail=0); ``` -------------------------------- ### Create and Compute Curvedata Invariants Source: https://context7.com/johncremona/eclib/llms.txt Shows how to create a Curvedata object, which automatically computes various invariants. Supports initialization from coefficients, existing Curve objects, or rational coefficients. ```cpp #include // Create with automatic computation of invariants // Second parameter: 1 = minimize on init, 0 = don't minimize Curvedata E(bigint(0), bigint(0), bigint(1), bigint(-79), bigint(342), 1); // Create from Curve Curve C(0, 0, 1, -79, 342); Curvedata ED(C, 1); // 1 = minimize on initialization // Create from rational coefficients (scales to integral model) vector qai = {bigrational(1,2), bigrational(0), bigrational(1,3), bigrational(-79), bigrational(342)}; bigint scale; Curvedata E_rat(qai, scale); // scale factor returned // Access b-invariants bigint b2, b4, b6, b8; E.getbi(b2, b4, b6, b8); cout << "b2=" << getb2(E) << " b4=" << getb4(E) << endl; // Access c-invariants bigint c4, c6; E.getci(c4, c6); cout << "c4=" << getc4(E) << " c6=" << getc6(E) << endl; // Get discriminant and j-invariant bigint disc = getdiscr(E); bigrational j = j_invariant(E); cout << "Discriminant: " << disc << ", j-invariant: " << j << endl; // Minimize the curve (Laska-Kraus-Connell algorithm) E.minimalize(); // Changes in place // Or get minimal model with transformation bigint u, r, s, t; Curvedata E_min = E.minimalize(u, r, s, t); // Original model transforms to E_min via [u,r,s,t] // Get bad primes (primes dividing discriminant) vector bad = getbad_primes(E); // Check minimality if (is_minimal(E)) { cout << "Curve is minimal" << endl; } // Number of connected components (1 or 2) int ncomp = getconncomp(E); // Apply transformation [1,r,s,t] to curve E.transform(r, s, t); // Find optimal x-shift bigint k; Curvedata E_opt = opt_x_shift(E, k); ``` -------------------------------- ### Interactive Elliptic Curve Point Search Source: https://context7.com/johncremona/eclib/llms.txt Introduces the `point_search` tool for interactively finding points on elliptic curves up to a specified height bound, including saturation. ```bash # point_search: Interactive point search with saturation # Prompts for: # - search limit (naive height bound) # - verbosity (0/1) ``` -------------------------------- ### Get Cuspidal Cycle Coordinates for Modsym Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Returns the coordinates of a cycle for a modular symbol m={a,b} within the cuspidal homology. Use for modular symbols defined by two rational numbers. ```cpp vec cycle(const modsym& m) ``` -------------------------------- ### Search for Quartic Points Source: https://context7.com/johncremona/eclib/llms.txt Shows how to use the `quartic_points` program to search for rational points on quartic curves of the form y^2 = g(x). Input includes verbosity, quartic coefficients, and a height bound. ```bash # quartic_points: Search for points on quartic 2-coverings # Input: verbosity, then quartic coefficients (a,b,c,d,e), height bound echo "1 1 0 -2 0 1 10 0 0 0 0 0" | quartic_points # Output: local solubility info, points found, and their images on Jacobian ``` -------------------------------- ### Get Cuspidal Cycle Coordinates for Rational Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Returns the coordinates of a cycle for a modular symbol defined by a rational number within the cuspidal homology. Use for rational inputs targeting cuspidal cycles. ```cpp vec cycle(const rational& r) ``` -------------------------------- ### mwrank Command-Line Options Reference Source: https://context7.com/johncremona/eclib/llms.txt Reference for mwrank command-line options, including quiet mode (-q), verbosity (-v), output format (-o), precision (-p), and saturation bounds (-S). ```bash # Display help mwrank -h # Common options: # -h Display help and quit # -q Quiet mode (suppress headers and prompts) # -v n Verbosity level (0-3, default 1) # 0: only rank output # 1: basic output # 2: detailed point search info # 3: maximum detail # -o Pari/GP compatible output format # -p n Bit precision for multiprecision floating point (default 50) # -b n Height bound for quartic point search (1-15, default 10) # -x n Number of auxiliary primes for syzygy sieving (default 15) # -l Output generating points (default follows verbosity) # -t Quartic equivalence test (debugging) # -s Selmer-only mode (local tests only, faster) # -d Skip second descent (for curves with 2-torsion) # -S n Saturation bound: # 0: no saturation # n>0: saturate at primes up to n # -1: automatic bound (capped at 100) # Example: minimal output with Pari format echo "[0,0,1,-79,342]" | mwrank -q -v 0 -o # Example: maximum verbosity with point output echo "[0,0,1,-79,342]" | mwrank -v 3 -l # Example: fast Selmer-only computation echo "[0,0,1,-79,342]" | mwrank -q -s ``` -------------------------------- ### Produce Eigenvalue List for Newforms Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt The 'aplist' program generates a text file containing eigenvalues for each newform up to prime 100, including Atkin-Lehner eigenvalues. A variant, 'qexp', lists prime coefficients of q-expansions. ```bash (c) aplist, qexp: aplist produces a simple text file containing the eigenvalues for each newform for primes up to 100 (and larger bad primes), called aplist* in the database, and like Table 3 in my book (includes Atkin-Lehner eigenvalues). A variant is qexp which lists the prime coefficients of the q-expansions. ``` -------------------------------- ### Shell Script: Show All Newform Data Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Displays all data for a given level. This output can be piped through 'more' or 'less' for easier viewing. ```bash shownf N ``` -------------------------------- ### List Curves with Labels and Data (h1clist) Source: https://context7.com/johncremona/eclib/llms.txt Lists curves with their labels and basic data. This is an interactive script that prompts for a level range. ```bash # h1clist: List curves with labels and basic data # Interactive prompts for level range ``` -------------------------------- ### Perform saturation at a list of primes Source: https://context7.com/johncremona/eclib/llms.txt Saturate points against a list of primes using do_saturation(). It returns whether saturation was successful for all primes, the total index, and a list of primes where saturation failed. ```cpp // Saturate at list of primes vector plist = {2, 3, 5, 7, 11}; long index; vector unsat; if (sat.do_saturation(plist, index, unsat)) { cout << "Saturated, total index: " << index << endl; } else { cout << "Saturation failed at primes: "; for (long p : unsat) cout << p << " "; cout << endl; } ``` -------------------------------- ### Analyze Profiling Data Source: https://github.com/johncremona/eclib/blob/master/how-to-profile.txt Use 'gprof' to analyze the profiling data generated from running 'tmanin'. Pipe the output to 'less' for easier viewing. ```bash libtool --mode=execute gprof ./tmanin| less ``` -------------------------------- ### Shell Script: Show Eigenvalues Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Displays all aq and ap (Hecke eigenvalues) for a given level. ```bash showeigs N ``` -------------------------------- ### Find Optimal Curves using +/- Spaces (nfhpmcurve) Source: https://context7.com/johncremona/eclib/llms.txt Computes optimal elliptic curves using both positive and negative spaces. Input specifies verbosity, num_ap, output to file flag, and the range of levels. ```bash # nfhpmcurve: Find optimal curves using both +/- spaces # Input: verbose, num_ap, output_to_file, first_level, last_level echo "0 500 1 1 1000" | nfhpmcurve ``` -------------------------------- ### List Reduced Binary Cubics Source: https://context7.com/johncremona/eclib/llms.txt Demonstrates the `list_cubics` program for listing reduced binary cubic forms up to a discriminant bound. Input is a single integer specifying the maximum absolute discriminant. ```bash # list_cubics: List all reduced cubics with discriminant bound # Input: single integer maxd echo "1000" | list_cubics # List reduced cubics with 0 < disc < 1000 echo "-1000" | list_cubics # List reduced cubics with -1000 < disc < 0 ``` -------------------------------- ### Display Auxiliary Data and Eigenvalues for Newforms Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt This command displays auxiliary data and all stored eigenvalues for each newform. The output is presented in columns, one for each newform. ```bash # ./shownf 210 # Displays auxiliary data and all stored eigenvalues # for each newform ``` -------------------------------- ### Copy Utility Scripts Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt Copy utility scripts from the 'scripts' directory to the working directory to display the contents of newforms binary files. Ensure they are executable. ```bash ./nnf 210 ./nap 210 ./showdata 210 ``` -------------------------------- ### Create and Access Curve Coefficients Source: https://context7.com/johncremona/eclib/llms.txt Demonstrates creating Curve objects from Weierstrass coefficients or c4/c6 invariants, and accessing their coefficients. Includes validity checks and equality testing. ```cpp #include // Create curves from Weierstrass coefficients Curve E1(0, 0, 1, -79, 342); // From long integers Curve E2(bigint(0), bigint(0), bigint(1), bigint(-79), bigint(342)); // From bigints // Create from c4, c6 invariants bigint c4("12345678901234567890"); bigint c6("98765432109876543210"); Curve E3(c4, c6); // Checks validity automatically // Create from j-invariant bigrational j(17, 1); Curve E4(j); // One curve with j-invariant 17 // Access coefficients bigint a1, a2, a3, a4, a6; E1.getai(a1, a2, a3, a4, a6); vector ai = E1.a_invariants(); // Returns [a1,a2,a3,a4,a6] // Check validity if (E1.isnull()) { cout << "Invalid curve (all coefficients zero)" << endl; } // Equality testing if (E1 == E2) { cout << "Curves are equal" << endl; } // Input/Output Curve E; cin >> E; // Reads [a1,a2,a3,a4,a6] or "a1 a2 a3 a4 a6" cout << E; // Outputs [a1,a2,a3,a4,a6] ``` -------------------------------- ### Set points for saturation Source: https://context7.com/johncremona/eclib/llms.txt Provide a vector of Point objects to the saturator using set_points(). These are the points that will be tested and potentially saturated. ```cpp // Set points to saturate vector points; points.push_back(Point(&E, bigint(3), bigint(11))); points.push_back(Point(&E, bigint(43), bigint(276))); sat.set_points(points); ``` -------------------------------- ### Display Stored Eigenvalues for Newforms Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt Use this command to display all stored eigenvalues for each newform. The output is organized in columns, with each column representing a newform. ```bash # ./showeigs 210 # Displays all stored eigenvalues for each newform ``` -------------------------------- ### Display Newform Data Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt Use the showdata script to display auxiliary data for each newform at a specified level. ```bash ./showdata 210 ``` -------------------------------- ### Output results to Pari/GP format Source: https://context7.com/johncremona/eclib/llms.txt Generate output compatible with the Pari/GP calculator using pari_output(). This format is useful for further analysis or visualization in Pari/GP. ```cpp // Pari/GP output td.pari_output(); // Output: [[rank],[P1,P2,...,Prank]] or [[r,r'],[P1,...,Pr]] ``` -------------------------------- ### Summer Class Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Base class for computing sums of the form sum_{n=1}^{\infty} a_n f(n) for various functions f(n) and coefficients a_n of a newform. ```APIDOC ## Class summer ### Description Base class for several others all of which compute sums of the form sum_{n=1}^{\infty} a_n f(n) for various real or complex-valued f(n), where the a_n are the coefficients of a newform. Using the usual Buhler-Gross-Zagier recursion. ### Data Fields See periods.h ``` -------------------------------- ### Create Newforms from Data Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Reads newform data from a file. If the file is absent, it can optionally revert to creating them from scratch. ```cpp void createfromdata(long ntp, int create_from_scratch_if_absent=1); ``` -------------------------------- ### Newform Class Methods Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Documentation for the methods available in the newform class, covering operations like matrix computations, homology, and data management. ```APIDOC ## Newform Class Methods ### Description This section details the methods of the newform class, which perform various operations such as computing matrices, managing homology spaces, creating and manipulating newforms, and calculating associated mathematical data. ### Methods - **opmat(int i, int d, int v=0)** (mat) - **opmat_restricted(int i, const subspace& s, int d, int v=0)** (mat) - **s_opmat(int i, int d, int v=0)** (smat) - **s_opmat_restricted(int i, const ssubspace& s, int d, int v=0)** (smat) These functions call similar functions in the associated homspace. `i` is the index of the prime to use. - **matdim(void)** (long) Returns the dimension of the underlying homspace. - **eigrange(int i)** (vector) Returns the list of possible eigenvalues for the i'th operator. - **dimoldpart(const vector l)** (long) Given an initial sequence of eigenvalues [a2,a3,...], uses the oldforms member to return the corresponding dimension of oldforms. - **display(void)** Outputs information to stdout. - **output_to_file(int binflag=1)** Outputs data to a file in NF_DIR. - **use(const vec& b1, const vec& b2, const vector l)** Adds a newform with basis b1, eiglist l to the current list. b2 is not used. - **createfromscratch(long ntp)** Finds newforms using homology. `ntp` is the number of eigenvalues to use for oldforms. - **createfromdata(long ntp, int create_from_scratch_if_absent=1)** Reads newforms from a file. If the file is absent, it may revert to `createfromscratch`. - **makebases()** Constructs bases (homology eigenvectors) from eigenvalue lists. - **apvec(long p)** (vector) Computes a vector of ap, one for each newform. - **addap(long last)** Computes ap for all primes up to the `last`'th prime and inserts them into each newform's own aplist. - **sort(int oldorder=0)** Sorts the newforms. - **get_real_period(long i, bigfloat& x, int verbose=0)** (int) Given a newform with no intdata, computes the least real (part of) period. Returns 0 if sfe=-1 and n=square. - **getperiods(long i, int method=-1, int verbose=0)** (Cperiods) Given all data, computes the periods as a Cperiods object. - **getcurve(long i, int method, bigfloat& rperiod, int verbose=0)** (Curve) Given all data and Cperiods, computes the curve. - **find_matrix(long i, long dmax, int& rp_known, bigfloat&x0, bigfloat&y0)** (int) Computes x0, y0 (real & imag parts of periods) & a matrix which gives these scaled by dotplus & dotminus. `rp_known` is set if x0 is known to be the least real part of a period. - **find_lminus(long i, long lmax, const bigfloat& y1)** (int) Given an imaginary period y1, finds a prime lminus = 3 (mod 4) and <= lmax for which L(f,lminus,1) is nonzero and hence a multiple mminus of y1. If lmax=0, it continues until a suitable lminus is found. ``` -------------------------------- ### Initialize two_descent with bigrational coefficients Source: https://context7.com/johncremona/eclib/llms.txt Initialize the two_descent class using a vector of bigrational coefficients representing the curve. This is an alternative to using a Curvedata object. ```cpp // From rational coefficients vector ai = {bigrational(0), bigrational(0), bigrational(1), bigrational(-79), bigrational(342)}; two_descent td2(ai, 1, 0, 20, 5, -1, 1); ``` -------------------------------- ### Perform saturation at a specific prime Source: https://context7.com/johncremona/eclib/llms.txt Execute the saturation process for a single prime 'p' using do_saturation(). Returns the logarithm of the index if successful, or -1 if saturation fails. ```cpp // Full saturation at prime p int log_index = sat.do_saturation(p); if (log_index >= 0) { cout << "Saturation succeeded, index was " << (1 << log_index) << endl; } ``` -------------------------------- ### Update eclib Version in Sage Package Files Source: https://github.com/johncremona/eclib/blob/master/doc/sage_packaging.txt Modify the version number in package-version.txt and spkg-configure.m4 within the Sage package directory for eclib. ```bash sage --package fix-checksum eclib ``` -------------------------------- ### Reduce Binary Cubic Forms Source: https://context7.com/johncremona/eclib/llms.txt Utilizes the `reduce_cubics` program to reduce binary cubic forms ax^3 + bx^2y + cxy^2 + dy^3. Input is the four integer coefficients, repeated until all are zero, yielding an equivalent reduced form and transformation matrix. ```bash # reduce_cubics: Reduce binary cubic forms ax^3 + bx^2y + cxy^2 + dy^3 # Input: 4 integers a b c d (coefficients), repeat until all 0 echo "1 2 3 4 3 -2 5 -7 0 0 0 0" | reduce_cubics # Output: equivalent reduced form and SL(2,Z) transformation matrix ``` -------------------------------- ### Compute New Hecke Operator Matrix (Heilbronn) Source: https://github.com/johncremona/eclib/blob/master/doc/g0n.txt Computes the p'th Hecke operator matrix using Heilbronn matrices. This is generally faster than 'heckeop' for the whole space but lacks a restricted version. ```cpp mat newheckeop(long p, int dual, int display=0) ``` -------------------------------- ### mwrank: Basic Curve Rank Computation Source: https://context7.com/johncremona/eclib/llms.txt Compute the rank of an elliptic curve by piping its coefficients [a1,a2,a3,a4,a6] to mwrank. Use -q for quiet mode. ```bash # Basic usage - input curve coefficients [a1,a2,a3,a4,a6] echo "[0,0,1,-79,342]" | mwrank # Output: Curve [0,0,1,-79,342] : Rank = 5 ``` ```bash # Multiple curves from file (r5.in contains 5 rank-5 curves) cat > curves.in << 'EOF' 0 0 1 -79 342 0 0 1 -169 930 0 1 1 -30 390 0 0 1 -301 2052 0 0 1 -457 3786 EOF mwrank -q -v 0 < curves.in # Output: # Curve [0,0,1,-79,342] : Rank = 5 # Curve [0,0,1,-169,930] : Rank = 5 # ... ``` ```bash # Pari/GP compatible output (-o flag) echo "[0,0,1,-79,342]" | mwrank -q -v 0 -o # Output: [[5],[[3,11],[43,276],[45,296],[62,483],[92,878]]] ``` ```bash # High-rank curve with increased auxiliary primes echo "[0,0,0,-9217,300985]" | mwrank -x 10 # Rank 7 curve, -x 10 uses 10 auxiliary primes for better splitting ``` ```bash # Curves with 2-torsion (uses 2-isogeny descent) echo "[0,36861504658225,0,1807580157674409809510400,0]" | mwrank # Fermigier's rank 13 curve ``` ```bash # Selmer-only mode (faster, upper bound only) echo "[0,0,1,-79,342]" | mwrank -s # Computes 2-Selmer rank without searching for points ``` ```bash # Adjust saturation bound echo "[0,0,1,-79,342]" | mwrank -S 200 # Saturate at primes up to 200 (default: automatic up to 100) ``` ```bash # No saturation echo "[0,0,1,-79,342]" | mwrank -S 0 ``` ```bash # Higher precision for large coefficients echo "[1,0,1,34318214642441646362435632562579908747,3184376895814127197244886284686214848599453811643486936756]" | mwrank -p 100 # Dujella's rank 15 curve, -p 100 sets 100 bits precision ``` -------------------------------- ### Generate Table of Hecke Eigenvalues (aplist) Source: https://context7.com/johncremona/eclib/llms.txt Generates a table of Hecke eigenvalues. This command is used for analyzing the properties of newforms. ```bash # aplist: Generate table of Hecke eigenvalues ``` -------------------------------- ### Extract eclib Archive Source: https://github.com/johncremona/eclib/blob/master/doc/howto.txt Unpack the downloaded eclib tar.bz2 archive using the tar command. ```bash tar jxf eclib-20230424.tar.bz2 ``` -------------------------------- ### Check two_descent success Source: https://context7.com/johncremona/eclib/llms.txt After initializing the two_descent object, check the 'ok()' method to determine if the descent process completed successfully. Failure might indicate issues with the curve or parameters. ```cpp // Check success if (!td.ok()) { cout << "Descent failed" << endl; } ``` -------------------------------- ### mwrank: Verbose Output and Generators Source: https://context7.com/johncremona/eclib/llms.txt Use verbose mode (-v) for detailed output and the -l flag to display generating points for the Mordell-Weil group. ```bash # Verbose output with generators (-l flag) echo "[0,0,1,-79,342]" | mwrank -v 1 -l # Shows generators covering cosets of 2E(Q) in E(Q) ```