I personally think that 0 or 1, the most important thing is to be consistent. Because the worst is switching between the two. So, since the rest of Python and SymPy uses 0-based, I would use that. And anyway, you will ultimately store things in a Python list, so it would be awkward to always switch from 1-based indexing on the user side and 0-based on the internal side.
With that being said, I seem to remember that the mechanics module uses 1-based indexing for its representation of three dimensions. I think it gets away with it because it only cares about those three dimensions, so it can just use named variables like x1, x2, x3 instead of x[0], x[1], x[2] (someone correct me if I am wrong). Aaron Meurer On Fri, Nov 22, 2013 at 2:53 PM, Ondřej Čertík <[email protected]> wrote: > On Fri, Nov 22, 2013 at 2:33 PM, F. B. <[email protected]> wrote: >> Hi, I was recently facing a problem in Newtonian mechanics vs. special >> relativity: textbooks represent Newtonian objects as 1-offset >> vector/matrices/tensors, while in special relativity they are 0-offset ones, >> by the addition of a time-like dimension. >> >> I was drafting on my IPython notebook some ways to make classical mechanics >> work along with special relativity, and this problem seems to be an issue, >> unless it simply gets ignored by breaking compatibility with textbooks and >> by shifting indices when passing from classical to relativistic mechanics. >> >> Do you think that an offset on index-counting for vectors/matrices/tensors >> could be a good idea? > > For sure we should allow indexing from 1 or from 0, depending on the physical > and mathematical context. > > This is related to this: > > https://plus.google.com/u/0/+Ond%C5%99ej%C4%8Cert%C3%ADk/posts/8FKW6vyuKsy > > and your example of i=1, 2, 3 (classical mechanics) vs mu=0, 1, 2, 3 > (special/general relativity/QFT) > is a great one. > > Ondrej > > P.S. I've seen also the mu=1, 2, 3, 4 usage in some older textbooks, > where 1, 2, 3 is the same as in classical mechanics and 4th is the > time. But I would not encourage this usage and rather follow the usual > modern physics notation. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sympy. > For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. For more options, visit https://groups.google.com/groups/opt_out.
