GithubHelp home page GithubHelp logo

Comments (5)

oscarbenjamin avatar oscarbenjamin commented on June 14, 2024 1

There is no matrix division operation in Python. The operation you show above is:

In [100]: b.T.solve(a.T).T
Out[100]: 
⎡1  2⎤
⎢    ⎥
⎣3  4

The transposes are needed because you're expecting the product a*inv(b) For inv(b)*a it's just a.solve(b).

from sympy.

chrisjohgorman avatar chrisjohgorman commented on June 14, 2024

Further investigation into the error after the decorator, line 2729, can be rewritten as return self * other.inv(), which is works, but is also probably not desired. I believe the original reading should be something like, in matrix terms, A * B**(-1). I will wait on playing with this further until someone more experienced than me can comment.

from sympy.

cbm755 avatar cbm755 commented on June 14, 2024

It might be that SymPy is not intending to support system solves via this operator (I mean, maybe it was just a coincidence that it worked before). But I'm not sure the current state.

Do the docs give any indication of what should happen and what what classes of objects?

Assuming this is a regression, then Gaussian elimination would be better than explicitly inv computation for example.

from sympy.

chrisjohgorman avatar chrisjohgorman commented on June 14, 2024

I took a look through the documentation and didn't see anything for division. So, I suppose that sympy is not supporting division as it's not a common matrix operation. Given this appears to be a regression, are you suggesting doing something like the following to get back our [1, 2; 3, 4] matrix?

a = Matrix([[9, 19], [19, 41]])
b = Matrix([[1, 3], [4, 8]])
c = b.row_join(eye(2))
d = c.rref()
e = d[0]
e.col_del(0)
e.col_del(0)
a*e

Or is there a better solution?

from sympy.

cbm755 avatar cbm755 commented on June 14, 2024

Ok, we'll do this downstream then, thanks @oscarbenjamin for the hints on a.solve(b) and similar.

from sympy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.