On Tue, Jun 11, 2013 at 10:14 AM, Stefan Krastanov <
krastanov.ste...@gmail.com> wrote:

> > What does it mean to factor vectors exactly?
>
> I was thinking about a*unit_vector + b*unit_vector -> (a+b)*unit_vector
>

My solution was the generic version in sympy/strategies/rl.py.  This
particular operation is handled abstractly by glom (which should perhaps be
renamed to factor?)  I tried to cover all of the standard operations.  The
goal was to not include any generic code in matrices/expressions.  Most of
the generic stuff was pushed upstream to rl.py.  The hope was that it could
one day serve as generic replacement for the scalar specific stuff in the
Expr codebase.


> But as you said there are many others that do not make sense for vectors.
>
> > In contrast the other way has proven to work in physics.quantum.  They're
> > both reasonable.
>
> And also in diffgeom.
>
> In any case, both of this methodologies seem ok to me (create new
> Add/Mul or reuse Add/Mul), but both of them are not what is proposed
> in general terms on the wiki describing the API (a ScalarField and
> Vector what eagerly eat anything that operates on them, i.e.
> ScalarField+ScalarField -> ScalarField).
>
> Ah, I see.  In that case I'll then just say that container classes are
good.  They let you describe computations without performing them.  You
want this unless you're absolutely sure you know how to handle every
possible input in exactly the right way.  Usually this isn't the case.


> >
> >
> > On Tue, Jun 11, 2013 at 9:21 AM, Stefan Krastanov
> > <krastanov.ste...@gmail.com> wrote:
> >>
> >> This is also one of the ways to go forward. I personally dislike it
> >> because:
> >>
> >> - A non trivial amount of functionality needs reimplementation
> >> (flatten for instance)
> >> - We do not have "standard correct way" to interface with functions
> >> like factor, symplify, had, get, atoms, etc, so it is hard to be sure
> >> that you have implemented everything
> >> - As a personal preference, I actually like "garbage in - garbage out"
> >>
> >> But this way has been proven to work in matrix expressions and is also
> >> used in Pernici's tensor module, so I am not against it.
> >>
> >> --
> >> 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+unsubscr...@googlegroups.com.
> >> To post to this group, send email to sympy@googlegroups.com.
> >> Visit this group at http://groups.google.com/group/sympy?hl=en-US.
> >> 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 sympy+unsubscr...@googlegroups.com.
> > To post to this group, send email to sympy@googlegroups.com.
> > Visit this group at http://groups.google.com/group/sympy?hl=en-US.
> > 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 sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy?hl=en-US.
> 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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to