Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit eba939b

Browse files
author
David Lucas
committed
Changes in dual_code method
1 parent 3152b5c commit eba939b

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

src/sage/coding/linear_code.py

+3-18
Original file line numberDiff line numberDiff line change
@@ -1610,13 +1610,11 @@ def divisor(self):
16101610

16111611
def dual_code(self):
16121612
r"""
1613-
This computes the dual code `Cd` of the code `C`,
1613+
Returns the dual code `C^{\perp}` of the code `C`,
16141614
16151615
.. math::
16161616
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 \}.
16201618
16211619
EXAMPLES::
16221620
@@ -1627,20 +1625,7 @@ def dual_code(self):
16271625
sage: C.dual_code()
16281626
Linear code of length 21, dimension 3 over Finite Field in a of size 2^2
16291627
"""
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())
16441629

16451630
def dimension(self):
16461631
r"""

0 commit comments

Comments
 (0)