Skip to content

Commit 5166396

Browse files
committed
some matrices aligned
1 parent a1add9c commit 5166396

File tree

1 file changed

+92
-91
lines changed

1 file changed

+92
-91
lines changed

src/sage/coding/self_dual_codes.py

Lines changed: 92 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,13 @@ def _And7():
214214
[1 1 0 1 0 0 0]
215215
"""
216216
return matrix(_F, [[1, 1, 1, 0, 0, 1, 1],
217-
[1, 1, 1, 0, 1, 0, 1],
218-
[1, 1, 1, 0, 1, 1, 0],
219-
[0, 0, 0, 0, 1, 1, 1],
220-
[0, 1, 1, 1, 0, 0, 0],
221-
[1, 0, 1, 1, 0, 0, 0],
222-
[1, 1, 0, 1, 0, 0, 0]])
217+
[1, 1, 1, 0, 1, 0, 1],
218+
[1, 1, 1, 0, 1, 1, 0],
219+
[0, 0, 0, 0, 1, 1, 1],
220+
[0, 1, 1, 1, 0, 0, 0],
221+
[1, 0, 1, 1, 0, 0, 0],
222+
[1, 1, 0, 1, 0, 0, 0]])
223+
223224

224225
@cached_function
225226
def _H8():
@@ -240,13 +241,13 @@ def _H8():
240241
[ 1 -1 -1 1 -1 1 1 -1]
241242
"""
242243
return matrix(ZZ, [[1, 1, 1, 1, 1, 1, 1, 1],
243-
[1, -1, 1, -1, 1, -1, 1, -1],
244-
[1, 1, -1, -1, 1, 1, -1, -1],
245-
[1, -1, -1, 1, 1, -1, -1, 1],
246-
[1, 1, 1, 1, -1, -1, -1, -1],
247-
[1, -1, 1, -1, -1, 1, -1, 1],
248-
[1, 1, -1, -1, -1, -1, 1, 1],
249-
[1, -1, -1, 1, -1, 1, 1, -1]]) # from Guava's Hadamard matrices database
244+
[1, -1, 1, -1, 1, -1, 1, -1],
245+
[1, 1, -1, -1, 1, 1, -1, -1],
246+
[1, -1, -1, 1, 1, -1, -1, 1],
247+
[1, 1, 1, 1, -1, -1, -1, -1],
248+
[1, -1, 1, -1, -1, 1, -1, 1],
249+
[1, 1, -1, -1, -1, -1, 1, 1],
250+
[1, -1, -1, 1, -1, 1, 1, -1]]) # from Guava's Hadamard matrices database
250251

251252
# Remark: The above matrix constructions aid in computing some "small" self-dual codes.
252253

