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

4
votes
2answers
145 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 ...
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

NMinimize error

I want to use NMinimize in the following way: ...
18
votes
1answer
478 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 ...
7
votes
2answers
376 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 ...
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; ...
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\}$... ...
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, ...
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 & ...
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
3answers
280 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 ...
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: ...
3
votes
2answers
126 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
94 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 ...
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 ...
1
vote
1answer
68 views

Why is KroneckerProduct(vector,vector) a matrix in mathematica, not a vector?

"If A is an m × n matrix and B is a p × q matrix, then the Kronecker product A ⊗ B is the mp × nq block matrix" from Wiki Thus the Kronecker product of two vectors, i.e. $3\times 1$ matrices, ...
7
votes
0answers
134 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 = ...
3
votes
1answer
65 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 ...
3
votes
0answers
51 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 ...
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 ...
9
votes
1answer
146 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
1answer
87 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, ...
1
vote
0answers
61 views

Rotating an oriented surface in 3D

I have an oriented surface S in three dimensions. Let's say that initially the surface is parallel to the x-y-plane with orientation vector ...
5
votes
1answer
114 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 ...
2
votes
0answers
72 views

Solve vs. LinearSolve - ill solutions using both methods [closed]

I'm wishing you a nice day. My question is related to this question previously asked by me, answered by PlatoManiac. Although I found a bug in his post I decided to leave his answer accepted and ask ...
4
votes
0answers
113 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
111 views

How to reduce an expression into user-defined variables?

In the following code, I define a set of matrices. Then, I define a function that calculates the commutation relation relation between these matrices ...
1
vote
0answers
59 views

Continuous integration of a tensor function using discrete density values

Hei, I am wondering is it possible to implement continuous integration using Integrate() of a fourth order tensor with discrete density values. ...
4
votes
3answers
109 views

Find six vectors with rational entries under constraints?

Define six vectors v[i] with i=1,2,3...,6. Each v[i] is six dimensional and all entries in ...
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 ...
0
votes
0answers
28 views

LUDecomposition does not give the expected results [duplicate]

Check this example: ...
1
vote
1answer
67 views

Invoking WorkingPrecision slows down Eigenvalue calculation drastically?

Normally, obtaining eigenvalues of random numerical matrices is fast. For instance a generic result looks like ...
2
votes
0answers
143 views

Linear Programming Using Dual Simplex method

I want to solve an optimization problem using the Dual Simplex Method. Although Mathematica gives the result directly when I use the command Minimize but I want to ...
3
votes
0answers
64 views

Explicitly find a guaranteed factorization of large expression?

Consider the large expression LE defined in this file (involving only linearly independent functions), or in this file (linear interdependence present but slightly ...
10
votes
2answers
243 views

Analytic determinant of a sparse 25x25 matrix?

I would like to compute the analytic determinant of the following sparse matrix ...
2
votes
1answer
73 views
12
votes
1answer
218 views

Nearest Kronecker Product

Some people (see The ubiquitous Kronecker product by Van Loan) have worked on finding two matrices $\mathbf A$,$\mathbf B$ of specified size whose tensor product $\mathbf A\otimes\mathbf B$ is closest ...
6
votes
3answers
258 views

How to simplify symbolic expressions with KroneckerProduct

Having $X,Y$ being symbols for matrices, I was wondering if there is a way to simplify expressions like KroneckerProduct[X, X] + KroneckerProduct[-X, X] to ...
2
votes
1answer
207 views

Solve overdetermined set using Mathematica?

As shown below, this is a overdetermined system. Could you teach me how to find the optimized solution in Mathematica? I know it could be solved by the method of least square, but how to realize it in ...
2
votes
2answers
193 views

Solve a symbolic underdetermined Linear System

Dear StackExchange Community, I'm trying to solve an indeterminate linear system of equations, with $n+1$ variables and $n$ equations; therefore, I need to express all $n$ other variables a function ...
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 ...
1
vote
1answer
99 views

Orthogonalization is not commutative!

I get stuck into a problem: I am going to produce orthogonalized eigenvectors of a matrix and in any iteration. I shortened my question in the bellow line: Why do we face to different results of ...
4
votes
1answer
84 views

Easy way to solve a matrix equation for a matrix?

I have two sets of $10\times 10$ matrices $M1,M2,M3,M4,M5$ and $N1,N2,N3,N4,N5$ and I want to solve a set of equations for these matrices ...
7
votes
0answers
80 views

Mathematica package for explicit matrix representations of group generators?

While there are several packages that are capable of working with weights and roots (for example LieArt), I couldn't find any package that spits out explicit matrices for the generators, for example ...
7
votes
0answers
81 views

Choosing appropriate WorkingPrecision when solving numerical system of equations [closed]

Consider a linear system of equations, which is conveniently written as A.x=y. The matrix A has dimensions ...
3
votes
0answers
121 views

Suggestions for solving a large linear system

I have a system of $\approx 200,000$ linear equations in $\approx 40,000$ variables (with rational coefficients) and I would like to determine the dimension of the solution space, which I know to be ...
1
vote
0answers
118 views

MatrixExp of a complex matrix of size about 10000 by 10000 [closed]

I want to apply MatrixExp of a numerical, complex matrix of size about 10000 by 10000, and I also need high precision as I need to multiply several such matrices. ...