Skip to content

Instantly share code, notes, and snippets.

@maresb
Last active October 6, 2023 21:16
Show Gist options
  • Save maresb/4ccc43ce07bc9e44e031aa9837a5104f to your computer and use it in GitHub Desktop.
Save maresb/4ccc43ce07bc9e44e031aa9837a5104f to your computer and use it in GitHub Desktop.
Exploring Schiemann's pair with PARI/GP
/*
An exploration of Alexander Schiemann's pair of inequivalent 4D lattices with
identical theta functions.
Context: <https://math.stackexchange.com/questions/4428707>
Ben Mares, 2022
References:
* Schiemann, A., 1990. Ein Beispiel positiv definiter quadratischer Formen der Dimension
4 mit gleichen Darstellungszahlen. Archiv der Mathematik, 54(4), pp.372-375.
* Conway, J.H. and Sloane, N.J., 1992. Four-dimensional lattices with the same theta
series. International Mathematics Research Notices, 1992(4), pp.93-96.
<http://neilsloane.com/doc/nipp.pdf>
* Nipp, G.L., 2012. Quaternary quadratic forms: computer generated tables.
Springer Science & Business Media.
<http://www.math.rwth-aachen.de/homes/Gabriele.Nebe/LATTICES/>
This file is a PARI/GP script. See <https://pari.math.u-bordeaux.fr/>.
Using PARI v2.11.2, this can be run using the command:
gp -q schiemann.gp
Expected output:
ALm ~ AS1
ALm ~ AN1
ALp ~ AS2
ALp ~ AN2
Gram matrix for L- matches Conway and Sloane's construction.
Gram matrix for L+ matches Conway and Sloane's construction.
Shortish vectors of L- are coplanar.
Shortish vectors of L+ are independent.
Theta series for L- and L+ are equal up to q^500 (length 1000).
Theta series coefficients:
[1, 0, 2, 0, 4, 6, 10, 6, 12, 6, 6, 8, 10, 8, 10, 22, 24, 4, 28, 12, 24, 20, 24, 14, 42, 20, 16, 14, 32, 10, 46, 8, 46, 30, 28, 28, 62, 34, 32, 40, 38, 28, 48, 28, 60, 50, 48, 32, 50, 28, 62, 34, 52, 26, 68, 30, 62, 56, 68, 38, 110, 28, 50, 64, 86, 60, 72, 50, 56, 34, 88, 50, 138, 44, 78, 64, 64, 44, 102, 48, 104, 84, 60, 50, 124, 70, 82, 44, 100, 36, 122, 60, 120, 98, 68, 90, 162, 54, 94, 104, 152, 44, 152, 46, 108, 84, 120, 58, 134, 84, 84, 90, 142, 74, 150, 82, 136, 88, 108, 72, 252, 78, 72, 132, 102, 100, 146, 84, 174, 80, 168, 74, 156, 78, 134, 168, 108, 104, 172, 84, 184, 150, 138, 68, 280, 92, 108, 106, 184, 130, 222, 94, 156, 98, 124, 106, 256, 76, 182, 88, 186, 112, 272, 122, 182, 128, 118, 86, 238, 128, 192, 144, 208, 70, 174, 142, 246, 198, 140, 112, 326, 88, 188, 144, 272, 108, 236, 98, 180, 184, 244, 140, 214, 136, 146, 162, 214, 160, 244, 122, 324, 178, 170, 114, 258, 138, 196, 222, 208, 88, 352, 138, 214, 192, 258, 154, 348, 106, 226, 224, 222, 132, 196, 116, 232, 270, 264, 108, 404, 138, 198, 148, 336, 160, 268, 196, 218, 156, 200, 180, 548, 136, 238, 166, 182, 208, 292, 190, 224, 248, 198, 130, 444, 192, 300, 236, 338, 104, 334, 142, 388, 196, 214, 188, 332, 162, 284, 296, 344, 134, 482, 142, 224, 222, 234, 234, 316, 188, 254, 198, 404, 194, 404, 140, 362, 192, 204, 150, 592, 176, 240, 308, 334, 158, 396, 242, 388, 216, 274, 148, 410, 214, 306, 242, 348, 282, 326, 172, 278, 306, 434, 178, 528, 174, 256, 340, 344, 254, 320, 182, 440, 226, 252, 238, 586, 188, 300, 262, 328, 194, 572, 224, 354, 368, 256, 204, 532, 200, 342, 238, 544, 138, 360, 226, 482, 406, 334, 240, 362, 226, 328, 372, 362, 208, 406, 208, 332, 294, 418, 282, 532, 250, 354, 186, 382, 300, 558, 176, 502, 284, 418, 212, 660, 216, 210, 454, 350, 216, 510, 262, 534, 226, 420, 218, 658, 298, 428, 394, 370, 274, 476, 226, 472, 316, 352, 220, 730, 266, 336, 300, 658, 292, 356, 276, 330, 426, 330, 216, 764, 212, 578, 268, 302, 218, 672, 330, 458, 334, 296, 206, 640, 304, 506, 370, 628, 268, 418, 296, 442, 390, 364, 282, 580, 202, 444, 504, 542, 242, 594, 230, 476, 408, 472, 306, 652, 348, 358, 330, 602, 310, 866, 194, 476, 366, 332, 332, 736, 360, 320, 428, 618, 252, 628, 352, 526, 396, 500, 272, 584, 262, 634, 432, 428, 344, 502, 322, 540, 398, 468, 272, 1040, 270, 366, 444, 526, 346, 628, 326, 458, 342, 448, 338, 884, 206, 516, 414, 490, 282, 674, 400, 656]
Increasing stack size for modular form computations.
*** Warning: new stack size = 100000000 (95.367 Mbytes).
The modular form has level 1729, weight 2, and character (1729/-).
Dimensionality of space of modular forms: 188
The basis vectors for the space of modular forms are linearly independent.
The theta series recomputed with modular forms agrees.
The theta series is the correct linear combination of modular forms.
? quit
*/
\\ DEFINE PAIRS OF GRAM MATRICES FROM SCHIEMANN, CONWAY & SLOANE, and NIPP.
\\ ------------------------------------------------------------------------
\\ Schiemann's original Gram matrices
AS1 = [ \
4, 2, 0, 1; \
2, 8, 3, 1; \
0, 3, 10, 5; \
1, 1, 5, 10 \
];
AS2 = [ \
4, 0, 1, 1; \
0, 8, 1, -4; \
1, 1, 8, 2; \
1, -4, 2, 10 \
];
\\ Gram matrices for Conway and Sloane's L-(1, 7, 13, 19) in the {vinf, v0, v1, v2} basis.
ALm = [ \
4, 2, 2, 5; \
2, 8, -3, 2; \
2, -3, 12, -2; \
5, 2, -2, 16 \
];
ALp = [ \
4, -1, -4, -4; \
-1, 8, 0, -4; \
-4, 0, 12, 1; \
-4, -4, 1, 16 \
];
\\ Gram matrices from Nipp's table
\\ <http://www.math.rwth-aachen.de/~Gabriele.Nebe/LATTICES/d1732.html>
\\ "1729 4 2 4 5 5 2 1 -2 1 1 5 -1 1-1 1 1729 2 703 48"
AN1 = [ \
4, 2, 1, 1; \
2, 8, -2, 1; \
1, -2, 10, 5; \
1, 1, 5, 10 \
];
\\ "1729 4 2 4 4 5 1 0 1 1 3 4 -1 1-1 1 1729 2 703 48"
AN2 = [ \
4, 1, 0, 1; \
1, 8, 1, 3; \
0, 1, 8, 4; \
1, 3, 4, 10 \
];
\\ DEMONSTRATE THAT THE ABOVE THREE PAIRS ARE EQUIVALENT
\\ -----------------------------------------------------
\\ Show equivalence of Gram matrices ALm ~ AS1 ~ AN1
u1 = qfisom(ALm, AS1);
u2 = qfisom(ALm, AN1);
if( \
ALm == u1~ * AS1 * u1, \
print("ALm ~ AS1"), \
error("AS1 not equivalent to ALm.") \
)
if( \
ALm == u2~ * AN1 * u2, \
print("ALm ~ AN1"), \
error("AN1 not equivalent to ALm.") \
);
\\ Show equivalence of Gram matrices ALp ~ AS2 ~ AN2
u1 = qfisom(ALp, AS2);
u2 = qfisom(ALp, AN2);
if( \
ALp == u1~ * AS2 * u1, \
print("ALp ~ AS2"), \
error("AS2 not equivalent to ALp.") \
)
if( \
ALp == u2~ * AN2 * u2, \
print("ALp ~ AN2"), \
error("AN2 not equivalent to ALp.") \
);
\\ VERIFY THAT THE GRAM MATRICES FOR L+ and L- ARISE FROM CONWAY AND SLOANE'S CONSTRUCTION
\\ ---------------------------------------------------------------------------------------
\\ Gram matrix for Conway and Sloane's {einf, e0, e1, e2} basis:
AE(a, b, c, d) = matdiagonal([a, b, c, d] / 12);
\\ Column vectors of components of {vinf, v0, v1, v2} in the above E-basis:
Mvm = [ \
-3, 1, 1, 1; \
-1, -3, -1, 1; \
-1, 1, -3, -1; \
-1, -1, 1, -3 \
];
Mvp = [ \
+3, 1, 1, 1; \
-1, +3, -1, 1; \
-1, 1, +3, -1; \
-1, -1, 1, +3 \
];
\\ Gram matrices of L-(1, 7, 13, 19) and L+(1, 7, 13, 19) in the above V-basis:
if( \
ALm == Mvm~ * AE(1, 7, 13, 19) * Mvm, \
print("Gram matrix for L- matches Conway and Sloane's construction."), \
error("Gram matrix for L- does not match Conway and Sloane's construction.") \
)
if( \
ALp == Mvp~ * AE(1, 7, 13, 19) * Mvp, \
print("Gram matrix for L+ matches Conway and Sloane's construction."), \
error("Gram matrix for L+ does not match Conway and Sloane's construction.") \
)
\\ DEMONSTRATE INEQUIVALENCE OF ALm AND ALp
\\ ----------------------------------------
\\ Get the three nonzero vectors of length < sqrt(8) up to sign from ALm and ALp
[num_vectors, max_norm, colvectors_ALm] = qfminim(ALm, 8);
[num_vectors, max_norm, colvectors_ALp] = qfminim(ALp, 8);
\\ Show that they are coplanar for ALm but not for ALp
if( \
matrank(colvectors_ALm) == 2, \
print("Shortish vectors of L- are coplanar."), \
error("Shortish vectors of L- are not coplanar.") \
)
if( \
matrank(colvectors_ALp) == 3, \
print("Shortish vectors of L+ are independent."), \
error("Shortish vectors of L+ are dependent.") \
)
\\ COMPUTE THE THETA SERIES
\\ ------------------------
NMAX = 500; \\ Compute the theta function up to q^NMAX
EVEN = 1; \\ flag for qfrep that form is even
\\ Vector containing the number of pairs of nonzero antipodal vectors of given length
reps_Lm = qfrep(ALm, NMAX, EVEN);
reps_Lp = qfrep(ALp, NMAX, EVEN);
\\ Transform vectors to get theta series.
\\ (Coefficient of exponent n is the number of lattice vectors of length 2n.)
theta_Lm = 1 + 2 * q * Ser(reps_Lm, q);
theta_Lp = 1 + 2 * q * Ser(reps_Lp, q);
if( \
theta_Lm == theta_Lp, \
print("Theta series for L- and L+ are equal up to q^", NMAX, " (length ", 2 * NMAX, ")."), \
error("Theta series for L- and L+ are not equal.") \
)
\\ Compute the n-th term of https://oeis.org/A317965
a(n) = {polcoeff(theta_Lm, n)};
print("Theta series coefficients:")
print(Vec(theta_Lm))
\\ VERIFY MODULARITY OF THE THETA SERIES
\\ -------------------------------------
\\ In the current version, computing the coefficients as above is significantly
\\ faster than computing them with modular forms here.
\\ According to Schiemann, 375 is sufficient to verify equality in this space of modular forms.
NMAX_MF = 375; \\ Using modular forms, compute the theta function up to q^NMAX_MF.
\\ Make sure stack size is at least 100 MB to avoid stack overflow.
if( \
default(parisize) < 100*10^6, \
print("Increasing stack size for modular form computations."); \
default(parisize, 100*10^6); \
)
\\ Construct the modular form from the Gram matrix.
[mf_space, theta_mf, theta_mf_coeffs] = mffromqf(ALm);
\\ It belongs to the space of modular forms of level 1729, weight 2, character (1729/-).
if( \
mf_space == mfinit([1729, 2, 1729]), \
print("The modular form has level 1729, weight 2, and character (1729/-)."), \
error("The type of modular form is not correct.") \
)
\\ Check the dimensionality.
print("Dimensionality of space of modular forms: ", mfdim(mf_space)); \\ 188
\\ Make sure that the q-series for the basis vectors in the space of modular
\\ forms are linearly independent when expanded out to q^NMAX_MF.
if( \
matker(mfcoefs(mf_space, NMAX_MF)) == [;], \
print("The basis vectors for the space of modular forms are linearly independent."), \
error("The basis vectors for the space of modular forms are being truncated.") \
)
\\ Check the theta series agrees with previous result.
if( \
theta_Lm == Ser(mfcoefs(theta_mf, NMAX_MF), q), \
print("The theta series recomputed with modular forms agrees."), \
error("The theta series recomputed with modular forms does not agree.") \
)
\\ The vector "theta_mf_coeffs" gives the linear combination of basis vectors
\\ from "mf_space" that give "theta_mf".
if( \
mfcoefs(theta_mf, NMAX_MF) == theta_mf_coeffs~ * mfcoefs(mf_space, NMAX_MF)~, \
print("The theta series is the correct linear combination of modular forms."), \
error("The linear combination of modular forms is incorrect.") \
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment