Skip to content

Commit

Permalink
fixed wrong changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Feb 5, 2025
1 parent 7e7d52a commit 11cba3d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
15 changes: 7 additions & 8 deletions src/sage/coding/binary_code.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3370,8 +3370,8 @@ cdef class BinaryCodeClassifier:
# equal to its minimum element
v[k] = nu.new_first_smallest_nontrivial(k, W, self.Phi_size * k)
if not nu.sat_225(k): hh = k + 1
e[k] = 0 # see state 12 and 17
state = 2 # continue down the tree
e[k] = 0 # see state 12 and 17
state = 2 # continue down the tree

elif state == 5:
# same as state 3, but in the case where we haven't yet defined zeta
Expand All @@ -3381,8 +3381,7 @@ cdef class BinaryCodeClassifier:
zb__Lambda_rho[k] = Lambda[k]
state = 4

elif state == 6:
# at this stage, there is no reason to continue downward, so backtrack
elif state == 6: # at this stage, there is no reason to continue downward, so backtrack
j = k

# return to the longest ancestor nu[i] of nu that could have a
Expand Down Expand Up @@ -3473,7 +3472,7 @@ cdef class BinaryCodeClassifier:

state = 10

elif state == 9: # nu is a better guess at the canonical label than rho
elif state == 9: # nu is a better guess at the canonical label than rho
rho = PartitionStack(nu)
k_rho = k
qzb = 0
Expand All @@ -3483,7 +3482,7 @@ cdef class BinaryCodeClassifier:
zb__Lambda_rho[k+1] = -1
state = 6

elif state == 10: # we have an automorphism to process
elif state == 10: # we have an automorphism to process
# increment l
if l < self.L-1: l += 1
# store information about the automorphism to Omega and Phi
Expand All @@ -3504,8 +3503,8 @@ cdef class BinaryCodeClassifier:
Omega[ii] ^= (1<<j) # so cancel
j = col_gamma[j] # cellmates
i += 1
while i < ncols and not Omega[ii]&(1<<i): # find minimal element
i += 1 # of next cell
while i < ncols and not Omega[ii]&(1<<i): # find minimal element
i += 1 # of next cell
i = 0
jj = self.radix
while i < nwords:
Expand Down
7 changes: 3 additions & 4 deletions src/sage/rings/finite_rings/integer_mod.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1586,15 +1586,14 @@ cdef class IntegerMod_abstract(FiniteRingElement):
if all:
return [K(s) for s in sign[:2]]
return K(sign[0])
if all:
modp = [mod(self, 8)]
modp = mod(self, 8)
modp = [mod(self, 8)] if all else mod(self, 8)
else:
sign = [1]
modp = self % p
self = self / K(R.teichmuller(modp))
modp = modp.nth_root(n, all=all, algorithm=algorithm)
# now self is congruent to 1 mod 4 or 1 mod p (for odd p), so the power series for p-adic log converges.
# now self is congruent to 1 mod 4 or 1 mod p (for odd p),
# so the power series for p-adic log converges.
# Hensel lifting is probably better, but this is easier at the moment.
plog = R(self).log()
nval = n.valuation(p)
Expand Down

0 comments on commit 11cba3d

Please sign in to comment.