Computing Eigen Values and Eigen Vector using IronPython2.7 - python

This might be a frequent problem for IronPython users. But I am new to python.
I wish to compute Eigen Value and Eigen vector of around 50x50 matrix using IronPython2.7
I explored possibilities of using Numpy and Scipy, but they are not supported for IronPython.
Are there any better ways to achieve what I require?

Sho for IronPython is a good environment by Microsoft that does provide what you want. I am glad it worked for you.
To quote the link itself
Sho is a playground for data: a set of libraries and an interactive
environment for rapid prototyping, data analysis, and visualization.
The linear algebra classes in Sho do provide multiple functions for computing the eigenvalues, as shown in the book of Sho.

Related

parallel algorithm for generalized nonsymmetric eigenproblems

I need to efficiently solve large nonsymmetric generalized eigenvalue/eigenvector problems.
A x = lambda B x
A, B - general real matrices
A - dense
B - mostly sparse
x - the eigenvector
lambda - the eigenvalue
Could someone help me by:
Informing me if the nonsymmetric generalized eigenvalue/eigenvector problems is known to be parallelized. (What are some good algorithms and libraries implementing them if any);
Telling me if scalapack is an alternative to dense nonsymmetric eigenproblems;
Suggesting some good computational alternatives to test the use of both sparse matrices and linear-algebra algorithms;
Suggesting an alternative linear algebra construction that I could use (if there are no simple routines call, perhaps there is a good solution that is not so simple).
I tested code efficiency using matlab, python and C programming. Matlab is said to have builtin lapack functionality. I used intel provided python, with scipy and numpy linking to intel MKL lapack and blas libraries. I also used C code linking to intel MKL lapack and blas libraries.
I was able to check that for non-generalized eigenvalue problems, the code ran in parallel. I had as many threads as physical cores in my machine. That told me that LAPACK uses parallel code in certain routines. (Either LAPACK itself or the optimized versions shipped within matlab and intel MKL oneapi libraries.
When I started to run generalized eigenvalue routines, I observed that the code ran with only one thread. I tested in matlab and python as distributed by intel.
I'd like to investigate this further, but first I need to know if it's possible even in theory to run generalized nonsymmetric eigen decompositions in parallel.
I've seen that scipy have routines for the reduction of a pair of general matrices to a pair of hessenberg/upper triagular matrices. It seems that from hessenberg form, that eigenvalue/eigenvector problems are computationally easier.
Hessenberg for a single matrix runs in parallel. But hessenberg for a pair of matrices, runs only in sequence with one thread. (tested in python scipy). And again, I hit a wall. Which raises the question: is this problem parallelizable?
Other source of optimization for the problem I have is that I have one of the matrices dense and the other is mostly sparse. I'm still not sure how to exploit this. Are there good implementations of sparse matrices and state of the art linear algebra algorithms that work well together?
Thank you very much for any help supplied! Including books and scientific papers.
For MKL-provided routines, you can run it in either parallel mode by using /Qmkl compiler option (Intel compilers) or in sequential mode using /Qmkl:sequential option. For more details, you can refer to the MKL developer reference manual for more details https://www.intel.com/content/www/us/en/develop/documentation/onemkl-linux-developer-guide/top/linking-your-application-with-onemkl.html regarding linking options
Here is the link which shows the MKL routines that use sparse matrices https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top/sparse-solver-routines.html

Eigenvectors of a large sparse matrix in tensorflow

I was wondering if there is a way to calculate the first few eigenvectors of a very large sparse matrix in tensorflow, hoping that it might be faster than scipy's implementation of ARPACK, which doesn't seem to support parallel computing. At least, as far as I noticed.
I believe you should rather look into PETCs4py or SLEPc4py.
They are python binding of PETSc (Portable, Extensible Toolkit for
Scientific Computation) and SLEPc (Scalable Library for Eigenvalue Problem Computations).
PETSc and SLEPc support MPI and therefore PETCs4py and SLEPc4py do too.
I believe you will find useful examples in examples

Python: matrix completion functions/library?

Are there functions in python that will fill out missing values in a matrix for you, by using collaborative filtering (ex. alternating minimization algorithm, etc). Or does one need to implement such functions from scratch?
[EDIT]: Although this isn't a matrix-completion example, but just to illustrate a similar situation, I know there is an svd() function in Matlab that takes a matrix as input and automatically outputs the singular value decomposition (svd) of it. I'm looking for something like that in Python, hopefully a built-in function, but even a good library out there would be great.
Check out numpy's linalg library to find a python SVD implementation
There is a library fancyimpute. Also, sklearn NMF

OpenGL matrix math utilities for Python?

Before I do it myself, are there any Python libraries available for OpenGL-specific/compatible matrix math on 4x4 matrices? Basically, I need about the feature set offered by Android's android.opengl.Matrix class.
I created the library Pyrr to provide all the maths features you need for Core OpenGL.
It features matrices, vectors and quaternions and basic support for other primitives (rectangles, rays, lines, etc).
It has both a procedural API and, more recently, an Object Oriented API which is very powerful.
It's available on PyPi pip install pyrr and from the github link above.
Feedback, issues and new features are welcome!
You can use numpy to generate data that is compatible with OpenGL. Many of the PyOpenGL calls can take numpy data structures directly (assuming it's the correct type). Additionally, numpy arrays are typically well arranged in memory, and so you can do what you want with the data (and it's easy to check how they are arranged).
PyGLM might be something to look at as well. The author claims to be 2x to 10x as fast as numpy.
It is based on the popular OpenGL Mathematics, C++ header only, library.
If you already know what you want in OpenGL, why not use PyOpenGL? I believe all the functionality you want should be there, and here are some docs on doing matrix transformations and interfacing with NumPy.

Anything like SciPy in Ruby?

Looking further into the differences between Python and Ruby, is there a Ruby equivalent to SciPy, or what other scientific math gems are available for Ruby?
There's nothing quite as mature or well done as SciPy, but check out SciRuby and Numerical Ruby.
rnum
Ruby Numerical Library is a linear
algebra package using Blas and Lapack.
http://rnum.rubyforge.org/
Site has some speed comparisons
Someone else mentioned NArray and Ara T. Howard's / #drawohara's SciRuby.
But there's also a new SciRuby project (proceeding with Ara's and Masahiro Tanaka's blessings) which includes a dense and sparse matrix gem, NMatrix. It's not finished yet, but it does basic stuff.
The SciRuby github account also has a bunch of other useful gems, including statsample (for statistics) and rubyvis (for visualization).
linalg https://github.com/wedesoft, installation instructions: http://www.quora.com/Installation-Instructions/How-do-I-install-Ruby-linalg-library-on-Mac

Categories

Resources