Questions tagged [linear-algebra]

Questions about Mathematica functionality related to manipulating vector spaces and linear mappings between such spaces. This includes determination of matrix properties, matrix transformations, decompositions, and factoring.

168 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
20
votes
0answers
931 views

LinearSolve and Krylov Method options

I need to solve a large, sparse, linear system. At some point Method -> "Multifrontal" fails and a bit later also "Pardiso" ...
14
votes
1answer
382 views

Factorize trigonometric matrices

Consider two square matrices $A_1$ and $A_2$. Consider the following matrix involving matrix trigonometric functions: \begin{equation} M_1(t)=\begin{bmatrix} \cos(tA_1) & t\mathrm{sinc}(t A_1) \\ ...
12
votes
0answers
802 views

What algorithm is Mathematica using to find the smallest eigenvalue so quickly?

My question is what kind of black magic is Mathematica doing to obtain the correct answer so quickly compared to other programming languages? Details: I've written a Mathematica notebook to find the ...
11
votes
0answers
533 views

How to speed up calculations on big symbolic matrices?

this is my first time posting something on a community of the StackExchange platform, so please feel free to correct me if I'm doing something wrong. :) Additionally you should probably know that I'm ...
10
votes
0answers
279 views

Mathematica package for explicit matrix representations of group generators?

While there are several packages that are capable of working with weights and roots (for example LieArt), I couldn't find any package that spits out explicit matrices for the generators, for example ...
9
votes
0answers
165 views

Matrix-free Arnoldi method for eigensystems

I am solving a generalized eigenvalue problem $$\mathbf S\,\mathbf x = \lambda\,\mathbf M\,\mathbf x$$ w/ $\mathbf S := \mathbf B\,\mathbf A^{-1}\,\mathbf B^{T}$, and $\mathbf A$ is a sparse ...
9
votes
0answers
197 views

Bug in PositiveDefiniteMatrixQ?

Fixed in 10.1.0. Exists in at least 9.0.1 -- 10.0.2. This seems like a bug in PositiveDefiniteMatrixQ to me: ...
8
votes
0answers
173 views

Why has Version 10.3 precision reduced?

In version 7.0.1.0 and versions 10.0 and 10.1 the following is produced: ...
7
votes
0answers
109 views

Differing behavior of Eigenvalues and Eigensystem

