Changes between Initial Version and Version 2 of Ticket #25896


Ignore:
Timestamp:
07/22/18 07:57:36 (4 years ago)
Author:
jdemeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #25896

    • Property Commit changed from to ea8fa5c491d9055ed1b213526d439ce82177de34
    • Property Branch changed from to u/chapoton/25379
  • Ticket #25896 – Description

    initial v2  
    111. The use of `_lift2smallest_field` is very dubious:
    22{{{
    3 sage -t --long src/sage/coding/code_constructions.py
    4 **********************************************************************
    5 File "src/sage/coding/code_constructions.py", line 624, in sage.coding.code_constructions.QuadraticResidueCodeOddPair
    6 Failed example:
    7     codes.QuadraticResidueCodeOddPair(17, GF(13))
    8 Exception raised:
    9     Traceback (most recent call last):
    10       File "/home/vdelecro/sage_patchbot/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 562, in _run
    11         self.compile_and_execute(example, compiler, test.globs)
    12       File "/home/vdelecro/sage_patchbot/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 972, in compile_and_execute
    13         exec(compiled, globs)
    14       File "<doctest sage.coding.code_constructions.QuadraticResidueCodeOddPair[0]>", line 1, in <module>
    15         codes.QuadraticResidueCodeOddPair(Integer(17), GF(Integer(13)))
    16       File "/home/vdelecro/sage_patchbot/local/lib/python2.7/site-packages/sage/coding/code_constructions.py", line 666, in QuadraticResidueCodeOddPair
    17         return DuadicCodeOddPair(F,Q,N)
    18       File "/home/vdelecro/sage_patchbot/local/lib/python2.7/site-packages/sage/coding/code_constructions.py", line 425, in DuadicCodeOddPair
    19         gg1 = P2(coeffs1)
    20       File "sage/structure/parent.pyx", line 920, in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9734)
    21         return mor._call_(x)
    22       File "sage/structure/coerce_maps.pyx", line 145, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4555)
    23         raise
    24       File "sage/structure/coerce_maps.pyx", line 140, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4423)
    25         return C._element_constructor(x)
    26       File "/home/vdelecro/sage_patchbot/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py", line 404, in _element_constructor_
    27         return C(self, x, check=check, is_gen=False, construct=construct)
    28       File "sage/rings/polynomial/polynomial_zmod_flint.pyx", line 100, in sage.rings.polynomial.polynomial_zmod_flint.Polynomial_zmod_flint.__init__ (build/cythonized/sage/rings/polynomial/polynomial_zmod_flint.cpp:14356)
    29         lst = [k(i) for i in x]
    30       File "sage/structure/parent.pyx", line 920, in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9734)
    31         return mor._call_(x)
    32       File "sage/rings/finite_rings/hom_prime_finite_field.pyx", line 46, in sage.rings.finite_rings.hom_prime_finite_field.SectionFiniteFieldHomomorphism_prime._call_ (build/cythonized/sage/rings/finite_rings/hom_prime_finite_field.c:3457)
    33         raise ValueError("%s is not in the image of %s" % (x, self._inverse))
    34     ValueError: 10*z^3 + 9*z^2 + z is not in the image of (map internal to coercion system -- copy before use)
    35     Ring morphism:
    36       From: Finite Field of size 13
    37       To:   Finite Field in z of size 13^4
    38 **********************************************************************
     3sage: S1 = [1,3,4,5,7,12,13]; S2 = [2,6,8,9,10,11,14]
     4sage: codes.DuadicCodeEvenPair(GF(7), S1, S2)
     5...
     6ValueError: 5*z + 2 is not in the image of (map internal to coercion system -- copy before use)
     7Ring morphism:
     8  From: Finite Field of size 7
     9  To:   Finite Field in z of size 7^2
    3910}}}
    4011
    41 2. The code assumes implicitly that the generator of a finite field is a multiplicative generator
    42 
    43 3. It doesn't work as documented:
     122. It doesn't work as documented:
    4413{{{
    4514sage: S1 = [1,3,4,5,7,12,13]; S2 = [2,6,8,9,10,11,14]
     
    6938ArithmeticError: multiplicative order of 3 not defined since it is not a unit modulo 15
    7039}}}
     40
     413. The code assumes implicitly that the generator of a finite field is a multiplicative generator (this is easy to fix).
     42
     43I can imagine that 1. and 2. should be considered "bad input" but in that case the documentation must be updated.