IndexError: Invalid index a[i] error

26 views
Skip to first unread message

万博

unread,
Jul 11, 2015, 7:00:29 PM7/11/15
to sy...@googlegroups.com
Greetings, everyone.
     I am trying to use sympy calculate a perturbation problem, which looks like:
     In sympy, I think it's safe to use code like:(all elements are Matrices.)

     i=Symbol("i",integer=True)
     summation( (u.H*Hamil*p.col(i))*(p.col(i).H*Hamil*u) , (i,0,5))   
      
     However, it gives the error:
     IndexError: Invalid index a[i]
 
     I have calculated manually the sum, which gives the right result. SO, I guess there is some misunderstanding about summation().
     Any advises about solving this would be appreciated.
     Thanks.

Aaron Meurer

unread,
Jul 13, 2015, 1:34:19 PM7/13/15
to sy...@googlegroups.com
This looks like a bug in SymPy. Can you paste the full traceback?

Aaron Meurer

--
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 sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/6dee658f-88ac-4ed9-9061-ab7859cf9f9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages