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.

learn more… | top users | synonyms

0
votes
1answer
45 views

Strange eigenvector behaviour for matrix with large numerical values

I'm trying to compute the eigenvectors of a matrix with large numerical values $$ \left( \begin{array}{ccccc} 0 & 1.\times 10^{18} & 100 \text{X} & 0 & 1.\times 10^{11} \text{X} \\ ...
6
votes
1answer
156 views

Strange performance of Outer

The following takes 0.07 seconds on my laptop. list1 = RandomReal[1.,1000000]; (Outer[Times, list1, RandomReal[1., 2]];) // AbsoluteTiming But this takes 1.2 ...
4
votes
3answers
176 views

How to plot real roots of complex polynomials avoiding branch cuts?

Lets say I have the following matrix: M={{1,3+E^(I x),-1+2I x},{3+E^(-I x),2,E^(3I x)},{-1-2I x,E^(-3I x),-2}}; $$ M=\begin{pmatrix} 1& 3+\mathrm e^{ix} &...
0
votes
1answer
192 views

Nonrectangular tensor encountered [closed]

I am trying to solve a system of equations which characteristic matrix: ...
3
votes
4answers
193 views

Pack Solve results into a vector

I am currently using a really easy function to get the eigenvectors of a corresponding eigenspace: ...
2
votes
0answers
127 views

How to solve lowest eigenvalue with Lanczos or Arnoldi algorithm? [closed]

By setting Method->Arnoldi in Eigensystem I was able to solve lowest eigenvalue and eigenstate of a large sparse matrix. ...
0
votes
1answer
122 views

Hermitian Matrix

From Derbyshire's Prime Obsession, I would like to get the Mathematica code to generate a Hermitian matrix for evaluation and display. $ 256 \times 256 $ would be nice. Random Normal distribution, ...
4
votes
0answers
146 views

strange timing result of LinearAlgebra`BLAS` in mathematica? [closed]

BLAS is short for "Basic Linear Algebra Subprograms". It is a famous collection of routines for doing linear algebra. I just know from Oleksandr R. that mma can directly call BLAS under the context "...
1
vote
2answers
103 views

Finding matrix given null space

Suppose I input a very large $n$ integer vectors and I wish to compute the matrix whose nullspace is spanned uniquely by these vectors. Is there an appropriate command/module to do this using ...
4
votes
2answers
150 views

How to be more efficient/faster with this MatrixExp-vector multiplication?

I am looking for expertise that helps to improve speed of the code below. First, a little bit of background: There is some system of differential equations $\dot{\vec{m}}(t)=S(t)\vec{m}(t)$. In order ...
0
votes
1answer
76 views

Minimization of linear combination of vectors

Suppose I have a vectors in $\mathbb{R}^{6}$. For example, take the vector $v = k(-2,2,4,6,2,2)$. I would like to find some $k$ with the constraint that the last two components are necessarily non-...
12
votes
2answers
4k views

Badly conditioned matrix (General::luc)

With some matrices, I am receiving the following message: ...
10
votes
0answers
123 views

Efficient solution of huge sparse linear system

I'm trying to improve efficiency of my code in which main task is a solution to huge (~$10^4\times 10^4$) but sparse linear system $$Ax=b$$ (In fact my aim is to solve nonlinear equations $F(x)=0$, ...
1
vote
0answers
50 views

Mapping over two indices with a condition

How can I use Map over two indices with a condition? I am trying to calculate second derivative of an eigenvalue, $\lambda_i(x)$, of $n \times n$ matrix $M(x)$ ...
9
votes
2answers
177 views

Does LinearSolve know that I gave it a Sparse lower triangular matrix?

Let $\mathbf L$ be a nonsingular numeric (non-symbolic) large, lower triangular sparse matrix. Let $\mathbf b$ be an appropriately sized vector. I want to solve $\mathbf L\mathbf x=\mathbf b$. ...
2
votes
1answer
110 views

Is there a good way to check, whether a small value produced numerically is a symbolic zero?