With the update to v12.0, I seem to be getting different behavior of eigenvalues returned by Eigenvalues and Eigensystem (oddly, ...
7
votes
0answers
88 views

Computing log-determinant?

Mathematica does-not have a function to compute the log-det of matrix? Naively computing Log[Det[M]] can be numerically unstable.
7
votes
0answers
343 views

Examples of using Mathematica to solve matrix equations symbolically

Suppose we want to solve a linear system like $$\left\lbrack\begin{array}{cc}M& S\\ -S^\mathrm{T}&0 \end{array} \right\rbrack \left\lbrack \begin{array}{c} x\\y\end{array}\right\rbrack = \...
7
votes
0answers
453 views

Inverse of a large sparse Hermitian block matrix

I am looking for a method (if it exists) for the inverse of a large sparse Hermitian block matrix. The off diagonal sparse matrices, named δ are 4x4, and they have ...
6
votes
0answers
76 views

Memory usage for smallest eigenvalues

I have a bunch of hermitian matrices which are huge (of order 2^17 x 2^17) but extremely sparse so that, when I build the matrices, the usage of RAM is low (say of order 1 GB or similar). The ...
6
votes
0answers
66 views

Where is the mistake in computing the particular eigenvector of the following DFT Matrix?

I have the following matrix (the DFT Matrix for N = 3) $$W = \frac{1}{\sqrt{3}}\begin{pmatrix} 1 & 1 & 1 \\ 1 & e^{-\frac{i 2 \pi}{3} } & e^{\frac{i 2 \pi}{3} } \\ 1 & e^{\frac{...
6
votes
0answers
896 views

How to determined intel MKL library version used by current Mathematica?

In Matlab, I can determined which intel MKL is used using a command such as this: >> version -lapack Intel(R) Math Kernel Library Version 11.2.3 Product ...
6
votes
0answers
131 views

MatrixPower performance

In Mathematica 9, (I think) MatrixPower[matrix(m.m), n].vector has complexity $O(m^{2+\epsilon}\times\log(n))$ (Mathematica automatically find the algorithm that ...
6
votes
0answers
2k views

Solve huge symbolic system of linear equations

I have a system of 76 symbolic linear equations (i.e. some coefficients are symbolic) with a sparse coefficient matrix. However, neither Solve[] nor ...
5
votes
0answers
103 views

Arbitrary Precision, Nearly-Singular Matrices, and LinearSolve

I have been trying to solve a nonlinear eigenvalue problem, $\mathbf{M}(\lambda) \mathbf{v} = 0$, in Mathematica using Newton's method. The core of the algorithm relies upon an inverse iteration, ...
5
votes
0answers
78 views

Bug for Cubics -> True in Eigenvalues?

Let's consider the simple code ...
5
votes
0answers
368 views

Documentation for LinearAlgebra`LAPACK`?

Does anybody use the functions provided in the context LinearAlgebra`LAPACK directly? Is there any documentation out there? Guessing the argument patterns for these function by trial and error is ...
5
votes
0answers
123 views

Is it possible to speedup these simple linear algebra operations

I'm trying to numerically solve some equations using splitting operator method. The solver I construct iteratively constructs a matrix and feeds it to LinearSolve. ...
5
votes
0answers
352 views

Change of basis of polynomials

Suppose I have a favourite basis for polynomials in $x_1,\dotsc,x_n$, say non-symmetric Macdonald polynomials to be specific. I can easily compute these, and thus the change-of-basis matrix that takes ...
5
votes
0answers
363 views

Eigenvalues FEAST method - performance is very variable

I am running the FEAST method option for Eigenvalues on sparse matrices of dimension around 500,000. I look for about 50 ...
5
votes
0answers
503 views

Suggestions for solving a large linear system

I have a system of $\approx 200,000$ linear equations in $\approx 40,000$ variables (with rational coefficients) and I would like to determine the dimension of the solution space, which I know to be ...
5
votes
0answers
988 views

Fast principal component analysis

I'd like to speed up a principal value value analysis. The data contains a large set of vectors with a large dimension. Both are in the range of 1000. I want to obtain the loadings matrix for further ...
5
votes
0answers
327 views

LeastSquare Solution for the Continuous Time Lyapunov Equation

I have been working with a problem which involves solving the continuous time Lyapunov equation $$A R + R A^\top = G$$ for the symmetric positive definite matrix $R$. Here $A$ is real, invertible ...
4
votes
0answers
99 views

Converting complex equations to matrix form

My question is a continuation of the topic: How to convert equation to vector (matrix) form? It is necessary to separate the components of equations into vectors and matrices and a combination of ...
4
votes
0answers
142 views

Speed improvements and confusion for MapThread and Dot

I have a question / confusion over improving the speed of MapThread[Dot,...] for lists of tensors. My problem involves taking two lists of tensors and then ...
4
votes
0answers
147 views

Orthogonal matrix decomposition of symmetric matrix?

If matrix mat is symmetric, we should be able to decompose it into eigenvalue matrix matJ and orthogonal matrix ...
4
votes
0answers
852 views

What is the fastest way to check if matrix is invertible

I have a huge matrix that I suspect is not invertible. What is the fastest function in mathematica to test it ? I have remarked that MatrixRank is faster than NullSpace and Det, but is there an even ...
4
votes
1answer
294 views

Implementing positivity constraints over a six-dimensional hypercube

This question involves the same subject matter as my previous one (How can one achieve the most accurate estimates of certain six-dimensional integrals under specific constraints?), but with another (...
4
votes
0answers
93 views

How to do parallel computation when using LinearProgramming function?

I have a LP problem which contains 2n+3 variables with 4n+6 inequality constraints. I was trying to use Mathematica's LinearProgramming function. When n is small, like less than 30, it gives outcome ...
4
votes
0answers
116 views

Generation of Space Representation of non-crystallographic Point Groups

In Mathematica the command FiniteGroupData[{"CrystallographicPointGroup",<group number>}, "SpaceRepresentation"] yields the space representation (...
4
votes
0answers
607 views

Finding eigenvalues in Mathematica: why so slow?

I am trying to find the eigensystem of a large sparse real symmetric matrix, and I only need the lowest 40 or so eigenstates. The relevant code is as follows: ...
4
votes
0answers
300 views

Real Canonical Form of Arbitrary Size Matrices

I have been searching the site and the Mathematica documentation, but have not found anything regarding this. If we find the Jordan Form of the following matrix, we get complex values, but I would ...
3
votes
0answers
75 views

Derivative of eigenvalues

I work with 4x4 Hermitian matrices (r). I want to calculate a derivative of a function f[t,r] (ff[t_,r_]=1/2*D[f[t,r],t]), where the function f depends on the absolute value of the eigenvalues of r. ...
3
votes
0answers
84 views

Antisymmetric Matrix Eigenvector Normalization

So, I have a complex $4n \times 4n$ antisymmetric matrix, $A$ and it has a non-degenerate spectrum. The matrix $A$ then has eigenvalues given by $$ \beta_{1}, -\beta_{1}, \beta_{2}, -\beta_{2}, ... , ...
3
votes
0answers
383 views

solving linear systems with parameters

I am trying to solve simple, small linear systems, with parameters. I would like to have the result shown for various values of the parameter. RowReduce[], ...
3
votes
0answers
80 views

Matrix elements in terms of Minors?

Is there a simple way to rewrite a rectangular $m \times n$ matrix in terms of its maximal minors? For a few small cases, $(m,n)$ = $(2,3),(2,4),(3,4)$ I can brute force by explicitly solving: ...
3
votes
0answers
213 views

Matrix Exponentiation

This is in continuation with this one but it is more general. I will try to make it self contained. I have a program and I need to take the Dot product of many ...
3
votes
0answers
119 views

Determinant of 2-forms

I have matrix 4x4 and elements of the matrix are 2-forms. How to calculate determinant (in Mathematica 11) if this matrix using external product instead of normal product? I use components of Riemann ...
3
votes
0answers
111 views

How can one best implement the multiplication of octonions using the Quaternions package?

I excerpt from p. 4 of the recent paper of P. J. Forrester (https://arxiv.org/pdf/1610.08081.pdf): "Let $p_1$ and $p_2$ be quaternions. The octonion algebra consists of elements of the form $p_1+p_2 ...
3
votes
0answers
259 views

Why does Eigenvalues work for a matrix $\{M\}$ but not $\{\{M\}\}$?

Suppose I have a matrix {{1, 2}, {3, 4}} which I'll call mat. In a blur of human error, I computed the eigenvalues of ...
3
votes
0answers
152 views

Writing a function to set up and solve the least squares problem

I have setup the explicit line equation for a given set of points using least-squares approximation and the knots computed below. I have tried extending the same code for use with an arbitrary degree, ...
3
votes
0answers
994 views

Mathematica's Singular Value Decomposition different from another math engine

I’ve been working with SVD – singular value decomposition. Things weren’t working as expected. Thus, I looked over to Matlab and executed the following code: ...
3
votes
0answers
94 views

Does NDSolve automatically simplify the system of equations for Hermitian matices?

I am currently starting to solve numerically a system of differential equations like this: $\dot{A}(t)=S(A)A(t)$ Here, the matrices are of dimension $d\times d$. $S(A)$ is some superoperator that ...
3
votes
0answers
90 views

Explicitly find a guaranteed factorization of large expression?

Consider the large expression LE defined in this file (involving only linearly independent functions), or in this file (linear interdependence present but slightly ...
3
votes
0answers
432 views

How to compute the Lovász number for the given graph in Mathematica?

Here is a graph whose adjacency matrix is ...
2
votes
0answers
67 views

“Learning” to parameterize Hermitian matrices with a basis using neural networks

I'm interested in using neural networks to "learn" how to write down Hermitian matrices, specifically those which are defined over spaces with a specific tensor product structure. The simplest example ...
2
votes
0answers
64 views

Memory leak in SmithDecomposition?

While trying to compute a large number of Smith decompositions in Mathematica 11.0 under Windows 10, my computer keeps running out of memory for no apparent reason. Here is a self-contained example ...