GSoC Introduction. Perturbation theory example

111 views
Skip to first unread message

weralwolf

unread,
Mar 23, 2011, 1:04:49 PM3/23/11
to sympy
Hello, where my simple example of calculations corrections due to
perturbation theory for hole with infinite walls. I thinks I didn't
use all SymPy features, so if it possible guide me.
Source: http://pygments.org/demo/16998/

P.S. Why my previous discussion("One more GSoC Introduction") was
deleted?

Regards,
Anatolii

Ondrej Certik

unread,
Mar 23, 2011, 3:48:28 PM3/23/11
to sy...@googlegroups.com, weralwolf
On Wed, Mar 23, 2011 at 10:04 AM, weralwolf <wera...@gmail.com> wrote:
> Hello, where my simple example of calculations corrections due to
> perturbation theory for hole with infinite walls. I thinks I didn't
> use all SymPy features, so if it possible guide me.
> Source: http://pygments.org/demo/16998/

Nice! I ran your script, and got a number:

-0.281647771314390

Then I printed E_n(_n, _a, _mass).n() and I got:

0.197392088021787

so the 0.197... is the original energy, and -0.281... is the corrected one?

Indeed, I agree with your conclusions, it'd be really cool to make
this work with brakets.

>
> P.S. Why my previous discussion("One more GSoC Introduction") was
> deleted?

I am quite sure nobody has deleted any discussions intentionally ---
is this the discussion you are referring to?

https://groups.google.com/forum/#!topic/sympy/Pmoc8sHP05M

Maybe google groups failed to show it temporarily?

Ondrej

weralwolf

unread,
Mar 23, 2011, 4:42:53 PM3/23/11
to sympy


On 23 Бер, 21:48, Ondrej Certik <ond...@certik.cz> wrote:
> On Wed, Mar 23, 2011 at 10:04 AM, weralwolf <weralw...@gmail.com> wrote:
> > Hello, where my simple example of calculations corrections due to
> > perturbation theory for hole with infinite walls. I thinks I didn't
> > use all SymPy features, so if it possible guide me.
> > Source:http://pygments.org/demo/16998/
>
> Nice! I ran your script, and got a number:
>
> -0.281647771314390
>
> Then I printed E_n(_n, _a, _mass).n() and I got:
>
> 0.197392088021787
>
> so the 0.197... is the original energy, and -0.281... is the corrected one?

Yes, you are right, it's exactly what I mean in script.

> Indeed, I agree with your conclusions, it'd be really cool to make
> this work with brakets.

It should be really shorter and simply. Can you guide me to get
application for this idea?

>
> > P.S. Why my previous discussion("One more GSoC Introduction") was
> > deleted?
>
> I am quite sure nobody has deleted any discussions intentionally ---
> is this the discussion you are referring to?
>
> https://groups.google.com/forum/#!topic/sympy/Pmoc8sHP05M
>
> Maybe google groups failed to show it temporarily?
Yeah, it gone when I connect from another network in dormitory.
> Ondrej

Ondrej Certik

unread,
Mar 23, 2011, 6:22:40 PM3/23/11
to sy...@googlegroups.com
On Wed, Mar 23, 2011 at 1:42 PM, weralwolf <wera...@gmail.com> wrote:
>
>
> On 23 Бер, 21:48, Ondrej Certik <ond...@certik.cz> wrote:
>> On Wed, Mar 23, 2011 at 10:04 AM, weralwolf <weralw...@gmail.com> wrote:
>> > Hello, where my simple example of calculations corrections due to
>> > perturbation theory for hole with infinite walls. I thinks I didn't
>> > use all SymPy features, so if it possible guide me.
>> > Source:http://pygments.org/demo/16998/
>>
>> Nice! I ran your script, and got a number:
>>
>> -0.281647771314390
>>
>> Then I printed E_n(_n, _a, _mass).n() and I got:
>>
>> 0.197392088021787
>>
>> so the 0.197... is the original energy, and -0.281... is the corrected one?
>
> Yes, you are right, it's exactly what I mean in script.

How hard would it be to do more perturbation terms, so that we can see
some kind of convergence in the energies? People don't do that by
hand, because it is tedious, but with sympy, it might be possible.
That'd be really cool.

>
>> Indeed, I agree with your conclusions, it'd be really cool to make
>> this work with brakets.
>
> It should be really shorter and simply. Can you guide me to get
> application for this idea?

Definitely. Go to the wiki:

https://github.com/sympy/sympy/wiki/Gsoc-current-applications

and start crafting it up, then ask for feedback, and I and other
people will try to help.

Ondrej

weralwolf

unread,
Mar 24, 2011, 2:07:29 AM3/24/11
to sympy


