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

3
votes
2answers
198 views

How do I get the inverse of a homogeneous transformation matrix?

I want to get the inverse of this homogeneous transformation matrix: iab = { {1, 0, 0, 0}, {0, 0, -1, 0}, {0, 1, 0, 3}, {0, 0, 0, 1} } ...
0
votes
0answers
60 views

Reproducing Mathematica's Nullspace basis within c++ [on hold]

Using the function NullSpace in Mathematica gives a basis that has very nice properties for my purposes; for example the vectors seem to be ordered with the last ...
0
votes
0answers
7 views

Linear vs. bilinear [migrated]

I'm tripping over something elementary: Suppose $f:\mathbb{R^2}\rightarrow X$ is linear, then $f(x+y)=f(x)+f(y)$ for all vectors $x$ and $y$. Now suppose that $f$ is also bilinear and in particular ...
9
votes
1answer
81 views

UnitaryMatrixQ function not returning true for a unitary matrix

So I know this matrix is unitary. It's a well proven fact in quantum mechanics and you can even check for yourself on pen and paper, Heres a quick proof: Assume $H$ is hermitian (i.e. $H^\dagger=H$) ...
0
votes
0answers
56 views

Is this problem parametrically solvable or it can just be solved for specific $\sigma$ and $\theta$?

In order to solve This problem: What is the maximum value of coefficient fv with the constraint that the matrix is positive semi-definite?, I have used the following code (Determinant is computed by ...
1
vote
1answer
41 views

Array Flattening arrays of matrices given by rules

Fix an $n$ and an $m$ positive integers.I have some set of four $n\times n$ matrices $A$,$B$,$Y$,$Z$ (where $Z$ is the zero matrix). I'd like to input the $nm\times nm$ matrix of block matrices given ...
3
votes
0answers
35 views

Generation of Space Representation of non-crystallographic Point Groups

In Mathematica the command FiniteGroupData[{"CrystallographicPointGroup",<group number>}, "SpaceRepresentation"] yields the space representation ...
6
votes
1answer
141 views

Incorrect Left and Right Eigenvectors in Mathematica

I'm trying to find the Left and Right Eigenvectors of a pretty straightforward matrix, but Mathematica doesn't seem to be able to do it for even a 200 dimensional matrix. Background: Given an ...
4
votes
1answer
137 views

How do I disable that Mathematica orders terms in lexicographic order?

I have matrices with entries where the order of the entries is important. Unfortunately Mathematica resorts terms in products in a lexicographic order. For example, ...
0
votes
0answers
21 views

Rewriting List of Matrix Equation in Terms of Individual Equations? [duplicate]

I have a list of matrix equations M1={{a1,b1},{c1,d1}}; A1={{x1,y1},{z1,w1}}; M2={{a2,b2},{c2,d2}}; A2={{x2,y2},{z2,w2}}; sys={M1==A1,M2==A2}; which I would like ...
4
votes
1answer
53 views

Computing the logarithmic spectral norm rapidly

I wish to compute the logarithmic spectral norm of a square matrix $A$, which is defined by \begin{equation} \mu_2[A]=\lim_{t\downarrow0}\frac{\|I+tA\|_2-1}{t}. \end{equation} Hence, I simply code ...
0
votes
1answer
43 views

Solving simultaneous and determinant given constant value and variable T (temperature) [closed]

How to solve this two simultaneous equations? these two equations got from this free energy equation ...
1
vote
1answer
32 views

How to find selected elements of inverse of a banded matrix without inverting it?

Is it possible to find some selected elements of the inverse of a large sparse matrix without inverting it? For example consider this Hermitian matrix (as a general case). ...
3
votes
0answers
86 views

Constructing the coefficient matrix in discretization of a PDE

In order to solve the following two dimensional PDE $$\frac{\partial u(x,y,t)}{\partial t}-\frac{1}{2} \sigma _1^2 x^2 \frac{\partial ^2u(x,y,t)}{\partial x\, \partial x}-\frac{1}{2} \sigma _2^2 y^2 ...
0
votes
1answer
37 views

LinearSolve on non-square matrices?

I just came across a strange behaviour for LinearSolve (on Mathematica 8.0.0.0). Consider the following definitions: ...
3
votes
2answers
50 views

How to avoid 0 OverVector[F] to be evaluated as 0?

I am fairly new in Mathematica and I am trying to work with scalars and vectors. I decided to denote vectors using OverVector (as example, ...
1
vote
0answers
58 views

Deriving ordinary least squares (OLS) in matrix form

How can I instruct Mathematica to derive the OLS in matrix form with respect to $\beta$ and obtain the result ${-2X}^{T}(y-X\beta)$? The matrices have the following dimensions: $y_{n \times 1}$, ...
3
votes
1answer
30 views

TensorContract with KroneckerProduct instead of ordinary Times

Is it possible somehow to contract two tensors, say A={{a1,a2,a3},{a4,a5,a6}} and B={b1,b2,b3}, where the elements ...
4
votes
3answers
133 views

Write Sum of Matrices Explicitly

I have sum of lots of matrices A+B+C+D+E+... and I want that Mathematica shows me this as explicit matrix sum, i.e. Explicit Matrix A + Explicit Matrix B + Explicit Matrix C + .... and not just ...
2
votes
1answer
66 views

Explicit Contraction of Tensor Indices [duplicate]

Is there any easy way to explicitly contract indices of several given tensors. For example, ...
2
votes
1answer
70 views

Eigenvectors choose intuitive ordering/sorting

Starting from some symmetric $L\times L$ matrices $M$(see below), I want to compute the eigenvectors in Mathematica, in order to construct an ...
13
votes
2answers
452 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 ...
0
votes
1answer
55 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 ...
2
votes
1answer
55 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
133 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
73 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 ...
0
votes
1answer
39 views

Tolerance of PositiveSemidefiniteMatrixQ [closed]

I believe the following should be True but returns False for me: ...
2
votes
2answers
62 views

Reliably computing the signature of a matrix with small eigenvalues

When asked to compute the eigenvalues of the following matrix ...
0
votes
1answer
43 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
154 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
151 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
81 views

Nonrectangular tensor encountered [closed]

I am trying to solve a system of equations which characteristic matrix: ...
16
votes
2answers
276 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
0answers
68 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. ...
4
votes
0answers
144 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 ...
0
votes
1answer
100 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, ...
1
vote
2answers
91 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 ...
0
votes
1answer
57 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 ...
9
votes
0answers
84 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
48 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)$ ...
6
votes
1answer
88 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
167 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: ...
4
votes
2answers
123 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
55 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
44 views

NMinimize error

I want to use NMinimize in the following way: ...
18
votes
1answer
414 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
141 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
289 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
122 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; ...