Re: [sympy] Re: SymPy documentation website down

2022-04-19 Thread Jason Moore
Aaron,

Thanks. That's surprisingly useless. They only say you violate copyright
but not what that violation exactly is.

I'm sorry you all are having to deal with this. If you need help with
anything let me know.

Jason
moorepants.info
+01 530-601-9791


On Wed, Apr 20, 2022 at 6:31 AM Aaron Meurer  wrote:

> Hi Jason.
>
> We were sent the same DMCA notice that is posted on GitHub's DMCA
> repo, which I linked to above.
>
> Aaron Meurer
>
> On Tue, Apr 19, 2022 at 10:23 PM Jason Moore  wrote:
> >
> > Aaron,
> >
> > Can you share the email you are sent that says precisely what the
> copyright violation is?
> >
> > Jason
> > moorepants.info
> > +01 530-601-9791
> >
> >
> > On Wed, Apr 20, 2022 at 4:57 AM Jeremy Monat 
> wrote:
> >>
> >> Oh, good news on HackerNews:
> >>
> >>> Hello again, Vivek, founder/CEO here. In the interest of moving
> swiftly, here are the actions we are going to take:
> >>>
> >>> (1) We have withdrawn the DMCA notice for sympy; Sent a note to senior
> leadership in Github to act on this quickly.
> >>>
> >>> (2) We have stopped the whole DMCA process for now and working on
> internal guidelines of what constitutes a real violation so that these kind
> of incidents don't happen. We are going to do this in-house
> >>>
> >>> (3) We are going to donate $25k to the sympy project.
> >>>
> >>> As a company we take a lot of pride in helping developers and it sucks
> to see this. I'm extremely sorry for what happened here.
> >>
> >>
> >> On Tue, Apr 19, 2022 at 10:54 PM Jeremy Monat 
> wrote:
> >>>
> >>> Hopefully this can get resolved soon! So is HackerRank's contention
> that one of the examples on our solvers page was taken from their site, for
> example one of their quizzes?
> >>>
> >>> Jeremy Monat
> >>>
> >>>
> >>> On Tue, Apr 19, 2022 at 10:50 PM oliphant 
> wrote:
> 
>  By the way, because I get to work with Aaron, I was chatting about
> this with him.  I saw the CEO post on Hacker News and I've reached out to
> him asking him to rescind the DMCA notice.   This is likely the fastest way
> to get the site back up -- though it will still take a couple of days, I
> suspect.
> 
>  I also suggested he make a donation to NumFOCUS to sponsor SymPy
> development for the trouble his vendor caused this community.
> 
>  Thanks for all of you who continue to make SymPy a very useful
> project.
> 
>  -Travis
> 
> 
>  On Tuesday, April 19, 2022 at 4:48:54 PM UTC-5 Aaron Meurer wrote:
> >
> > Hi All.
> >
> > As some of you may have noticed, the SymPy documentation site is
> > currently down. This is due to a complaint that has been filed to
> > GitHub under the DMCA by HackerRank. You can read the complaint here
> >
> https://github.com/github/dmca/blob/5de8f80b171afdc3741c9ab9d4c32ea32c44e59c/2022/04/2022-04-15-hackerrank.md
> >
> > As a result of this complaint, GitHub has taken down our site. We are
> > looking into the claim and working on getting the site back up as
> soon
> > as possible.
> >
> > Aaron Meurer
> 
>  --
>  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/d276c484-56c8-4f8d-b1a5-22fe15e04bb4n%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/CAO00iLjLVg7oSs_HYYSx48GPO%2Btb-E11ufAG%3DF_1ZLbEhKuXkA%40mail.gmail.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/CAP7f1AhxJqgwPcEmt2K9fDi8cB%2BHWHcBcVUN5LopAx3%2BC8WF-Q%40mail.gmail.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/CAKgW%3D6%2BzykM6t6HR7ov%2BMk%2Bhu%2BsPgfE9_sRw9JEfP0uB_qdcPg%40mail.gmail.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 

Re: [sympy] Re: SymPy documentation website down

2022-04-19 Thread Aaron Meurer
Hi Jason.

We were sent the same DMCA notice that is posted on GitHub's DMCA
repo, which I linked to above.

Aaron Meurer

On Tue, Apr 19, 2022 at 10:23 PM Jason Moore  wrote:
>
> Aaron,
>
> Can you share the email you are sent that says precisely what the copyright 
> violation is?
>
> Jason
> moorepants.info
> +01 530-601-9791
>
>
> On Wed, Apr 20, 2022 at 4:57 AM Jeremy Monat  wrote:
>>
>> Oh, good news on HackerNews:
>>
>>> Hello again, Vivek, founder/CEO here. In the interest of moving swiftly, 
>>> here are the actions we are going to take:
>>>
>>> (1) We have withdrawn the DMCA notice for sympy; Sent a note to senior 
>>> leadership in Github to act on this quickly.
>>>
>>> (2) We have stopped the whole DMCA process for now and working on internal 
>>> guidelines of what constitutes a real violation so that these kind of 
>>> incidents don't happen. We are going to do this in-house
>>>
>>> (3) We are going to donate $25k to the sympy project.
>>>
>>> As a company we take a lot of pride in helping developers and it sucks to 
>>> see this. I'm extremely sorry for what happened here.
>>
>>
>> On Tue, Apr 19, 2022 at 10:54 PM Jeremy Monat  wrote:
>>>
>>> Hopefully this can get resolved soon! So is HackerRank's contention that 
>>> one of the examples on our solvers page was taken from their site, for 
>>> example one of their quizzes?
>>>
>>> Jeremy Monat
>>>
>>>
>>> On Tue, Apr 19, 2022 at 10:50 PM oliphant  wrote:

 By the way, because I get to work with Aaron, I was chatting about this 
 with him.  I saw the CEO post on Hacker News and I've reached out to him 
 asking him to rescind the DMCA notice.   This is likely the fastest way to 
 get the site back up -- though it will still take a couple of days, I 
 suspect.

 I also suggested he make a donation to NumFOCUS to sponsor SymPy 
 development for the trouble his vendor caused this community.

 Thanks for all of you who continue to make SymPy a very useful project.

 -Travis


 On Tuesday, April 19, 2022 at 4:48:54 PM UTC-5 Aaron Meurer wrote:
>
> Hi All.
>
> As some of you may have noticed, the SymPy documentation site is
> currently down. This is due to a complaint that has been filed to
> GitHub under the DMCA by HackerRank. You can read the complaint here
> https://github.com/github/dmca/blob/5de8f80b171afdc3741c9ab9d4c32ea32c44e59c/2022/04/2022-04-15-hackerrank.md
>
> As a result of this complaint, GitHub has taken down our site. We are
> looking into the claim and working on getting the site back up as soon
> as possible.
>
> Aaron Meurer

 --
 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/d276c484-56c8-4f8d-b1a5-22fe15e04bb4n%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/CAO00iLjLVg7oSs_HYYSx48GPO%2Btb-E11ufAG%3DF_1ZLbEhKuXkA%40mail.gmail.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/CAP7f1AhxJqgwPcEmt2K9fDi8cB%2BHWHcBcVUN5LopAx3%2BC8WF-Q%40mail.gmail.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/CAKgW%3D6%2BzykM6t6HR7ov%2BMk%2Bhu%2BsPgfE9_sRw9JEfP0uB_qdcPg%40mail.gmail.com.


Re: [sympy] Re: SymPy documentation website down

2022-04-19 Thread Jason Moore
Aaron,

Can you share the email you are sent that says precisely what the copyright
violation is?

Jason
moorepants.info
+01 530-601-9791


On Wed, Apr 20, 2022 at 4:57 AM Jeremy Monat  wrote:

