Commit e42ae080 authored by Peter Bruin's avatar Peter Bruin

remove obsolete GP functions

parent d2a3cc6c
......@@ -77,37 +77,6 @@ scalar_multiplication_subgroup_traces(V, H) =
scalar_multiplication_traces(V) = apply(vecsum, values_by_scalar_multiplication_orbit(V));
projective_polynomial(p) =
{
V = readvec(filename("values", p))[1];
liftall(roots_to_pol(scalar_multiplication_traces(V), 't));
}
projectivisation(p) =
{
V = readvec(filename("values", p))[1];
x = varhigher("x", variable(V));
l = matsize(V)[1];
T = scalar_multiplication_traces(V);
W = matrix(l, l, i, j,
if(j == 1, if(i == 1, 0, T[l + 1]),
T[(i - 1)/(j - 1) % l + 1]));
liftall(polinterpolate(concat(Vec(V))[2..l^2],
concat(Vec(W))[2..l^2], x));
}
relative_polynomial(p) =
{
[g, a] = readvec("projective_polynomial_reduced.gp");
V = readvec(filename("values", p))[1];
x = variable(V);
z = varhigher("z", x);
y = varhigher("y", z);
T = scalar_multiplication_traces(V);
R = [roots_to_pol(v, z) | v <- values_by_scalar_multiplication_orbit(V)];
liftall(subst(polinterpolate(T, R, y), y, a));
}
/* Compute a maximal chain of subgroups of G. */
subgroup_chain_maximal(G) =
{
......@@ -213,43 +182,6 @@ reduced_bases() =
vector(#c, j, red_basis(n, [nfinit(variable(f[j])), K[j]], [c[j], alpha[j]]));
}
addition(p) =
{
V = readvec(filename("values", p))[1];
x = variable(V);
z = varhigher("z", x);
y = varhigher("y", z);
l = matsize(V)[1];
A = matrix(l, l, i0, j0,
W = matrix(l, l, i, j,
V[(i + i0 - 2) % l + 1, (j + j0 - 2) %l + 1]);
polinterpolate(concat(Vec(V)), concat(Vec(W)), z));
liftall(polinterpolate(concat(Vec(V)), concat(Vec(A)), y));
}
scalar_multiplication(p, r) =
{
V = readvec(filename("values", p))[1];
z = varhigher("z", variable(V));
l = matsize(V)[1];
Vr = matrix(l, l, i, j,
V[(i - 1)*r % l + 1, (j - 1)*r % l + 1]);
liftall(polinterpolate(concat(Vec(V)), concat(Vec(Vr)), z));
}
scalar_multiplication_relative(p, r) =
{
[g, a] = readvec("projective_polynomial_reduced.gp");
V = readvec(filename("values", p))[1];
z = varhigher("z", variable(V));
y = varhigher("y", z);
l = matsize(V)[1];
W = values_by_scalar_multiplication_orbit(V);
F = [polinterpolate(v, vector(l - 1, i, v[i*r % l]), z) | v <- W];
T = scalar_multiplication_traces(V);
liftall(subst(polinterpolate(T, F, y), y, a));
}
pairing(p) =
{
my(V = readvec(filename("values", p)),
......@@ -310,26 +242,6 @@ suitable_primes() =
return(vecextract(P, ind));
}
/*
Return the list of suitable primes p for which in addition
the polynomial modulo p is square-free.
*/
suitable_primes_poly() =
{
[p | p <- readvec("suitable_primes.gp"),
issquarefree(Mod(readvec(filename("poly", p))[1], p))];
}
/*
Return the list of suitable primes p for which in addition
the projective polynomial modulo p is square-free.
*/
suitable_primes_ppoly() =
{
[p | p <- readvec("suitable_primes.gp"),
issquarefree(Mod(read(filename("ppoly", p)), p))];
}
/*
Return the list of suitable primes p for which in addition
both k-th intermediate polynomials modulo p are square-free.
......@@ -350,18 +262,6 @@ suitable_primes_ipoly(k) =
| i <- [1..#f]]))];
}
/*
Return the primes p in suitable_primes_ppoly for which in addition
the change of variables to the reduced projective polynomial has no
p in the denominator.
*/
suitable_primes_rpoly() =
{
v = Vec(lift(readvec("projective_polynomial_reduced.gp")[2]));
[p | p <- readvec("suitable_primes_ppoly.gp"),
iferr(v % p; 1, e, 0)];
}
/*
Return the primes p in suitable_primes_ipoly(k) for which in addition
the changes of variables to both k-th intermediate polynomials have no
......@@ -420,58 +320,6 @@ polheight(f) =
log(max(abs(numerator(f)), denominator(f))));
}
height_polynomial() = polheight(read("polynomial.gp"));
height_projective_polynomial() = polheight(read("projective_polynomial.gp"));
height_relative_polynomial() = polheight(read("relative_polynomial.gp"));
height_addition() = polheight(read("addition.gp"));
height_scalar_mul() = polheight(read("scalar_mul.gp"));
info() =
{
rnfeq = read("relative_equation.gp");
K = read("projective_field.gp");
polabs = rnfeq[1];
pol = rnfeq[5];
r1 = polsturm(polabs);
r2 = (poldegree(polabs) - r1) / 2;
print("[K:Q] = ", poldegree(K.pol));
print("[L:K] = ", poldegree(pol));
print("disc(Z_K/Z) = ", K.disc);
iferr(L = read("relative_field.gp");
D_abs = (-1)^r2 * abs(K.disc)^poldegree(pol) * idealnorm(K, L.disc[1]);
print("disc(Z_L/Z_K) = ", L.disc[1]);
print("factorisation of |disc(Z_L/Z)| = ", factor(D_abs)),
err,
/* do nothing */);
print("sign(projective field) = ", K.sign);
print("sign(absolute field) = ", [r1, r2]);
print("projective polynomial = ", K.pol);
print("relative polynomial = ", pol);
print("absolute polynomial = ", polabs);
print("h(projective_polynomial) = ", polheight(read("projective_polynomial.gp")));
print("h(relative_polynomial) = ", polheight(lift(read("relative_polynomial.gp"))));
print("h(projective_polynomial_reduced) = ", polheight(K.pol));
print("h(relative_polynomial_reduced) = ", polheight(pol));
print("h(absolute_polynomial) = ", polheight(polabs));
iferr(F = readvec("absolute_polynomial_reduced.gp")[1];
print("h(absolute_polynomial_reduced) = ", polheight(F)),
err,
/* do nothing */);
iferr(print("h(pairing) = ", matheight(read("pairing.gp"))),
err,
/* do nothing */);
iferr(print("h(addition) = ", polheight(read("addition.gp"))),
err,
/* do nothing */);
print("h(scalar_mul_rel) = ", polheight(liftall(read("scalar_mul_rel.gp"))));
print("h(scalar_mul_rel_reduced) = ", polheight(liftall(read("scalar_mul_rel_reduced.gp"))));
print("h(scalar_mul_absolute) = ", polheight(lift(read("scalar_mul_absolute.gp"))));
}
summary() =
{
my(D = readvec("reduced_dual_pair.gp"),
......@@ -535,20 +383,6 @@ chinese_from_files(prefix, P) =
Mod(x, N);
}
/*
Reconstruct a polynomial P whose splitting field is
the field of definition of the Galois representation.
*/
reconstruct_polynomial() =
{
my(P = readvec("suitable_primes.gp"),
Fp = [Mod(readvec(filename("poly", p))[1], p) | p <- P],
F = bestappr_shift(chinese(Fp)));
if(F == [],
error("cannot reconstruct polynomial"));
F;
}
reconstruct_polynomials() =
{
my(P = readvec("suitable_primes.gp"),
......@@ -559,26 +393,6 @@ reconstruct_polynomials() =
f;
}
reconstruct_projective_polynomial() =
{
P = readvec("suitable_primes.gp");
Fp = [Mod(read(filename("ppoly", p)), p) | p <- P];
F = bestappr_shift(chinese(Fp));
if(F == [],
error("cannot reconstruct projective polynomial"));
F;
}
reconstruct_relative_polynomial() =
{
P = readvec("suitable_primes_rpoly.gp");
Gp = [Mod(read(filename("rpoly", p)), p) | p <- P];
G = bestappr(chinese(Gp));
if(G == [],
error("cannot reconstruct relative polynomial"));
Mod(G, readvec("projective_polynomial_reduced.gp")[1]);
}
reconstruct_intermediate_polynomials(k) =
{
if(k == 0,
......@@ -619,57 +433,6 @@ reconstruct_origins() =
L;
}
reconstruct_addition() =
{
P = readvec("suitable_primes_poly.gp");
L = [Mod(read(filename("addition", p)), p) | p <- P];
alpha0 = chinese(L);
alpha = bestappr(alpha0);
if(alpha == [],
error("cannot reconstruct addition"));
f = read("polynomial.gp");
x = variable(f);
[y, z] = variables(alpha);
if(substvec(alpha, [y, z], [z, y]) != alpha,
error("addition is not commutative"));
\\ The check below is very slow for l >= 7.
if(subst(f, x, Mod(Mod(alpha, subst(f, x, y)), subst(f, x, z))) != 0,
error("alpha does not operate on the roots of f"));
alpha;
}
reconstruct_scalar_mul() =
{
P = readvec("suitable_primes_poly.gp");
L = [Mod(read(filename("scalar_mul", p)), p) | p <- P];
mu0 = chinese(L);
mu = bestappr_shift(mu0);
if(mu == [],
error("cannot reconstruct scalar multiplication"));
f = read("polynomial.gp");
x = variable(f);
z = variable(mu);
if(subst(f, x, Mod(mu, subst(f, x, z))) != 0,
error("mu does not operate on the roots of f"));
mu;
}
reconstruct_projectivisation() =
{
P = readvec("suitable_primes_poly.gp");
L = [Mod(read(filename("projectivisation", p)), p) | p <- P];
iota0 = chinese(L);
iota = bestappr_shift(iota0);
if(iota == [],
error("cannot reconstruct projectivisation"));
iota = Mod(iota, read("polynomial_star.gp"));
g = read("projective_polynomial.gp");
t = variable(g);
if(subst(g, t, iota) != 0,
error("projectivisation inconsistent"));
iota;
}
reconstruct_pairing() =
{
my(P = readvec("suitable_primes_dual.gp"),
......@@ -700,17 +463,6 @@ reduced_dual_pair() =
[variable(K[2]), K[2].pol], [Mat(1), K[2][8]], T]);
}
projectivisation_to_reduced() =
{
iota = read("projectivisation.gp");
[g, a] = readvec("projective_polynomial_reduced.gp");
t = variable(g);
kappa = subst(lift(modreverse(a)), t, iota);
if(subst(g, t, kappa) != 0,
error("projectivisation_to_reduced inconsistent"));
kappa;
}
relative_polynomial_reduced() =
{
G = read("relative_polynomial.gp");
......@@ -781,46 +533,3 @@ intermediate_fields(k) =
F = if(#F == 3, [F[1]], [F[1], F[4]]);
[nfinit([f, P]) | f <- F];
}
reconstruct_scalar_mul_rel() =
{
f = read("relative_polynomial.gp");
g = readvec("projective_polynomial_reduced.gp")[1];
P = readvec("suitable_primes_strict.gp");
L = [Mod(read(filename("scalar_mul_rel", p)), p) | p <- P];
mu0 = chinese(L);
mu = bestappr(mu0);
if(mu == [],
error("cannot reconstruct scalar multiplication"));
mu = Mod(Mod(mu, g), f);
z = variable(f);
if(subst(f, z, mu) != 0,
error("mu does not operate on the roots of f"));
mu;
}
scalar_mul_rel_reduced() =
{
[f, a] = readvec("relative_polynomial_reduced.gp");
[z, t] = variables(f);
mu = read("scalar_mul_rel.gp");
mu = Mod(subst(lift(modreverse(a)), z, subst(lift(mu), z, a)), f);
if(subst(f, z, mu) != 0,
error("mu does not operate on the roots of f"));
mu;
}
scalar_mul_absolute() =
{
rnfeq = read("relative_equation.gp");
f = rnfeq[1];
mu = read("scalar_mul_rel_reduced.gp");
\\ K = \Q(alpha), L = K(beta),
\\ L = \Q(beta + k alpha)
\\ mu(beta + k alpha) = mu(beta) + k alpha
mu = Mod(eltreltoabs(rnfeq, liftpol(mu)) + rnfeq[3] * rnfeq[2], f);
z = variable(f);
if(subst(f, z, mu) != 0,
error("mu does not operate on the roots of f"));
mu;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment