My entire code is:
import itertools as it
import numpy as np
import scipy
from scipy import special
for q in [29, 37, 53, 61]:
p = int((q-1)/4)
d0 = [2**(4*i) % q for i in range(p)]
d2 = [2**(4*i + 2) % q for i in range(p)]
c2 = list(it.combinations(d0,2))
cd = list(it.combinations(d2,p-2))
s2 = [sum(c2[i]) % q for i in range(len(c2))]
sd = [sum(cd[i]) % q for i in range(len(cd))]
a = [i for i,x in enumerate(s2) if x == 1]
b = [i for i,x in enumerate(sd) if x == 1]
l = [list(c2[i]) for i in a]
l1 = [list(cd[i]) for i in b]
c = [[d0.index(l[i][j]) for j in range(2)] for i in range(len(l))]
d = [[d2.index(l1[i][j]) for j in range(p-2)] for i in range(len(l1))]
cp = [[4*c[i][j] for j in range(2)] for i in range(len(c))]
dp = [[4*d[i][j]+2 for j in range(p-2)] for i in range(len(d))]
dps = [set(x) for x in dp]
dpp = [4*i+2 %q for i in range(p)]
cop_dpp = []
for i in range(len(dp)):
cop_dpp.append(dpp)
cop_dpps = [set(x) for x in cop_dpp]
diff = [cop_dpps[i] - dps[i] for i in range(len(dp))]
diffl = [list(x) for x in diff]
e = []
for i in range(len(cp)):
for o in range(len(cp)):
x = cp[i] + diffl[o]
e.append(x)
f = []
for k in range(1):
for l in range(1):
x = e[k] + e[l]
f.append(x)
print(q,cp)
print(q, diffl)
print(q,e)
print(q,f)
The error it gives is:
f = []
^
IndentationError: unindent does not match any outer indentation level
I have tried moving f = [] every where. Tabbing it in different places in the code (along with the for-loop it depends on) but obtain the same error. Wrote a simple piece of code:
a = [[1,2,3]]
b = [[3,4,5]]
e = []
for i in range(len(a)):
for o in range(len(b)):
x = a[i] + b[o]
e.append(x)
f = []
for k in range(len(e)):
for l in range(len(e)):
x = e[k] + e[l]
f.append(x)
print(e)
print(f)
which ran fine. I have used tabs for every line of code. Any help would be much appreciated. Thank you in advance!