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
0
votes
1answer
90 views

Step-by-step GramSchmidt [closed]

Is there a way where Mathematica gives a step-by-step process for orthonormalization of vectors? I have the final result, but I would like to see the process of GramSchmidt to obtain the normalized ...
0
votes
1answer
61 views

Number of elements in a list [closed]

I have written the following program in mathematica. ...
3
votes
1answer
248 views

Laplace's problem in Mathematica

I am computing the Laplace's eigenvalue problem on the region $\Omega$ formed by the four vertices $(1,1),(1,2),(−1,2),(−1,1)$. Consider the Laplace problem, $$-L u = \lambda u$$ where $$L = y^2 \Big( ...
1
vote
1answer
84 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
45 views

List of eigenvalues not exceeding a given number

I am interested in computing the eigenvalues of Laplacian numerically. Consider Laplace's boundary value problem on a unit square: Let $\Omega = [0 , 1]^2$. Now the eigenvalue problem is as follows $$-...
1
vote
2answers
71 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 ...
9
votes
1answer
165 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
157 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
61 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
77 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
59 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. ...
1
vote
1answer
96 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
170 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
72 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
203 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
169 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
168 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
97 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 ...
1
vote
2answers
163 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
75 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 \...
8
votes
2answers
307 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
176 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
168 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
196 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
196 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
54 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
67 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
73 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
38 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
105 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
333 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
81 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
75 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
57 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
74 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
90 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
429 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
279 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
215 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
169 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
59 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
63 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
45 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 ...
1
vote
3answers
134 views

How to get the squared norm of each vector from a Table? [closed]

This question is certainly very basic, but I don't get it! How can I make a table of all the squared norms from this table? ...
0
votes
0answers
48 views

Difference Equation system

I am new in Mathematica and I have a very large system of difference equations like: ...
1
vote
0answers
38 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
81 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 ...

1 2
3
4 5
28