Skip to main content

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.

267 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
23 votes
0 answers
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" ...
unlikely's user avatar
  • 7,123
16 votes
2 answers
729 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) \\ ...
anderstood's user avatar
  • 14.4k
13 votes
0 answers
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 ...
Daniel Walsh's user avatar
11 votes
0 answers
781 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 ...
TSwift's user avatar
  • 121
11 votes
0 answers
336 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 ...
jak's user avatar
  • 950
10 votes
0 answers
366 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 ...
Sasha's user avatar
  • 201
10 votes
0 answers
218 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: ...
Teake Nutma's user avatar
  • 6,031
8 votes
0 answers
186 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: ...
Chris Degnen's user avatar
7 votes
0 answers
296 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 ...
swish47's user avatar
  • 153
7 votes
0 answers
155 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, ...
erfink's user avatar
  • 1,099
7 votes
0 answers
191 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 ...
Dario Rosa's user avatar
7 votes
0 answers
3k 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 ...
Stanislav Poslavsky's user avatar
7 votes
0 answers
558 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 ...
Raffaele Carlone's user avatar
6 votes
0 answers
81 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{...
Sotiris's user avatar
  • 116
6 votes
0 answers
153 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 ...
fred's user avatar
  • 81
6 votes
0 answers
2k 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 ...
Nasser's user avatar
  • 147k
6 votes
0 answers
177 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 ...
user202729's user avatar
5 votes
0 answers
110 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 ...
LUCAS FREITAS's user avatar
5 votes
0 answers
110 views

Bug for Cubics -> True in Eigenvalues?

Let's consider the simple code ...
Giancarlo's user avatar
  • 712
5 votes
0 answers
588 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 ...
Henrik Schumacher's user avatar
5 votes
0 answers
147 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. ...
xslittlegrass's user avatar
5 votes
0 answers
586 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 ...
Per Alexandersson's user avatar
5 votes
0 answers
785 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: ...
Xiao's user avatar
  • 111
5 votes
0 answers
460 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 ...
user16316's user avatar
5 votes
0 answers
648 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 ...
José Figueroa-O'Farrill's user avatar
5 votes
0 answers
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 ...
AWi's user avatar
  • 51
4 votes
0 answers
124 views

Calculate the integral of the Slater determinant

This is a Slater determinant: $$ s=\left|\begin{array}{ll} \psi_{1 s}\left(r_1\right) \alpha & \psi_{1 s}\left(r_1\right) \beta \\ \psi_{1 s}\left(r_2\right) \alpha & \psi_{1 s}\left(r_2\right)...
我心永恒's user avatar
  • 1,572
4 votes
0 answers
83 views

Calculate an n-order determinant by FindSequenceFunction

Calculate an n-order determinant: $\left|\begin{array}{cccccc}1 & 2 & 3 & \cdots & n-1 & n \\ n & 1 & 2 & \cdots & n-2 & n-1 \\ n-1 & n & 1 & \cdots ...
lotus2019's user avatar
  • 2,151
4 votes
0 answers
145 views

Efficiently calculating half of the eigenvectors of a sparse array

Eigenvectors of a sparse array $\quad$ Problem statement I want to calculate the eigenvectors corresponding to the negative eigenvalues of an $8L^2 \times 8 L^2$ matrix ($L \sim 30 )$. Most of the ...
Lucas Freitas's user avatar
4 votes
0 answers
137 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 ...
1729taxi's user avatar
  • 777
4 votes
0 answers
226 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 ...
Matteo's user avatar
  • 283
4 votes
0 answers
244 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 ...
ala10's user avatar
  • 109
4 votes
0 answers
597 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 ...
Kagaratsch's user avatar
4 votes
0 answers
2k 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 ...
StarBucK's user avatar
  • 2,174
4 votes
1 answer
420 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 (...
Paul B. Slater's user avatar
4 votes
0 answers
178 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 ...
Paul B. Slater's user avatar
4 votes
0 answers
179 views

Generation of Space Representation of non-crystallographic Point Groups

In Mathematica the command FiniteGroupData[{"CrystallographicPointGroup",<group number>}, "SpaceRepresentation"] yields the space representation (...
Rainer's user avatar
  • 2,931
4 votes
0 answers
418 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 ...
Moo's user avatar
  • 3,388
3 votes
0 answers
140 views

Fast approximations of Lyapunov exponents in Mathematica

I have $x_i$ sampled IID from $\mathcal{D}$=Gaussian in $\mathbb{R}^d$ with 0 mean and diagonal covariance $H=\operatorname{diag}h$ and need to find the largest value of $\alpha$, such that the ...
Yaroslav Bulatov's user avatar
3 votes
0 answers
110 views

First few smallest eigenvalues of a large dense symmetric matrix

I construct a large (say 2000x2000) matrix M whose entries are real random variables drawn from a certain distribution. Most of these values will be nonzero, so <...
sonarventu's user avatar
3 votes
0 answers
111 views

Transpose[m,{1,1}]

According to the documentation, Transpose with a second argument {1,1} on a square matrix returns the diagonal of the matrix. ...
Whelp's user avatar
  • 1,725
3 votes
0 answers
90 views

Supplying a seed for an iterative method in LinearSolve

Just a quick question. Does anyone know if it is possible to supply a seed for the iterative methods in LinearSolve? I have a large sparse system, and even using some Krylov iterative solver, my ...
Filipe Miguel's user avatar
3 votes
0 answers
300 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 ...
fewfew4's user avatar
  • 131
3 votes
0 answers
123 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$ ...
Moo's user avatar
  • 3,388
3 votes
0 answers
332 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 ...
ayr's user avatar
  • 2,444
3 votes
0 answers
164 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. ...
Agnieszka's user avatar
  • 697
3 votes
0 answers
133 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}, ... , ...
user1058860's user avatar
3 votes
0 answers
92 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: ...
jjstankowicz's user avatar
3 votes
0 answers
509 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 ...
L.K.'s user avatar
  • 683
3 votes
0 answers
209 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 ...
nail's user avatar
  • 189

1
2 3 4 5 6