Luv Agarwal | 25 Apr 19:28 2015
Picon

GSoc Selections

Hello,

Some of the organizations have already given the information about the gsoc selections. It would be great if SymPy can also gives us some pre information :-).

Thanks
Luv Agarwal

--
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/d06ad8bd-105f-4d6e-bb51-97c505290fa1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Amit Saha | 23 Apr 23:57 2015
Picon

Should declaring an assumption restrict values substituted?

Hi all,

Let's say I have a symbol:

>>> x = Symbol('x', positive=True)

Should the below substitution be permitted:

>>> (x+1).subs({x:-5})
-4

My thinking is if x is declared to be positive, substituting negative
values should result in an error.  Does that make sense?

Best,
Amit.

-- 
http://echorand.me

--

-- 
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/CANODV3kKyVJ0%2BH4DmzTdVpgmuKYfmMRiwvODH420OzjRoKJi6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

j.gonthier01 | 23 Apr 19:45 2015
Picon

Bug in solve including commutative and non-commutative symbols

The simplest example I could think if is:

>>> a = symbols('a',commutative=True)
>>> c = symbols('c', commutative=False)
>>> solve(a-c,a)
[]

which returns an empty list. If both symbols have commutative=True or both have commutative=False, the correct solution [c] is returned.

Is there anything I am doing wrong 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+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/a7d9e447-d259-440d-a6b0-cc7bb6626429%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Duy Nguyen Truong | 23 Apr 05:46 2015
Picon

Bug in Multiplication between MatrixSymbol and Matrix

A matrix A and a MatrixSymbol B are defined as follows:

>>> from sympy import * >>> q = MatrixSymbol('q', 4, 1) >>> A = Matrix([[q[0,0], 1, 2], [q[1,0], 2, 3], [q[2,0], 3, 4]]) >>> B = MatrixSymbol('B', 3, 3)

The behavior is different for A * B and B * A. The operation A * B succeeds:

>>> A * B Matrix([ [q[0, 0], 1, 2], [q[1, 0], 2, 3], [q[2, 0], 3, 4]])*B

However, B * A crashes:

>>> B * A Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy-0.7.6_git-py2.7.egg/sympy/matrices/expressions/matexpr.py", line 21, in __sympifyit_wrapper return func(a, b) File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy-0.7.6_git-py2.7.egg/sympy/core/decorators.py", line 118, in binary_op_wrapper return func(self, other) File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy-0.7.6_git-py2.7.egg/sympy/matrices/expressions/matexpr.py", line 101, in __mul__ return MatMul(self, other).doit() File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy-0.7.6_git-py2.7.egg/sympy/matrices/expressions/matmul.py", line 112, in doit return canonicalize(MatMul(*args)) File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy-0.7.6_git-py2.7.egg/sympy/strategies/core.py", line 11, in exhaustive_rl new, old = rule(expr), expr File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy-0.7.6_git-py2.7.egg/sympy/strategies/core.py", line 95, in switch_rl return rl(expr) File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy-0.7.6_git-py2.7.egg/sympy/strategies/core.py", line 85, in do_one_rl result = rl(expr) File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy-0.7.6_git-py2.7.egg/sympy/matrices/expressions/matmul.py", line 183, in xxinv if X.is_square and Y.is_square and X == Y.inverse(): File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy-0.7.6_git-py2.7.egg/sympy/matrices/expressions/matexpr.py", line 194, in inverse return self._eval_inverse() File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy-0.7.6_git-py2.7.egg/sympy/matrices/dense.py", line 307, in _eval_inverse rv = M.inverse_GE(iszerofunc=iszerofunc) File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy-0.7.6_git-py2.7.egg/sympy/matrices/matrices.py", line 2621, in inverse_GE red = big.rref(iszerofunc=iszerofunc, simplify=True)[0] File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy-0.7.6_git-py2.7.egg/sympy/matrices/matrices.py", line 2679, in rref r[pivot, i] = simpfunc(r[pivot, i]) File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy-0.7.6_git-py2.7.egg/sympy/simplify/simplify.py", line 3700, in simplify expr2 = shorter(together(expr, deep=True), together(expr1, deep=True)) File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy-0.7.6_git-py2.7.egg/sympy/simplify/simplify.py", line 3694, in shorter return min(choices, key=measure) File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy-0.7.6_git-py2.7.egg/sympy/core/function.py", line 2290, in count_ops if a.is_Rational: AttributeError: 'str' object has no attribute 'is_Rational'

