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

1
vote
1answer
55 views

Only get the lowest Eingenvalue? [duplicate]

I have a huge sparse matrix and I want to have the smallest eigenvalue and its corresponding eingenvector. I use this code (a used a smaller matrix for the example): ...
6
votes
1answer
457 views

What does it mean when Mathematica returns a zero “eigenvector”? [closed]

For example, I ask Mathematica to compute the eigenvectors of $\left(\begin{array}{cccc} 1 & 1 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 5 & -4 \\ 0 & 0 & 4 & ...
6
votes
1answer
127 views

Issue in Det[…] when computing determinants of polynomials?

When I form a matrix of at least size $12 \times 12$ of second order polynomials in $w$ and I calculate the determinant of that, I get something that is a rational expression in $w$. Since the ...
5
votes
3answers
307 views

Bilinear Dot Function

In mathematics the matrix product is a bilinear operation $$ \alpha A \cdot(\beta B + \gamma C) = \alpha\beta ( A \cdot B )+ \alpha \gamma (A\cdot C ), $$ where capital letters denote matrices and ...
3
votes
0answers
75 views

Change of basis of polynomials

Suppose I have a favourite basis for polynomials in $x_1,\dotsc,x_n$, say non-symmetric Macdonald polynomials to be specific. I can easily compute these, and thus the change-of-basis matrix that takes ...
0
votes
1answer
133 views

Solving linear system with constraints

I need to come up with a solution for a rather, odd situation. Let's say I have an $M \times N$ matrix called ${\bf A}$, and I would like to solve it for ${\bf x}$ where $b_1 \le {\bf A} {\bf x} \le ...
3
votes
0answers
98 views

Writing a function to set up and solve the least squares problem

I have setup the explicit line equation for a given set of points using least-squares approximation and the knots computed below. I have tried extending the same code for use with an arbitrary degree, ...
2
votes
1answer
97 views

Solving large linear systems of equations efficiently?

I need to solve linear systems of equations of approximate size $(n!)\times(n!)$ as efficiently as possible for as high parameter n as possible. All the entries ...
5
votes
3answers
119 views

Finding most general matrices $A$ and $B$ such that $A\cdot B=1$

I would like to find the most general shape of matrices $A$ and $B$ such that $A\cdot B=1_{4\times4}$. Naively, I just define for example ...
0
votes
1answer
62 views

Varying constant in Matrix calculation to generate 3D plot

As suggested, I rewrite my code to make it simpler and directly showing the problem. Here is a short example. I'd like to generate 3D plot where x,y,z (= a,b,answer) while I am varying a (0 ...
4
votes
1answer
61 views

Transform set of linear equations into matrix and two vectors

Consider a list L containing entries dependent on variables x[i] (the i are integer, yet not ...
2
votes
2answers
133 views

Repeated multiplication of a square matrix and a column vector in Mathematica

I am very new to Mathematica and StackExchange, so pardon me if I am repeating a question that has already been answered. I am trying to use Mathematica to do the following: u[n+1] = A.u[n] where A is ...
11
votes
2answers
394 views

Expressing the n-th power of a matrix [duplicate]

My matrix is $\qquad A= \begin{pmatrix} {1} & {2} & {3}\\ {4} & {1} & {0}\\ {0} & {5} & {4} \end{pmatrix} $ I need $\qquad A^n$ I tried ...
3
votes
0answers
177 views

Mathematica's Singular Value Decomposition different from another math engine [closed]

I’ve been working with SVD – singular value decomposition. Things weren’t working as expected. Thus, I looked over to Matlab and executed the following code: ...
3
votes
2answers
655 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} } ...
9
votes
1answer
109 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
59 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
46 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
48 views

Generation of Space Representation of non-crystallographic Point Groups

In Mathematica the command FiniteGroupData[{"CrystallographicPointGroup",<group number>}, "SpaceRepresentation"] yields the space representation (...
7
votes
1answer
197 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
152 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, ...
4
votes
0answers
176 views

Finding eigenvalues in Mathematica: why so slow?

I am trying to find the eigensystem of a large sparse real symmetric matrix, and I only need the lowest 40 or so eigenstates. The relevant code is as follows: ...
0
votes
0answers
22 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 ...
1
vote
1answer
96 views

diagonalization function

If we have a matrix m which is n*n, how can I do mm=U^dagger m U which is a transformation ...
4
votes
1answer
61 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
49 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 ...
6
votes
0answers
131 views

Why has Version 10.3 precision reduced?

In version 7.0.1.0 and versions 10.0 and 10.1 the following is produced: ...
1
vote
1answer
45 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). ...
0
votes
1answer
62 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: ...
1
vote
1answer
80 views

What's is the restrictions for the function MatrixExp?

When I use the MatrixExp on a general $2\times2$ matrix, Mathematica gives me this result: MatrixExp[{{a,b},{c,d}}] // TraditionalForm $\frac{1}{2\triangle}\left(...
7
votes
1answer
181 views

What kind of Arnoldi method is used in Mathematica?

Can someone give me a bit more information about what mathematical method Mathematica is using, (preconditioner, filtering-restarting, deflation) in the Lanczos implementation when I input something ...
3
votes
0answers
83 views

Real Canonical Form of Arbitrary Size Matrices

I have been searching the site and the Mathematica documentation, but have not found anything regarding this. If we find the Jordan Form of the following matrix, we get complex values, but I would ...
5
votes
0answers
159 views

VERY slow to solve a nonlinear equation involving matrix eigenvalues

I am trying to solve a problem similar to the following: ...
3
votes
2answers
54 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
76 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}$, $X_{...
3
votes
1answer
34 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
154 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
115 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
88 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 ...
0
votes
0answers
66 views

LatticeReduce of a linearly dependent basis

l1 = {{-6327, 0, -2109}, {131, 0, -131}, {-6840, 0, 24929}}; LatticeReduce[l1]] returns {{1,0,0},{0,0,1}}. How do I find ...
13
votes
2answers
581 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
121 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
60 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
145 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
82 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
110 views

Precision of Eigensystem? [closed]

I was using Eigensystem to obtain the rotation matrix. However, I find out Mathematica does not fully diagonalize my matrix (or say not precise enough). My matrix ...
0
votes
1answer
42 views

Tolerance of PositiveSemidefiniteMatrixQ [closed]

I believe the following should be True but returns False for me: ...
2
votes
2answers
73 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} \\ ...