Ryan Rueger

ryan@rueg.re / picture / key / home
aboutsummaryrefslogtreecommitdiffhomepage
path: root/theta_lib/theta_structures/theta_helpers_dim2.py
diff options
context:
space:
mode:
authorPierrick-Dartois <pierrickdartois@icloud.com>2025-05-22 18:51:58 +0200
committerPierrick-Dartois <pierrickdartois@icloud.com>2025-05-22 18:51:58 +0200
commitcb6080eaa4f326d9fce5f0a9157be46e91d55e09 (patch)
tree4d080ade8db9faa0da5268ab420dad2b02a4e248 /theta_lib/theta_structures/theta_helpers_dim2.py
parentd40de259097c5e8d8fd35539560ca7c3d47523e7 (diff)
downloadpegasis-cb6080eaa4f326d9fce5f0a9157be46e91d55e09.tar.gz
pegasis-cb6080eaa4f326d9fce5f0a9157be46e91d55e09.tar.bz2
pegasis-cb6080eaa4f326d9fce5f0a9157be46e91d55e09.zip
Clean up PEGASIS submodule inclusion
Diffstat (limited to 'theta_lib/theta_structures/theta_helpers_dim2.py')
-rw-r--r--theta_lib/theta_structures/theta_helpers_dim2.py32
1 files changed, 0 insertions, 32 deletions
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]