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
10
votes
4answers
417 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: <...
15
votes
3answers
13k views

Is there a built-in function to find the adjoint of a matrix?

I've been looking for a function that helps me get the adjoint matrix o a given one, I found that you can get the cofactors of a matrix but only by using the "Combinatorica" package, which I couldn't ...
16
votes
2answers
565 views

Factorize trigonometric matrices

Consider two square matrices $A_1$ and $A_2$. Consider the following matrix involving matrix trigonometric functions: \begin{equation} M_1(t)=\begin{bmatrix} \cos(tA_1) & t\mathrm{sinc}(t A_1) \\ ...
4
votes
2answers
226 views

How to apply a linear transformation to a tensor?

I would like to apply a linear transformation to a tensor. My linear transformation is encoded by a matrix, for example M = Table[m[i, j], {i, 4}, {j, 4}] Take some ...
15
votes
1answer
265 views

Are compound matrices implemented in mathematica?

Compound matrices are matrices whose entries are all the minors of a given size of another matrix. https://en.wikipedia.org/wiki/Compound_matrix https://www.researchgate.net/profile/James-Muldowney-2/...
0
votes
0answers
52 views

How to define a Matrix algebra in Mathematica [closed]

I want to define a specific product over three by three matrices over complex numbers. Does anybody knows how can I do it?
2
votes
1answer
40 views

My construction of additive compound matrices doesn't work sometimes; why?

Using the multiplicative compound matrix --see definition at Are compound matrices implemented in mathematica? one may define also additive compound matrices ...
3
votes
0answers
83 views

Solving or Minimizing the Norm of the matrix equation $M^TAM - M^TB - B^TM =C$

I am trying to solve the matrix equation $M^TAM - M^TB - B^TM=C$ where I know A, B and C. My unknown matrix is M which has the special form that all the rows and columns sum to zero. i.e. I have four ...
3
votes
1answer
54 views

Construction of an additive compound matrix

I want to construct an additive compound matrix which has the following form as output : ...
0
votes
0answers
42 views

Relationship between a matrix and its eigenvectors [migrated]

Given a matrix $A$ and its eigenvalue $λ$ and its eigenvector $\vec{x}$. Problem: From the definition that $A\vec{x}=λ\vec{x}$, can I say that eigenvectors $\vec{x}$ must be all in $A$'s column space ...
0
votes
1answer
49 views

Minimal polynomial of an element in a polynomial quotient ring

