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.

1,380 questions
Filter by
Sorted by
Tagged with
65 views

135 views

How to compute eigenvalues of linear function (not matrix)?

How to compute eigenvalues of a known linear function? In Julia, there is a package https://jutho.github.io/LinearMaps.jl/dev/ to compute the matrix representation of given function, then we can ...
82 views

Implementing solution of a system of recurrence relations [closed]

Let us consider a system of recurrence relations such as $a_{n-1} = ( \lambda_1 + n \lambda_2 ) a_n + \lambda_3 b_n$ $b_{n-1} = ( \lambda_4 + n \lambda_2 ) b_n + \lambda_5 a_n$ subject to the ...
89 views

How to write a matrix in a different basis by using Mathematica

I have these two 4x4 matrix ...
130 views

Kronecker Square Roots

I'm interested in computing the 'Kronecker Square Root' $\mathbf{A}_{n\times n}$ of a matrix $\mathbf{M}_{n^2\times n^2}=\mathbf{A}\otimes\mathbf{A}$. In case it doesn't exist, I'd like to find the ...
63 views

Finding matrix in Krylov subspace (Lanczos method)

The Lanczos method for finding the smallest eigenvalue of a hermiteian matrix $H$ is based on the construction of a vector subspace (Krylov space) where one can build a matrix $H_{Krylov}$ which is ...
79 views

How to correctly differentiate quadratic form by vector in Mathematica, i.e.: $Q=\omega^T I_{p} \omega$ $\frac{dQ}{d\omega}= ???$ ...
44 views

On the diagonalization of matrices and strange results [duplicate]

I'm trying to implement the following calculation in mathematica $$U^{(0)}(\mu,m) = V\left(\left[\frac{\alpha_S(m)}{\alpha_S(\mu)}\right]^{\frac{\gamma^{(0)}}{2\beta_0}}\right)_DV^{-1}$$ where \$\gamma^...
82 views

A function that modifies functions - well-defined operation?

Here's my basic setup: Say I have a list of specific symbols and a function noSymbol, which accepts a mathematica expression and checks whether any symbol from my ...
126 views

Eigenvalue and SparseArray

This the code of Hofstadter spectrum for square lattice using Mathematica ...
98 views

Given A and B, how to find C if A = CBC?

Given A={{0,1,1,0},{1,0,0,-1},{-1,0,0,1},{0,1,1,0}} and B={{0,1,0,0},{0,0,0,0},{0,0,0,1},{0,0,0,0}} and ...
31 views

Question about a restricted rewrite rule [closed]

I just started learning Mathematica and I'm not sure why a function I defined doesn't work. So I'm trying to write a function that takes a list of vectors and eliminates all zero vectors (with respect ...
231 views

What is the best source to learn how to use tensor operations (exterior algebra) in Mathematica?

I'm specifically interested in the TensorProduct,TensorWedge, HodgeDual and certain build in functions to do tensor arithmetic like TensorReduce, TensorExpand. I would like to do exterior algebra ...
119 views

How to collect a polynomial with a specific power

Suppose I have got this polynomial u=x^12-3x^8-x^4+3 Now, I am trying to collect this polynomial with x^4 terms. I need to write it like this: (-1+x^4) (-3 + x^4) (1 + x^4) To evaluate it, I used ...
50 views

Use Root object as a function in NonlinearModelFit or similar

I have a matrix and its eigenvalues are returned by Mathematica as a Root Object. ...
46 views

How to make first component of eigenvectors on grid real and normalize using Map and Normalize? [closed]

I am trying to use the following approach: How get eigenvectors without phase jump? to apply the same conditions to an array of complex-valued Mathematica eigenvectors. The matrix solved for is a <...
69 views

unable to verify this Gaussian elimination output

I was trying the following code to obtain the Gaussian elimination matrix. (the Echelon form, not the reduce echelon form). Since Mathematica does not have a build in function for it, but I used this ...
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: ...
56 views

Nominal variables in LinearModelFit must be specified before continuous variables

I am applying the LinearModelFit to a 90 x 5 matrix, in which the 4th variable is a nominal variable (i.e., x4 is a categorical ...