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.

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

Exploit bilinearity of KroneckerProduct symbolic calculations

Mathematica recognizes the bilinearity of the trace and the Kronecker product, as well as $Tr(A\otimes B)=Tr(A)Tr(B)$. But I have issues trying to implement this in symbolic calculations: Kronecker ...
1
vote
0answers
81 views

Determinant of 11x11 Matrix consumes immense amount of memory

I'm trying to take the determinant of an 11x11 matrix, constructed out of some functions I've defined ...
2
votes
1answer
44 views

Analytic calculation of the Pfaffian using sqrt

I'm trying to calculate the Pfaffian of a matrix. In general, it is given by, $$Pf(A) = \sqrt{\det(A)}.$$ In my case, $A$ is a matrix of $8\times8$. When I calculate the determinant of $A$, it yields ...
0
votes
1answer
68 views

How to show Timing command with more decimals?

I'm trying to compare the time that it takes to use the command LinearSolve when solving matrix(with random integers from 3 to 150 in each position) that are 10x10,20x20,30x30, ... , 150x150 for the ...
1
vote
2answers
96 views

Eigenvectors inside a maniupulate function

I am trying to make a physics application and it requires that the eigenvectors be taken for a 3x3 matrix. It is my intention that Mathematica never have to deal with the matrices symbolically. ...
1
vote
0answers
113 views

Fast computation of eigenvalues of large Hermitian matrices

I need to compute numerically all the eigenvalues of roughly $500$ large Hermitian matrices, $(5 \times 10^5) \times (5 \times 10^5)$). At best, I can speed up my computation such that it takes ...
0
votes
0answers
22 views

Doesn't print the Inverse of a Matrix [duplicate]

I want to calculate and print the inverse of a Matrix. But it calculates it but doesn't show the Output. What can be the problem here?
2
votes
1answer
42 views

Square root of a matrix with complex elements

How to compute the square root of the matrix Rho = {{Wxx, Wxy, Wxz}, {Wyx, Wyy, Wyz}, {Wzx, Wzy, Wzz}} if not all of its elements are real?
7
votes
1answer
137 views

Efficiently calculating matrix exponential of a recursively generated matrix

Given a matrix $A$ of size $N \times N$, I want to evaluate the function \begin{equation} F(t) = |\operatorname{Tr}(\exp(-i A t))|^2 \end{equation} as a function of $t$. Here, $A[n]$ is constructed ...
1
vote
1answer
38 views

How to check positive linear dependence of vectors/matrices?