Let $p(z)$ be a (not necessarily irreducible) polynomial in $\mathbb{Q}[z]$. Is there a built-in function I can use for determining the minimal polynomial of an element $\overline{q(z)} \in \mathbb{Q}[...
0
votes
0answers
125 views

Could all eigenvalues of this matrix be positive?

I have the following list $\beta$ with 5 equations ...
0
votes
0answers
35 views

Matrix with Gauss method in Mathematica [duplicate]

I need to define a matrix and write code to solve it with the Gaussian method. When I write the dimensions of the matrix, it should be calculated. Could you please help?
2
votes
1answer
374 views

Gauss Jordan code for mathematica [closed]

I want to find the inverse of the matrix using a unit matrix. I know it's done directly using Inverse, but I need to write a simple code. I can't write because I'm just starting to learn. How can I ...
0
votes
0answers
50 views

SVD with k smallest singular values

Is there any efficient way to find k smallest singular values of a large matrix?
3
votes
1answer
154 views

Code for the elementary $m\times m$ matrix $E_{ij}$

Let $E_{ij}$ be an $m\times m$ matrix with a $1$ in the $(i,j)$-entry and zero otherwise. DiagonalMatrix[{1},j,m] will put a $1$ in the first row along the $j$-th ...
2
votes
2answers
117 views

I want to improve my algorithm of knowing eigenvalues of the matrix H(k)

I want to improve my algorithm. I want to know the eigenvalues of below n-dimensional matrix H. When n=10, the matrix H is like below. Now, $To$ and $M$ are constants and $T1$ and $T2$ are functions ...
1
vote
1answer
75 views

Normal of plane given three points [duplicate]

Is there a command (or a combination of commands) that takes three points of a plane and outputs the normal vector of that plane? I'm told there is a ready way of automating this, but have been unable ...
0
votes
2answers
94 views

Problem about vanishing determinant of a matrix with NSolve

When I try to solve my question according to @DanielLichtblau's comments, I encountered another issue, with which I have been struggling for a whole night. Taking a matrix for example, ...
1
vote
1answer
57 views

How do I make Mathematica to always evaluate Log[0, x] as Power[0, x]?

So, sometimes Mathematica cannot evaluate the base-0 logarithm of certain matrices. But we know that the expressions $0^x$ and $\log_0 x$ are always equivalent. What can I do so that Mathematica ...
1
vote
2answers
103 views

How do I solve a system of equations through Gaussian elimination using Mathematica?

I have absolutely no experience using Mathematica or similar packages, so please bear in mind with me. I am an IB student that has gotten themselves a copy of Mathematica for the purpose of simply ...
3
votes
1answer
116 views

How can I do operations in this basis (using matrices)? [closed]

Let's define $u=t+1/2$ $v=t-1/2$ Now, I have vectors in the basis $e_n=u^n-v^n$, I want to apply functions to such expressions, but as a result get expressions in the same basis again. For instance, $...
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 ...
1
vote
1answer
82 views

Determine a positive semidefinite 5*5 matrix

I'd like to find the real parameters $\left\{a_{14},c_6,c_8,c_{10},c_{12},c_{13},c_{14},c_{15},\alpha \right\}$ in M, which is a $5\times 5$ real symmetric matrix, such that M is positive semidefinite....
1
vote
0answers
25 views

Can we make Mathematica output the sequence of row operations it does when executing RowReduce[]? [duplicate]

Mathematica does row reduction with the function RowReduce[] but can we make it output the sequence of row operations it made. For example, something like this:
4
votes
1answer
198 views

How to implement Drazin inverse?

Wolfram site says it will be implemented in the future as DrazinInverse[m] function. But what to do now?
9
votes
1answer
200 views

Arbitrary Precision, Nearly-Singular Matrices, and LinearSolve

I have been trying to solve a nonlinear eigenvalue problem, $\mathbf{M}(\lambda) \mathbf{v} = 0$, in Mathematica using Newton's method. The core of the algorithm relies upon an inverse iteration, ...
2
votes
1answer
75 views

In NMinimize, how to incorporate constraints on positive semidefiniteness of a matrix which is not the matrix variable being optimised?

The problem I want to solve the following problem for symmetric matrix $X$: $$ \begin{aligned} \min_{X\succ 0} \; & -\log(\det(X)) & \\ \text{subject to} \; & \begin{pmatrix} X &...
3
votes
3answers
115 views

Finding the interval of values of an unknown element such that a square matrix is positive semidefinite

I'm looking for a way to determine which values of $c \in \mathbb{R}$ make the matrix $A$ positive semidefinite: $$ A = \begin{bmatrix} 1 & c \\ c & 1 \end{bmatrix} $$
2
votes
2answers
377 views

Symbolic calculation of the rank of jacobian matrix

I would like to symbolically determine the rank of a jacobian matrix. In the help, I have seen that the MatrixRank function can be used for this purpose. However, when I use this function, the ...
2
votes
0answers
55 views

JordanDecomposition not evaluating

When there are very small differences between entries in a diagonal matrix, sometimes JordanDecomposition does not evaluate and gives an error message: ...
0
votes
2answers
46 views

Making NullSpace give correct result for all parameters

I found out that NullSpace only gives the correct answer for 'generic' parameters. For example, NullSpace[{{a, b}, {c, d}}] ...
2
votes
1answer
76 views

LinearOptimization duality

I'm solving a linear program using LinearOptimization. I'm curious why "DualityGap" does not return zero (as described in the docs). Here's the code: ...
0
votes
1answer
75 views

Complex Conjugate of matrix

I have written the following code ...
0
votes
1answer
163 views

Complex Conjugate Transpose of a vector

Suppose that the vector is Psi={{a},{b}}; and a and b are imaginary numbers in general. I want to calculate in Mathematica the tensor product and define a1,b2 as ...
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 $$-...
7
votes
1answer
897 views

Speeding up the matrix exponential computation for sparse matrices

I want to compute the action of matrix exponential on a vector. My matrix $B$ is of a very large size and it is sparse, e.g., it is written as follows: ...
1
vote
1answer
51 views

Generate a normalized Haar-random vector

What is the procedure to generate a random qutrit quantum state? That is, I want to generate a $3 \times 1$ vector $u$ such that $u$ is generated by a Haar random $3 \times 3$ unitary $U$ multiplied ...
5
votes
2answers
205 views

Is there a way to view all two-dimensional arrays in matrix form?

Is there a way to ensure that every time I perform an operation such as RowReduce, Linear Solve, Null Space, Inverse, Eigenvectors, etc. that the matrix is displaying in MatrixForm instead of applying ...
0
votes
1answer
56 views

The function Norm is giving complex numbers as output [closed]

I'm trying to find the norm of a complex vector ...
1
vote
0answers
51 views

HermitianMatrixQ Ignores Assuming, $Assumptions

HermitianMatrixQ seems to ignore a variety of ways I tried to help it get the right answer. For example, ...
0
votes
0answers
80 views

Matrix condition number

...
4
votes
1answer
342 views

Implementing positivity constraints over a six-dimensional hypercube

This question involves the same subject matter as my previous one (How can one achieve the most accurate estimates of certain six-dimensional integrals under specific constraints?), but with another (...
2
votes
1answer
54 views

Expand tensor expressions with matrix powers and outer products

I would like to have TensorExpand distribute across repeated matrices involving outer products. This question notes that ...
0
votes
2answers
87 views

Problem for defining continuously Eigenvectors from Kane and Mele model

The model is a simple eigenvalue problem. A matrix that depends on some parameters kx, ky, t, defined by: ...
5
votes
3answers
23k 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} } using the ...
3
votes
1answer
77 views

How to find the steps in finding the reduced row echelon form of a matrix programmatically?

I would like to figure out a way to see the row operations RowReduce uses to arrive at the reduced row echelon form of a matrix. I am aware of the step-by-step solutions in Wolfram Alpha and Wolfram ...
0
votes
1answer
46 views

"Instantiate" an output of Solve [closed]

I would like to use Mathematica to find a non-trivial solution of the linear system $Ax = 0$. When I try running Solve[A.x == 0, x] the output I receive is a ...
0
votes
1answer
41 views

How to flip the z axis of a Graphics3D in order to create a left-handed coordinate space?

I would like to know how this 3D graphic could interpreset the y axis as being the up direction and the z axis flipped so that it creates a left handed coordinate system? ...
3
votes
2answers
1k views

RowReduce: Solving for the resource vector (a, b, c) in Augmented Matrix

Here are two examples: RowReduce[{{3, 1, a}, {2, 1, b}}] evaluates to {{1, 0, a - b}, {0, 1, -2 a + 3 b}} but ...

1
2 3 4 5
28