Re: [sympy] Simple way to construct an arbitrary rank numpy array of sympy zeros

2011-09-29 Thread Torquil Macdonald Sørensen
On 29/09/11 19:45, Mateusz Paprocki wrote: Hi, On 29 September 2011 04:52, Torquil mailto:torq...@gmail.com>> wrote: Hi everybody! What is the simplest way of constructing e.g. a (2,3,4)-shaped numpy array containing sympy zeros? The simplest, but maybe not the most efficient is:

[sympy] unflatten

2011-09-29 Thread smichr
In pull request 589 I added an unflatten function to iterables which groups elements of an interable into groups of 2 (by default). Is this a good name? Are there any objections? Should this be in the namespace? >>> unflatten([1,2,3,4]) [(1, 2), (3, 4)] >>> unflatten([1,2,3]) Trac

Re: [sympy] Gröbner Bases / Modulus / Algebraic Relations

2011-09-29 Thread Mateusz Paprocki
Hi, On 29 September 2011 05:07, Vinzenz wrote: > Hi, > > I'm trying to port a Mathematica project to sympy. Therefore, I would > like to use an algorithm to decompose an expression using Gröbner > Bases as described in > > 8.3 Algebraic Relations, Gröbner Bases: A Short Introduction for > System

Re: [sympy] modulus arithmetic

2011-09-29 Thread Aaron Meurer
On Thursday, September 29, 2011, Chris Smith wrote: > Maybe during break I can write a little tutorial about doing modular > arithmetic to include in the docs. Your example, Aaron, is exactly > what I was looking for with the arithmetic (though the repr form is > rather ugly -- see below). And Hec

Re: [sympy] Simple way to construct an arbitrary rank numpy array of sympy zeros

2011-09-29 Thread Mateusz Paprocki
Hi, On 29 September 2011 04:52, Torquil wrote: > Hi everybody! > > What is the simplest way of constructing e.g. a (2,3,4)-shaped numpy > array containing sympy zeros? > The simplest, but maybe not the most efficient is: In [1]: import numpy as np In [2]: a = S.Zero*np.zeros((2, 3, 4)) In [3

Re: [sympy] EuroSciPy 2011

2011-09-29 Thread Aaron Meurer
On Wed, Sep 28, 2011 at 10:18 AM, Mateusz Paprocki wrote: > Hi, > > On 28 September 2011 08:41, Aaron Meurer wrote: >> >> Great!  I don't suppose there were any videos. > > This is a "budget" conference, so no videos. >> >> I don't quite understand the graph on that slide.  What does the >> x-axi

Re: [sympy] modulus arithmetic

2011-09-29 Thread Hector
Hi, We don't need any separate functions for finding square roots and cube roots. Following are from csolve[0] branch - For the cube root In [14]: from sympy.polys.galoistools import gf_csolve In [15]: gf_csolve([1, 0, 0, -4], 7) Out[15]: [] In [16]: gf_csolve([1, 0, 0, -4], 11) Out[16]: [5]

Re: [sympy] modulus arithmetic

2011-09-29 Thread Chris Smith
As a followup, if anyone is interested, there is a fairly tractable paper on computing cube roots in a modular field at http://eprint.iacr.org/2009/457.pdf . It does not appear that this is implemented yet: ```python >>> m7(4)**Rational(1,3) Traceback (most recent call last): File "", line 1, in

Re: [sympy] modulus arithmetic

2011-09-29 Thread Chris Smith
Maybe during break I can write a little tutorial about doing modular arithmetic to include in the docs. Your example, Aaron, is exactly what I was looking for with the arithmetic (though the repr form is rather ugly -- see below). And Hector's work will allow one to answer the other question (about

Re: [sympy] Gröbner Bases / Modulus / Algebraic Relations

2011-09-29 Thread Jeremias Yehdegho
Hi, ``reduced`` from polytools.py does this. Regards, Jeremias -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.c

Re: [sympy] modulus arithmetic

2011-09-29 Thread Hector
Hi On Fri, Sep 23, 2011 at 9:13 PM, Aaron Meurer wrote: > If you just want to do simple arithmetic, you can use the FF class: > > In [1]: FF(12) > Out[1]: ℤ₁₂ > > In [2]: FF(12)(4) > Out[2]: 4 mod 12 > > In [3]: FF(12)(4)/FF(12)(11) > Out[3]: 8 mod 12 > > Note that the name FF comes from finite

[sympy] Gröbner Bases / Modulus / Algebraic Relations

2011-09-29 Thread Vinzenz
Hi, I'm trying to port a Mathematica project to sympy. Therefore, I would like to use an algorithm to decompose an expression using Gröbner Bases as described in 8.3 Algebraic Relations, Gröbner Bases: A Short Introduction for Systems Theorists ( http://people.reed.edu/~davidp/pcmi/buchberger.pdf

[sympy] Simple way to construct an arbitrary rank numpy array of sympy zeros

2011-09-29 Thread Torquil
Hi everybody! What is the simplest way of constructing e.g. a (2,3,4)-shaped numpy array containing sympy zeros? At the moment, I'm doing a = numpy.array(sympy.zeros((1,2*3*4))).reshape((2,3,4)) but I think that having to reshape is a bit ugly. I am also considering: a = numpy.zeros((2,3,4),d