First time here? Check out the FAQ!

Ask Your Question
1

compiling problems with new versions

asked 10 years ago

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Hi, I've been developing a project on my university's computers (which unfortunately run a 4.7.1 version) and on the sagenb.org site, and everything went fine. But as soon as I tried to run the project on cloud.sagemath I ran into problems (like a "keyerror 0" message). After some work I think that these problems are somehow due to the .ngens() function, so I'd like to know if there are some known issues regarding versions update and/or with this particular function. thanks

Preview: (hide)

Comments

I think we need some more details, this is pretty vague. We try pretty hard to maintain backwards compatibility but there may be something here. Is there a minimal case you can provide, and edit your question to incorporate?

kcrisman gravatar imagekcrisman ( 10 years ago )

I tried to cut of the project a minimal case, but after some more debugging it seems that the problem is that the .homology() function of an acyclic chain complex is an empty dictionary, while according to the documentation it should be a dictionary containing the value 0 in the appropriate degrees. In other terms, i would like the output of: sage: D = ChainComplex({0: identity_matrix(ZZ, 4), 4: identity_matrix(ZZ, 30)}) sage: D.homology()

to be {0: 0, 1: 0, 4: 0, 5: 0}, while on cloud.sagemath it gives back just {}

springfieldgion gravatar imagespringfieldgion ( 10 years ago )

I can confirm this is a bug in SMC. I have no problems with old or new Sage outside of the cloud, but it happens there.

kcrisman gravatar imagekcrisman ( 10 years ago )

Maybe this is caused by SMC having an optional package installed, which might change the semantics. When I try with a clean build of Sage (without the optional packages installed) then it works as you expect. So possibly this doesn't have anything to do specifically with SMC, but with some optional package. Here's a worksheet, btw: https://cloud.sagemath.com/projects/4...

William Stein gravatar imageWilliam Stein ( 10 years ago )

Thanks for the quick clarification! is there any possible known quick way to bypass the problem (I guess I could try to fix my problem somehow, but I would not like to create more mess if it is not necessary)

springfieldgion gravatar imagespringfieldgion ( 10 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 10 years ago

You could replace your call to D.homology() by D.homology(algorithm='no_chomp'). If that doesn't help, then you'll have to provide more details about what you're doing.

Preview: (hide)
link

Comments

This does not seem to work either, and the same problem arises: the output on the sagenb site (and on the older version) is different from the one on the SMC (and on a 6.3 version on a VM). Which sort of details could be useful? The program basically just computes the homology of a complex and then does operations (such as computing Lefschetz polynomials) on the outputted homology groups.

springfieldgion gravatar imagespringfieldgion ( 10 years ago )
1

So you're doing something like H = D.homology() and then later trying to use H[3] (for example)? What's wrong with my earlier suggestion:

from sage.homology.homology_group import HomologyGroup
i=3
try:
    group = H[i]
except KeyError: # i is missing from H, so group is zero
    group = HomologyGroup(0, ZZ)
print group
John Palmieri gravatar imageJohn Palmieri ( 10 years ago )
1

You can replace all the try/except stuff above by:

H.get(i, 0)

as illustrated here.

William Stein gravatar imageWilliam Stein ( 10 years ago )

Yes, of course, that's what I should have suggested instead.

John Palmieri gravatar imageJohn Palmieri ( 10 years ago )

Thanks! This was really helpful!!

springfieldgion gravatar imagespringfieldgion ( 10 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 10 years ago

Seen: 471 times

Last updated: Nov 26 '14