> Oh, good news on HackerNews
> :
>
> Hello again, Vivek, founder/CEO here. In the interest of moving swiftly,
>> here are the actions we are going to take:
>>
>> (1) We have withdrawn the DMCA notice for sympy; Sent a note to senior
>> leadership in Github to act on this quickly.
>>
>> (2) We have stopped the whole DMCA process for now and working on
>> internal guidelines of what constitutes a real violation so that these kind
>> of incidents don't happen. We are going to do this in-house
>>
>> (3) We are going to donate $25k to the sympy project.
>>
>> As a company we take a lot of pride in helping developers and it sucks to
>> see this. I'm extremely sorry for what happened here.
>>
>
> On Tue, Apr 19, 2022 at 10:54 PM Jeremy Monat  wrote:
>
>> Hopefully this can get resolved soon! So is HackerRank's contention that
>> one of the examples on our solvers page was taken from their site, for
>> example one of their quizzes?
>>
>> Jeremy Monat
>>
>>
>> On Tue, Apr 19, 2022 at 10:50 PM oliphant  wrote:
>>
>>> By the way, because I get to work with Aaron, I was chatting about this
>>> with him.  I saw the CEO post on Hacker News and I've reached out to him
>>> asking him to rescind the DMCA notice.   This is likely the fastest way to
>>> get the site back up -- though it will still take a couple of days, I
>>> suspect.
>>>
>>> I also suggested he make a donation to NumFOCUS to sponsor SymPy
>>> development for the trouble his vendor caused this community.
>>>
>>> Thanks for all of you who continue to make SymPy a very useful project.
>>>
>>> -Travis
>>>
>>>
>>> On Tuesday, April 19, 2022 at 4:48:54 PM UTC-5 Aaron Meurer wrote:
>>>
 Hi All.

 As some of you may have noticed, the SymPy documentation site is
 currently down. This is due to a complaint that has been filed to
 GitHub under the DMCA by HackerRank. You can read the complaint here

 https://github.com/github/dmca/blob/5de8f80b171afdc3741c9ab9d4c32ea32c44e59c/2022/04/2022-04-15-hackerrank.md

 As a result of this complaint, GitHub has taken down our site. We are
 looking into the claim and working on getting the site back up as soon
 as possible.

 Aaron Meurer

>>> --
>>> 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/d276c484-56c8-4f8d-b1a5-22fe15e04bb4n%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/CAO00iLjLVg7oSs_HYYSx48GPO%2Btb-E11ufAG%3DF_1ZLbEhKuXkA%40mail.gmail.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/CAP7f1AhxJqgwPcEmt2K9fDi8cB%2BHWHcBcVUN5LopAx3%2BC8WF-Q%40mail.gmail.com.


[sympy] Re: Keeping expressions short and concise

2022-04-19 Thread Andre Bolle
Jonathan,

I managed to install.

python -m pip install --user Algebra_with_Sympy

Here's what I did. You will notice that the second derivative couldn't see 
the 'x', which had been replaced by psi.

I do like the equation annotation.  (eq1), (eq2), (eq3), etc. Nice.

Andre

On Tuesday, April 19, 2022 at 3:24:00 PM UTC+1 gu...@uwosh.edu wrote:

> Alternative path that works better with complicated derivatives. Also 
> shows the nicer output inside Jupyter notebooks.
> [image: Screen Shot 2022-04-19 at 9.23.21 AM.png]
>
> On Tuesday, April 19, 2022 at 8:16:25 AM UTC-5 gu...@uwosh.edu wrote:
>
>> Is this the behavior you are trying to get?
>>
>>
>> >>> from algebra_with_sympy import *
>> >>> algwsym_config.output.human_text=True
>> >>> var('psi k x')
>> (psi, k, x)
>> >>> eq1=Eqn(psi, exp(I*k*x))
>> >>> eq1
>> psi = exp(I*k*x)
>> >>> eq2 =diff(eq1,x)
>> >>> eq2
>> Derivative(psi, x) = I*k*exp(I*k*x)
>> >>> eq2.subs({exp(I*k*x):psi})
>> Derivative(psi, x) = I*k*psi
>>
>> Jonathan
>> On Tuesday, April 19, 2022 at 7:50:54 AM UTC-5 andre...@gmail.com wrote:
>>
>>> When I differentiate the function
>>>
>>> ψ = exp(I*(k*x))
>>>
>>> I get
>>>
>>> i*k*exp(I*(k*x)).[which is  i*k*ψ] 
>>>
>>> Is there a way to get exp(I*(k*x)) substituted with  ψ, in order to get 
>>> the shorter expression i*k*ψ ?
>>>
>>> Thanks,
>>> André
>>>
>>>
>>>
>>>
>>>
>>>

-- 
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/1df0f4e9-f2ef-4b57-a9e6-6239f467e537n%40googlegroups.com.


Re: [sympy] Re: SymPy documentation website down

2022-04-19 Thread oliphant
I would not be surprised if the opposite happened.  They likely copied a 
snippet from one of the SymPy examples on that page to use in a test 
question.  Then, their hired-gun using an automated tool found the 
similarity between their code and the SymPy example.   This is a clear 
example of not understanding the "downside risks" of automation -- and 
putting appropriate measures to mitigate.  

-Travis

On Tuesday, April 19, 2022 at 9:54:40 PM UTC-5 Jeremy Monat wrote:

> Hopefully this can get resolved soon! So is HackerRank's contention that 
> one of the examples on our solvers page was taken from their site, for 
> example one of their quizzes?
>
> Jeremy Monat
>
>
> On Tue, Apr 19, 2022 at 10:50 PM oliphant  wrote:
>
>> By the way, because I get to work with Aaron, I was chatting about this 
>> with him.  I saw the CEO post on Hacker News and I've reached out to him 
>> asking him to rescind the DMCA notice.   This is likely the fastest way to 
>> get the site back up -- though it will still take a couple of days, I 
>> suspect.
>>
>> I also suggested he make a donation to NumFOCUS to sponsor SymPy 
>> development for the trouble his vendor caused this community. 
>>
>> Thanks for all of you who continue to make SymPy a very useful project.
>>
>> -Travis
>>
>>
>> On Tuesday, April 19, 2022 at 4:48:54 PM UTC-5 Aaron Meurer wrote:
>>
>>> Hi All. 
>>>
>>> As some of you may have noticed, the SymPy documentation site is 
>>> currently down. This is due to a complaint that has been filed to 
>>> GitHub under the DMCA by HackerRank. You can read the complaint here 
>>>
>>> https://github.com/github/dmca/blob/5de8f80b171afdc3741c9ab9d4c32ea32c44e59c/2022/04/2022-04-15-hackerrank.md
>>>  
>>>
>>> As a result of this complaint, GitHub has taken down our site. We are 
>>> looking into the claim and working on getting the site back up as soon 
>>> as possible. 
>>>
>>> Aaron Meurer 
>>>
>> -- 
>> 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/d276c484-56c8-4f8d-b1a5-22fe15e04bb4n%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/cfce523a-2447-46f4-935b-c882f40fd71fn%40googlegroups.com.


Re: [sympy] Re: SymPy documentation website down

2022-04-19 Thread Jeremy Monat
Oh, good news on HackerNews :

Hello again, Vivek, founder/CEO here. In the interest of moving swiftly,
> here are the actions we are going to take:
>
> (1) We have withdrawn the DMCA notice for sympy; Sent a note to senior
> leadership in Github to act on this quickly.
>
> (2) We have stopped the whole DMCA process for now and working on internal
> guidelines of what constitutes a real violation so that these kind of
> incidents don't happen. We are going to do this in-house
>
> (3) We are going to donate $25k to the sympy project.
>
> As a company we take a lot of pride in helping developers and it sucks to
> see this. I'm extremely sorry for what happened here.
>

On Tue, Apr 19, 2022 at 10:54 PM Jeremy Monat  wrote:

> Hopefully this can get resolved soon! So is HackerRank's contention that
> one of the examples on our solvers page was taken from their site, for
> example one of their quizzes?
>
> Jeremy Monat
>
>
> On Tue, Apr 19, 2022 at 10:50 PM oliphant  wrote:
>
>> By the way, because I get to work with Aaron, I was chatting about this
>> with him.  I saw the CEO post on Hacker News and I've reached out to him
>> asking him to rescind the DMCA notice.   This is likely the fastest way to
>> get the site back up -- though it will still take a couple of days, I
>> suspect.
>>
>> I also suggested he make a donation to NumFOCUS to sponsor SymPy
>> development for the trouble his vendor caused this community.
>>
>> Thanks for all of you who continue to make SymPy a very useful project.
>>
>> -Travis
>>
>>
>> On Tuesday, April 19, 2022 at 4:48:54 PM UTC-5 Aaron Meurer wrote:
>>
>>> Hi All.
>>>
>>> As some of you may have noticed, the SymPy documentation site is
>>> currently down. This is due to a complaint that has been filed to
>>> GitHub under the DMCA by HackerRank. You can read the complaint here
>>>
>>> https://github.com/github/dmca/blob/5de8f80b171afdc3741c9ab9d4c32ea32c44e59c/2022/04/2022-04-15-hackerrank.md
>>>
>>> As a result of this complaint, GitHub has taken down our site. We are
>>> looking into the claim and working on getting the site back up as soon
>>> as possible.
>>>
>>> Aaron Meurer
>>>
>> --
>> 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/d276c484-56c8-4f8d-b1a5-22fe15e04bb4n%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/CAO00iLjLVg7oSs_HYYSx48GPO%2Btb-E11ufAG%3DF_1ZLbEhKuXkA%40mail.gmail.com.


Re: [sympy] Re: SymPy documentation website down

2022-04-19 Thread Jeremy Monat
Hopefully this can get resolved soon! So is HackerRank's contention that
one of the examples on our solvers page was taken from their site, for
example one of their quizzes?

Jeremy Monat


On Tue, Apr 19, 2022 at 10:50 PM oliphant  wrote:

> By the way, because I get to work with Aaron, I was chatting about this
> with him.  I saw the CEO post on Hacker News and I've reached out to him
> asking him to rescind the DMCA notice.   This is likely the fastest way to
> get the site back up -- though it will still take a couple of days, I
> suspect.
>
> I also suggested he make a donation to NumFOCUS to sponsor SymPy
> development for the trouble his vendor caused this community.
>
> Thanks for all of you who continue to make SymPy a very useful project.
>
> -Travis
>
>
> On Tuesday, April 19, 2022 at 4:48:54 PM UTC-5 Aaron Meurer wrote:
>
>> Hi All.
>>
>> As some of you may have noticed, the SymPy documentation site is
>> currently down. This is due to a complaint that has been filed to
>> GitHub under the DMCA by HackerRank. You can read the complaint here
>>
>> https://github.com/github/dmca/blob/5de8f80b171afdc3741c9ab9d4c32ea32c44e59c/2022/04/2022-04-15-hackerrank.md
>>
>> As a result of this complaint, GitHub has taken down our site. We are
>> looking into the claim and working on getting the site back up as soon
>> as possible.
>>
>> Aaron Meurer
>>
> --
> 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/d276c484-56c8-4f8d-b1a5-22fe15e04bb4n%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/CAO00iLjRFVJ7Ha7eruNqvhqv_TqPtQ-qv0WP4PA23cjpbdmqVw%40mail.gmail.com.


[sympy] Re: SymPy documentation website down

2022-04-19 Thread oliphant
By the way, because I get to work with Aaron, I was chatting about this 
with him.  I saw the CEO post on Hacker News and I've reached out to him 
asking him to rescind the DMCA notice.   This is likely the fastest way to 
get the site back up -- though it will still take a couple of days, I 
suspect.

I also suggested he make a donation to NumFOCUS to sponsor SymPy 
development for the trouble his vendor caused this community. 

Thanks for all of you who continue to make SymPy a very useful project.

-Travis


On Tuesday, April 19, 2022 at 4:48:54 PM UTC-5 Aaron Meurer wrote:

> Hi All.
>
> As some of you may have noticed, the SymPy documentation site is
> currently down. This is due to a complaint that has been filed to
> GitHub under the DMCA by HackerRank. You can read the complaint here
>
> https://github.com/github/dmca/blob/5de8f80b171afdc3741c9ab9d4c32ea32c44e59c/2022/04/2022-04-15-hackerrank.md
>
> As a result of this complaint, GitHub has taken down our site. We are
> looking into the claim and working on getting the site back up as soon
> as possible.
>
> Aaron Meurer
>

-- 
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/d276c484-56c8-4f8d-b1a5-22fe15e04bb4n%40googlegroups.com.


Re: [sympy] Keeping expressions short and concise

2022-04-19 Thread Alan Bromborsky

This might be relevant -

https://physics.stackexchange.com/questions/32296/introduction-to-differential-forms-in-thermodynamics

If you find anything of interest in the link you should check it out 
with someone in the math department.  The limit to my knowledge of 
differential forms is that dx is an element in the dual space.  If we 
are in (x,y,z) space then dx is a linear mapping from (x,y,z) to the 
reals and dx(x,y,z) = x, dy(x,y,z) = y, and dz(x,y,z) = z.


On 4/19/22 12:54 PM, Jonathan Gutow wrote:

Alan,

I have thought about this a little too. I have not had time to work on 
it recently. The issue I ran into is that to make this work well in 
SymPy you really need the concept of an infinitesimal dx, dy, dz, etc. 
Things got circular when I tried to implement that using the sympy 
definition of functions. It might be worth comparing notes. I would 
really like to be able to work with total differentials and do 
integrations on expressions containing infinitesimals in the Leibniz 
style notation.


Jonathan


On Apr 19, 2022, at 10:24 AM, Alan Bromborsky  
wrote:



CAUTION:This email originated from outside of the organization. Do 
not click links or open attachments unless you recognize the sender 
and know the content is safe.



I am working on a linear differential operator class for sympy 
(Dop.py). Here is a Jupyter notebook with a simple example -




Note that lap*f gives a function but f*lap gives differential operator.




--
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/7C0243F5-5603-4DBF-806D-BC2C51507E86%40uwosh.edu 
.


--
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/366e362f-92a7-8cb8-86a6-4a264b390cb5%40gmail.com.


[sympy] SymPy documentation website down

2022-04-19 Thread Aaron Meurer
Hi All.

As some of you may have noticed, the SymPy documentation site is
currently down. This is due to a complaint that has been filed to
GitHub under the DMCA by HackerRank. You can read the complaint here
https://github.com/github/dmca/blob/5de8f80b171afdc3741c9ab9d4c32ea32c44e59c/2022/04/2022-04-15-hackerrank.md

As a result of this complaint, GitHub has taken down our site. We are
looking into the claim and working on getting the site back up as soon
as possible.

Aaron Meurer

-- 
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/CAKgW%3D6%2BNGBM4GVtUwz7zjF_S1PFxzSjWZAWgGVL69wdFrE%3D52Q%40mail.gmail.com.


Re: [sympy] Faster symbolics

2022-04-19 Thread Aaron Meurer
On Tue, Apr 19, 2022 at 7:31 AM Ondřej Čertík  wrote:
>
> Hi Alan!
>
> Indeed, parallelism is another avenue. SymEngine can be compiled in a 
> "thread-safe" mode, which enables to then use it in parallel. It's slightly 
> slower, since the reference counted pointer becomes an atomic (so the idea 
> below about not using reference counted pointers might help here too).
>
> The question then is if it makes sense to parallelize algorithms like 
> expand(), or even just "add" for two larger expressions. Possibly have both 
> serial and parallel options.
>
> I can imagine especially matrix operations could be sped up greatly in 
> parallel.

I would suggest focusing on "embarrassing" parallelism such as matrix
operations where there are multiple top-level operations. Matrices are
a great example of this. There's also a lot of functions that are
linear, in the sense that if you pass them an Add with many terms you
just apply it term-wise. Since symbolic expressions are immutable
there's generally no issue with doing operations out of order. Trying
to parallelize lower level operations like constructing a single large
expression is likely to be more work, and in most cases, it is part of
a larger operation, so it itself can be done in parallel with
something else.

To some degree you can already do this sort of thing with SymPy and
the Python multiprocessing module, although there are some issues with
it due to pickling problems.

Aaron Meurer

>
> Ondrej
>
> On Tue, Apr 19, 2022, at 5:11 AM, Alan Bromborsky wrote:
> > For speed up how about parallel processing?  Looking at Ryzen processors
> > 16 cores and 32 threads are quite affordable these days.  Is parallel
> > python mature code these days?
> >
> > On 4/18/22 11:45 PM, Ondřej Čertík wrote:
> >> Hi,
> >>
> >> I am CCing the symengine list also. Let me say a few words about the 
> >> design and goals of SymEngine. It's a result of many years of experience 
> >> with SymPy and implementing high performance code in general. The goal is 
> >> the fastest possible symbolic manipulation. So we do not want to introduce 
> >> slowdowns just to get a different API, rather we should figure out how to 
> >> create an API that works for everybody, while keeping the speed.
> >>
> >> The design is, as Isuru wrote below, quite close to optimal: SymEngine 
> >> does not do any unnecessary work. The C++ classes just "pass through" the 
> >> data, which must be prepared ahead of time. In order to get good speed, it 
> >> needs to store the data in data structures like a hash table, which 
> >> restricts what it can represent, in return for good speed. It seems that 
> >> covers 90% of use cases. If you need to represent things differently than 
> >> what SymEngine can do (such as `x+x` instead of `2*x`), you can always use 
> >> SymPy, or we can implement some slower representations, but I think that 
> >> should not be the default.
> >>
> >> One idea for improvement is to represent all SymEngine classes in some 
> >> kind of a description language, similar to what we use for LFortran here: 
> >> https://gitlab.com/lfortran/lfortran/-/blob/8761fcee2bbc4cb924bf65f5d576541e58bb8b08/src/libasr/ASR.asdl,
> >>  and generate all the C++ classes automatically from it. This has many 
> >> advantages (much less code to maintain, consistent code, easy to add a new 
> >> symbolic function/object, etc.) and almost no downsides. One can then also 
> >> experiment with changing how things are represented.
> >>
> >> Regarding the internal representation itself --- if anyone knows a faster 
> >> design, please let me know!
> >>
> >> * One idea is not to use reference counted pointers at all, and just 
> >> represent everything by value. That means if you take a term from an Add, 
> >> it will get copied. When Add goes out of scope, it deallocates all its 
> >> terms. Whether this approach is overall faster is unclear, but it might be 
> >> quite a bit faster if you don't need to reuse subexpressions too much.
> >>
> >> * Another orthogonal idea is to represent all symbols like "x" in a 
> >> separate structure (symbol table) and only reference them from expressions 
> >> like x^3 + 2x^2+sin(x)...; The issue becomes again with memory management, 
> >> but there are probably a few ways forward.
> >>
> >> * SymEngine was design to operate fast on general expressions. One can of 
> >> course get faster speed if you know that you are dealing with a polynomial 
> >> or other more specific structure, but this is an orthogonal idea. It seems 
> >> just getting the general case working really fast is worth it.
> >>
> >> If anyone is interested in discussing this more, I am happy to have a 
> >> video meeting where we can discuss more. Just let me know!
> >>
> >> Ondrej
> >>
> >> On Fri, Apr 15, 2022, at 7:53 PM, Isuru Fernando wrote:
> >>> Hi Oscar,
> >>>
> >>> Here's a few things that are different in SymEngine than SymPy.
> >>>
>  As an example it would be trivial in SymPy to make 