I have a complicated 4x4 matrix and need to know the eigenvalues. I expect a zero eigenvalue for physical reasons. Giving numerical values first gives me an eigenvalue of $\mathcal O(10^{-15})$. Now ...
7
votes
1answer
91 views

Count degrees of freedom of a polynomial

I want to count the independent degrees of freedom of a polynomial in three variables $(z_0,z_1,z_2)$. Therefore I take the coefficients of $f$ and compute the rank Jacobian with respect to the ...
6
votes
1answer
183 views

Eigenvector Concern in Large Fractal-Like Matrix (Possible Bug?)

This is my first post and I have quite a long question. Thanks to any who read. To start with, I have an operator m=Transpose[n] on a 7 dimensional vector space V where n is constructed as follows: <...
1
vote
0answers
63 views

Multivariate Path Construction using Sobol numbers

I am sharing my code,which I have tried to perform as per the instruction mentioned below. Please correct it so that I could get my output. Instruction: Use the first m dimensions of the Sobol vector ...
1
vote
1answer
57 views
7
votes
2answers
422 views

Finding a unitary matrix in Mathematica

I have the following equation : $ \tilde{B} = U B U^{\dagger} $ I also know both $ B $ and $ \tilde{B} $ , I just want to find the matrix U, that gives me the transformation. I tried using ...
18
votes
1answer
496 views

Sparse Cholesky Decomposition

I am working with square matrices with a special form, which for large rank ($> 100,000$) would be best stored and manipulated as a SparseArray. I believe that ...
8
votes
1answer
155 views

What values of $\delta$ and $\eta$ are being used in LatticeReduce?

The Lenstra–Lenstra–Lovász algorithm has a parameter $\delta$ with $1/4 < \delta < 1$, where roughly speaking the closer $\delta$ is to 1 the longer it takes, but the better basis reduction you ...
4
votes
1answer
128 views

Solving a linear equation in an abstract vector space

I have five abstract vectors a1,a2,a3,a4 and a5 that yield four other objects through abstract addition w1 = a1 + a2; w2 = a2 + a3; w3 = a3 + a4; w4 = a4 + a5; ...
12
votes
1answer
713 views

What type of solver does Mathematica use in LinearSolve

I have a question regarding linear equation solvers. For a specific 9-diagonal matrix, every method I tried in C++ (Gaus, GCC, BICGTAB) didn't work (even though they worked for other matrices). But in ...
1
vote
1answer
55 views

A bijection between a list of $n$ elements and the canonical basis of $\mathbb{R}^n$

