Questions on the linear algebra functionality of Mathematica.

learn more… | top users | synonyms

1
vote
1answer
59 views

Expand a product of operators

Lets suppose I have a family of operators $f_i$, and unknown c-numbers $a,b,c$. I want to expand such products: $(f_1+f_2+c)(f_3+f_2+b)$ into $b c+b f_2+b f_1+c f_2+c f_3+f_2^2+f_1 f_2+f_2 f_3+f_1 ...
4
votes
1answer
228 views

How to draw a tropical surface?

By definition, a tropical surface in $\mathbb R^3$ is the set of points $(x,y,z)$ where the maximum $f=\max(f_1,f_2,\dots,f_n)$ is attained at least twice, here $f_i$ stand for some linear functions ...
0
votes
1answer
47 views

Matrix multiplication for higher dimensional matrices

I have a matrix like this (myb1): I would like to get the matrix multiplication of each of the submatrix to itself. For example the first 2x2 matrix $\begin{bmatrix}1 & 2\\1 & ...
1
vote
2answers
94 views

Are variables always assumed to be real in Jordan Decomposition?

If you give the Input in Mathematica 9.0 (Student Edition) JordanDecomposition /@ ({{1, #}, {#, -1}} & /@ {i, I}) Mathematica gives you two completely ...
0
votes
0answers
45 views

Is Eigensystem::eivin message a bug?

I noticed that in the question Request for clarification of Eigensystem::eivn message the error message Eigensystem::eivn: Incorrect number 2 of eigenvectors for eigenvalue ...
1
vote
1answer
53 views

Multiplying three matrices does not give expected form [on hold]

I'm having lectures on analytic geometry. I've learned that there is an associated matrix multiplication for a quadratic form: $\quad \quad \left( \begin{array}{ccc} x & y & 1 \\ \end{array} ...
2
votes
0answers
30 views

How to get simultaneous eigenvectors of commuting matrices? [duplicate]

So let's say there are two square matrices A and B that commute (AB-BA=0). This implies that there must exist some complete set of vectors that are eigenvectors of both A and B. Is there any way to ...
1
vote
0answers
43 views

Does a matrix need to be rationalized when calculating MatrixExp? [on hold]

I have a sparse matrix, L, and need to calculate its exponential, MatrixExp[L t], where t is ...
0
votes
0answers
53 views

OLS Estimation - Computational results vs. calculation by hand [on hold]

I calculated the OLS estimators for a data set by hand using $$\hat\beta=(X^TX)^{-1}X^Ty$$ If I check my results with Mathematica I get different results. I'm quite sure that I didn't make any ...
1
vote
1answer
54 views

Mathematica computes wrong eigenvectors? [on hold]

I have a matrix M = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, b}, {0, 0, -b, 0}} that I want to diagonalize. So far, I always used the following and it worked, but ...
0
votes
1answer
83 views

Traces of products of Gell-Mann matrices in FeynCalc

I am working on an assignment in FeynCalc and I need to evaluate traces of products of two commutators of Gell-Mann (SU(3)) matrices, i.e. I need to calculate the ...
0
votes
0answers
13 views

Symbol in Linear Algebra [migrated]

I'm newbie in linear algebra and I do not understand the symbol that is selected with blue color. What does this symbol means? What is the purpose to use this symbol? What context is this symbol ...
1
vote
0answers
39 views

reset the value of a variable [closed]

Folks, I have a problem in populating a matrix without overriding the values. After performing computations for various values for j, I want to store these values in following matrix. Here is the ...
3
votes
1answer
80 views

Solve an eigensystem faster and eliminate Root[…] from the solution

I have a symbolic, 2-parameter, 8x8 matrix to solve, but Mathematica takes something like 20 minutes to solve it and returns a very large output containing expressions of the form ...
0
votes
0answers
47 views

Null space of a stochastic matrix [closed]

I want to calculate NullSpace of a matrix m - IdentityMatrix[n]. Normally I would do it with ...
4
votes
2answers
79 views

Pauli matrices — simplify expressions without printing out the raw matrix

Squaring a Pauli matrix results in the identity matrix. These bits of documentation (weakly, to a Mathematica-newbie like me) imply that some algebraic identities that link the Pauli matrices ...
2
votes
2answers
1k views

Is there a built-in function to find the adjoint of a matrix?

I've been looking for a function that helps me get the adjoint matrix o a given one, I found that you can get the cofactors of a matrix but only by using the "Combinatorica" package, which I couldn't ...
8
votes
1answer
281 views

Is it possible to implement symbolic sub matrices?

The accepted answer in the question Symbolic matrices in Mathematica with unknown dimensions provides a functionality to create symbolic matrices which behave pretty much as the name suggests. ...
9
votes
1answer
396 views

How get eigenvectors without phase jump?

I'm using Eigenvectors to get the eigenvectors for some matrixes, but the eigenvectors seems to have some phase jump. Here is an example: Say we have a 2 by 2 ...
0
votes
0answers
33 views

Why is there a different eigenvector for the same matrix? [duplicate]

I have a matrix that depends on two variables x and y. Matrix[x,y] When I make x=-.25*(1 - 1/3) + .25*(1/3) + .25 y=0 I ...
1
vote
1answer
127 views

Efficient algorithm to generate a basis for exact diagonalization

The problem is described as follows: I need to generate a basis(matrix) in lexicographic order. For two different basis vector $\{n_1,n_2,\cdots,n_M\}$ and $\{t_1,t_2,\cdots,t_M\}$, there must exist ...
7
votes
5answers
1k views

Check if a matrix is Positive Semidefinite

I have a question concerning the check whether a given matrix is positive semidefinite or not. In mathematica the function PositiveDefiniteMatrixQ[m] tells me ...
12
votes
2answers
872 views

Find the eigenvector associated with the smallest eigenvalue, not smallest in magnitude

I am trying to find the eigenvector of a $20000 \times 20000$ sparse matrix associated with the smallest eigenvalue. I realized that the smallest eigenvalue might be negative; for example, if the ...
13
votes
1answer
407 views

Why is MainEvaluate being used when LinearSolve can be compiled?

According to this question LinearSolve can be compiled. However, CompilePrint[] shows a call to ...
0
votes
0answers
44 views

Normalized, symbolic Eigenvectors without abs(), sign() etc

I'm trying to compute the normalized eigenvectors of a matrix M = {{0, 0, 0, 0}, {0, 0, M5, 0}, {0, M5, 0, M4}, {0, 0, M4, 0}} If I try Normalize ...
4
votes
1answer
171 views

Eigenvalues of matrix not giving imaginary parts

This might be a very simple problem, but I can't seem to figure out why I am getting this. I am trying to find the eigenvalues of the matrix: ...
10
votes
2answers
3k views

Badly conditioned matrix (General::luc)

With some matrices, I am receiving the following message: ...
2
votes
1answer
387 views

Matrix exponential MatrixExp[] vs Sum[MatrixPower[]] doesn't match?

I might be an idiot, but I cannot get the manual expansion of $e^{At}$ to match the MatrixExp[A t] result. For example, I have the following: ...
2
votes
2answers
105 views

Reordering numerically calculated eigenvalues assuming smooth dependence on a parameter

As was discussed in a different question here on SE (link) if you compute eigenvalues numerically of a matrix which depends on a parameter y, the resulting plot of ...
27
votes
1answer
3k views

Simplify matrix algebra

I'm trying to simplify some matrix linear algebra, for example, simplify $$\big(a1\times(A1\cdot A2)\big)\cdot\Big(a2\times A3\cdot A4+(a3\times A5)\cdot(a4\times A6)\Big)^{T}$$ where lower case ...
5
votes
1answer
481 views

Generating random symmetric matrix

Suppose first that I want to generate a matrix whose elements are independent and identically distributed (i.i.d.) with distribution dist. This is easy: ...
1
vote
1answer
140 views

Transform linear system into a matrix form

I have a system of linear equations in variables $A_n$ of form: $$ \sum _{k=-K}^K h_k A_{n-k} J_{n-k}\left(\frac{(1-i) \text{$\eta $Sqrt}(n-k)}{\sqrt{2}}\right)+A_n\left(\frac{(1-i) \eta ...
30
votes
2answers
787 views

eigenvector bug?

Bug introduced in 7.0.1 or earlier and fixed in 10.0.0 I have a fairly simple $3\times3$ complex matrix, $$ M=\left( \begin{array}{ccc} \frac{7}{2}-\frac{i}{2} & -1+i & \frac{1}{2}+\frac{5 ...
0
votes
3answers
151 views

Calculating eigenvalues of a large matrix takes a long time

I have a tridiagonal matrix (1000×1000) with each element equal to $1$ except {n,n}=2. It takes 8 hours to give me the eigenvalues?!! Here is the code I used: ...
1
vote
2answers
69 views

Create a random 2×2 matrix with a repeated eigenvalue and single eigenvector

Does anyone have a good technique for creating a random $2\times 2$ matrix that has one eigenvalue of multiplicity two, but only a single eigenvector? And more generally, has anyone written a ...
5
votes
2answers
652 views

How to plot several functions without jumping? (multiple eigenvalues of a system as functions of 2 parameters)

I've been working on this research problem for months with some success by no global/proper solution to the problem. So I have square, Hermitian matrices of various sizes ($8,20,38$ dimensions) with ...
4
votes
1answer
140 views

Proving positive definiteness or semi-definiteness of a matrix

I have the following 4x4 real symmetric matrix: $K=\begin{bmatrix}3-3w & -\frac{4}{3}+a+2w & \frac{5}{12}+b-\frac{w}{2} & 0\\ -\frac{4}{3}+a+2w & -1-6a-3x & ...
3
votes
1answer
260 views

Principal Components - how to obtain linear transformations?

I have a list "xlsf" with 6 columns and 1200 rows for PCA analysis. The PrincipalComponents[xlsf] gives the following: "The principal components of matrix are ...
4
votes
3answers
209 views

What is the best way to write a polynomial in the Bernstein basis?

The Bernstein basis of polynomials of degree $n$ is the set of polynomials of the form $$\binom{n}{k} t^{n-k}(1-t)^k$$ where $0 \leq k \leq n$. What is the best way to transform a given polynomial ...
8
votes
2answers
540 views

Is there any fast way to solve a quadratic matrix equation in Mathematica approximately?

Let the square nonsingular matrix $M$ is a given convergent matrix. What are the best scalar values for $\alpha$ and $\beta$ (in the real numbers domain), at which the following quadratic matrix ...
0
votes
0answers
44 views
0
votes
0answers
37 views

Can LinearSolve use Parallelize and WorkingPrecision in computation

I am looking for a two things while calculating the large array matrix equation: 1) To increase the precision in simple LinearSolve[] function 2) To find a way to parallelize the computation on all ...
8
votes
1answer
168 views

Possible Method for MatrixExp

Well, probably a hard question, but I think it's better to cry out loud :). I noticed that MatrixExp owns Method option when ...
2
votes
1answer
115 views

Maximizing the number of zero entries in a matrix

I have a matrix with a bunch of parameters in its entries, they all come in different combinations in different places of the matrix. I can post the matrix itself if requested, but I think what I mean ...
0
votes
1answer
73 views

Mathematica Lattice Reduce Command

I'm going through a very old copy of "Mathematica: A System for Doing Mathematics by Computer" for self practice. I'm on chapter 3, and ran into the LatticeReduce ...
1
vote
1answer
99 views

Extract coefficient matrix $A$ from expression $f(x)$

I have expression: $$f(x)=\sum_{i=0}^{K-1}\sum_{j=0}^{N-1}a_{i,j}e^{ix}x^j.$$ I want to extract coefficient matrix $A$ from expression $f(x)$ where $$A=\left( \begin{array}{ccccc} a_{0,0}& ...
3
votes
1answer
128 views

$\mathbf L\mathbf D\mathbf L^\top$ Cholesky decomposition

Mathematica can do a Cholesky decomposition $\mathbf A = \mathbf L\mathbf L^\top$, but how do I do a LDL decomposition $\mathbf A = \mathbf L\mathbf D\mathbf L^\top$, with $\mathbf L$ being a unit ...
2
votes
1answer
61 views

Algebraic Manipulations with Indices

I am absolutely new to Mathematica, but I've heard it is a pretty powerful tool for symbolic calculations. My problem (stated generally): I have three dimensional array. I define a symbolic operator ...
4
votes
1answer
52 views

Finding maximal subset of linearly independent functions

I've got a set of functions in one variable. I wish to find the basis of the corresponding spanning set Example: $$\left\{1,\frac{1}{1-\sqrt{x}},\frac{1}{1-x},\frac{\sqrt{x}}{1-x}\right\}$$ may ...
3
votes
0answers
68 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" ...