On 24 Бер, 00:22, Ondrej Certik <ond...@certik.cz> wrote:
> On Wed, Mar 23, 2011 at 1:42 PM, weralwolf <weralw...@gmail.com> wrote:
>
> > On 23 Бер, 21:48, Ondrej Certik <ond...@certik.cz> wrote:
> >> On Wed, Mar 23, 2011 at 10:04 AM, weralwolf <weralw...@gmail.com> wrote:
> >> > Hello, where my simple example of calculations corrections due to
> >> > perturbation theory for hole with infinite walls. I thinks I didn't
> >> > use all SymPy features, so if it possible guide me.
> >> > Source:http://pygments.org/demo/16998/
>
> >> Nice! I ran your script, and got a number:
>
> >> -0.281647771314390
>
> >> Then I printed E_n(_n, _a, _mass).n() and I got:
>
> >> 0.197392088021787
>
> >> so the 0.197... is the original energy, and -0.281... is the corrected one?
>
> > Yes, you are right, it's exactly what I mean in script.
>
> How hard would it be to do more perturbation terms, so that we can see
> some kind of convergence in the energies? People don't do that by
> hand, because it is tedious, but with sympy, it might be possible.
> That'd be really cool.
>

It wouldn't be much harder, we just should wright down formulas for
next perturbation terms, or provide way for calculating more general
formula. I write it just for two first terms cause anyone who does
work with perturbation theory or just learn it in University should
know they.

>
> >> Indeed, I agree with your conclusions, it'd be really cool to make
> >> this work with brakets.
>
> > It should be really shorter and simply. Can you guide me to get
> > application for this idea?
>
> Definitely. Go to the wiki:
>
> https://github.com/sympy/sympy/wiki/Gsoc-current-applications
>
> and start crafting it up, then ask for feedback, and I and other
> people will try to help.
>
> Ondrej

Thanks! I'll start today.

weralwolf

unread,
Mar 24, 2011, 12:22:10 PM3/24/11
to sympy


On Mar 24, 12:22 am, Ondrej Certik <ond...@certik.cz> wrote:
So, I went there and create draft of my application:
https://github.com/sympy/sympy/wiki/Perturbation-theory-by-Anatolii-Koval
. Will be very appreciative to hear some fixes or proposals about it.
Also I will write more information little bit later.

Anatolii

Alexey U. Gudchenko

unread,
Mar 24, 2011, 12:45:17 PM3/24/11
to sy...@googlegroups.com

24.03.2011 19:22, weralwolf пишет:

Hi,

It's very hopeful title, but I just notice that :

> Yes, let's use this convention. Title the page like "GSoC 2011 Application Your Name". Someone go ahead and rename all existing pages to this format.
>
> Aaron Meurer
>

http://groups.google.com/group/sympy/browse_thread/thread/3184d64aefba96c9?hl=en


> So, I went there and create draft of my application:
> https://github.com/sympy/sympy/wiki/Perturbation-theory-by-Anatolii-Koval
> . Will be very appreciative to hear some fixes or proposals about it.
> Also I will write more information little bit later.
>
> Anatolii
>


--
Alexey U.

Jeron Smuta

unread,
Mar 24, 2011, 12:51:28 PM3/24/11
to sy...@googlegroups.com


2011/3/24 Alexey U. Gudchenko <pr...@goodok.ru>


24.03.2011 19:22, weralwolf пишет:

Hi,

It's very hopeful title, but I just notice that :

Yes, let's use this convention.  Title the page like "GSoC 2011 Application Your Name".  Someone go ahead and rename all existing pages to this format.

Aaron Meurer


http://groups.google.com/group/sympy/browse_thread/thread/3184d64aefba96c9?hl=en


So, I went there and create draft of my application:
https://github.com/sympy/sympy/wiki/Perturbation-theory-by-Anatolii-Koval
. Will be very appreciative to hear some fixes or proposals about it.
Also I will write more information little bit later.

Anatolii



--
Alexey U.


--
You received this message because you are subscribed to the Google Groups "sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sympy?hl=en.


Vinzent Steinberg

unread,
Mar 24, 2011, 12:53:30 PM3/24/11
to sympy
Hi,

On Mar 23, 6:04 pm, weralwolf <weralw...@gmail.com> wrote:
> Hello, where my simple example of calculations corrections due to
> perturbation theory for hole with infinite walls. I thinks I didn't
> use all SymPy features, so if it possible guide me.
> Source:http://pygments.org/demo/16998/

Nice, do you think this could be polished a bit and added to sympy's
examples? This could be your first patch. :)

Vinzent

weralwolf

unread,
Mar 24, 2011, 12:59:40 PM3/24/11
to sympy


On Mar 24, 6:53 pm, Vinzent Steinberg
Hm... I hope it could be added as example. But can you tell me what
exactly I should polish, may be more comments or you talking about
coding style?

Anatolii

Ondrej Certik

unread,
Mar 24, 2011, 2:06:41 PM3/24/11
to sy...@googlegroups.com

Can you please add the link here:

https://github.com/sympy/sympy/wiki/GSoc-2011-current-applications

