Hello,

  I've just started trying to use some of sympy's codegen features in an 
attempt to create fast routines to output numpy arrays.  It seems that not 
all of the functionality is there at the moment and I have a few things on 
my wishlist:

1. working fcode (and ccode/jscode) for Sum(expr, Tuple())
  a. a better method for determining output arguments than (somewhat 
opaquely) scraping off a top-level Equality() class.
2. re-working of the tensor class (which does some great things) to put it 
in-line with numpy's array class:
  a. removal of tensor contraction routines in favor of the Sum() class
  b. combining Indexed and IndexedBase classes (I have a test version for 
this)
  c. changing semantics of tensor indices (Idx class) to simply use (start, 
stop, step) to specify selected strides for each tensor dimension (note 
that 12*A[2:4] dies with an error because Tuple cannot be ().expand()-ed)

-- these last changes would remove a lot of the tensor functionality in 
codegen in favor of some sophistication in translating "Sum"-s.  However, 
the code generation mechanism seems difficult to expand to me because I 
want it to work with arrays ( i.e. numpy.array([Symbol('x')]) ), and 
because it doesn't have a facility for injecting new variables to hold 
intermediate steps in the computation.  A lot more sophistication should go 
into creating an internal representation before fcode() and friends get 
called, I.e. creating a call graph from cse and optimizing the computation 
order of the intermediate variables.

  This seems a bit far off, so I'm calling it quits for now and sending a 
few helpful patches I made along the way.

~ David M. Rogers
  Postdoc, Susan B. Rempe Lab
  Sandia National Labs

-- 
You received this message because you are subscribed to the Google Groups 
"sympy-patches" group.
To post to this group, send email to sympy-patches@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-patches+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sympy-patches/-/Tdjw8loLZUsJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to