I have some lists omega[i], i=0,1,...,15. And, e.g., omega[0] has four elements. I would like to define a function that maps omega[0][[i]] into $e_i$, where $e_1=\{1,0,0,0\}$, $e_2=\{0,1,0,0\}$... (...
21
votes
1answer
754 views

How to determine BLAS/LAPACK implementation used internally for numerical matrix operations?

Is there a command which reveals which implementation of BLAS and LAPACK are used in Mathematica's matrix operations such as Eigensystem? I asked a related question ...
0
votes
0answers
163 views

LU factorization

Basically what I need to do is this: Write an algorithm that finds the LU factorization of the following matrix. The algorithm should perform the necessary elementary row operations to reduce A to U, ...
2
votes
2answers
804 views

Determinant of a large matrix and solution of a linear equation

I am trying to solve a linear equation in x, where the equation is given by Det[M]==0. The M is a symmetric matrix (dimensions 47x47) with an element equal to x and all other elements are equal to ...
9
votes
3answers
290 views

How to speed up auxilary DoolittleDecomposite function?

The Doolittle Decomposition algorithm as below: $$A=LU$$ where $A= \begin{pmatrix} a_{11} & a_{12} & \cdots a_{1n}\\ a_{21} & a_{22} & \cdots a_{2n}\\ \vdots & \vdots & \vdots ...
4
votes
1answer
135 views

Is it possible to find the vectors that span the nullspace of a large, symbolic matrix

My problem is composed of two parts, a large sparse matrix $L$ ($m$x$n$ where $m=10^3$, and $n=10^5$, with $10^7$ non-zero complex numbers), and a dense, symbolic matrix $F$ ($m$x$m$ where $m=10^3$), ...
4
votes
2answers
188 views

How to solve a linear system by LinearSolve when the variables are duplicate?

Given that I have a set of equations about varible $x_0,x_1,\cdots,x_n$, which own the following style: $ \left( \begin{array}{cccccccc} \frac{1}{6} & \frac{2}{3} & \frac{1}{6} & 0 & ...
6
votes
1answer
566 views

Is there any faster way than Eigensystem to diagonalize a Hermitian matrix?

Is there any faster way than using Eigensystem to diagonalize (get all the eigenvectors and eigenvalues) of a Hermitian (self-adjoint) matrix? That would be ...
11
votes
1answer
409 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. However,...
17
votes
1answer
313 views

Simple Matrix multiplication takes very long

Bug introduced in 10.1.0 and fixed in 10.3.0 I came across some strange behaviour during a computation involving matrices with symbolic values. It is reproduced below. Multiplying a random 30x30 ...
2
votes
3answers
314 views

Eigenvalues of a large matrix

I want to compute the eigenvalues (and later the corresponding eigenvectors) of an $n\times n$ Hermitian matrix. For this I use {evs, vecs} = Eigensystem[matrix] or ...
3
votes
2answers
127 views

How to make the determinant formula visible even in cases when det=0

When I compute the determinant analytically in Mathematica, I do it with Det[{{a, b}, {c, d}}] which gives the output ...
6
votes
0answers
74 views

How to instruct MatrixLog to work with singular matrices?

How to instruct MatrixLog to work with singular matrices by ignoring the zero eigenvalues (thus only acting on a subspace orthogonal to the matrix kernel)? I'm ...
0
votes
0answers
97 views

Absurd solution by LinearSolve

I am trying to find curve that passes through all the data points.To do this i am doing interpolation using LinearSolve. No. of equations vary from 1000 to 3000. LinearSolve gives me values of ...
0
votes
1answer
325 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 ...
2
votes
1answer
492 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 ...
5
votes
1answer
116 views

Evaluating only one column of a $m \times m$ matrix without evaluating the matrix itself

Suppose I have f[x_] := SparseArray[{someRules}, {m, m}]; g[x_] := MatrixPower[f[x], k]; Would it be possible to evaluate only the $n$-th column ($n\neq m$) of <...
1
vote
1answer
88 views

How to plot the field of values of a matrix

For a given matrix A (let's say of dimension 2 to keep it simple), I need to plot in the complex plane its field of values. The field of values of a matrix is defined as the set $\{\langle{Ax, x}\...
3
votes
0answers
52 views

Does NDSolve automatically simplify the system of equations for Hermitian matices?

I am currently starting to solve numerically a system of differential equations like this: $\dot{A}(t)=S(A)A(t)$ Here, the matrices are of dimension $d\times d$. $S(A)$ is some superoperator that ...
7
votes
0answers
141 views

Examples of using Mathematica to solve matrix equations symbolically

Suppose we want to solve a linear system like $$\left\lbrack\begin{array}{cc}M& S\\ -S^\mathrm{T}&0 \end{array} \right\rbrack \left\lbrack \begin{array}{c} x\\y\end{array}\right\rbrack = \...
4
votes
0answers
121 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 ...
3
votes
1answer
75 views

Reduce set of symbolic equations to linearly independent subset

Given a set of symbolic equations $f_i(x_1,x_2,...,x_n)=0$ in several variables, for example f1=x+y-z; f2=x-y+z; f3=3x-y+z; I would like to apply a function <...
9
votes
1answer
155 views

Sorting eigenvectors according to its projection

The problem I'm trying to calculate the eigenvalues and eigenvectors of a matrix that depends on a parameter x. As x changes, I ...
1
vote
0answers
66 views

“Reduce” works fine for a non-linear system with 9 equations, but cannot solve it if 10 equations. Any ways to improve the code?

I am trying to solve a class of problems, which are basically about a solution to a system of non-linear equations subject to the constraint that some subset of solutions must be non-decreasing. I ...