Suppose I have a bunch of vectors or matrices $v,v_1,v_2,\ldots, v_n$, living in an $N$ dimensional linear space. How to check (using mathematica) if $v$ is positively dependent on the set $\{v_1,v_2,\...
0
votes
1answer
63 views

Finding an eigenvector for a specific eigenvalue of a symbolic matrix

The relevant matrix is $$M=\left( \begin{matrix} p^3+\frac{1}{\sqrt{3}}p^8 & p^1-ip^2 & p^4-ip^5 \\ p^1 +i p^2 & -p^3 + \frac{1}{\sqrt{3}}p^8 & p^6-ip^7\\ p^4+i p^5 & p^6+i p^7 &...
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.
4
votes
2answers
61 views

Undesired complex number in the square root

I am trying to solve the eigenvalues of a hamiltonian The code I used is typed below. ...
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 ...
1
vote
0answers
58 views

Interpolation of a eigenvector of a matrix and its derivative

I have a matrix with two variables and the condition is I can't evaluate it's eigenvectors analytically. I want to interpolate its numerical eigenvectors and most importantly get a derivative of them ...
2
votes
2answers
598 views

How to obtain a Symplectic 4×4 matrix?

I have a problem in obtaining a $2n \times 2n$ Symplectic matrix $T$, with $n=2$. I couldn't find a direct command in Mathematica to achieve this. Conditions: ...
1
vote
0answers
73 views

Defining commutations rules over arbitrary matrix

I'm working with spin connections with Dirac gamma matrix commutator (I know, mathematica has specific ways to work with it), and I need to define the following rules; $[\gamma_{0},\gamma_{i}]= 2 \...
0
votes
1answer
105 views

An example of symmetric, real entry matrix with non-real eigenvalues, according to Mathematica. Is this a bug?

The following matrix is symmetric and all entries are real, ...
5
votes
1answer
1k views

Use of Strassen's algorithm

Strassen's algorithm is an algorithm for matrix multiplication that is asymptotically faster than the naive one. In practice, the matrices involved have to be quite large before Strassen's algorithm ...
2
votes
1answer
137 views

sorting eigenvectors of a final combined matrix

I have two matrices m1 and m2 as below: ...
1
vote
1answer
214 views

Save and use results of LinearSolve for symbolic large system (28 equations)

I need to solve system of 28 linear equations, for 28 variables, symbolicly. The coefficient matrix is sparse, and is composed from 8 parameters (symbols). After that I need to use 6 of the variables ...
4
votes
1answer
455 views

Sporadic bug in Mathematica 7.01.0 MatrixPower and/or Eigensystem functions on floating-point symmetric matrices with repeated eigenvalues

Note: From the comments submitted below by other StackExchange users it appears that this apparent bug was fixed sometime after version 7.0.1. I asked a vague variant of this question a few days ago, ...
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, ...
1
vote
1answer
27 views

Simplify expression with abstract matrices

After defining a commutator function Commutator[X_, Y_] := X.Y - Y.X; I would like to be able to simplify abstract matrix algebra expressions such as ...
10
votes
1answer
133 views

Extract ViewVertical from ViewMatrix

Given a ViewMatrix setting of the form {t, p}, how can one determine the ViewVertical? Let'...
2
votes
1answer
1k views

Solving this system of equations produces an error message about badly conditioned matrix

I want to determine a balance distribution. Ü = {{0.4, 0.2, 0.3}, {0.3, 0.5, 0.2}, {0.3, 0.3, 0.5}}; and ...
3
votes
1answer
90 views

Solving $\det{(A+\epsilon B)}=0$ for large, symmetric and dense $A$ and $B$

In an algorithm I am writing, I need to solve the equation $$ \det{(A+\epsilon B)} = 0, $$ for the smallest value of $\epsilon$, given large ($n$x$n$ ideally up to 150x150), dense and symmetric A ...
0
votes
1answer
140 views

Det, MatrixRank and Eigenvalues

I consider myself to be an inexperienced Mathematica user so maybe someone could point out what am I doing wrong. In short, here is what I want to get: suppose that there is a matrix of dimension $ N ...
13
votes
2answers
1k views

How to efficiently compute the partial trace of a matrix?

How can we efficiently compute the partial trace of a matrix with Mathematica? There is some Mathematica code around to compute this, but most of it seems outdates and not very well written. See for ...
61
votes
4answers
16k views

Can Mathematica do symbolic linear algebra?

For instance, is there some way I can say "let A and B be arbitrary real $m\times n$ and $k\times m$ matrices, Simplify[Transpose[Transpose[A].Transpose[B]]]" and ...
8
votes
3answers
1k views

Build a Companion Matrix of a Polynomial?

The eigenvalues of a square matrix $A$ are the roots of its characteristic polynomial $\chi(\lambda)$. Conversely, if we have a monic polynomial $p(\lambda)=a_0 + a_1 \lambda + \cdots + a_{n-1}\lambda^...
5
votes
2answers
1k views

Simplify matrix into an upper triangular matrix

I have a tridiagonal matrix that I am trying to simplify into an upper triangular matrix using Mathematica, so I can use back substitution and solve my linear system. I have found the command ...
2
votes
1answer
138 views

Using ZeroTest method with RowReduce

My goal is to solve this system: \begin{align*} x_1+2x_2+2x_3+2x_4&=a\\ 2x_1+4x_2+6x_3+8x_4&=b\\ 3x_1+6x_2+8x_3+10x_4&=c \end{align*} Setting up the augmented matrix and using RowReduce, ...
1
vote
1answer
332 views

How to track row swap in Gaussian elimination?

How do I track which rows were swapped in the Gaussian elimination using RowReduce? I am doing metabolic control analysis on a mathematical of the energy ...
4
votes
1answer
93 views

How to collect the negative eigenvalues of a matrix?

I want to plot Sum[E[i]] verseus t where E[i] are the negative eigenvalues of the matrix: <...
5
votes
1answer
225 views

Finding the orthogonal diagonalizing similarity of a symmetric matrix

I'm aware that there are some questions similar to this here, but none that could solve my problem. So, I have to diagonalize a symmetric symbolic matrix $m$ (to be seen below) and obtain the ...
6
votes
2answers
144 views

Inconsistency in eigenvalues of matrices in a specific form (sparse & non-Hermitian)

Suppose one has a non-Hermitian sparse matrix defined as: ...
1
vote
2answers
359 views

What is the fastest way to obtain the eigenvalues of a Wishart matrix?

I would like a fast method of creating a sample of random numbers which corresponds to the eigenvalues of a Wishart matrix: For M>N the eigenvalues \lambda_i are given by the jpd Where $K_N$ is a ...
2
votes
1answer
261 views

Returning the matrix which represents the row reductions in Gauss-Jordan Elimination

I have a square matrix A. I want to row reduce it so it is in Upper Triangular form. When row reducing you perform operations which can also be represented with matrices that are just multiplied to ...
4
votes
1answer
95 views

Partial transpose of 8x8 density matrix?

Please could someone help me to knew how to compute the partial partial-transposition of the following matrix? mat = Table[ρ[i, j], {i, 1, 8}, {j, 1, 8}]
5
votes
1answer
1k views

Compute numeric Pfaffians of matrices efficiently?

I have the following code, that computes the Pfaffian of an even dimensional anti-symmetric matrix via direct row expansion: ...
6
votes
1answer
77 views

How to use RiccatiSolve with symbolic matrix

According to the RiccatiSolve documentation the Eigensystem method can apply to symbolic matrices. However, I can not get it to ...
1
vote
0answers
57 views

Finding eigenvalues of a large ( >1000 x 1000) matrix accurately

I'm doing a spectral method-based eigenvalue problem where I create a matrix, A, of size (nr+1)(nz+1)(2nf+1) where nr,nz,nf are integers, composed of a diagonal of (2nf+1) submatrices of size (nr+1)*(...
1
vote
3answers
603 views

How to transform symmetric matrix to diagonal? [duplicate]

I wonder whether there is a way how to transform symmetric matrix to diagonal matrix using symetretric transformation. I could not find any function that performs symmetric transformation in ...
3
votes
2answers
152 views

editing entries of a sparse array + sparse Smith normal form

Why does the following code ...
0
votes
1answer
41 views

Strange numerical values of Eigenvectors

When I calculate Eigenvalues and Eigenvector by using: Eigensystem[{{3.8, 21, 21}, {0.3, 3.5, 2.5}, {-0.8, -6.2, -5.2}}] I get the following result: ...
1
vote
0answers
37 views

What does Eigensystem::geinsl1 mean (a solution for the generalized eigenproblem may be incorrect)?

I'm trying to solve a generalized eigenvalue problem and ran across a warning Eigensystem::geinsl1: Warning: a solution for the generalized eigenproblem may be incorrect. Here's a minimal working ...
4
votes
3answers
466 views

It seems Eigensystem[m] returns vectors that are not eigenvectors

I am new to here so please forgive me if I do something wrong carelessly. I have faced a serious problem in eigensystem method, or more particular, eigenvalue. It seems that the following codes that ...
1
vote
1answer
23 views

No Plot output for function using large output from LinearSolve

I am using least squares approximation to fit the data in Y. However when I attempt to plot the the curve g[x] using the results from LinearSolve, there is no plot output. ...
1
vote
2answers
93 views

Why the difference in the results of MatrixFunction between Mathematica and Maple?

Mastering my Mathematica skills, I consider an example m = {{1., 1., 3.}, {0., 1., 0.}, {0., 1.0*I, 2.}}; cosm = MatrixFunction[Cos, m] $$\left( \begin{array}{...

1
2 3 4 5
23