On 1/14/08, David Roe <[EMAIL PROTECTED]> wrote: > That looks quite cool. > > spkg's are generally for non-Python files. The way to put a Python file > into sage is to convert your .sage file to a .py file (for example, changing > "^" to "**" throughout)
That's very dangerous to do and will likely introduce bugs. It is safer to type sage -preparse hodge_numbers_ci.sage then take a look at the file foo.py which is generated. That .py file will work 100% like your .sage file -- in fact it is the one Sage actually uses when you load/attached that .sage file. You can then look it over and remove excessive preparsing. > and then putting it somewhere with the sage library > files (for example, in > $SAGE_ROOT/devel/sage-main/sage/schemes/generic/) Then you > could, from the command line do from > sage.schemes.generic.hodge_numbers_ci import * and have > access to all of your functionality. Once you do so, get an account on > sage_trac (e-mail William), post this as a ticket to include in Sage, get > someone to review it and you're all set. Yep, email me. > At some point we need to get around to improving the documentation for > people in exactly your situation: just starting to contribute to the sage > library. It was a project started at Sage Days 6, but hasn't gone very far > since then. Agreed! However, before jumping into that it is very useful for us to have this sort of discussion via email a few times first, as it helps clarify in response to _real situations_ exactly what we need to tell people and what their responses would be. It's much better writing for a real audience then cleaning it up, then writing docs for an imaginary audience. > I like making a CompleteIntersection class eventually. Yep. I'm glad you just volunteered :-) > > > On Jan 14, 2008 8:38 AM, D. Benjamin Antieau <[EMAIL PROTECTED] > > wrote: > > To all, > > > > I've created a sage file to calculate, among other things, the Hodge > numbers of an arbitrary complete intersection. Attached is the .sage file. I > also attempted to create a .spkg file, but it does not seem to work. Mine > contains simply a .py file that the install script puts it > $SAGE_ROOT/local/bin. But, I cannot seem to use it from within sage. Any > help on that front would be appreciated. On the other hand, loading the > .sage file works fine. > > > > The file itself is well-documented. I would love suggestions for further > methods to add. For instance, at some point I will add the ability to > compute the degrees of the top Chern classes of a threefold. > > > > I don't see putting this in sage at the moment, but it does lead to the > question: should there be a CompleteIntersection class, which would inherit > from AlgebraicScheme_subscheme_projective. If so, then I > could put this code in that class in the characteristic zero case. > > > > Ben Antieau > > > > Example: > > > > The Hodge numbers of a crazy fourfold. The list of integers is the list of > degrees of the complete intersection. > > sage: hodge_numbers_ci([2,4,6,3,6,4,3,2,9,5],4) > > [ 1 0 0 0 2658146543] > > [ 0 1 0 22238665343 0] > > [ 0 0 42452753184 0 0] > > [ 0 22238665343 0 1 0] > > [ 2658146543 0 0 0 1] > > > > The file provides the following functions: > > > chiy_characteristic_ci(degrees,index,yprecision,zprecision) > > hodge_numbers_ci(degrees,dimension) > > betti_numbers_ci(degrees,dimension) > > euler_characteristic_ci(degrees,dimension) > > topological_euler_characteristic_ci(degrees,dimension) > > arithmetic_genus_ci(degrees,dimension) > > geometric_genus_ci(degrees,dimension) > [==arithmetic_genus_ci] > > K_squared_surface_ci(degrees,dimension) [computes the > degree of K^2 of a complete intersection surface] > > c2_surface_ci(degrees,dimension) [computes the degree of > the second Chern class of a complete intersection surface] > > > > > > > > > > > > > > > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---