Changeset 7750:0194e639d9f4


Ignore:
Timestamp:
12/11/07 10:38:42 (5 years ago)
Author:
Robert Miller <rlmillster@…>
Branch:
default
Message:

removed is_equivalent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sage/coding/linear_code.py

    r7748 r7750  
    845845                return False 
    846846        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 in 
    853         SAGEHOME/local/lib/gap*/pkg/guava*. See  
    854         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+1 
    860             sage: C2 = CyclicCode(g,7,GF(2)) 
    861             sage: C1; C2 
    862             Linear code of length 7, dimension 4 over Finite Field of size 2 
    863             Linear code of length 7, dimension 4 over Finite Field of size 2 
    864             sage: C1 == C2 
    865             False 
    866             sage: C1.is_equivalent(C2) 
    867             True 
    868  
    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 False 
    878         if sdim != rdim: 
    879             return False 
    880         if sF != rF: 
    881             return False 
    882         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) == True 
    888             if bval == False: 
    889                 return False 
    890             if bval == True: 
    891                 G = SymmetricGroup(slength) 
    892                 g = C1g.CodeIsomorphism(C2g) 
    893                 return True,G(str(g)) 
    894         return C1g.IsEquivalent(C2g) == True 
    895847 
    896848    def is_permutation_automorphism(self,g): 
Note: See TracChangeset for help on using the changeset viewer.