[sympy] Re: generating fortran code for expressions with multiple indices

2010-11-11 Thread Omar Awile
Hi Øyvind Thanks a lot! Indeed that's a dirty hack, but it produces the desired result :) I'd be interested in actually fixing this. So maybe if I take some time to understand how sympy expressions are parsed and how exactly your printing works I could help in finding a good solution for this. Act

[sympy] Re: generating fortran code for expressions with multiple indices

2010-11-12 Thread Omar Awile
On Nov 11, 6:30 pm, Aaron Meurer wrote: > > That would be great.  Just let us know here if you need any help.  It > shouldn't be too difficulty, since the Sum framework is already there. >  All you would need to do is probably modify it a little bit so it > works correctly with Idx, and then mod

Re: [sympy] Re: generating fortran code for expressions with multiple indices

2010-11-11 Thread Aaron Meurer
On Thu, Nov 11, 2010 at 2:40 AM, Omar Awile wrote: > Hi Øyvind > > Thanks a lot! Indeed that's a dirty hack, but it produces the desired > result :) > I'd be interested in actually fixing this. So maybe if I take some > time to understand how sympy expressions are parsed and how exactly > your pri

Re: [sympy] Re: generating fortran code for expressions with multiple indices

2010-11-12 Thread Øyvind Jensen
Hi Omar, It is extremely cool that you want to work on this, don't hesitate to ask if you encounter any difficulties! When you start hacking, it would be very cool if you upload early and regularly to github. I'd be very interested in your work! I've got some suggestions based on stuff I was st

Re: [sympy] Re: generating fortran code for expressions with multiple indices

2010-11-12 Thread Aaron Meurer
If I understand you correctly, you will implicitly sum over Symbol indices and loop over Idx indices, right? If so, that sounds like a good idea, except why do you want to use Symbol instead of creating a new class? I'm also confused about creating one class vs. another. What would happen in your

Re: [sympy] Re: generating fortran code for expressions with multiple indices

2010-11-13 Thread Øyvind Jensen
fr., 12.11.2010 kl. 11.19 -0700, skrev Aaron Meurer: > If I understand you correctly, you will implicitly sum over Symbol > indices and loop over Idx indices, right? If so, that sounds like a > good idea, except why do you want to use Symbol instead of creating a > new class? Well, maybe a new cl

Re: [sympy] Re: generating fortran code for expressions with multiple indices

2010-11-13 Thread Aaron S. Meurer
On Nov 13, 2010, at 4:23 AM, Øyvind Jensen wrote: > fr., 12.11.2010 kl. 11.19 -0700, skrev Aaron Meurer: >> If I understand you correctly, you will implicitly sum over Symbol >> indices and loop over Idx indices, right? If so, that sounds like a >> good idea, except why do you want to use Symbol

Re: [sympy] Re: generating fortran code for expressions with multiple indices

2010-11-17 Thread Omar Awile
Hi Øyvind, Aaron Sorry for the late reply.. it took me some time to digest all this :) I also went through the code in the fcode and the index* modules. I think it will take me considerable time to wrap my head around the relevant parts of the sympy code to understand how to extend it. I was also

Re: [sympy] Re: generating fortran code for expressions with multiple indices

2010-11-17 Thread Ondrej Certik
On Wed, Nov 17, 2010 at 8:44 AM, Omar Awile wrote: > Hi Øyvind, Aaron > > Sorry for the late reply.. it took me some time to digest all this :) > I also went through the code in the fcode and the index* modules. I > think it will take me considerable time to wrap my head around the > relevant part

Re: [sympy] Re: generating fortran code for expressions with multiple indices

2010-11-18 Thread Øyvind Jensen
Hi Omar, In a week or so, I think I can join you in hacking on the Indexed stuff. There are also some other issues that need to be fixed. As Ondrej suggests, it may be a good idea for you to start learning about the printing system, in particular fcode. In addition, the CodePrinter class which i