Re: [sympy] Parsing expressions problem | "ImportError: Clang is not installed, cannot parse C code"

2022-04-19 Thread Audrius-St
Okay, I found "python-clang" on conda-forge and installed it.

$ conda list python-clang
# NameVersion   Build  Channel
python-clang  13.0.1  default_hccd1708_0conda-forge

I now receive the error message:

NotImplementedError: Only bool, int and float are supported

My understanding of this error message is that arrays such as 
std::array are not currently supported.
Is this correct?

On Tuesday, April 19, 2022 at 3:39:14 PM UTC-4 Audrius-St wrote:

> Thanks for your prompt reply.
>
> What is "clang-python" and from where may I download it?
>
> A search on "clang-python" did return anything obvious.
>
> Do you mean "python3-clang-13"?
>
> I suggest that the documentation be updated with this required information.
>
> On Tuesday, April 19, 2022 at 3:23:38 PM UTC-4 asme...@gmail.com wrote:
>
>> The error message should be improved there. You need clang-python.
>>
>> Aaron Meurer
>>
>> On Tue, Apr 19, 2022 at 1:20 PM Audrius-St  wrote:
>> >
>> > Hello,
>> >
>> > I am attempting to parse C code into Python using SymPyExpression but 
>> am receiving the error message "ImportError: Clang is not installed, cannot 
>> parse C code"
>> >
>> > However, I'm quite certain that I have Clang installed
>> >
>> > $ conda list clang
>> > # Name Version Build Channel
>> > clang 13.0.1 ha770c72_0 conda-forge
>> > clang-13 13.0.1 default_hc23dcda_0 conda-forge
>> > libclang-cpp13 13.0.1 default_hc23dcda_0 conda-forge
>> >
>> > Code fragment:
>> >
>> > src_X = """
>> > inline double advanceX(
>> > double const& x,
>> > double const& px,
>> > double const& y,
>> > double const& py,
>> > double const& t)
>> > // The C code output from FORM starts array indices at 1 not 0. Go 
>> figure.
>> > std::array w;
>> >
>> > w[1]=1./3.*y;
>> > w[2]=139./33. + 19./2.*y;
>> > w[2]=w[2]*w[1];
>> > . . .
>> > double x_t=w[1] + x;
>> >
>> > return x_t;
>> > """
>> >
>> > def main():
>> > p = SymPyExpression(src_X, 'c')
>> > p.convert_to_python()
>> > print('p:', p)
>> >
>> >
>> > if __name__ == "__main__":
>> > main()
>> >
>> > System:
>> > Python 3.9.12
>> > Sympy 1.10.1
>> > VS Code 1.66.2
>> > Ubuntu 20.04 on WSLg 1.0.33
>> >
>> > Is there some parameter in VS Code that I need to set?
>> > Puzzled.
>> >
>> > Another unrelated issue. Just now, when I attempt to go to 
>> https://docs.sympy.org/
>> > I receive the message
>> >
>> > 404
>> >
>> > There isn't a GitHub Pages site here.
>> >
>> >
>> > --
>> > 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/5a69ee30-2084-4f8c-929e-ddab57e254b0n%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/da6a78cd-c11f-4d44-a9af-9e98cff60888n%40googlegroups.com.


Re: [sympy] Parsing expressions problem | "ImportError: Clang is not installed, cannot parse C code"

2022-04-19 Thread Isuru Fernando
It should be python-clang.

Isuru

On Tue, Apr 19, 2022 at 2:23 PM Aaron Meurer  wrote:

> The error message should be improved there. You need clang-python.
>
> Aaron Meurer
>
> On Tue, Apr 19, 2022 at 1:20 PM Audrius-St 
> wrote:
> >
> > Hello,
> >
> > I am attempting to parse C code into Python using SymPyExpression but am
> receiving the error message "ImportError: Clang is not installed, cannot
> parse C code"
> >
> > However, I'm quite certain that I have Clang installed
> >
> > $ conda list clang
> > # NameVersion Build  Channel
> > clang 13.0.1   ha770c72_0conda-forge
> > clang-13   13.0.1   default_hc23dcda_0conda-forge
> > libclang-cpp13 13.0.1  default_hc23dcda_0conda-forge
> >
> > Code fragment:
> >
> > src_X = """
> > inline double advanceX(
> > double const& x,
> > double const& px,
> > double const& y,
> > double const& py,
> > double const& t)
> > // The C code output from FORM starts array indices at 1 not 0. Go
> figure.
> > std::array w;
> >
> > w[1]=1./3.*y;
> > w[2]=139./33. + 19./2.*y;
> > w[2]=w[2]*w[1];
> > . . .
> > double x_t=w[1] + x;
> >
> > return x_t;
> > """
> >
> > def main():
> > p = SymPyExpression(src_X, 'c')
> > p.convert_to_python()
> > print('p:', p)
> >
> >
> > if __name__ == "__main__":
> > main()
> >
> > System:
> > Python 3.9.12
> > Sympy 1.10.1
> > VS Code 1.66.2
> > Ubuntu 20.04 on WSLg 1.0.33
> >
> > Is there some parameter in VS Code that I need to set?
> > Puzzled.
> >
> > Another unrelated issue. Just now, when I attempt to go to
> https://docs.sympy.org/
> > I receive the message
> >
> > 404
> >
> > There isn't a GitHub Pages site here.
> >
> >
> > --
> > 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/5a69ee30-2084-4f8c-929e-ddab57e254b0n%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/CAKgW%3D6LzBM32J9_%3DMK0na7SZeC5VBn335u2AYJJa0x%3Dpajppgg%40mail.gmail.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/CA%2B01voP-rNCKuH1segyvsjEHCWBu5W5bsjbJ12SDzHXU155RWA%40mail.gmail.com.


Re: [sympy] Parsing expressions problem | "ImportError: Clang is not installed, cannot parse C code"

2022-04-19 Thread Audrius-St
Thanks for your prompt reply.

What is "clang-python" and from where may I download it?

A search on "clang-python" did return anything obvious.

I suggest that the documentation be updated with this required information.
On Tuesday, April 19, 2022 at 3:23:38 PM UTC-4 asme...@gmail.com wrote:

> The error message should be improved there. You need clang-python.
>
> Aaron Meurer
>
> On Tue, Apr 19, 2022 at 1:20 PM Audrius-St  wrote:
> >
> > Hello,
> >
> > I am attempting to parse C code into Python using SymPyExpression but am 
> receiving the error message "ImportError: Clang is not installed, cannot 
> parse C code"
> >
> > However, I'm quite certain that I have Clang installed
> >
> > $ conda list clang
> > # Name Version Build Channel
> > clang 13.0.1 ha770c72_0 conda-forge
> > clang-13 13.0.1 default_hc23dcda_0 conda-forge
> > libclang-cpp13 13.0.1 default_hc23dcda_0 conda-forge
> >
> > Code fragment:
> >
> > src_X = """
> > inline double advanceX(
> > double const& x,
> > double const& px,
> > double const& y,
> > double const& py,
> > double const& t)
> > // The C code output from FORM starts array indices at 1 not 0. Go 
> figure.
> > std::array w;
> >
> > w[1]=1./3.*y;
> > w[2]=139./33. + 19./2.*y;
> > w[2]=w[2]*w[1];
> > . . .
> > double x_t=w[1] + x;
> >
> > return x_t;
> > """
> >
> > def main():
> > p = SymPyExpression(src_X, 'c')
> > p.convert_to_python()
> > print('p:', p)
> >
> >
> > if __name__ == "__main__":
> > main()
> >
> > System:
> > Python 3.9.12
> > Sympy 1.10.1
> > VS Code 1.66.2
> > Ubuntu 20.04 on WSLg 1.0.33
> >
> > Is there some parameter in VS Code that I need to set?
> > Puzzled.
> >
> > Another unrelated issue. Just now, when I attempt to go to 
> https://docs.sympy.org/
> > I receive the message
> >
> > 404
> >
> > There isn't a GitHub Pages site here.
> >
> >
> > --
> > 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/5a69ee30-2084-4f8c-929e-ddab57e254b0n%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/3f77edee-b2e4-4bce-b3d9-28bc18707b3fn%40googlegroups.com.