@@ -560,14 +561,14 @@ def self_dual_binary_codes(n):
560561
"Type":"I","Comment": "'Exceptional'. Unique codeword of smallest non-zero wt."}
561562
# [18,7] (equiv to H18 in [P])
562563
genmat = _MS(n)([[1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0],
563-
[0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1],
564-
[0,0,1,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1],
565-
[0,0,0,1,0,0,0,0,0,1,1,1,1,0,0,0,0,1],
566-
[0,0,0,0,1,0,0,0,0,1,1,0,0,1,0,1,1,0],
567-
[0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,1,1,0],
568-
[0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,0,1,0],
569-
[0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,1],
570-
[0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,1]])
564+
[0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1],
565+
[0,0,1,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1],
566+
[0,0,0,1,0,0,0,0,0,1,1,1,1,0,0,0,0,1],
567+
[0,0,0,0,1,0,0,0,0,1,1,0,0,1,0,1,1,0],
568+
[0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,1,1,0],
569+
[0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,0,1,0],
570+
[0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,1],
571+
[0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,1]])
571572
# G = PermutationGroup( [ "(9,10)(16,18)", "(9,16)(10,18)", "(8,9)(14,16)",\
572573
# "(7,11)(12,17)", "(7,12)(11,17)", "(5,6)(11,12)", "(5,7)(6,17)",\
573574
# "(4,13)(5,8)(6,14)(7,9)(10,12)(11,18)(16,17)", "(3,4)(13,15)",\
@@ -578,23 +579,23 @@ def self_dual_binary_codes(n):
578579
"Type":"I","Comment": "'Exceptional' construction. Min dist 4."}
579580
# [18, 8] (equiv to I18 in [P])
580581
I18 = _MS(n)([[1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
581-
[0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
582-
[0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0],
583-
[0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0],
584-
[1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0],
585-
[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0],
586-
[0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0],
587-
[0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1],
588-
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]])
582+
[0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
583+
[0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0],
584+
[0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0],
585+
[1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0],
586+
[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0],
587+
[0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0],
588+
[0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1],
589+
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]])
589590
genmat = _MS(n)([[1,0,0,0,0,0,0,0,0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
590-
[0,1,0,0,0,0,0,0,0, 1, 0, 1, 1, 1, 0, 1, 1, 1],
591-
[0,0,1,0,0,0,0,0,0, 0, 1, 1, 0, 0, 0, 1, 1, 1],
592-
[0,0,0,1,0,0,0,0,0, 0, 1, 0, 0, 1, 0, 1, 1, 1],
593-
[0,0,0,0,1,0,0,0,0, 0, 1, 0, 1, 0, 0, 1, 1, 1],
594-
[0,0,0,0,0,1,0,0,0, 1, 1, 0, 0, 0, 0, 1, 1, 1],
595-
[0,0,0,0,0,0,1,0,0, 0, 0, 0, 0, 0, 1, 0, 1, 1],
596-
[0,0,0,0,0,0,0,1,0, 0, 0, 0, 0, 0, 1, 1, 0, 1],
597-
[0,0,0,0,0,0,0,0,1, 0, 0, 0, 0, 0, 1, 1, 1, 0]])
591+
[0,1,0,0,0,0,0,0,0, 1, 0, 1, 1, 1, 0, 1, 1, 1],
592+
[0,0,1,0,0,0,0,0,0, 0, 1, 1, 0, 0, 0, 1, 1, 1],
593+
[0,0,0,1,0,0,0,0,0, 0, 1, 0, 0, 1, 0, 1, 1, 1],
594+
[0,0,0,0,1,0,0,0,0, 0, 1, 0, 1, 0, 0, 1, 1, 1],
595+
[0,0,0,0,0,1,0,0,0, 1, 1, 0, 0, 0, 0, 1, 1, 1],
596+
[0,0,0,0,0,0,1,0,0, 0, 0, 0, 0, 0, 1, 0, 1, 1],
597+
[0,0,0,0,0,0,0,1,0, 0, 0, 0, 0, 0, 1, 1, 0, 1],
598+
[0,0,0,0,0,0,0,0,1, 0, 0, 0, 0, 0, 1, 1, 1, 0]])
598599
G = PermutationGroup( [ "(9,15)(16,17)", "(9,16)(15,17)", "(8,9)(17,18)",
599600
"(7,8)(16,17)", "(5,6)(10,13)", "(5,10)(6,13)", "(4,5)(13,14)",
600601
"(3,4)(12,14)", "(1,2)(6,10)", "(1,3)(2,12)" ] )
@@ -611,15 +612,15 @@ def self_dual_binary_codes(n):
611612
# are formally equivalent but with different automorphism groups;
612613
# one of these has a unique codeword of lowest weight
613614
A10 = MatrixSpace(_F,10,10)([[1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
614-
[1, 1, 1, 0, 1, 0, 1, 0, 1, 1],
615-
[1, 0, 0, 1, 0, 1, 0, 1, 0, 1],
616-
[0, 0, 0, 1, 1, 1, 0, 1, 0, 1],
617-
[0, 0, 1, 1, 0, 1, 0, 1, 0, 1],
618-
[0, 0, 0, 1, 0, 1, 1, 1, 0, 1],
619-
[0, 1, 0, 1, 0, 1, 0, 1, 0, 1],
620-
[0, 0, 0, 1, 0, 0, 0, 0, 1, 1],
621-
[0, 0, 0, 0, 0, 1, 0, 0, 1, 1],
622-
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1]])
615+
[1, 1, 1, 0, 1, 0, 1, 0, 1, 1],
616+
[1, 0, 0, 1, 0, 1, 0, 1, 0, 1],
617+
[0, 0, 0, 1, 1, 1, 0, 1, 0, 1],
618+
[0, 0, 1, 1, 0, 1, 0, 1, 0, 1],
619+
[0, 0, 0, 1, 0, 1, 1, 1, 0, 1],
620+
[0, 1, 0, 1, 0, 1, 0, 1, 0, 1],
621+
[0, 0, 0, 1, 0, 0, 0, 0, 1, 1],
622+
[0, 0, 0, 0, 0, 1, 0, 0, 1, 1],
623+
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1]])
623624
# [20,0]:
624625
genmat = _I2(n).augment(_I2(n))
625626
# G = PermutationGroup( ["(10,20)", "(9,10)(19,20)", "(8,9)(18,19)", "(7,8)(17,18)", "(6,7)(16,17)",\
@@ -720,15 +721,15 @@ def self_dual_binary_codes(n):
720721
# [20,9]: (genmat, K20 are equiv)
721722
genmat = _I2(n).augment(A10)
722723
K20 = _MS(n)([[1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
723-
[0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
724-
[0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
725-
[0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0],
726-
[0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0],
727-
[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0],
728-
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0],
729-
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],
730-
[1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,0,0,0,0,0],
731-
[0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0]])
724+
[0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
725+
[0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
726+
[0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0],
727+
[0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0],
728+
[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0],
729+
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0],
730+
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],
731+
[1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,0,0,0,0,0],
732+
[0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0]])
732733
#genmat = K20 # not in standard form
733734
# G = PermutationGroup( [ "(4,13)(5,15)", "(4,15)(5,13)", "(3,4,13)(5,11,15)",
734735
# "(3,4,6,11,15,17)(5,13)", "(3,5,17,4,12)(6,15,7,11,13)",
@@ -741,15 +742,15 @@ def self_dual_binary_codes(n):
741742
"Type":"I","Comment": "Min dist 4."}
742743
# [20,10]
743744
L20 = _MS(n)([[1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
744-
[0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
745-
[1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
746-
[0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0],
747-
[0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0],
748-
[0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0],
749-
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0],
750-
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],
751-
[0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,0,0,0,0],
752-
[0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,1,0,1,0]])
745+
[0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
746+
[1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
747+
[0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0],
748+
[0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0],
749+
[0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0],
750+
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0],
751+
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],
752+
[0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,0,0,0,0],
753+
[0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,1,0,1,0]])
753754
genmat = L20 # not in standard form
754755
# G = PermutationGroup( [ "(17,18)(19,20)", "(17,19)(18,20)", "(15,16)(19,20)",
755756
# "(15,17)(16,18)", "(10,11)(12,13)", "(10,12)(11,13)", "(9,10)(13,14)",
@@ -760,15 +761,15 @@ def self_dual_binary_codes(n):
760761
"Type":"I","Comment": "Min dist 4."}
761762
# [20,11]
762763
S20 = _MS(n)([[1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
763-
[0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
764-
[0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
765-
[0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0],
766-
[0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0],
767-
[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0],
768-
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],
769-
[1,0,1,0,1,0,1,0,1,1,0,0,0,0,0,0,1,1,0,0],
770-
[1,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,1,0,0],
771-
[1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,0,1,0]] )
764+
[0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
765+
[0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
766+
[0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0],
767+
[0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0],
768+
[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0],
769+
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],
770+
[1,0,1,0,1,0,1,0,1,1,0,0,0,0,0,0,1,1,0,0],
771+
[1,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,1,0,0],
772+
[1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,0,1,0]] )
772773
genmat = S20 # not in standard form
773774
# G = PermutationGroup( [ "(17,18)(19,20)", "(17,19)(18,20)", "(13,14)(15,16)",
774775
# "(13,15)(14,16)", "(11,12)(15,16)", "(11,13)(12,14)", "(9,10)(15,16)",
@@ -780,15 +781,15 @@ def self_dual_binary_codes(n):
780781
"Type":"I","Comment":"Min dist 4."}
781782
# [20,12]
782783
R20 = _MS(n)([[0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
783-
[0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
784-
[0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0],
785-
[0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0],
786-
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0],
787-
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],
788-
[0,1,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,1,1,0],
789-
[1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0],
790-
[1,1,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1],
791-
[1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1]])
784+
[0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
785+
[0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0],
786+
[0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0],
787+
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0],
788+
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],
789+
[0,1,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,1,1,0],
790+
[1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0],
791+
[1,1,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1],
792+
[1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1]])
792793
genmat = R20 # not in standard form
793794
# G = PermutationGroup( [ "(17,18)(19,20)", "(17,19)(18,20)", "(15,16)(19,20)",
794795
# "(15,17)(16,18)", "(11,12)(13,14)", "(11,13)(12,14)", "(9,10)(13,14)",
@@ -800,15 +801,15 @@ def self_dual_binary_codes(n):
800801
"Type":"I","Comment":"Min dist 4."}
801802
# [20,13]
802803
M20 = _MS(n)([[1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
803-
[0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
804-
[0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0],
805-
[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0],
806-
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],
807-
[0,0,0,0,0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0],
808-
[1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,0],
809-
[0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1],
810-
[0,0,1,1,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0],
811-
[0,0,0,0,0,0,1,1,0,1,1,0,1,0,0,1,0,0,0,0]])
804+
[0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
805+
[0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0],
806+
[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0],
807+
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],
808+
[0,0,0,0,0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0],
809+
[1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,0],
810+
[0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1],
811+
[0,0,1,1,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0],
812+
[0,0,0,0,0,0,1,1,0,1,1,0,1,0,0,1,0,0,0,0]])
812813
genmat = M20 # not in standard form
813814
# G = PermutationGroup( [ "(17,18)(19,20)", "(17,19)(18,20)", "(13,14)(15,16)",
814815
# "(13,15)(14,16)", "(9,10)(11,12)", "(9,11)(10,12)", "(5,6)(7,8)",

0 commit comments

Comments
 (0)