From cb6080eaa4f326d9fce5f0a9157be46e91d55e09 Mon Sep 17 00:00:00 2001 From: Pierrick-Dartois Date: Thu, 22 May 2025 18:51:58 +0200 Subject: Clean up PEGASIS submodule inclusion --- theta_lib/theta_structures/theta_helpers_dim2.py | 32 ------------------------ 1 file changed, 32 deletions(-) delete mode 100644 theta_lib/theta_structures/theta_helpers_dim2.py (limited to 'theta_lib/theta_structures/theta_helpers_dim2.py') diff --git a/theta_lib/theta_structures/theta_helpers_dim2.py b/theta_lib/theta_structures/theta_helpers_dim2.py deleted file mode 100644 index a57789d..0000000 --- a/theta_lib/theta_structures/theta_helpers_dim2.py +++ /dev/null @@ -1,32 +0,0 @@ -from sage.all import * - -def batch_inversion(L): - r"""Does n inversions in 3(n-1)M+1I. - - Input: - - L: list of elements to invert. - - Output: - - [1/x for x in L] - """ - # Given L=[a0,...,an] - # Computes multiples=[a0, a0.a1, ..., a0...an] - multiples=[L[0]] - for ai in L[1:]: - multiples.append(multiples[-1]*ai) - - # Computes inverses=[1/(a0...an),...,1/a0] - inverses=[1/multiples[-1]] - for i in range(1,len(L)): - inverses.append(inverses[-1]*L[-i]) - - # Finally computes [1/a0,...,1/an] - result=[inverses[-1]] - for i in range(2,len(L)+1): - result.append(inverses[-i]*multiples[i-2]) - return result - -def product_theta_point(theta1,theta2): - a,b=theta1 - c,d=theta2 - return [a*c,b*c,a*d,b*d] -- cgit v1.2.3-70-g09d2