Re: [sympy] Parsing expressions problem | "ImportError: Clang is not installed, cannot parse C code"

2022-04-19 Thread Aaron Meurer
The error message should be improved there. You need clang-python.

Aaron Meurer

On Tue, Apr 19, 2022 at 1:20 PM Audrius-St  wrote:
>
> Hello,
>
> I am attempting to parse C code into Python using SymPyExpression but am 
> receiving the error message "ImportError: Clang is not installed, cannot 
> parse C code"
>
> However, I'm quite certain that I have Clang installed
>
> $ conda list clang
> # NameVersion Build  Channel
> clang 13.0.1   ha770c72_0conda-forge
> clang-13   13.0.1   default_hc23dcda_0conda-forge
> libclang-cpp13 13.0.1  default_hc23dcda_0conda-forge
>
> Code fragment:
>
> src_X = """
> inline double advanceX(
> double const& x,
> double const& px,
> double const& y,
> double const& py,
> double const& t)
> // The C code output from FORM starts array indices at 1 not 0. Go figure.
> std::array w;
>
> w[1]=1./3.*y;
> w[2]=139./33. + 19./2.*y;
> w[2]=w[2]*w[1];
> . . .
> double x_t=w[1] + x;
>
> return x_t;
> """
>
> def main():
> p = SymPyExpression(src_X, 'c')
> p.convert_to_python()
> print('p:', p)
>
>
> if __name__ == "__main__":
> main()
>
> System:
> Python 3.9.12
> Sympy 1.10.1
> VS Code 1.66.2
> Ubuntu 20.04 on WSLg 1.0.33
>
> Is there some parameter in VS Code that I need to set?
> Puzzled.
>
> Another unrelated issue. Just now, when I attempt to go to 
> https://docs.sympy.org/
> I receive the message
>
> 404
>
> There isn't a GitHub Pages site here.
>
>
> --
> 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/5a69ee30-2084-4f8c-929e-ddab57e254b0n%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/CAKgW%3D6LzBM32J9_%3DMK0na7SZeC5VBn335u2AYJJa0x%3Dpajppgg%40mail.gmail.com.


[sympy] Parsing expressions problem | "ImportError: Clang is not installed, cannot parse C code"

2022-04-19 Thread Audrius-St
Hello,

I am attempting to parse C code into Python using SymPyExpression but am 
receiving the error message "ImportError: Clang is not installed, cannot 
parse C code"

However, I'm quite certain that I have Clang installed

$ conda list clang
# NameVersion Build  Channel
clang 13.0.1   ha770c72_0conda-forge
clang-13   13.0.1   default_hc23dcda_0conda-forge
libclang-cpp13 13.0.1  default_hc23dcda_0conda-forge

Code fragment:

src_X = """
inline double advanceX(
double const& x,
double const& px,
double const& y,
double const& py,
double const& t)
// The C code output from FORM starts array indices at 1 not 0. Go 
figure.
std::array w; 

w[1]=1./3.*y;
w[2]=139./33. + 19./2.*y;
w[2]=w[2]*w[1];
. . .
double x_t=w[1] + x;
 
return x_t;
"""

def main():
p = SymPyExpression(src_X, 'c')
p.convert_to_python()
print('p:', p)


if __name__ == "__main__":
main()

System:
Python 3.9.12
Sympy 1.10.1
VS Code 1.66.2
Ubuntu 20.04 on WSLg 1.0.33

Is there some parameter in VS Code that I need to set?
Puzzled.

Another unrelated issue. Just now, when I attempt to go 
to https://docs.sympy.org/
I receive the message 

404

There isn't a GitHub Pages site here.

-- 
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/5a69ee30-2084-4f8c-929e-ddab57e254b0n%40googlegroups.com.


Re: [sympy] Keeping expressions short and concise

2022-04-19 Thread Alan Bromborsky
Since I have no rant control I proselytize the following graphics 
software (free) for generating publication quality graphics whenever I 
have a likely target -


https://galgebra.readthedocs.io/en/latest/

look at the "3D Graphs" and "WebGL" galleries.  I especially like this 
one (you can zoom, rotate, and translate it interactively) -


https://asymptote.sourceforge.io/gallery/3Dwebgl/Klein.html

On 4/19/22 1:48 PM, Jonathan Gutow wrote:



On Apr 19, 2022, at 12:20 PM, Alan Bromborsky  
wrote:


I don't think sympy can return f for the integral of (df/dx)dx 
without first differentiating and then integrating.


Alan,

Yep, that is essentially the sticking point. It relates to the fact 
that there is no concept of an infinitesimal in the sympy core. I am 
interested in things like the total differential of f wrt multiple 
variables. For example: df = (df/dx)dx + (df/dy)dy + …, where these 
are partial derivatives and implicitly everything but the variable of 
differentiation is held constant. I use these mostly when doing 
thermodynamics, but there are other applications.


I will see if I can get time to look at what you are doing with galgebra.

Thanks,

Jonathan
--
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/C3F3650B-8F47-4DEF-AE9C-6487168FCBB8%40uwosh.edu 
.


--
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/6213e1e4-0622-c066-2bb7-7da1f08b5bf1%40gmail.com.


Re: [sympy] Keeping expressions short and concise

2022-04-19 Thread Jonathan Gutow


On Apr 19, 2022, at 12:20 PM, Alan Bromborsky 
mailto:abrombo...@gmail.com>> wrote:

I don't think sympy can return f for the integral of (df/dx)dx without first 
differentiating and then integrating.

Alan,

Yep, that is essentially the sticking point. It relates to the fact that there 
is no concept of an infinitesimal in the sympy core. I am interested in things 
like the total differential of f wrt multiple variables. For example: df = 
(df/dx)dx + (df/dy)dy + …, where these are partial derivatives and implicitly 
everything but the variable of differentiation is held constant. I use these 
mostly when doing thermodynamics, but there are other applications.

I will see if I can get time to look at what you are doing with galgebra.

Thanks,

Jonathan

-- 
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/C3F3650B-8F47-4DEF-AE9C-6487168FCBB8%40uwosh.edu.


Re: [sympy] Keeping expressions short and concise

2022-04-19 Thread Alan Bromborsky

Look at -

https://galgebra.readthedocs.io/en/latest/

gradient (geometric derivative) and associated operators implemented 
with the same interface.  Nothing to do with integration implemented.  
Attached is the code for Dop.py and the test code in Jupyter notebook.  
The problem with the differential operator class is that in order to use 
them to stuff a sympy Matrix they have to be sympy expressions and I 
don't know if that is possible without changing some of the sympy core.  
You might want to look at geometric calculus -


https://en.wikipedia.org/wiki/Geometric_calculus

galgebra includes all of the differential geometric calculus. Could you 
give me examples of what you want to do in pdf/latex format files.  
Essentially all that Dop.py does is provide a different api to using 
sympy derivatives.  If all is required is changing the api that would 
not be too difficult.  A integrator class could be written with a more 
natural api.  What would be difficult is if you had an integrand with 
unevaluated differential expressions.  I don't think sympy can return f 
for the integral of (df/dx)dx without first differentiating and then 
integrating.


On 4/19/22 12:54 PM, Jonathan Gutow wrote:

Alan,

I have thought about this a little too. I have not had time to work on 
it recently. The issue I ran into is that to make this work well in 
SymPy you really need the concept of an infinitesimal dx, dy, dz, etc. 
Things got circular when I tried to implement that using the sympy 
definition of functions. It might be worth comparing notes. I would 
really like to be able to work with total differentials and do 
integrations on expressions containing infinitesimals in the Leibniz 
style notation.


Jonathan


On Apr 19, 2022, at 10:24 AM, Alan Bromborsky  
wrote:



CAUTION:This email originated from outside of the organization. Do 
not click links or open attachments unless you recognize the sender 
and know the content is safe.



I am working on a linear differential operator class for sympy 
(Dop.py). Here is a Jupyter notebook with a simple example -




Note that lap*f gives a function but f*lap gives differential operator.




--
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/7C0243F5-5603-4DBF-806D-BC2C51507E86%40uwosh.edu 
.


