Some time ago I made an animation of the Hopf fibration using Sage. Recently, a graduate of the African Institute for Mathematical Sciences has finished animating a different map from S^3 to S^2. Ihechukwu Chinyere worked with Bruce Bartlett there and made an animation visualizing what he calls the modular fibration. This is a map related to the j-invariant of elliptic curves and to the SO(2) action on SL_2(R) / SL_2(Z). The generic fibers are trefoils, and there are two singular fibers which are unknotted circles.
I'll leave the rest of the explanation to people who understand it better than me -- here are links to Ihechukwu's essay and a relevant question / answer on Mathoverflow:
Lastly, there's a heartwarming example of the benefits of open development here: I made all of the Sage code for my animation public, and I deliberately tried to use open-source software for the entire project so that someone else could easily use the code I wrote. I had never met Ihechukwu or Bruce when they started working on this, nor did I know anything about this modular fibration. But I'm thrilled with their work! I certainly couldn't predict this, and this outcome makes me even happier that I decided to make the source public :)
> Lastly, there's a heartwarming example of the benefits of open
> development here: I made all of the Sage code for my animation public,
> and I deliberately tried to use open-source software for the entire
> project so that someone else could easily use the code I wrote. I had
> never met Ihechukwu or Bruce when they started working on this, nor did
> I know anything about this modular fibration. But I'm thrilled with
> their work! I certainly couldn't predict this, and this outcome makes
> me even happier that I decided to make the source public :)
That's really cool!
I was just playing around with the code a bit, which is really easy using Sage's load command, for example:
> On 9/13/12 2:45 PM, Niles Johnson wrote:
>> Lastly, there's a heartwarming example of the benefits of open
>> development here: I made all of the Sage code for my animation public,
>> and I deliberately tried to use open-source software for the entire
>> project so that someone else could easily use the code I wrote. I had
>> never met Ihechukwu or Bruce when they started working on this, nor did
>> I know anything about this modular fibration. But I'm thrilled with
>> their work! I certainly couldn't predict this, and this outcome makes
>> me even happier that I decided to make the source public :)
I looked at the code some more, and it looked like there was *lots* of potential for speeding it up. I first added some imports from the python math library, which sped it up by a factor of 5-10 on one case [1]. Then I converted the fib2_param function to use fast_callable (in a really simple way...) [2]. That sped it up by another factor of 2-4 or so.
Okay, that's it for now. But I still think there is room for improvement. On my computer, the initial version took 20 seconds to do the above benchmark, and the Cython version takes .37s, so a speedup of about 50x or so. I don't see that same speedup on aleph, and I'm not sure why. Anyways, now it sort of works as an interact: http://aleph.sagemath.org/?q=3d4f343c-323e-43f6-a8a8-149cfd7217dc
> Okay, that's it for now. But I still think there is room for > improvement. On my computer, the initial version took 20 seconds to do > the above benchmark, and the Cython version takes .37s, so a speedup of > about 50x or so. I don't see that same speedup on aleph, and I'm not > sure why. Anyways, now it sort of works as an interact: > http://aleph.sagemath.org/?q=3d4f343c-323e-43f6-a8a8-149cfd7217dc