@@ -1206,7 +1206,6 @@ cdef class BinaryCode:
1206
1206
combination ^= (1 << j)
1207
1207
word ^= self .basis[j]
1208
1208
1209
-
1210
1209
cpdef int put_in_std_form(self ):
1211
1210
"""
1212
1211
Put the code in binary form, which is defined by an identity matrix on
@@ -1225,7 +1224,6 @@ cdef class BinaryCode:
1225
1224
Binary [6,2] linear code, generator matrix
1226
1225
[101011]
1227
1226
[010111]
1228
-
1229
1227
"""
1230
1228
cdef codeword swap, current = 1 , pivots = 0
1231
1229
cdef int i, j, k, row = 0
@@ -1261,6 +1259,7 @@ cdef class BinaryCode:
1261
1259
self ._apply_permutation_to_basis(perm)
1262
1260
self ._update_words_from_basis()
1263
1261
1262
+
1264
1263
cdef class OrbitPartition:
1265
1264
"""
1266
1265
Structure which keeps track of which vertices are equivalent
@@ -2770,7 +2769,8 @@ cdef class PartitionStack:
2770
2769
j = 0
2771
2770
if alpha[m] & flag:
2772
2771
while j < self_ncols:
2773
- i = j; s = 0
2772
+ i = j
2773
+ s = 0
2774
2774
invariant += 8
2775
2775
while True :
2776
2776
self_col_degs[i- j] = self .col_degree(CG, self_col_ents[i], alpha[m]^ flag, k)
@@ -2800,7 +2800,8 @@ cdef class PartitionStack:
2800
2800
j = i
2801
2801
else :
2802
2802
while j < self .nwords:
2803
- i = j; s = 0
2803
+ i = j
2804
+ s = 0
2804
2805
invariant += 64
2805
2806
while True :
2806
2807
self_wd_degs[i- j] = self .wd_degree(CG, self_wd_ents[i], alpha[m], k, ham_wts)
@@ -3430,7 +3431,9 @@ cdef class BinaryCodeClassifier:
3430
3431
alpha[1 ] = nu.flag
3431
3432
nu.refine(k, alpha, 2 , C, ham_wts)
3432
3433
if nu.sat_225(k): hh = k
3433
- if nu.is_discrete(k): state = 18 ; continue
3434
+ if nu.is_discrete(k):
3435
+ state = 18
3436
+ continue
3434
3437
3435
3438
# store the first smallest nontrivial cell in W[k], and set v[k]
3436
3439
# equal to its minimum element
@@ -3448,7 +3451,9 @@ cdef class BinaryCodeClassifier:
3448
3451
alpha[0 ] = nu.split_vertex(v[k- 1 ], k)
3449
3452
Lambda[k] = nu.refine(k, alpha, 1 , C, ham_wts) # store the invariant to Lambda[k]
3450
3453
# only if this is the first time moving down the search tree:
3451
- if h == - 1 : state = 5 ; continue
3454
+ if h == - 1 :
3455
+ state = 5
3456
+ continue
3452
3457
3453
3458
# update hzf__h_zeta
3454
3459
if hzf__h_zeta == k- 1 and Lambda[k] == zf__Lambda_zeta[k]: hzf__h_zeta = k
@@ -3478,7 +3483,9 @@ cdef class BinaryCodeClassifier:
3478
3483
else : state = 6
3479
3484
3480
3485
elif state == 4 : # at this point we have -not- ruled out the presence of automorphisms
3481
- if nu.is_discrete(k): state = 7 ; continue # we have a terminal node, so process it
3486
+ if nu.is_discrete(k):
3487
+ state = 7
3488
+ continue # we have a terminal node, so process it
3482
3489
3483
3490
# otherwise, prepare to split out another column:
3484
3491
# store the first smallest nontrivial cell in W[k], and set v[k]
@@ -3521,7 +3528,9 @@ cdef class BinaryCodeClassifier:
3521
3528
if hb > k:# update hb since we are backtracking
3522
3529
hb = k
3523
3530
# if j == hh, then all nodes lower than our current position are equivalent, so bail out
3524
- if j == hh: state = 13 ; continue
3531
+ if j == hh:
3532
+ state = 13
3533
+ continue
3525
3534
3526
3535
# recall hh: the height of the oldest ancestor of zeta for which Lemma 2.25 is
3527
3536
# satisfied, which implies that all terminal nodes descended from there are equivalent.
@@ -3536,11 +3545,15 @@ cdef class BinaryCodeClassifier:
3536
3545
elif state == 7 : # we have just arrived at a terminal node of the search tree T(G, Pi)
3537
3546
# if this is the first terminal node, go directly to 18, to
3538
3547
# process zeta
3539
- if h == - 1 : state = 18 ; continue
3548
+ if h == - 1 :
3549
+ state = 18
3550
+ continue
3540
3551
3541
3552
# hzf is the extremal height of ancestors of both nu and zeta, so if k < hzf, nu is not
3542
3553
# equivalent to zeta, i.e. there is no automorphism to discover.
3543
- if k < hzf__h_zeta: state = 8 ; continue
3554
+ if k < hzf__h_zeta:
3555
+ state = 8
3556
+ continue
3544
3557
3545
3558
nu.get_permutation(zeta, word_gamma, col_gamma)
3546
3559
@@ -3553,18 +3566,26 @@ cdef class BinaryCodeClassifier:
3553
3566
elif state == 8 : # we have just ruled out the presence of automorphism and have not yet
3554
3567
# considered whether nu improves on rho
3555
3568
# if qzb < 0, then rho already has larger indicator tuple
3556
- if qzb < 0 : state = 6 ; continue
3569
+ if qzb < 0 :
3570
+ state = 6
3571
+ continue
3557
3572
3558
3573
# if Lambda[k] > zb[k] or nu is shorter than rho, then we have an improvement for rho
3559
- if (qzb > 0 ) or (k < k_rho): state = 9 ; continue
3574
+ if (qzb > 0 ) or (k < k_rho):
3575
+ state = 9
3576
+ continue
3560
3577
3561
3578
# now Lambda[k] == zb[k] and k == k_rho, so we appeal to an enumeration:
3562
3579
j = nu.cmp(rho, C)
3563
3580
# if C(nu) > C(rho), we have a new label, goto 9
3564
- if j > 0 : state = 9 ; continue
3581
+ if j > 0 :
3582
+ state = 9
3583
+ continue
3565
3584
3566
3585
# if C(nu) < C(rho), no new label, goto 6
3567
- if j < 0 : state = 6 ; continue
3586
+ if j < 0 :
3587
+ state = 6
3588
+ continue
3568
3589
3569
3590
# if C(nu) == C(rho), get the automorphism and goto 10
3570
3591
rho.get_permutation(nu, word_gamma, col_gamma)
@@ -3627,7 +3648,9 @@ cdef class BinaryCodeClassifier:
3627
3648
3628
3649
# j stores whether anything happened or not- if not, then the automorphism we have
3629
3650
# discovered is already in the subgroup spanned by the generators we have output
3630
- if not j: state = 11 ; continue
3651
+ if not j:
3652
+ state = 11
3653
+ continue
3631
3654
3632
3655
# otherwise, we have a new generator, so record it:
3633
3656
self .record_automorphism(col_gamma, ncols)
@@ -3641,10 +3664,11 @@ cdef class BinaryCodeClassifier:
3641
3664
if tvc & nu.flag:
3642
3665
i = tvc^ nu.flag
3643
3666
if Theta.wd_min_cell_rep[Theta.wd_find(i)] == i:
3644
- state = 11 ; continue
3645
- else :
3646
- if Theta.col_min_cell_rep[Theta.col_find(tvc)] == tvc:
3647
- state = 11 ; continue
3667
+ state = 11
3668
+ continue
3669
+ elif Theta.col_min_cell_rep[Theta.col_find(tvc)] == tvc:
3670
+ state = 11
3671
+ continue
3648
3672
3649
3673
# Otherwise, proceed to where zeta meets nu:
3650
3674
k = h
@@ -3675,11 +3699,17 @@ cdef class BinaryCodeClassifier:
3675
3699
state = 13
3676
3700
3677
3701
elif state == 13 : # hub state
3678
- if k == - 1 : state = - 1 ; continue # exit point
3702
+ if k == - 1 :
3703
+ state = - 1
3704
+ continue # exit point
3679
3705
3680
- if k > h: state = 17 ; continue # we are still on the same principal branch from zeta
3706
+ if k > h:
3707
+ state = 17
3708
+ continue # we are still on the same principal branch from zeta
3681
3709
3682
- if k == h: state = 14 ; continue # update the stabilizer index and check for new splits,
3710
+ if k == h:
3711
+ state = 14
3712
+ continue # update the stabilizer index and check for new splits,
3683
3713
# since we have returned to a partition of zeta
3684
3714
# otherwise k < h, hence we have just backtracked up zeta, and are one level closer to done
3685
3715
h = k
@@ -3719,7 +3749,8 @@ cdef class BinaryCodeClassifier:
3719
3749
v[k] = i^ nu.flag
3720
3750
else :
3721
3751
# there is no new split at this level
3722
- state = 16 ; continue
3752
+ state = 16
3753
+ continue
3723
3754
# new split column better be a minimal representative in Theta, or wasted effort
3724
3755
if Theta.wd_min_cell_rep[Theta.wd_find(i)] == i:
3725
3756
state = 15
@@ -3733,7 +3764,8 @@ cdef class BinaryCodeClassifier:
3733
3764
v[k] = i
3734
3765
else :
3735
3766
# there is no new split at this level
3736
- state = 16 ; continue
3767
+ state = 16
3768
+ continue
3737
3769
# new split column better be a minimal representative in Theta, or wasted effort
3738
3770
if Theta.col_min_cell_rep[Theta.col_find(v[k])] == v[k]:
3739
3771
state = 15
@@ -3760,7 +3792,8 @@ cdef class BinaryCodeClassifier:
3760
3792
i = W[jj]
3761
3793
j = ham_wts[i & 65535 ] + ham_wts[(i >> 16 ) & 65535 ]
3762
3794
else :
3763
- i = 0 ; j = 0
3795
+ i = 0
3796
+ j = 0
3764
3797
ii = self .radix
3765
3798
while i* ii < nwords:
3766
3799
iii = W[jj+ 1 + i]
@@ -3812,15 +3845,17 @@ cdef class BinaryCodeClassifier:
3812
3845
if (1 << i% self .radix) & W[jjj+ 1 + i/ self .radix]: break
3813
3846
if i < nwords:
3814
3847
v[k] = i^ nu.flag
3815
- state = 15 ; continue
3848
+ state = 15
3849
+ continue
3816
3850
else :
3817
3851
i = v[k]
3818
3852
while i < ncols:
3819
3853
i += 1
3820
3854
if (1 << i) & W[jjj]: break
3821
3855
if i < ncols:
3822
3856
v[k] = i
3823
- state = 15 ; continue
3857
+ state = 15
3858
+ continue
3824
3859
3825
3860
k -= 1
3826
3861
state = 13
0 commit comments