--
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/31039ccc-0ca6-ca30-d5d0-9f36ec6107a4%40gmail.com.
"""
Differential operators, for all sympy expressions

For multivector-customized differential operators, see :class:`galgebra.mv.Dop`.
"""
import copy
import itertools
import numbers
import warnings
from typing import List, Tuple, Any, Iterable
from sympy import Symbol, S, Add, simplify, diff, Expr, Dummy, Matrix, shape
from IPython.display import display, Math, Latex

ZERO_STR = ' 0 '
PD = '\u2202'
PDpow = ('','','\u00B2','\u00B3','\u2074','\u2075','\u2076','\u2077','\u2078','\u2079')
PDmax = 9

def apply_function_list(f, x):
if isinstance(f, (tuple, list)):
fx = x
for fi in f:
fx = fi(fx)
return fx
else:
return f(x)

class Simp:
modes = [simplify]

@staticmethod
def profile(s):
Simp.modes = s

@staticmethod
def apply(expr):
obj = S.Zero
for coef, base in linear_expand_terms(expr):
obj += apply_function_list(Simp.modes, coef) * base
return obj

@staticmethod
def applymv(mv):
return Mv(Simp.apply(mv.obj), ga=mv.Ga)

def _consolidate_terms(terms):
"""
Remove zero coefs and consolidate coefs with repeated pdiffs.
"""
new_coefs = []
new_pdiffs = []
for coef, pd in terms:
if coef != S.Zero:
if pd in new_pdiffs:
index = new_pdiffs.index(pd)
new_coefs[index] += coef
else:
new_coefs.append(coef)
new_pdiffs.append(pd)
return tuple(zip(new_coefs, new_pdiffs))


def _merge_terms(terms1, terms2):
""" Concatenate and consolidate two sets of already-consolidated terms """
pdiffs1 = [pdiff for _, pdiff in terms1]
pdiffs2 = [pdiff for _, pdiff in terms2]

pdiffs = pdiffs1 + [x for x in pdiffs2 if x not in pdiffs1]
coefs = len(pdiffs) * [S.Zero]

for coef, pdiff in terms1:
index = pdiffs.index(pdiff)
coefs[index] += coef

for coef, pdiff in terms2:
index = pdiffs.index(pdiff)

Re: [sympy] Keeping expressions short and concise

2022-04-19 Thread Jonathan Gutow
Alan,

I have thought about this a little too. I have not had time to work on it 
recently. The issue I ran into is that to make this work well in SymPy you 
really need the concept of an infinitesimal dx, dy, dz, etc. Things got 
circular when I tried to implement that using the sympy definition of 
functions. It might be worth comparing notes. I would really like to be able to 
work with total differentials and do integrations on expressions containing 
infinitesimals in the Leibniz style notation.

Jonathan


On Apr 19, 2022, at 10:24 AM, Alan Bromborsky 
mailto:abrombo...@gmail.com>> wrote:


CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.



I am working on a linear differential operator class for sympy (Dop.py). Here 
is a Jupyter notebook with a simple example -



Note that lap*f gives a function but f*lap gives differential operator.



-- 
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/7C0243F5-5603-4DBF-806D-BC2C51507E86%40uwosh.edu.


[sympy] Re: Keeping expressions short and concise

2022-04-19 Thread gu...@uwosh.edu
> pip install -U Algebra-with-SymPy
>... lots of stuff, followed finally by
>ERROR: Could not install packages due to an OSError: [WinError 5] Access 
is denied: 
'C:\\Users\\python\\AppData\\Local\\Temp\\pip-uninstall-pns2p03y\\jupyter-kernel.exe'
>Consider using the `--user` option or check the permissions.

Andre,

I am not a regular Windows user so this is just a guess. My experience is 
with *nix flavors (MacOS, BSD, Linux). You may need to try `python -m pip 
install --user Algebra_with_Sympy` or something like that. I would do it 
inside a virtual environment, so that you can isolate it from other setups. 
I usually use pipenv to set those up.

Jonathan


-- 
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/7383179c-dd6c-470d-a46b-10f8cc454d36n%40googlegroups.com.


[sympy] Introduction

2022-04-19 Thread Andre Bolle
Hi,

I recently started to learn sympy, as it is a useful tool to investigate so 
many areas of mathematics which interest me. Most recently Lagrange and 
quantum mechanics.

I'd like to shout out a massive thanks to all the devs.

Sympy, the best thing since pencil and paper.
André


-- 
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/9b01d061-2e48-4650-bfea-8b4476aae44fn%40googlegroups.com.


[sympy] Re: Keeping expressions short and concise

2022-04-19 Thread Andre Bolle
That is precisely what I was looking for.

On Tuesday, April 19, 2022 at 3:24:00 PM UTC+1 gu...@uwosh.edu wrote:

> Alternative path that works better with complicated derivatives. Also 
> shows the nicer output inside Jupyter notebooks.
> [image: Screen Shot 2022-04-19 at 9.23.21 AM.png]
>
> On Tuesday, April 19, 2022 at 8:16:25 AM UTC-5 gu...@uwosh.edu wrote:
>
>> Is this the behavior you are trying to get?
>>
>>
>> >>> from algebra_with_sympy import *
>> >>> algwsym_config.output.human_text=True
>> >>> var('psi k x')
>> (psi, k, x)
>> >>> eq1=Eqn(psi, exp(I*k*x))
>> >>> eq1
>> psi = exp(I*k*x)
>> >>> eq2 =diff(eq1,x)
>> >>> eq2
>> Derivative(psi, x) = I*k*exp(I*k*x)
>> >>> eq2.subs({exp(I*k*x):psi})
>> Derivative(psi, x) = I*k*psi
>>
>> Jonathan
>> On Tuesday, April 19, 2022 at 7:50:54 AM UTC-5 andre...@gmail.com wrote:
>>
>>> When I differentiate the function
>>>
>>> ψ = exp(I*(k*x))
>>>
>>> I get
>>>
>>> i*k*exp(I*(k*x)).[which is  i*k*ψ] 
>>>
>>> Is there a way to get exp(I*(k*x)) substituted with  ψ, in order to get 
>>> the shorter expression i*k*ψ ?
>>>
>>> Thanks,
>>> André
>>>
>>>
>>>
>>>
>>>
>>>

-- 
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/1deb7d10-ff35-44dc-99f9-3cb5a6534fbcn%40googlegroups.com.


Re: [sympy] GSoC Project: Rebuilding SymPy Gamma using Pyodide

2022-04-19 Thread Aman Sharma
"""
Something I would like to know more about is what adding a new feature
would look like on the technical side.
"""
Adding a new feature like a new card could be done entirely in python. The 
Pyodide coderunner handles the input expression provided by javascript and 
returns the cards in the form of a JS Map (equivalent to a Python dict). 
The javascipt loops over all the items in the Map, and evaluates any card 
if needed. Currently, it is hard-coded in Javascript which cards have to be 
evaluated. We can update the python logic to include a Boolean value in the 
dict whether the card needs any evaluation.
Eg: Currently, when JS recieves a card like this, 
>>> s.eval('x**2')[2]
{'card': 'roots', 'var': 'x', 'title': 'Roots', 'input': 'solve(x**2 -1 ,  
x)', 'pre_output': 'x', 'parameters': []}
It then sends the following code to  run in Python
>>> s.eval_card('roots', 'x**2-x', 'x', {})
{'value': '[0, 1]', 'output': '\n0\n1\n'}
Here, the required html is provided to the JS and it is inserted into the 
proper div for the card.
The JS here follows the same routine for all cards. Hence, adding a new 
card should be possible to do entirely in python.

"""
Particularly how the pyodide will work and any challenges there.
"""
Pyodide runs on a browser on a service worker, and their documentation have 
provided a basic API to run Python code in JS.
In my source code, there is a "main" function which deals with the Pyodide 
API and returns the result. It can evaluate mathematical expressions in 
different flavours by changing the type parameter in the "main" function.

like for running a pure python command, we can set type = "input"
for generating cards using SymPyGamma object, we can set type = "eval"
and for evaluating a card we can set type = "eval-card"

[image: de.png]
The major challenge about using Pyodide is transferring Python objects to 
Javascript. Pyodide usually converts the basic types very well, like Python 
dicts to JS Maps. I have not experimented much and have currently stuck 
with strings to share information between JS and Python.

