#9055: Moving/cleaning enumeration functions for points on schemes
--------------------------------------------+-------------------------------
Reporter: cturner | Owner: AlexGhitza
Type: enhancement | Status: needs_review
Priority: minor | Milestone: sage-4.6.1
Component: algebraic geometry | Keywords: rational points
enumeration
Author: Charlie Turner, David Joyner | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------------------------+-------------------------------
Comment(by rlm):
I will simply mention for the record that things like
{{{
G = self.gen_mat()
F = self.base_ring()
q = F.order()
q0 = F0.order()
a = log(q,q0) # test if F/F0 is a field extension
if not isinstance(a, Integer):
raise ValueError,"Base field must be an extension of given
field %s"%F0
n = len(G.columns())
k = len(G.rows())
G0 = [[x**q0 for x in g.list()] for g in G.rows()]
G1 = [[x for x in g.list()] for g in G.rows()]
G2 = G0+G1
MS = MatrixSpace(F,2*k,n)
G3 = MS(G2)
r = G3.rank()
MS = MatrixSpace(F,r,n)
Grref = G3.echelon_form()
G = MS([Grref.row(i) for i in range(r)])
return LinearCode(G)
}}}
(`galois_closure` in `linear_code.py`) can be vastly simplified, and
probably sped up in the process.
Programming no-nos:
1. Using logarithms to test whether one finite field is contained in
another (why not just check whether the characteristics are the same and
if one degree divides the other?).
1. `G1 = [[x for x in g.list()] for g in G.rows()]` ... Why not `G1 =
G.rows()` or at least `G1 = [g.list() for g in G.rows()]` etc.? This is a
big waste of time (remember that Python is slow anyway...)
1. This is also bad:
{{{
MS = MatrixSpace(F,2*k,n)
G3 = MS(G2)
r = G3.rank()
MS = MatrixSpace(F,r,n)
Grref = G3.echelon_form()
G = MS([Grref.row(i) for i in range(r)])
}}}
... why not just `G3 = Matrix(F, 2*k, n, G2); G =
G3.row_space().basis_matrix()` or the equivalent? It's easier to follow
and might be more efficient, too.
(Not criticisms of code in this ticket at all, for the skimmer -- just an
indication that `linear_code.py` needs more work...)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9055#comment:12>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.