This repository was archived by the owner on Jan 30, 2023. It is now read-only.
File tree 1 file changed +3
-18
lines changed
1 file changed +3
-18
lines changed Original file line number Diff line number Diff line change @@ -1610,13 +1610,11 @@ def divisor(self):
1610
1610
1611
1611
def dual_code (self ):
1612
1612
r"""
1613
- This computes the dual code `Cd ` of the code `C`,
1613
+ Returns the dual code `C^{\perp} ` of the code `C`,
1614
1614
1615
1615
.. math::
1616
1616
1617
- Cd = \{ v \in V\ |\ v\cdot c = 0,\ \forall c \in C \}.
1618
-
1619
- Does not call GAP.
1617
+ C^{\perp} = \{ v \in V\ |\ v\cdot c = 0,\ \forall c \in C \}.
1620
1618
1621
1619
EXAMPLES::
1622
1620
@@ -1627,20 +1625,7 @@ def dual_code(self):
1627
1625
sage: C.dual_code()
1628
1626
Linear code of length 21, dimension 3 over Finite Field in a of size 2^2
1629
1627
"""
1630
- G = self .generator_matrix ()
1631
- H = G .transpose ().kernel ()
1632
- V = H .ambient_vector_space ()
1633
- Cd = LinearCodeFromVectorSpace (V .span (H ))
1634
- return Cd
1635
- #another way:
1636
- #Gsf, p = standard_form(G)
1637
- #k = len(G.rows())
1638
- #n = len(G.columns())
1639
- #MS = G.parent()
1640
- #sG = G.matrix_from_columns(range(k,n))
1641
- #Inmk = MatrixSpace(F,n-k,n-k).identity_matrix()
1642
- #H = Inmk.augment(sG.transpose())
1643
- #return LinearCode(H)
1628
+ return LinearCode (self .parity_check_matrix ())
1644
1629
1645
1630
def dimension (self ):
1646
1631
r"""
You can’t perform that action at this time.
0 commit comments