Questions tagged [linear-algebra]

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.

Filter by
Sorted by
Tagged with
1
vote
1answer
21 views

Solving an eigenvalue problem

I am computing the eigenvalues of Laplacian-type operator on the unit square $\Omega = [0, 1]^2$ Consider the eigenvalue problem on the unit square $\Omega$, $$-L u = \lambda u$$ where $$L = e^{2y} \...
0
votes
0answers
33 views

List of eigenvalues not exceeding a given number

I am interested in computing the eigenvalues of Laplacian numerically. Consider the $\textbf{LAPLACE'S BOUNDARY VALUE PROBLEM ON A UNIT SQUARE:}$ Let $\Omega = [0 , 1]^2$. Now the eigenvalue problem ...
0
votes
1answer
36 views

How can I solve a linear equation with many input variables symbolically without taking forever

Background: I have a linear equation whereas T2 and T3 are transformation matrices, Rp is ...
8
votes
1answer
104 views

Efficiently populate a Sparsearray for a set of rules for a constrained basis

I want to populate quite a large SparseArray(10^6 x10^6) efficiently. It is basically a spin system Hamiltonian with a constrained Hilbert space. Unlike the examples I have looked at in this forum ...
4
votes
2answers
149 views

Asymptotic law in Laplace's problem

$\textbf{Eigenvalue problem on a unit square $\Omega = [0,1]^2$ :}$ Consider the eigenvalue problem with the Dirichlet boundary condition that is, $$-Lu = \lambda u$$ where $$L = \frac{\partial^2}{\...
0
votes
0answers
56 views

How can I show the calculation of the determinant of a matrix step by step? [duplicate]

I would like to emulate what Wolfram Alpha does in Mathematica. Can you help me? ...
1
vote
0answers
62 views

Multiplicity in Laplace's Eigenvalue Problem

I am computing Laplacian on a unit square $\textbf{numerically}$. Consider the eigenvalue problem on $\Omega = [0 , 1]^2$ $$-Lu = \lambda u$$ where $$L = \frac{\partial^2}{\partial x^2} + \frac{\...
0
votes
2answers
56 views

Why these equations are not giving any solution? [closed]

I am trying to solve these three coupled linear equations but this gives me zero value. I don't know why it is happening. If anyone can resolve this is most welcome. ...
0
votes
1answer
46 views

Symbolic Real Positive Definite Matrix

I'd like to define a symbolic real positive definite matrix. For the 2 x 2 example, I thought I could define four real variables using ...
2
votes
2answers
113 views

How to check linear independence

I want to check linear independence in Mathematica. But I don't know to how to use this. My question is as follows: I want to check whether $\sin (m \pi x) \sin (n \pi y)$ where $m, n =1,2, 3 \cdots$ ...
0
votes
1answer
65 views

How to create a set (of matrices) which will be used as an finite group to minimize a function?

I'm new here so I'm a little lost. I need to minimize a function considering that the minimizing parameter belongs to a preestablished set. It all involves matrices.It's something like this: Where ...
3
votes
1answer
162 views

Solving a Eigenvalue Problem

$\textbf{Eigenvalue problem on a unit square $\Omega = [0,1]^2$ :}$ Consider the eigenvalue problem with the Dirichlet boundary condition that is, $$-Lu = \lambda u$$ where $$L = \frac{\partial^2}{\...
1
vote
1answer
132 views

How to speed up by Compile?

I need to NDSolve a system many times by scanning some of its parameters and do some matrix calculation with the (discretized) solutions. The example is the ...
3
votes
1answer
153 views

How can I use Tally in my code?

I a computing the eigenvalues and eigenfunctions of a Laplacian on a unit square. I have written it as follows: ...
0
votes
1answer
68 views

How to write matrix elements in Mathematica? [closed]

For a matrix $A$, one computes the $ij$-$th$ matrix elements in a basis $\{|e_i\rangle\}$ as $$A_{ij} = \langle e_i|A|e_j\rangle$$ How can one implement this in Mathematica? As an example, consider a ...
0
votes
0answers
15 views

QR algorithm implementation for eigensystem - where is error [duplicate]

I implemented the simplest possible program of QR algorithm, but the program gives wrong solutions, i.e. eigenvalues (diagonal elements of converged matrix x) and ...
0
votes
0answers
54 views

linear algebra 1, linear applications [migrated]

Given the endomorphism f defined by its associated matrix A, A=((a,-3),(-2,-2)) relative to the canonical base R^2. Find the variable a so that f admets a line of fixed points. Solution is a=7, line ...
0
votes
0answers
4 views

Why doesn't the K-SVD algorithm simply take the derivative equals zero method to update d_k? [migrated]

Here is K-SVD from wikipedia. the objective function is $$ \quad \min \limits _{D, X} \{ \|Y - DX\|^2_F \} \qquad \text{subject to } \quad \forall i \;, \|x_i\|_0 \le T_0. $$ In the K-SVD algorithm,...
1
vote
2answers
122 views

Exploring Matrix Powers with Wolfram (using Sum Notation)

I am trying to gain an intuition for what algebraically happens to a square matrix (say a $2$-dimensional square matrix) when it is successively multiplied by itself. I have used ...
1
vote
0answers
71 views

Showing $e^{(α Ω)} e^{(β Ω)} = e^{((α + β) Ω)}$ with Wolfram Technology [closed]

Context. I am currently reading a Quantum Mechanics book in which it is stated that it is "obvious" (without proof) that $$ e^{(α Ω)} e^{(β Ω)} = e^{((α + β) Ω)} $$ where $\alpha, \beta \in \...
3
votes
1answer
164 views

Square root of a 2 by 2 matrix using MatrixPower[]

According to Wikipedia a square root of a 2×2 matrix M is another 2×2 matrix R such that M = R^2. In general, there can be zero, two, four, or even an infinitude of square-root matrices. I tried to ...
4
votes
1answer
145 views

How to find a diagonalizing basis of a matrix by using Mathematica? [closed]

I have a $3\times 3$ matrix which I want to diagonalize, $A$. So I want to find the matrix $P$ such that $A=P^{-1}DP$, where $D$ is the diagonal matrix such that the eigenvalues of $A$ appear in the ...
1
vote
0answers
52 views

How to let Mathematica evaluate a large amount of data

I have the following code in mathematica which runs perfectly for a small matrix of 21 x 12 matrix. But I really want to test it for a large system. My data is 35844 x 21000 elements, totaling 1.5 GB. ...
2
votes
0answers
30 views

finding a transpose matrix [duplicate]

sample = MatrixForm[ RandomVariate[NormalDistribution[0, 1.2], {3, 2, 2}]] Tranp = Transpose[MatrixForm[sample]] This is my attempt to find the transpose of ...
5
votes
1answer
140 views

Finding invariant matrix given group elements

I have a question about speeding up / optimising the following calculation. I have a feeling there is a way to rewrite it but I can't quite see what to do. In $d=3$ dimensions, given a set of ...
4
votes
2answers
146 views

How do I reduce to a basis?

I'm doing some computation with symbols X, Y, Z, XX, XY, ..., which are linearly independent elements in some larger vector space. For example, consider the ...
4
votes
1answer
138 views

How can I direct sum matrices into the middle of one another another?

I would like to execute the mathematical operation of the direct sum of matrices in the case where the matrices are not appended one after the other along the diagonal, but instead mixed among one ...
0
votes
1answer
47 views

How I can find the eigenvalues and eigenvectors of 500 matrices with 3x3 dimensions? [closed]

I can apply the Eigensystem command to a single matrix and it worked fine. But it takes me too much time. I want to get the eigenvalues and eigenvectors of multiple 3x3 matrices at the same time. ...
1
vote
0answers
46 views

SchurDecomposition returns matrices which are not a Schur decomposition [closed]

A Schur decomposition is a decomposition $M = Q T Q^\dagger$ where $Q$ is unitary, and $T$ upper triangular. It is implemented in Mathematica by ...
0
votes
0answers
40 views

Converting Tensor product to Matrix

I have a basic question regarding matrices and tensor product forms. Given $N > 0$, I am interested in the tensor product series $\sum_{i}^{N} X_i$, where $X_i$ is the Pauli $X$ spin operator at ...
2
votes
3answers
36 views

Repeated ReplacePart On Each Element of a Square Matrix for Eigenvalue Difference

I have a large $n\times n$ square matrix, whose elements are all either 0 or 1. I want to see by how much the single largest eigenvalue of the matrix (which Mathematica gives as the first element in ...
0
votes
0answers
59 views

Appending to a list in a For-loop

I am new to Mathematica. Here is my problem: Given the matrix $\qquad M = \begin{pmatrix} 2 & -1 \\ 1 & 2 \end{pmatrix}$, sum the overlap (inner-product) of it's eigenvectors $\qquad \bigg\{\...
3
votes
2answers
288 views

Speedup calculation of the largest eigenvalue and eigenvector of a 400×400 matrix? [duplicate]

Actually, the matrix is an adjacency matrix of a network. The code is: ...
1
vote
1answer
76 views

How to get Mathematica to return more accurate symbolic eigenvectors

This code: Eigenvectors[{{Cos[t], Sin[t]}, {Sin[t], -Cos[t]}}] returns this output: ...
2
votes
0answers
46 views

Matrix regularization, how to pick $\lambda$

Since v12 FindFit[] now supports regularisation, such as Tikhonov regularization. Do there exist statistics to help guide the choice of the hyper-parameter $\...
0
votes
1answer
49 views

RowReduce with parameter, strange output (?) [closed]

I am facing some "strange" (?) output when using RowReduce with the following matrix $$ \begin{pmatrix} 1 & 2 & 2 \\ 2 & k & 1 \\ k+1 & 6 & 5 \end{pmatrix} $$ for it ...
1
vote
1answer
64 views

Maximize a function over several variables [closed]

I want to maximize the function, $$S_{v}=\sum_{a \in\{1,-1\}^{n}}\left\|\sum_{i=1}^{n} a_{i} v_{i}\right\|$$ over $v_{i}$ and a given $n$ (say $n$=3). $v_i$ are unit vectors. $a$ are lists with $n$ ...
3
votes
1answer
64 views

Getting different eigenvectors for same matrix? [closed]

I have the same two matrices, one has the input values as integer and the other as real numbers. Mathematica shows the eigenvectors are completely different for the two same matrices and wondering ...
4
votes
2answers
314 views

Plotting an image of a discrete dynamical system

I am trying to plot a discrete dynamical system of the form $$\vec{x}_{k+1} = A \vec{x}_k$$ where $A$ is a $2\times 2$ matrix in the form $$\begin{pmatrix}a&b\\c&d\end{pmatrix}$$ where $a$, $b$...
6
votes
4answers
261 views

FindInstance won't compute this simple expression

I want to find instances where this standard 3x3 symmetric matrix has only positive eigenvalues. So I run ...
5
votes
1answer
111 views

How to compute the trace distance of a density matrix

I am trying to compute the trace distance of two general $4 \times 4$ density matrices as such: $D=\frac{1}{2} \, \mathrm{tr} \, |\Delta\rho|_1$ where $\Delta\rho$ is the difference between two ...
0
votes
1answer
44 views

How to solve three simultaneous equations on Mathematica to get N in terms of X,Y and Z?

I am trying to solve a system with 3 equations 3 unknowns. My code is following X = A1*S + N1 Y = A2*S + N1 Z = N1^2 + A1N1S + A2N1S + 2A1A2*S^2
0
votes
0answers
48 views

How to constrain symbols to be (non-) commutative?

I have an expression that contains both matrices and scalars: H0 and H[k] are (non-commuting) matrices, and all the ...
1
vote
1answer
43 views

Ordering eigenvectors for basis transformation

Let's say I have a matrix $H$ represented in some basis, $a$, and I'd like to transform this to be represented in a different basis, $b$. The only difference between the bases is that $b$ is a basis ...
0
votes
1answer
44 views

Why does `Solve` repeat the same solution twice?

I have the system of matrix equations {s.n == n.s, n.n == 0, s + n == f} where ...
0
votes
0answers
42 views

Difference Equation system

I am new in Mathematica and I have a very large system of difference equations like: ...
1
vote
0answers
37 views

Solving Kronecker-structured linear equations

I need to approximately solve the following underdetermined system of $n$ linear equations $$y_i=a_i^T X b_i$$ Where $X$ is $d\times d$ unknown matrix, $a_i$ and $b_i$ are given vectors and $n=d$. Is ...
1
vote
1answer
72 views

Lowest Eigenvalue of a large sparse matrix without choking up the RAM (Corrected) [closed]

I am trying to find the lowest eigenvalue of a large sparse matrix of dimension N (=$3^n$, where n is number of particles in system ) using ...
3
votes
1answer
93 views

How to compute matrices in Einstein notation:

I would like to compute $ r_{ii'} = \sum_{kk'} A_{ii'}^{kk'} r_{kk'} $ where all indices vary from 0 to 1 to yield a vector / matrix.
3
votes
2answers
264 views

How to solve a linear system like that

I'm trying to reproduce the following result: with ...

1
2 3 4 5
26