so we can access it from one place? I also corrected the wiki front
page, the link to GSoc-2011-current-applications was broken.

Ondrej

Ondrej Certik

unread,
Mar 24, 2011, 4:12:48 PM3/24/11
to sy...@googlegroups.com


Btw, I think that perturbation theory module would work well with the
project idea I just posted on the sympy list: "Implement All Known
Analytical Solutions to Quantum Mechanical Systems".

So that one can use known analytical solutions from sympy, and then
use perturbation theory to solve more QM systems.

Ondrej

Brian Granger

unread,
Mar 24, 2011, 4:37:55 PM3/24/11
to sy...@googlegroups.com, Ondrej Certik

Yep!

> Ondrej


>
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
>
>

--
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgra...@calpoly.edu and elli...@gmail.com

weralwolf

unread,
Mar 24, 2011, 5:54:40 PM3/24/11
to sympy


On Mar 24, 6:53 pm, Vinzent Steinberg
<vinzent.steinb...@googlemail.com> wrote:
I guide your tip and after few minutes get this: http://pygments.org/demo/17051/
- could it be as good example? If yes, how I can submit it?

Anatolii

Ondrej Certik

unread,
Mar 24, 2011, 6:16:47 PM3/24/11
to sy...@googlegroups.com, weralwolf

Create a pull request to sympy, adding it into the examples directory.
More info here:

http://sympy.org/development.html

Ondrej

Vinzent Steinberg

unread,
Mar 25, 2011, 8:41:20 AM3/25/11
to sympy
Nice, this is exactly what I meant with polishing. About submitting
it, I think Ondrej answered your question.

Why did you add all these semicolons? In Python there is no need for
them, a newline has the same effect as ';' (except for code inside
parentheses).

Vinzent

weralwolf

unread,
Mar 25, 2011, 11:35:58 AM3/25/11
to sympy
On Mar 25, 2:41 pm, Vinzent Steinberg
All that semicolons are coming from my C++ coding style. I put it
everywhere it just can be placed, in this way I fill some kind of
order. I just really like it =)

Anatolii

Ondrej Certik

unread,
Mar 25, 2011, 1:50:30 PM3/25/11
to sy...@googlegroups.com, weralwolf

All code in sympy should conform to the Python coding guidelines:

http://www.python.org/dev/peps/pep-0008/

so no semicolons, and also the names of the functions should be
lowercase_with_underscores.

Ondrej

weralwolf

unread,
Mar 25, 2011, 2:09:42 PM3/25/11
to sympy
On Mar 25, 7:50 pm, Ondrej Certik <ond...@certik.cz> wrote:
Thanks for tip, I've fix semicolons and etc.

Anatolii

weralwolf

unread,
Mar 28, 2011, 5:07:06 PM3/28/11
to sympy
Can some one help me and tell what I should do next... I create some
kind of application: https://github.com/sympy/sympy/wiki/GSoC-2011-Application-Anatolii-Koval
(will appreciative to hear critic and amendments)
I have send pull request: https://github.com/sympy/sympy/pull/159 and
waiting for approving or comments
But currently really don't know what I should to do next to
participate the project...
Sorry if my question is stupid, but I really disoriented.

Regards,
Anatolii

Brian Granger

unread,
Mar 28, 2011, 5:14:12 PM3/28/11
to sy...@googlegroups.com, weralwolf
Some general comments:

* It would be useful if you have a patch that changed sympy itself.
While your example is nice, it doesn't show that you have dived into
the sympy code base.
* You need to have a very specific and concrete proposal for what you
will do. This needs to include, background and motivation,
demonstrate an understanding of the math/physics, a weekly plan of
what you will do, code-level details of the various components. I
strongly suggest looking at previous year's proposals on the WIki.
* Describe what types of Perturbation theories you will implement.
How will you implement them (in detail)?
* What will the interfaces in the code looks like? What
objects/modules will you implement?
* How will you handle the sum in perturbation theory?
* What examples/tests/documentation will you write.

Hope that helps,

Brian

Ondrej Certik

unread,
Mar 28, 2011, 5:19:53 PM3/28/11
to sy...@googlegroups.com
On Mon, Mar 28, 2011 at 2:07 PM, weralwolf <wera...@gmail.com> wrote:

Here is the Google timeline:

http://www.google-melange.com/gsoc/events/google/gsoc2011

so the applications open today, and end on April 8. You apply using
the google-melange.com webapp to the sympy project. Depending on the
number of applications, Google will assign us some number of slots,
usually roughly from 1/3 to 1/5 of all applications (e.g. for example
10 out of 30), and then we select the best ones.

The idea is to write as good application as you can, and the best way
to do it is to discuss it on the sympy list and with us, as you have
been doing. Brian has offered you some useful suggestions, that you
can incorporate.

Ondrej

Reply all
Reply to author
Forward
0 new messages