Changeset 7750:0194e639d9f4
- Timestamp:
- 12/11/07 10:38:42 (5 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
sage/coding/linear_code.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sage/coding/linear_code.py
r7748 r7750 845 845 return False 846 846 return True 847 848 def is_equivalent(self, right,isomorphism=False):849 """850 Checks if self is permutation equivalent to right.851 Only works for *binary* codes at the moment.852 This requires that Leon's code be compiled in853 SAGEHOME/local/lib/gap*/pkg/guava*. See854 http://sage.math.washington.edu/home/wdj/guava/855 or the README.guava file there.856 857 EXAMPLES:858 sage: C1 = HammingCode(3,GF(2))859 sage: x = PolynomialRing(GF(2),"x").gen(); g = x^3+x+1860 sage: C2 = CyclicCode(g,7,GF(2))861 sage: C1; C2862 Linear code of length 7, dimension 4 over Finite Field of size 2863 Linear code of length 7, dimension 4 over Finite Field of size 2864 sage: C1 == C2865 False866 sage: C1.is_equivalent(C2)867 True868 869 """870 slength = self.length()871 rlength = right.length()872 sdim = self.dimension()873 rdim = right.dimension()874 sF = self.base_ring()875 rF = right.base_ring()876 if slength != rlength:877 return False878 if sdim != rdim:879 return False880 if sF != rF:881 return False882 genmat1 = self.gen_mat(); gapgenmat1 = genmat1._matrix_(GF(2))883 C1g = gap(gapgenmat1).GeneratorMatCode(GF(2))884 genmat2 = right.gen_mat(); gapgenmat2 = genmat2._matrix_(GF(2))885 C2g = gap(gapgenmat2).GeneratorMatCode(GF(2))886 if isomorphism == True:887 bval = C1g.IsEquivalent(C2g) == True888 if bval == False:889 return False890 if bval == True:891 G = SymmetricGroup(slength)892 g = C1g.CodeIsomorphism(C2g)893 return True,G(str(g))894 return C1g.IsEquivalent(C2g) == True895 847 896 848 def is_permutation_automorphism(self,g):
Note: See TracChangeset
for help on using the changeset viewer.
