Want to keep learning?

This content is taken from the Partnership for Advanced Computing in Europe (PRACE)'s online course, Python in High Performance Computing. Join the course to learn more.

Hands-on: Linear algebra

In this exercise you can will explore NumPy’s in-built linear algebra routines

Source code for this exercise is located in numpy/linear-algebra/

  1. Construct two symmetric 2x2 matrices A and B. Hint: a symmetric matrix can be constructed easily from a square matrix as Asym = A + A^T
  2. Calculate the matrix product C = A * B using numpy.dot().
  3. Calculate the eigenvalues of matrix C with numpy.linalg.eigvals().

Share this article:

This article is from the free online course:

Python in High Performance Computing

Partnership for Advanced Computing in Europe (PRACE)