Björn Dahlgren | 30 Aug 18:12 2015
Picon

Demo jupyter notebooks with SymPy

As you may know, the IPython guys are showcasing the new jupyter notebook here:

https://try.jupyter.org/

They have a subfolder "communities" where they invite groups to publish example notebooks:
https://github.com/jupyter/docker-demo-images

I think it would be a nice addition to have a communities/sympy subfolder with some notebooks.
One example that come to mind is this notebook Ondřej posted a while back:
http://nbviewer.ipython.org/gist/certik/6469476

We could create a repo "sympy-demo-notebooks" under github.com/sympy/ where we could peer
review the notebooks before making a PR at jupyter/docker-demo-images.

Just a thought, what do you guys think?

Best,
Björn

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/c1679302-d4f9-4cca-9175-005a763650f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Preet Singh Khalsa | 29 Aug 19:22 2015
Picon

bug #9869

Hey!
I am new to open source. I would like to fix bug #9869 (label: easy to fix). Can someone please get me started?
Thanking in anticipation,
Preet.

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/4892a35f-779e-477e-9847-370991ca5a7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Matt Chan | 28 Aug 19:57 2015
Picon

Second quantization substitution

Hi Sympy-users,

I'm trying to figure out if it's possible to evaluate an expression from the quantum physics module. I'm fairly new at Sympy but I have some python experience. I thought I would ask before I dived into the source code.

Say for example I have something like the code in examples/intermediate/coupled_cluster.py. It derives the energy and amplitude equations in second quantization, but it needs to be solved.

The energy equation after cleanup is here: 

E = AntiSymmetricTensor(f, (_k,), (_c,))*AntiSymmetricTensor(t, (_c,), (_k,)) + AntiSymmetricTensor(t, (_c,), (_l,))*AntiSymmetricTensor(t, (_d,), (_k,))*AntiSymmetricTensor(v, (_k, _l), (_d, _c))/2

Can I provide some values for AntiSymmetricTensor(t, (_c,), (_k,)) to be substituted with evalf or lambdify? 

Thanks in advance for your help!
Matt

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/8872393e-3387-4104-8eb2-afc67a131da7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
bsdz | 28 Aug 15:22 2015
Picon

Is it possible to prevent recursion or eval

Hi

I'm looking at Lucas Lehmer sequences. I am modelling them in Sympy.

I've created a function class:

class L(Function):
    nargs
= (1)

    _recursions_maximum
= S.Infinity
    _recursions_count
= 0

   
<at> classmethod
   
def set_recursion_count(cls, c):
        cls
._recursions_maximum = c
        cls
._recursions_count = 0

   
<at> classmethod
   
def eval(cls, x):
        cls
._recursions_count += 1
       
if cls._recursions_count > cls._recursions_maximum:
            cls
._recursions_maximum = S.Infinity
           
return
       
elif x is S.Zero:
           
return 4
       
else:
           
return (L(x-1)**2)-2

This does work mostly as expected although I am running into trouble with the sympy cache:

n = Symbol('n', integer=True, positive=True)
L
.set_recursion_count(2)
print(L(n))
>> (L(n - 2)**2 - 2)**2 - 2

print(L(4))
>> 1416317954

clear_cache
()
L
.set_recursion_count(2)
print(L(4))
>> (L(2)**2 - 2)**2 - 2


The first two outputs (highlighted with >>) are expected but the fourth must be cached from somewhere?

Is there a better way to do this? Ideally, I'd like to avoid adding the maximum recursion limit as an argument to my function.

Thanks in advance!

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/be100c36-b81f-4a44-8669-a9f811547400%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Danny McNeela | 28 Aug 01:04 2015
Picon

Looking to Get Involved

Hi Folks,

My name is Danny, and I'm a math major at UC Berkeley. I'd like to get involved with Sympy development, and I was hoping that someone familiar with the project would be able to suggest a bugfix or feature that I could start working on in order to get myself familiarized with the codebase. I looked through the easy-fix issues on Github, but most of them seem to be already under active development or outdated. I'm pretty comfortable with calculus, linear algebra, set theory, abstract algebra, and analysis.
 
Thanks, and I look forward to working with all of you!

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/cddab4e7-1948-4674-9699-892fbb88ae07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nico | 24 Aug 23:09 2015
Picon

