Fix a bug (% is not mod for negative integers).

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2019-10-26 01:19:51 +01:00
parent 78b0876888
commit 3f763f3f62
1 changed files with 2 additions and 1 deletions

3
injectivitylemma.py Normal file → Executable file
View File

@ -9,7 +9,8 @@ def gamma_delta():
yield ( 0, 1)
def sums_mod4(gd):
return (sum([gd[j][0] * (2**j) for j in range(k)]) % 4, sum([gd[j][1] * (2**j) for j in range(k)]) % 4)
return ((2**(k+1) + sum([gd[j][0] * (2**j) for j in range(k)])) % 4,
(2**(k+1) + sum([gd[j][1] * (2**j) for j in range(k)])) % 4)
for k in (1, 2):
M_k = [list(s) for s in product(gamma_delta(), repeat=k)]