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.

222 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1k 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" ...
554 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) \\ ...
1k 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 ...
637 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 ...
291 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 ...
251 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 ...
204 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: ...
178 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: ...
135 views

How to compute eigenvalues of linear function (not matrix)?

How to compute eigenvalues of a known linear function? In Julia, there is a package https://jutho.github.io/LinearMaps.jl/dev/ to compute the matrix representation of given function, then we can ...
115 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, ...
121 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 ...
137 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.
373 views

1k 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 ...
143 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 ...
69 views

Effectivelly using Compile for calculate a Unitary transformation

I am new to Mathematica, and this is my first post, so if my question is not clear enough, I would be glad to read the comments and edit my question to add more information. The problem I need to ...
98 views

Bug for Cubics -> True in Eigenvalues?

Let's consider the simple code ...
437 views

Documentation for LinearAlgebraLAPACK?

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 ...
135 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. ...
440 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 ...
403 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 ...
549 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 ...
1k 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 ...
358 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 ...
63 views

Finding matrix in Krylov subspace (Lanczos method)

The Lanczos method for finding the smallest eigenvalue of a hermiteian matrix $H$ is based on the construction of a vector subspace (Krylov space) where one can build a matrix $H_{Krylov}$ which is ...
179 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 ...
304 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 ...
1k 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 ...
341 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 (...
118 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 ...
138 views

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 ... 0answers 140 views Generation of Space Representation of non-crystallographic Point Groups In Mathematica the command FiniteGroupData[{"CrystallographicPointGroup",<group number>}, "SpaceRepresentation"] yields the space representation (... 0answers 680 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: ... 0answers 355 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 ... 0answers 82 views Solving or Minimizing the Norm of the matrix equation$M^TAM - M^TB - B^TM =C$I am trying to solve the matrix equation$M^TAM - M^TB - B^TM=C$where I know A, B and C. My unknown matrix is M which has the special form that all the rows and columns sum to zero. i.e. I have four ... 0answers 121 views Symbolic matrix multiplication? I'm dealing with infinite dimensional matrices$M$, who's elements$M_{nm}$can be expressed as a sum of terms with kronecker deltas$a_{nk}\delta_{n+k,m}$, with some coefficient$a_{nk}$for each ... 0answers 72 views Prime Matrix with determinant of powers$2^x$Mathematica has commands for finding prime matrices, for example, here is a matrix with randoms in the range$<100$: RandomPrime[100, {3, 3}] This$2 \times 2$... 0answers 173 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 ... 0answers 118 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. ... 0answers 109 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}, ... , ... 0answers 88 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: ... 0answers 287 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 ... 0answers 168 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 ... 0answers 303 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 ...