Questions on the linear algebra functionality of Mathematica.

learn more… | top users | synonyms

6
votes
2answers
311 views

Given a set of four linearly independent vectors, how can I compute two additional linearly independent vectors?

I have four linearly independent vectors: $$ \left( \begin{array}{c} \left\{\frac{1}{2},\frac{1}{2},0,0,0,0\right\} \\ \end{array} \right)$$ $$ \left( \begin{array}{c} \left\{\frac{1}{2 ...
2
votes
0answers
40 views

Parallel evaluation of symbolic matrix eigenvalues

I'm trying to find eigenvalues of symbolic hermitian 40x40 block matrix. It is made from 20 2x2 matrices like this: ArrayFlatten[Table[M[m,n],{m,1,20},{n,1,20}]] ...
2
votes
0answers
35 views

Approximate inverse of large sparse matrix with small diagonal element

I need to find inverse of a large sparse matrix with small diagonal element. I follow this question - Is there any way to obtain an approximate inverse for very large sparse matrices? and try to use ...
1
vote
0answers
42 views

How to remove parts of an expression

I have an expression where terms Transpose[R].R appear. R is a matrix with the property Transpose[R].R=IdentityMatrix[3]. How ...
5
votes
1answer
97 views

Distribute transpose on matrix multiplication

I need to do the following: Transpose[A.(B+C)]=Transpose[B].Transpose[A]+Transpose[C].Transpose[A] How should I do this in mathematica? So far mathematica does ...
0
votes
0answers
4 views

What is X if position value is between 0 and 500 and I need it has -1 to 1? [migrated]

let's say I have a line from 0 to 500, and I'd like to know in which position a point is from -1 to 1, where centre is 250, how can I do that ? Any suggestions ? Thanks! So far this is what I've ...
6
votes
2answers
180 views

Can't find the eigenvectors of a simple 2x2 matrix

Bug introduced in 8.0 or earlier and persisting through 10.2.0 Why can't Mathematica find the eigenvectors of this matrix? ...
1
vote
1answer
62 views

Transposition of state space form of a transfer function

How can I transpose the output of state space model in Mathematica? trying the following code would transpose the top right symbol s instead of the matrices. ...
0
votes
1answer
70 views

Find all degenerate eigenvalues of a cubic equation

I have an equation that is cubic in w. The three solutions correspond to bands in a bandstructure, and are a function of wavevector ...
1
vote
1answer
67 views

Handle matrices and vectors with general dimension

I have a matrix of $n \times n$ dimension: $$ K - \omega^2 M = \begin{pmatrix} 2\omega_0^2 - \omega^2 & - \omega_0^2 & 0 & \cdots & 0 \\ - \omega_0^2 & 2\omega_0^2 - \omega^2 ...
0
votes
0answers
39 views

Signage of eigenvector [duplicate]

I am comparing eigenvectors generated from mathematica to matllab. It seems signage of eigenvector generated from Mathematica is opposite from what is generated from matlab. Can anybody review and ...
1
vote
0answers
34 views

Diagonal times dense matrix, high precision

I have a fixed dense matrix M of high precision numbers, say 40 by 40 and precision 40. Then I have a variable vector v of the ...
15
votes
0answers
188 views

Simple Matrix multiplication takes very long

Bug introduced in 10.1.0 I came across some strange behaviour during a computation involving matrices with symbolic values. It is reproduced below. Multiplying a random 30x30 array with symbolic ...
1
vote
0answers
28 views

Function to be used for spectral decompostion of matrix [duplicate]

Can anybody please help in finding out what is best way to do spectral decomposition (or Eigen decomposition) of the matrix. The details of Eigen decomposition can be found in attached link 1. ...
1
vote
0answers
47 views
2
votes
0answers
62 views

MatrixRank of a large but sparse matrix

I want to find the rank of a very sparse, quite rectangular matrix mat, but I'm running out of RAM (I have 16 GB) if I try to use ...
0
votes
0answers
48 views

Compilable function with the functionality of SingularValueList

I'm doing something that involves finding the singular values of a lot of matrices. Basically I need to find singular values of $n$ matrices of dimension $n\times n$, where $n$ is as large as ...
1
vote
1answer
84 views

Matrix multiplication for higher dimensional matrices [duplicate]

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 & ...
2
votes
1answer
70 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 ...
0
votes
0answers
52 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
59 views

Multiplying three matrices does not give expected form [closed]

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
32 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
44 views

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

I have a sparse matrix, L, and need to calculate its exponential, MatrixExp[L t], where t is ...
1
vote
1answer
54 views

Mathematica computes wrong eigenvectors? [closed]

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
105 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 ...
1
vote
0answers
40 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 ...
0
votes
0answers
51 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
110 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 ...
3
votes
1answer
84 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
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
145 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 ...
0
votes
0answers
49 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
173 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: ...
1
vote
1answer
144 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 ...
0
votes
0answers
46 views

CharacteristicPolynomial returns 0

I have the following matrix. ...
2
votes
2answers
108 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 ...
0
votes
0answers
39 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
170 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 ...
1
vote
1answer
101 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
133 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
62 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
54 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
74 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" ...
1
vote
3answers
211 views

Using mathematica to visualise solution of vectors and planes

Im struggling with a question I'm my math book and I wanted to use mathematica to visualise it for me, the problem is that I don't even get something remotely similar to what I was expecting. How here ...
1
vote
2answers
105 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 ...
4
votes
2answers
66 views

Using LeviCivitaTensor

I have 2 questions about using LeviCivitaTensor, based on the following session: The signs for the cross product seems to come out "opposite" of what I expected. Why is that? Did I miss anything? ...
1
vote
1answer
65 views

Eigenvectors with imaginary part

I am working on the following: ...
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 ...
2
votes
2answers
181 views

Are there any good mass row/column swapping functions for matrices?

I have the following matrix Keeping the 20 row and 20 column fixed (so the 21st rows and columns because I started at 0)...how do I push each row and column back one spot? I need to push the 0th row ...