#9326: Add cohomology of toric varieties
----------------------------------+-----------------------------------------
Reporter: vbraun | Owner: AlexGhitza
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.5.2
Component: algebraic geometry | Keywords:
Author: Volker Braun | Upstream: N/A
Reviewer: Andrey Novoseltsev | Merged:
Work_issues: |
----------------------------------+-----------------------------------------
Comment(by novoselt):
OK, here is the patch, let me know if you approve it. I have
* changed `_latex_` to give LaTeX representation of the lift-polynomial,
I think it is better than using text representation;
* made `cohomology_basis` return tuple of tuples so that it does not get
changed accidentally, I also rewrote its computation using list
comprehension instead of functional style since I got a little confused.
Of course, this is just me, so I am ready to change it back if you want. I
actually though that calling `map` and filter should be faster, but
{{{
sage: L = [1..1000]
sage: timeit("[e for e in L]", number=10000)
10000 loops, best of 3: 114 µs per loop
sage: timeit("map(lambda x: x, L)", number=10000)
10000 loops, best of 3: 263 µs per loop
sage: timeit("[e for e in L if e > 50]", number=10000)
10000 loops, best of 3: 637 µs per loop
sage: timeit("filter(lambda x: x > 50, L)", number=10000)
10000 loops, best of 3: 775 µs per loop
}}}
so it seems that actually list comprehension is a little more efficient.
My variant also does the degree splitting in a single pass through the
full basis;
* made changes in a couple of places to check for existence of cached
value before checking for errors (my sneaky plan is to allow myself to
circumvent you characteristic zero defense system by setting
`_cohomology_ring` directly if I wish so, but for sane users everything
will work exactly as you have written it originally ;-));
* some little changes to the documentation, see the patch.
I'll now run complete tests including this patch, to make sure there are
no surprises in unrelated places, but if you are happy with modifications
I am ready to switch it to positive review.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9326#comment:20>
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.