The cause of the crash is related to issue with count_ops ( https://groups.google.com/forum/#!topic/sympy/Edq9jnzwqhI )

Can we make the behavior of MatrixSymbol * Matrix same as Matrix * MatrixSymbol ? (Since multiplication is supposed to be commutative)

--
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/d9abd8f9-7173-4dcf-8408-c56729bd2753%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Duy Nguyen Truong | 23 Apr 05:44 2015
Picon

Bug in count_ops (in sympy/core/function.py) for expr with MatrixSymbol and indexing

The function count_ops (in sympy/core/function.py) fails for expression involving MatrixSymbol and indexing (e.g. M[0,0] + 1). Following is the program that reproduces the bug:

>>> from sympy import * >>> M = MatrixSymbol('M', 7, 7) >>> count_ops(M[0,0] + 1) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "sympy/core/function.py", line 2290, in count_ops if a.is_Rational: AttributeError: 'str' object has no attribute 'is_Rational'

Cause: MatrixSymbol M has is_Symbol equal False. Hence, count_ops continues to examine M.args (as in the code block https://github.com/sympy/sympy/blob/7163137e22fbefbb645147a15147b26dad220d49/sympy/core/function.py#L2352-L2353 ). Also, M.args contains the string which is the name of the symbol, causing the failure when count_ops considers it in the next while-loop iteration (which is the string and has no is_Rational attribute)

--
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/a0401003-699c-46bf-9773-7b4af414ff99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Paul Royik | 22 Apr 13:17 2015
Picon

What is the fastest way to calculate CDF of T-distribution?

I need to calculate P(X<1.2) where X follows T distribution with 5 degrees of freedom.

cdf(StudentT('x',5))(1.2) takes too much time.

Is there another way?

--
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/d3f9ee62-3b39-40ad-87d1-a4609bb5a7a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Carl Sunderman | 21 Apr 18:02 2015
Picon

Proper use of sympy for calculating geographic coordinates

So i am attempt to calculate new coords based on x,y and angle. 

say my initial coords are:
startx = 1988681.3858
starty = 201375.4566

and my angle is:
angle = 12.14

Now the formula that I use to get the angle is:
radian = math.atan((endx - startx)/(endy - starty))



so what i am trying to do is work backwards and get the endx, endy:

12.14 = math.atan((x - 1988681.3858)/(y - 201375.4566))

and solve for x, y

I think i may need to approach this a different way though. Possibly using the midpoints, which would be stationary regardless of the rotation, but does anyone have any ideas of the proper way to handle this and perhaps the sympy usage to at least get a result, or a list of results for that matter. I seem to error out on the below, which obviously is wrong:

solve(Eq [(12.14 == math.atan((x - 1988681.3858)/(y - 201375.4566)), (x,y))])

TypeError: can't convert expression to float

--
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/73701df8-d9ec-4379-abd5-ca1980f50afb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dirk Van Essendelft | 20 Apr 21:35 2015
Picon

bug in fcode

I'm writing some code to produce some fortran and c compilable math expressions and I notices a strange thing:

if I do:

x = symbols("x")

exp(Min(2,x))

I get 'exp(Min(2,x))'

as I would expect, but if I do

fcode(exp(Min(2,x)))

I get: 'exp(Min(1.0d0, x))'

which is obviously not the right expression

If I do

ccode(exp(Min(2,x)))

I get: 'exp(Min(2,x))'

which seems correct

--
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/36105b9f-eeef-4bc5-92eb-7aad845429c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Matheus Queiroz | 20 Apr 18:48 2015
Picon

CSympy and C++

Hi!
I'm a undergraduate student in need of a symbolic library.
I know enough C++ and Qt Framework to get into some "adventures".
I heard about sympy and I simply loved it. It's simple, efficient and has everything that I currently need.
My question:

Can I use it in C++?
If yes... is there any documentation on how to use it in C++ code?

Sorry, folks. But I really have no time to learn Python up to the level I am currently programming in C++ (Not to mention that my scientific work uses a lot of matrices that are dynamically allocated).

--
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/1a1d120d-b0d8-453e-ae2a-7d2ba3615681%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Duy Nguyen Truong | 19 Apr 09:51 2015
Picon

MatrixSymbol of real-valued variables

Question: For Symbol, we can declare it as a real-valued variable: x = Symbol('x', real=True). Is there a way in sympy that we can declare a MatrixSymbol of dimension M * N whose elements are real-valued variables ?

Why: In the problem I am working on, I need to compute the differentiation of Abs of a matrix element (which is real-valued for my problem). However, the sympy output for matrix element is not as nice as the output of the differentiation of Abs of a real-value symbol. See the sample program:

>>> from sympy import *

>>> N = Symbol('N', integer=True)

>>> M = MatrixSymbol('M', N, N)

>>> diff(Abs(M[0,0]), M[0,0])

(re(M[0, 0])*Subs(Derivative(re(_xi_2), _xi_2), (_xi_2,), (M[0, 0],)) + im(M[0, 0])*Subs(Derivative(im(_xi_2), _xi_2), (_xi_2,), (M[0, 0],)))/Abs(M[0, 0])

>>> X = Symbol('X', real=True)

>>> diff(Abs(X), X)

sign(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/c8ad1f75-f199-4136-b257-40e6b7cc0ed9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
James Crist | 17 Apr 07:40 2015
Picon

The great issue cleanup of 2015

As of this writing, SymPy has 1648 issues open. That's more than numpy, scipy, or pandas (more than numpy and scipy combined!). Further, our issue tagging system is a mess. We can do better than this!

Many of these issues are imported from google code, and may be already fixed in master (some as old as 2008). Others may be duplicates. I've taken it upon myself to start cleaning these up. Here's the system I'm using:

Issue label breakdown:

Submodule tags (html #0000FF, blue):
Everything after `sympy.` for the specific submodule. Keep the naming and casing consistent with the sympy namespace. If the relevant submodule is small, group it in with it's parent submodule. Feel free to create new labels if needed. Multiple tags may be used, but only if needed.

Classifier tags (html #d4c5f9, light purple):
What kind of issue is this. Currently 3 supported:
- `valid`: valid bug *in current master* (will be renamed to bug later, see below)
- `wontfix`: not a bug, should be tagged and closed (once everyone agrees/explanation given of course!)
- `duplicate`: same issue already exists. Main issue should be linked, and the duplicate closed.
- `enhancement`: not a bug, but something that would be nice to have

Platform tags (html #800080, purple):
Things that have to deal with specific platforms, python versions. This includes `IPython`, `Python 3`, other versions such as `PyPy`, etc..., `Windows`, and `SymPy Gamma`/`SymPy Live`. I feel like the last 2 should be moved to their respective repositorys, but I don't know how to export issues (it may not even be possible). I'd like to consolidate these if possible, but current system isn't terrible.

Priority tags (html #eb6420, orangeish?):
How important this is to sympy. I don't like these, as almost everything is marked as medium. I feel they don't provide a level of information that we actually care about, and a better triaging system could be used. Mainly, priority is relative - what's important to some users may be irrelevant to others. Really, only the `critical` tag has been used to some success. But, as we were using them before, let's keep them for now.

Meta tags (html #c7def8, sky blue):
Issues that have to deal with non-code functionality. Testing and documentation tags are obvious, `Maintainability` has to do with how we organize code/code quality/dev environment issues.

Special tags (html #f7c6c7, pink):
Things that need their own issue and need to stand out. Right now this is deprecation warning removal issues, as they're important and should be easily visible, and `Needs decision` labels.

Difficulty tags (html #009800, green):
How hard is this task? Currently only "easy to fix". I'd like to get a better breakdown, such as what Pandas has. See below for more info

------------------------------------------------------------

You may notice that leaves many tags in our current labeling system unused. That's because I'd like to get rid of them, but only once they're retagged. Too many different labels makes the whole system hard to navigate, too few and we can't find what we're looking for. I believe the above is a good proposed start.

How can you help???
If you want to help out with the effort, here's what I need:

- Brief discussion on labeling system. I will not accept a bikeshed on this, so discussion should be kept brief. Anything is better than what we had before, we don't need to decide on the *end all* labelling system. Really, all I want is to know if others think the Priority labels are useful (I don't), and also how people would feel about labels for effort and difficulty levels, such as what Pandas does.

- Help labeling. I've already started at the end of our issue list, and have been making my way forward. The methodology:

  1. Determine if the issue is still valid in master. If not, close it.
  2. Tag issue with classifier tags (`enhancement`, `valid`, `duplicate`, or `wontfix`)
  3. If relevant, tag issue with submodule tag. Create new one if no good match exists.
  4. If relevant, tag issue with platform tag. Create new one if no good match exists
  5. If relevant, tag issue with meta tag.
  6. Difficulty, priority, and special (really just `Needs decision`) tags are super optional. If we can agree to tag difficulty in some tiered system, then this should be done as well, but I'm not going to enforce this. Same for priority. SymPy is big - not everyone is going to know what's important or difficult. Further, what's important to me, may be irrelevant to others.

Once all issues have been gone through, the `bug` and `wrong result` issues should be deleted, and `valid` renamed to `bug`.

To work together on this, just start at the back, and work forward. Most issues have no tags, so it should be reasonably easy to see what hasn't been touched by others yet.

The goal:
- All issues are tagged
- Many of the issues are found to be already fixed/duplicates and can be closed

GSoC starts in a month - it'd be really nice to get our issue tracker cleaned up for the big push through the summer. I'm sure we can do it!

- Jim

--
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/6b60659e-15ff-47ee-8e0c-a2cb53810340%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gmane