Hi Aron,

Thank you very much, very appreciated. I am mainly want to construct a 
symbolic Sobolev inequality, so f is symbolic is fine at the moment. 

On Friday, September 2, 2022 at 12:32:09 AM UTC+2 asme...@gmail.com wrote:

> It depends on what you intend to do with the expression. If you're
> only interested in having it print correctly, you can write a custom
> function that defines LaTeX printing in the way you want (see
> https://docs.sympy.org/latest/guides/custom-functions.html#printing).
> For example
>
> class F(Function):
> @classmethod
> def eval(cls, p, f):
> pass
>
> def _latex(self, printer):
> p, f = self.args
> _p, _f = printer._print(p), printer._print(f)
> return r'\left | %s \right | {L^{%s}}' % (_p, _f)
>
> And use it like
>
> p, f = symbols('p f')
> F(p, f)
>
> However, the issue here is that f isn't really a function, it's a
> symbol. In SymPy it's currently not possible to represent Function
> objects as symbolic objects (see
> https://github.com/sympy/sympy/issues/4787). So if you want to later
> use f as a SymPy function that you can call with other arguments,
> you'll have to structure it differently.
>
> Aaron Meurer
>
>
> On Thu, Sep 1, 2022 at 3:42 PM Yang Liu <mica...@gmail.com> wrote:
> >
> > I am trying to define a Sympy function $F(p,f)=|f|{L^p}$ symbolically. 
> So it take Symbol("p") and Function f and output is in latex form of 
> $|f|{L^p}$. Any idea of how to do it?
> >
> > Thanks a lot!
> >
> > --
> > 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/fb7bab86-69f5-49a2-9a49-73b1a03d033fn%40googlegroups.com
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/97e78b79-4323-4f2c-a8dd-30f7ecb69fbcn%40googlegroups.com.

Reply via email to