If some change to the UI is to be implemented, it will most probably have 
to be done in JS. Thankfully, Vue enables us to create components which can 
be reused. like the same component can be used for the search bar and the 
context menu (see https://github.com/sympy/sympy_gamma/issues/188 ) and the 
expression recieved from each can be executed differently using the type 
parameter in main function. 

In my opinion, we can certainly bring in new contributors for Gamma if we 
have some guides on how to navigate the code. Learning how to interface 
with Python codebase was much more work for me than to implement it using 
JS. Thats why, I have given Phase 2 of GSoC to majorly create documentation 
for new contributors.

I will update my proposal with some tasks to make it easier to implement 
features using Python. 
Nevertheless, I totally understand if SymPy Gamma is discontinued in the 
future. I enjoyed working on this project. 
On Tuesday, April 19, 2022 at 8:22:16 AM UTC+5:30 Aman Sharma wrote:

> Thank you Qijia for your reply. SymPy Beta is surely a great project . 
> SymPy Beta was a proof of concept to me, and motivated me to spend time 
> learning Web Development and Pyodide.
> SymPy Gamma brings the power of SymPy to users without learning the 
> correct Python syntax or the SymPy API. I would like to see it grow and 
> getting used by students like me in the future utilising the capabilities 
> of complete SymPy library without a coding background. (I have been talking 
> about SymPy Gamma to my friends and they have already become daily users : )
>
> If we go ahead and decide to continue SymPy Gamma, I completely agree with 
> Aaron here
> """
> Something I would like to know more about is what adding a new feature
> would look like on the technical side. How hard would it be for
> someone not familiar with the code? Just how much of that will require
> writing Javascript vs. writing something in Python?
> """
> Adding a feature should be done majority in Python. I will elaborate  on 
> this in a few hours.
>
> Aman
>
>
> On Tuesday, April 19, 2022 at 6:58:27 AM UTC+5:30 Qijia Liu wrote:
>
>> Hi all,
>>
>> Thanks for mentioning SymPy Beta.
>> If I understand correctly, SymPy Gamma's goal is to make SymPy 
>> end-user-friendly in a Wolfram|Alpha way, and some of the users (like Aman) 
>> may contribute back to SymPy.
>> If I'm allowed to be as ambitious as I choose, SymPy Beta's goal is to be 
>> an open source alternative to Wolfram|Alpha, as close as possible.
>> That is to say, although currently more than 90% of its kernel is powered 
>> by SymPy, in the future it may involve functionalities from other 
>> libraries, like NumPy and SciPy, or even outside Python ecosystem. At that 
>> time, it should be renamed, and maintained by a different group of people 
>> rather than only SymPy community.
>> So, do you need a pure-SymPy web service, or 

[sympy] Re: Keeping expressions short and concise

2022-04-19 Thread Andre Bolle
 Jonathan,

Hi there and thanks for your assistance.

Is this the behavior I am trying to get? Quite possibly. Having trouble 
installing "algebra_with_sympy". Do I need to be admin? My installation 
attempt is as follows:

pip install -U Algebra-with-SymPy
... lots of stuff, followed finally by
ERROR: Could not install packages due to an OSError: [WinError 5] Access is 
denied: 
'C:\\Users\\python\\AppData\\Local\\Temp\\pip-uninstall-pns2p03y\\jupyter-kernel.exe'
Consider using the `--user` option or check the permissions.

Thanks again,
Andre



On Tuesday, April 19, 2022 at 2:16:25 PM UTC+1 gu...@uwosh.edu wrote:

> Is this the behavior you are trying to get?
>
>
> >>> from algebra_with_sympy import *
> >>> algwsym_config.output.human_text=True
> >>> var('psi k x')
> (psi, k, x)
> >>> eq1=Eqn(psi, exp(I*k*x))
> >>> eq1
> psi = exp(I*k*x)
> >>> eq2 =diff(eq1,x)
> >>> eq2
> Derivative(psi, x) = I*k*exp(I*k*x)
> >>> eq2.subs({exp(I*k*x):psi})
> Derivative(psi, x) = I*k*psi
>
> Jonathan
> On Tuesday, April 19, 2022 at 7:50:54 AM UTC-5 andre...@gmail.com wrote:
>
>> When I differentiate the function
>>
>> ψ = exp(I*(k*x))
>>
>> I get
>>
>> i*k*exp(I*(k*x)).[which is  i*k*ψ] 
>>
>> Is there a way to get exp(I*(k*x)) substituted with  ψ, in order to get 
>> the shorter expression i*k*ψ ?
>>
>> Thanks,
>> André
>>
>>
>>
>>
>>
>>

-- 
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/d426ebbc-d87b-4482-8630-9a9697664a28n%40googlegroups.com.


[sympy] Re: Keeping expressions short and concise

2022-04-19 Thread gu...@uwosh.edu
Alternative path that works better with complicated derivatives. Also shows 
the nicer output inside Jupyter notebooks.
[image: Screen Shot 2022-04-19 at 9.23.21 AM.png]

On Tuesday, April 19, 2022 at 8:16:25 AM UTC-5 gu...@uwosh.edu wrote:

> Is this the behavior you are trying to get?
>
>
> >>> from algebra_with_sympy import *
> >>> algwsym_config.output.human_text=True
> >>> var('psi k x')
> (psi, k, x)
> >>> eq1=Eqn(psi, exp(I*k*x))
> >>> eq1
> psi = exp(I*k*x)
> >>> eq2 =diff(eq1,x)
> >>> eq2
> Derivative(psi, x) = I*k*exp(I*k*x)
> >>> eq2.subs({exp(I*k*x):psi})
> Derivative(psi, x) = I*k*psi
>
> Jonathan
> On Tuesday, April 19, 2022 at 7:50:54 AM UTC-5 andre...@gmail.com wrote:
>
>> When I differentiate the function
>>
>> ψ = exp(I*(k*x))
>>
>> I get
>>
>> i*k*exp(I*(k*x)).[which is  i*k*ψ] 
>>
>> Is there a way to get exp(I*(k*x)) substituted with  ψ, in order to get 
>> the shorter expression i*k*ψ ?
>>
>> Thanks,
>> André
>>
>>
>>
>>
>>
>>

-- 
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/7480d68d-f183-4a1b-831e-ba3b85040161n%40googlegroups.com.


Re: [sympy] Faster symbolics

2022-04-19 Thread Ondřej Čertík
Hi Alan!

Indeed, parallelism is another avenue. SymEngine can be compiled in a 
"thread-safe" mode, which enables to then use it in parallel. It's slightly 
slower, since the reference counted pointer becomes an atomic (so the idea 
below about not using reference counted pointers might help here too).

The question then is if it makes sense to parallelize algorithms like expand(), 
or even just "add" for two larger expressions. Possibly have both serial and 
parallel options.

I can imagine especially matrix operations could be sped up greatly in parallel.

Ondrej

On Tue, Apr 19, 2022, at 5:11 AM, Alan Bromborsky wrote:
> For speed up how about parallel processing?  Looking at Ryzen processors 
> 16 cores and 32 threads are quite affordable these days.  Is parallel 
> python mature code these days?
>
> On 4/18/22 11:45 PM, Ondřej Čertík wrote:
>> Hi,
>>
>> I am CCing the symengine list also. Let me say a few words about the design 
>> and goals of SymEngine. It's a result of many years of experience with SymPy 
>> and implementing high performance code in general. The goal is the fastest 
>> possible symbolic manipulation. So we do not want to introduce slowdowns 
>> just to get a different API, rather we should figure out how to create an 
>> API that works for everybody, while keeping the speed.
>>
>> The design is, as Isuru wrote below, quite close to optimal: SymEngine does 
>> not do any unnecessary work. The C++ classes just "pass through" the data, 
>> which must be prepared ahead of time. In order to get good speed, it needs 
>> to store the data in data structures like a hash table, which restricts what 
>> it can represent, in return for good speed. It seems that covers 90% of use 
>> cases. If you need to represent things differently than what SymEngine can 
>> do (such as `x+x` instead of `2*x`), you can always use SymPy, or we can 
>> implement some slower representations, but I think that should not be the 
>> default.
>>
>> One idea for improvement is to represent all SymEngine classes in some kind 
>> of a description language, similar to what we use for LFortran here: 
>> https://gitlab.com/lfortran/lfortran/-/blob/8761fcee2bbc4cb924bf65f5d576541e58bb8b08/src/libasr/ASR.asdl,
>>  and generate all the C++ classes automatically from it. This has many 
>> advantages (much less code to maintain, consistent code, easy to add a new 
>> symbolic function/object, etc.) and almost no downsides. One can then also 
>> experiment with changing how things are represented.
>>
>> Regarding the internal representation itself --- if anyone knows a faster 
>> design, please let me know!
>>
>> * One idea is not to use reference counted pointers at all, and just 
>> represent everything by value. That means if you take a term from an Add, it 
>> will get copied. When Add goes out of scope, it deallocates all its terms. 
>> Whether this approach is overall faster is unclear, but it might be quite a 
>> bit faster if you don't need to reuse subexpressions too much.
>>
>> * Another orthogonal idea is to represent all symbols like "x" in a separate 
>> structure (symbol table) and only reference them from expressions like x^3 + 
>> 2x^2+sin(x)...; The issue becomes again with memory management, but there 
>> are probably a few ways forward.
>>
>> * SymEngine was design to operate fast on general expressions. One can of 
>> course get faster speed if you know that you are dealing with a polynomial 
>> or other more specific structure, but this is an orthogonal idea. It seems 
>> just getting the general case working really fast is worth it.
>>
>> If anyone is interested in discussing this more, I am happy to have a video 
>> meeting where we can discuss more. Just let me know!
>>
>> Ondrej
>>
>> On Fri, Apr 15, 2022, at 7:53 PM, Isuru Fernando wrote:
>>> Hi Oscar,
>>>
>>> Here's a few things that are different in SymEngine than SymPy.
>>>
 As an example it would be trivial in SymPy to make substitutions
>>> involving large expressions and many replacements much faster with a
>>> small redesign. The problem though is backwards compatibility: each
>>> expression class can implement its own _eval_subs method so for
>>> backwards compatibility the subs implementation must recurse in the
>>> same slow way once throughout the whole tree for each replacement that
>>> is to be made. (There are ways to work around this but the design
>>> makes it harder than it should be.)
>>>
>>> In SymEngine, classes do not have such a method and therefore cannot
>>> extend for eg: subs function.
>>> However the subs function itself (SubsVisitor class technically) can be
>>> extended.
>>>
 This is a small example of a more general problem. Using classes means
>>> you have to use the interfaces of the class which means that efficient
>>> algorithms needing something not provided by that public interface are
>>> impossible. Even worse both SymPy and SymEngine allow the
>>> *constructors* of those classes to do nontrivial work 

[sympy] Re: Keeping expressions short and concise

2022-04-19 Thread gu...@uwosh.edu
Is this the behavior you are trying to get?


>>> from algebra_with_sympy import *
>>> algwsym_config.output.human_text=True
>>> var('psi k x')
(psi, k, x)
>>> eq1=Eqn(psi, exp(I*k*x))
>>> eq1
psi = exp(I*k*x)
>>> eq2 =diff(eq1,x)
>>> eq2
Derivative(psi, x) = I*k*exp(I*k*x)
>>> eq2.subs({exp(I*k*x):psi})
Derivative(psi, x) = I*k*psi

Jonathan
On Tuesday, April 19, 2022 at 7:50:54 AM UTC-5 andre...@gmail.com wrote:

> When I differentiate the function
>
> ψ = exp(I*(k*x))
>
> I get
>
> i*k*exp(I*(k*x)).[which is  i*k*ψ] 
>
> Is there a way to get exp(I*(k*x)) substituted with  ψ, in order to get 
> the shorter expression i*k*ψ ?
>
> Thanks,
> André
>
>
>
>
>
>

-- 
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/3ad5c732-248a-4e56-9b1b-c195b1c13435n%40googlegroups.com.


[sympy] Keeping expressions short and concise

2022-04-19 Thread Andre Bolle
When I differentiate the function

ψ = exp(I*(k*x))

I get

i*k*exp(I*(k*x)).[which is  i*k*ψ] 

Is there a way to get exp(I*(k*x)) substituted with  ψ, in order to get the 
shorter expression i*k*ψ ?

Thanks,
André





-- 
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/6f59ce08-aa7b-4f1b-8f7c-ce719a8770een%40googlegroups.com.


Re: [sympy] Faster symbolics

2022-04-19 Thread Alan Bromborsky
For speed up how about parallel processing?  Looking at Ryzen processors 
16 cores and 32 threads are quite affordable these days.  Is parallel 
python mature code these days?


On 4/18/22 11:45 PM, Ondřej Čertík wrote:

Hi,

I am CCing the symengine list also. Let me say a few words about the design and 
goals of SymEngine. It's a result of many years of experience with SymPy and 
implementing high performance code in general. The goal is the fastest possible 
symbolic manipulation. So we do not want to introduce slowdowns just to get a 
different API, rather we should figure out how to create an API that works for 
everybody, while keeping the speed.

The design is, as Isuru wrote below, quite close to optimal: SymEngine does not do any 
unnecessary work. The C++ classes just "pass through" the data, which must be 
prepared ahead of time. In order to get good speed, it needs to store the data in data 
structures like a hash table, which restricts what it can represent, in return for good 
speed. It seems that covers 90% of use cases. If you need to represent things differently 
than what SymEngine can do (such as `x+x` instead of `2*x`), you can always use SymPy, or 
we can implement some slower representations, but I think that should not be the default.

One idea for improvement is to represent all SymEngine classes in some kind of 
a description language, similar to what we use for LFortran here: 
https://gitlab.com/lfortran/lfortran/-/blob/8761fcee2bbc4cb924bf65f5d576541e58bb8b08/src/libasr/ASR.asdl,
 and generate all the C++ classes automatically from it. This has many 
advantages (much less code to maintain, consistent code, easy to add a new 
symbolic function/object, etc.) and almost no downsides. One can then also 
experiment with changing how things are represented.

Regarding the internal representation itself --- if anyone knows a faster 
design, please let me know!

* One idea is not to use reference counted pointers at all, and just represent 
everything by value. That means if you take a term from an Add, it will get 
copied. When Add goes out of scope, it deallocates all its terms. Whether this 
approach is overall faster is unclear, but it might be quite a bit faster if 
you don't need to reuse subexpressions too much.

* Another orthogonal idea is to represent all symbols like "x" in a separate 
structure (symbol table) and only reference them from expressions like x^3 + 
2x^2+sin(x)...; The issue becomes again with memory management, but there are probably a 
few ways forward.

* SymEngine was design to operate fast on general expressions. One can of 
course get faster speed if you know that you are dealing with a polynomial or 
other more specific structure, but this is an orthogonal idea. It seems just 
getting the general case working really fast is worth it.

If anyone is interested in discussing this more, I am happy to have a video 
meeting where we can discuss more. Just let me know!

Ondrej

On Fri, Apr 15, 2022, at 7:53 PM, Isuru Fernando wrote:

Hi Oscar,

Here's a few things that are different in SymEngine than SymPy.


As an example it would be trivial in SymPy to make substitutions

involving large expressions and many replacements much faster with a
small redesign. The problem though is backwards compatibility: each
expression class can implement its own _eval_subs method so for
backwards compatibility the subs implementation must recurse in the
same slow way once throughout the whole tree for each replacement that
is to be made. (There are ways to work around this but the design
makes it harder than it should be.)

In SymEngine, classes do not have such a method and therefore cannot
extend for eg: subs function.
However the subs function itself (SubsVisitor class technically) can be
extended.


This is a small example of a more general problem. Using classes means

you have to use the interfaces of the class which means that efficient
algorithms needing something not provided by that public interface are
impossible. Even worse both SymPy and SymEngine allow the
*constructors* of those classes to do nontrivial work without
providing any good way to override that. This means that you can't
even represent a symbolic expression without allowing arbitrary code
execution: it's impossible to optimize higher-level algorithms if you
have so little control over execution from the outside.

No, SymEngine does not do anything in the constructor of the C++ class
itself. (For eg: class "Add"). We have different functions (For eg:
function "add")
that do complicated functionality to create the C++ class. A user is
allowed
to create the C++ class directly and we assume that the data structure
that the
user passed is internally consistent in Release mode and we check user
input in Debug mode. This allows the user to do low level optimizations
when they know that going through the complicated function is
unnecessary.


There are ways that this can be improved in both SymPy and SymEngine


[sympy] Re: Two-line function to make expressions callable.

2022-04-19 Thread emanuel.c...@gmail.com


Try :

In [1]: from sympy import Lambda

In [2]: help(Lambda)

HTH,
​
Le lundi 18 avril 2022 à 12:12:31 UTC+2, andre...@gmail.com a écrit :

> Sorry about the spelling. I meant to write "A function which I find quite 
> useful."
>
> def mkfun(expr):
> free = list(ordered(expr.free_symbols))
> return lambda *x: expr.subs(zip(free,x))
>
> :o)
>
> On Sunday, April 17, 2022 at 10:33:37 AM UTC+1 Andre Bolle wrote:
>
>> A function a fund quite useful, so I thought I'd pass it on.
>>
>> def mkfun(expr):
>> """ Creates a lambda with arguments which are the alphabetically 
>> ordered free symbols.
>> E.g.
>> f1 = mkfun(x**2)
>> print(f1(3))
>> f2 = mkfun(x**2 + y**2)
>> print(f2(3,4))
>> f3 = mkfun(x**2 + y**2 + z**2)
>> print(f3(3,4,5))
>> """
>> free = list(ordered(expr.free_symbols))
>> return lambda *x: expr.subs(zip(free,x))
>
>

-- 
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/43b84a0b-6b79-45d4-b89d-575e0ce44c1an%40googlegroups.com.