Received: by 10.100.122.7 with SMTP id u7mr190783anc.10.1314790490920; Wed, 31 Aug 2011 04:34:50 -0700 (PDT) X-BeenThere: sympy@googlegroups.com Received: by 10.90.122.4 with SMTP id u4ls22414669agc.5.gmail; Wed, 31 Aug 2011 04:34:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.113.7 with SMTP id q7mr20256agm.15.1314790489364; Wed, 31 Aug 2011 04:34:49 -0700 (PDT) Received: by k15g2000yqd.googlegroups.com with HTTP; Wed, 31 Aug 2011 04:34:49 -0700 (PDT) Date: Wed, 31 Aug 2011 04:34:49 -0700 (PDT) In-Reply-To: References: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1,gzip(gfe) Message-ID: Subject: Re: What should Matrix([1,2,3]) give? From: Vinzent Steinberg To: sympy Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Aug 29, 8:33=A0pm, Aaron Meurer wrote: > I see. =A0So the main reason for the numpy syntax is consistency with > broadcasting, which doesn't really make sense in SymPy (or at least > not at the moment). =A0Actually, I originally thought we should try to > match the numpy syntaxes, but as I look at them, I'm not sure. =A0For > example, I said we should try to match the slicing syntax, but there > are some aspects of the way numpy does that that some people don't > like (see issuehttp://code.google.com/p/sympy/issues/detail?id=3D2544). > > So I think we need to consider things from the SymPy point of view, > like you said. =A0One thing to consider is that eventually we will have > an ImmutableMatrix(), which is Basic, but which will have the same > syntax as Matrix(). =A0So it will need to satisfy the > ImmutableMatrix(*args) invariant. > > We also should consider backwards compatibility breaks of our own. > Changing Matrix([1, 2, 3]) to a row vector will break a lot of code. I think we can break numpy compatibility here. (IIRC they are not that happy with their matrix interface anyway.) For me Matrix([1,2,3]) returning a column vector is just convenient, because it is closer to the mathematical conventions and most often used. If you want a row vector, you can use the explicit Matrix([[1,2,3]]) (or transposition of course).