Thank you. Is there a way to create a non-commutative expression
*directly* from a string? To be specific, if I write something like
ex1 = sympify('x1*x2*x1**-1')
I get 'x2' because sympy automatically assumes that the symbols are
commutative.
Akin
On Feb 15, 4:37 am, Chris Smith wrote:
> When
On Wed, Feb 15, 2012 at 7:02 PM, Akin wrote:
> Thank you. Is there a way to create a non-commutative expression
> *directly* from a string? To be specific, if I write something like
>
> ex1 = sympify('x1*x2*x1**-1')
>
Other than preprocessing the string and replacing symbols foo with
Symbol(foo, c
Sympy objects are usually immutable once created, mutable matrices are an
exceptions.
I guess that sympify simply avoids creating a mutable object.
On Thursday, November 7, 2013 7:44:37 PM UTC+1, Carsten Knoll wrote:
>
> Hi all,
>
>
> I just stumbled on the following behavior:
>
>
> >>> type(
On Thu, Jun 5, 2008 at 4:20 PM, Ondrej Certik <[EMAIL PROTECTED]> wrote:
> On Thu, Jun 5, 2008 at 3:50 PM, Robert Cimrman <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> In [16]: sympy.__version__
>> Out[16]: '0.5.15-hg'
>> In [19]: K = sympy.Matrix(nm.array(1, ndmin = 2))
>> In [20]: sympy.sympify(K)
>
Ondrej Certik wrote:
> I just discovered we probably need to think about this:
>
> In [1]: a = Matrix((1, x), (2, y))
>
> In [2]: from numpy import array
>
> In [3]: a
> Out[3]:
> ⎡1 x⎤
> ⎣2 y⎦
>
> In [4]: Matrix(sin(array(a)))
> Out[4]:
> ⎡sin(1) sin(x)⎤
> ⎣sin(2) sin(y)⎦
>
> In [5]: sin(a)
On Thu, Jun 5, 2008 at 3:50 PM, Robert Cimrman <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> In [16]: sympy.__version__
> Out[16]: '0.5.15-hg'
> In [19]: K = sympy.Matrix(nm.array(1, ndmin = 2))
> In [20]: sympy.sympify(K)
> ...
> NotImplementedError: matrix support
>
> Is there a reason for this? Why a M
On Thu, Jun 5, 2008 at 4:32 PM, Robert Cimrman <[EMAIL PROTECTED]> wrote:
>
> Ondrej Certik wrote:
>> I just discovered we probably need to think about this:
>>
>> In [1]: a = Matrix((1, x), (2, y))
>>
>> In [2]: from numpy import array
>>
>> In [3]: a
>> Out[3]:
>> ⎡1 x⎤
>> ⎣2 y⎦
>>
>> In [4]: Mat
Ondrej Certik wrote:
> On Thu, Jun 5, 2008 at 4:32 PM, Robert Cimrman <[EMAIL PROTECTED]> wrote:
>> Ondrej Certik wrote:
>>> I just discovered we probably need to think about this:
>>>
>>> In [1]: a = Matrix((1, x), (2, y))
>>>
>>> In [2]: from numpy import array
>>>
>>> In [3]: a
>>> Out[3]:
>>>
>> So that's not how I would like this to be. It should either work for
>> all functions or for no functions.
>
> I see. I do not use numpy matrices anyway, just arrays, as they are not
> really the linear algebra matrices, only arrays with some peculiar
> modifications - they have no extra value
Let's clean this up. I sent an email to the numpy-list asking for an advice:
http://projects.scipy.org/pipermail/numpy-discussion/2008-June/034801.html
The ultimate reason that Matrix is not a subclass of a Basic is that
it is mutable, while SymPy objects need to be immutable, so that when
you h
> Disadvantage -- if one needs to set entries of a Matrix using the
> syntax "A[1, 2] = y" not only at the beginning of the calculaton, but
> also in the middle, then he would have to do: A = Matrix(Array(A)[1,2]
> = y). Of course A[1,2] = y would create an exception saying: "use the
> A = Matrix(
Ondrej Certik wrote:
> Let's clean this up. I sent an email to the numpy-list asking for an advice:
>
> http://projects.scipy.org/pipermail/numpy-discussion/2008-June/034801.html
I agree with Robert Kern's view that sympy.Matrix should not be tied to
numpy.matrix - the latter in numpy has a lim
Hi,
Just a quick note that could be relevant to the discussion:
check also out
http://code.google.com/p/sympycore/wiki/MatrixSupportIdeas
that contains ideas how to deal with mutable matrices in
operations where they should be immutable, all in a very efficient
way.
The idea is based on using v
On Mon, Jun 9, 2008 at 10:40 AM, Pearu Peterson
<[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Just a quick note that could be relevant to the discussion:
> check also out
>
> http://code.google.com/p/sympycore/wiki/MatrixSupportIdeas
>
> that contains ideas how to deal with mutable matrices in
> operatio
Ondrej Certik wrote:
>> Disadvantage -- if one needs to set entries of a Matrix using the
>> syntax "A[1, 2] = y" not only at the beginning of the calculaton, but
>> also in the middle, then he would have to do: A = Matrix(Array(A)[1,2]
>> = y). Of course A[1,2] = y would create an exception sayin
On Jun 9, 9:18 am, "Ondrej Certik" <[EMAIL PROTECTED]> wrote:
> On Mon, Jun 9, 2008 at 10:40 AM, Pearu Peterson
>
> <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > Just a quick note that could be relevant to the discussion:
> > check also out
>
> >http://code.google.com/p/sympycore/wiki/MatrixSupport
On Mon, Jun 9, 2008 at 11:34 AM, Robert Cimrman <[EMAIL PROTECTED]> wrote:
> Ondrej Certik wrote:
>>>
>>> Disadvantage -- if one needs to set entries of a Matrix using the
>>> syntax "A[1, 2] = y" not only at the beginning of the calculaton, but
>>> also in the middle, then he would have to do: A
Thanks, Aaron Meurer.
I have opened a new issue :
http://code.google.com/p/sympy/issues/detail?id=2663&q=sympify&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary%20Stars
For my use, I have succeeded with a workaround in "Limit" (passing
some functions as "locals=locals()" argum
I just checked the source code. There is actually a _sympy_ attribute
check. Why are we then using something so strange as a global
`convert` dictionary?
On 12 May 2012 01:14, krastanov.ste...@gmail.com
wrote:
> How about adding a check for a _sympify_ attribute in the sympify
> routine. It will
Just to be clear, the `converter` dictionary makes sense for things
like `int` and `tuple`, but using it for stuff like `Matrix` and
`GeometryEntity` seems strange.
On 12 May 2012 01:17, krastanov.ste...@gmail.com
wrote:
> I just checked the source code. There is actually a _sympy_ attribute
> ch
I have documented it here https://github.com/sympy/sympy/pull/1289
--
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...@googlegroup
Yes, sympify() always returns an instance of Basic if it can. Basic
instances have to be immutable, so MutableMatrix is not Basic whereas
ImmutableMatrix is. This is done so that classes that include matrices
in their args automatically get the immutable one. Immutability is
important because of ha
I see.
Thank you both for the information.
On 11/08/2013 12:47 AM, Aaron Meurer wrote:
> Yes, sympify() always returns an instance of Basic if it can.
> Basic instances have to be immutable, so MutableMatrix is not Basic
> whereas ImmutableMatrix is. This is done so that classes that
> include ma
23 matches
Mail list logo