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

5
votes
3answers
1k 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: ...
13
votes
2answers
537 views

more numerically accurate inverse matrix

I encountered the following matrix mat = {{2, 2.161209223472559` + 1.682941969615793` I}, {2.161209223472559` - 1.682941969615793` I, 2}} and ...
1
vote
2answers
132 views

LUDecomposition for non-square matrices

How do we go about finding the LUDecomposition for non-square matrices. When i try to input the standard LUDecomposition ...
7
votes
1answer
224 views

How write a new MatrixRank feature with symbolic computation

The current MatrixRank is a slight foolish without any capacity of symbolic computation ,feature of Mathematica, like this: ...
0
votes
1answer
41 views

Tolerance of PositiveSemidefiniteMatrixQ [closed]

I believe the following should be True but returns False for me: ...
0
votes
1answer
106 views

Generate random Hermitian matrices [duplicate]

I want to generate random Hermitian matrices. For now, random Hermitian matrices with size 2 are obvious to construct. But elegant methods for higher dimension would be nice! Are there methods besides ...
0
votes
0answers
34 views

Handling a matrix with components greater than machine precision

I have four quantities stemming from a 4th order differential equation. I can represent these as a vector which is a product of a 4X4 matrix $$ M=\left\{v,\frac{\partial v}{\partial x},\frac{\partial ...
0
votes
0answers
69 views
2
votes
1answer
59 views

Eigenvalues are not the same in the special case

I have this matrix: h = { {e1, 2, x}, {2, 2, x}, {x, x, 2} }; I want to calculate the eigenvalues and then set x equal to zero: ...
2
votes
3answers
144 views

What is the correct way to perform the Gram-Schmidt process?

Im trying to do a simple processing in Mathematica. My original code was in Matlab. Part of the computation is Gram-Schmidt process, which is an iterative calculation. Every vector is changed ...
-2
votes
1answer
78 views

How can I calculate $(y - A \,x)^{T}(y -A\,x)$ symbolically? [closed]

Given that $x$ and $y$ are column vectors and $A$ is a matrix, I figured out the result $y^{T}y-2y^{T}Ax +x^{T}A^{T}A\,x$ I want to use Mathematica to make such calculations. how do I enter them into ...
20
votes
2answers
342 views

How to know the usage of undocumented function like LinearAlgebra`BLAS?

BLAS is not documented in mathematica. Using ?LinearAlgebra`BLAS`* gives But None of the function has a detailed usage information Click any of the ...
2
votes
2answers
72 views

Reliably computing the signature of a matrix with small eigenvalues

When asked to compute the eigenvalues of the following matrix ...
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
155 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
170 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
168 views

Nonrectangular tensor encountered [closed]

I am trying to solve a system of equations which characteristic matrix: ...
3
votes
4answers
191 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
110 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
113 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
97 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
146 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
70 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 ...
12
votes
2answers
4k views

Badly conditioned matrix (General::luc)

With some matrices, I am receiving the following message: ...
10
votes
0answers
111 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
170 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
105 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
179 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
52 views
7
votes
2answers
378 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
480 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
154 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; ...
11
votes
1answer
700 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
54 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\}$... ...
2
votes
1answer
164 views

Eigenvectors of numerical matrix

I have a large numerical matrix whose eigenvalues are all distinct. In the documentation for Eigenvectors it says: For approximate numerical matrices m, the ...
20
votes
1answer
715 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
133 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
782 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
287 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
119 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
186 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
530 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
408 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. ...
17
votes
1answer
307 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 ...