Reputation: 2545
I'm working on a project that involves messing around with large, dense matrices full of 256-bit numbers. Because of this, I want to use Sage methods. (SymPy's method for modular matrix inversion proved too memory-inefficient for my needs). For this project, I also need to be able to monitor system statistics such as CPU load and memory usage. This is fine in normal python because binaries are easy to install, but Sage cannot do this natively In my previous implementation with Python and SymPy, I used a library called psutil
. I've got a Ubuntu VM set up with Sage, but it seems that Sage can only use its own internal version of Python and cannot be imported into my system's version of python. Is there any way to either install external libraries in to Sage or to get my system's version of python to be able to import Sage? I would prefer the second option so I can write my programs in an IDE rather than command line. An alternative solution for me would be a way to calculate the modular inverse of a matrix much more efficiently than SymPy's built-in method.
Upvotes: 2
Views: 167
Reputation: 189
Is there any way to either install external libraries in to Sage
Sure. The easiest way to do this is to enter a Sage shell, which will set the environment such that you're calling Sage binaries:
$ sage --sh
Within this Sage shell, you can install Python packages the usual way using easy_install or pip for example.
Upvotes: 4