Thank you!

On Friday, October 30, 2015 at 11:55:03 AM UTC-4, Aaron Meurer wrote:
>
> You should subclass Expr and define certain methods. For **, you 
> should define _eval_power(self, expt) on the omega object. 
>
> For + and *, there are no direct ways to interface with Add and Mul, 
> but you can define __add__ and __mul__ to define the Python operators 
> directly. 
>
> Aaron Meurer 
>
> On Fri, Oct 30, 2015 at 6:54 AM, Michael O'Connor <[email protected] 
> <javascript:>> wrote: 
> > Hi, 
> > 
> > I'm quite new to Sympy, so this is probably simple, but I couldn't find 
> it 
> > in the documentation.  The documentation does a good job of explaining 
> how 
> > you can define a new function, and specify how it should reduce on 
> certain 
> > arguments.  But I couldn't see how to define new symbols and declare how 
> > they should act with respect to +, *, **, ... 
> > 
> > For example, I was thinking of trying to implement ordinal arithmetic. 
>  In 
> > that case, I would have, for example, new symbols omega and epsilon0, 
> and 
> > would like omega**epsilon0 to evaluate to epsilon0.  Can that be 
> > accomplished? 
> > 
> > Thanks! 
> > 
> > -- 
> > 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] <javascript:>. 
> > To post to this group, send email to [email protected] 
> <javascript:>. 
> > 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/47e6cc6a-f6dd-456e-9d4a-66ebeb9ab5ec%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/05f99fd0-61fb-4dd9-a2d5-54424e61fbc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to