generate code for Boolean expressions

With `codegen`, one can generate code from a sympy expression. Typically, it is assumed that the return value is a scalar.

In one of my use cases, the return value is Boolean. (The answer to "Is x inside a particular domain?")
The hack I employed so far is to generate the code as usual
```
from sympy import *
from sympy.utilities.codegen import codegen

x = Symbol('x')
expr = x**2 - x + sin(x) < x**3 - 2*x - cos(5*x)  # ok
[(c_name, c_code), (h_name, c_header)] = codegen(("f", expr), "C")
print(c_code)
```
and then regex the relevant part out of `c_code`. (If you know of a better way to handle this, I'll be happy to hear about it.)
This works alright, but fails in the most simple cases, e.g.,
```
expr = True
```
with
```
TypeError: The first argument must be a sympy expression.
```
Quite understandable.

Is there a better way/hack to support this kind of code generation?

Cheers,
Nico

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/21baed7f-e7e6-4d1e-979c-6d30dee206e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nico | 24 Aug 23:00 2015
Picon

live shell on the website

I've been using Sympy in the past few weeks more than ever before, and I have to say it's been quite a nice experience.

As a an almost-newcomer, the single most annoying thing was that you can't copy-and-paste code from the website. Every time I select code from the documentation on [1], the live shell opens with seemingly unrelated code ("I didn't ask for this!"), and after hiding it, I find myself on another place in the documentation. Yikes!

Other than that great work. I particularly appreciate the helpfulness of this "mailing list".

Cheers,
Nico


[1] http://docs.sympy.org/

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/58147b7b-8128-4346-a2cd-5b465777fb42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Aaron Meurer | 23 Aug 21:59 2015
Picon

GSoC winding down

The GSoC period is now over. This is a reminder to all mentors and students to submit final evaluations at https://www.google-melange.com/. Mentors: if you do not submit your evaluations, the org admins will mark your students as fail! Your deadline is August 26.

Students, there is one additional thing you should do. Please write up a report of what you have done over the summer on the wiki https://github.com/sympy/sympy/wiki/ (search the wiki for "report" to see examples from previous years). A suggested outline for the report would be

About Me
Project Overview
GSoC Period
Future Work
Advice

(you don't have to follow that outline exactly, but that should give you an idea of what goes in the report).

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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6KAXi-tQwkDM_FkFY2XTf24MtOvd0e_EgomxRdaM0n8Jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Denis Akhiyarov | 20 Aug 06:23 2015
Picon

Smarter cache

Once I had some issues with cache in sympy and recently noticed this nice idea cachey. Seems to be a perfect
fit for sympy? In short the idea is to cache based on size and computation effort using a simple formula.

http://matthewrocklin.com/blog/work/2015/08/03/Caching/

The goal is to keep the cache of limited size, but pick/keep the cached items wisely.

score+=compute_time/nbytes*(1+e)^t

--

-- 
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+unsubscribe@...
To post to this group, send email to sympy@...
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/131c8b3c-db25-4b24-9652-c35efc377a82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
shinya.kat | 19 Aug 17:09 2015
Picon

Bug in "sympy.physics.quantum.cg"

I found a wrong expression to indicate a variable in "Wigner6j.doit()".

Original in Sympy version 0.7.6:
    def doit(self, **hints):
        if self.is_symbolic:
            raise ValueError("Coefficients must be numerical")
        return wigner_6j(self.j1, self.j2, self.j12, self.j3, self.j, self.j3)

Revised:
    def doit(self, **hints):
        if self.is_symbolic:
            raise ValueError("Coefficients must be numerical")
        return wigner_6j(self.j1, self.j2, self.j12, self.j3, self.j, self.j23)

This bug may be a simple typo...

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/c4b2a5ef-4259-4519-972d-988945dbfae5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nico | 19 Aug 14:07 2015
Picon

relate x[0] back to x

After defining a vector `x` and one of its components, say `x0`,
```
import sympy
x = sympy.DeferredVector('x')
x0 = x[0]
```
is there any way to relate `x0` back to `x`? I.e., I'm looking for a Boolean function that returns `True` for the question "Is x0 a component of 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/906550a7-f11d-4ccd-a097-0f47f1fff0a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gmane