Aaron,

I'm being dense. Can you point me to some tips on how to use this? Say I 
want to define something like

class VGate(OneQubitGate):
    gate_name = 'V'
    gate_name_latex = u'V'

on the fly (e.g. so that the 'V' is defined) how do I do this with 
UndefinedFunction or BasicMeta or some other metaclass in function.py?

(Not asking you to do it, just point me to some examples or something). 

On Thursday, July 18, 2013 10:27:04 AM UTC-6, Aaron Meurer wrote:
>
> Take a look at how undefined functions (like Function('f')) work in 
> sympy/core/function.py (look at UndefinedFunction and all its super 
> classes and metaclasses).  They are basically dynamically created 
> classes. 
>
> Aaron Meurer 
>
> On Thu, Jul 18, 2013 at 11:22 AM, Rick Muller 
> <[email protected]<javascript:>> 
> wrote: 
> > We could do some metaprogramming like they do to define namedtuple, but 
> I 
> > don't know whether hacks like that are looked down upon in sympy. 
> > 
> > 
> > On Thursday, July 18, 2013 10:20:06 AM UTC-6, Rick Muller wrote: 
> >> 
> >> But I don't know how do define a function that does this, without 
> defining 
> >> arguments or 
> > 
> > 
> >> 
> >> modifying the object after creation, both of which I understand are 
> >> forbidden in sympy operators. 
> >> 
> >> 
> >> Any thoughts? 
> > 
> > -- 
> > 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. 
> > 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.


Reply via email to