# Tagged Questions

Questions on the linear algebra functionality of Mathematica.

0answers
48 views

### Nontrivial solutions of equation

Here I have one problem how to find nontrivial solution of a system of equation. I want to choose one variable, for example X1 and to get solutions of X2(X1) and X3(X1). It is not difficult when I ...
0answers
5 views

### Finding Vectors in cartesian form [migrated]

I am stuck on this question could you please help me. Find,in Cartesian form, the equations of the straight line through the point with position vector (-1,2,-3) parallel to the direction given by ...
2answers
140 views

### A matrix-vector cross product

I want to do a cross product involving a vector of Pauli matrices $\vec \sigma = \left( {{\sigma _1},{\sigma _2},{\sigma _3}} \right)$; for example, $\vec \sigma \times \left( {1,2,3} \right)$. ...
1answer
85 views

### Exploiting self-adjointness when changing basis

I am using Mathematica to analyze a real, self-adjoint matrix $H$ of the size $32 \times 32$, which comes from a physics problem. In the picture there is also a matrix $Q$ which commutes with $H$. I ...
0answers
165 views

### Matrix algebra vs. PrincipalComponents and Varimax/Oblimin

Using matrix algebra I can calculate loadings and scores from the covariance matrix (data matrix is column centered): ...
4answers
249 views

### How to find the index of a square matrix in Mathematica quickly?

Let $A$ be an $n\times n$ complex matrix. The smallest nonnegative integer $k$ such that $\mathrm{rank}(A^{k+1})=\mathrm{rank}(A^{k})$, is the index fo $A$ and denoted by $\mathrm{Ind}(A)$. I would ...
1answer
39 views

### Partial row reduction of a matrix

I have an $m\times n$ matrix (presumably of full rank) with $m>n$, and I would like to row reduce it, but leave the last column unreduced; that is, I want to get output on the form \$\pmatrix{ 1 ...
1answer
82 views

### large matrix eigenvalue problem

I need solve a very large complex matrix (not sparse and not symmetry) eigenvalue problem, e.g., 1e4*1e4 or even 1e6*1e6. How large dimensions of the matrix can Mathematica support? And, how about ...
0answers
53 views

### Fast calculation of commute distances on large graphs (i.e. fast computation of the pseudo-inverse of a large Laplacian / Kirchhoff matrix)

I have a large, locally connected and undirected graph $G$ with $\approx 10^4$ vertices and $\approx 10^5$ to $\approx 10^6$ edges. Moreover I can bound the maximum vertex degree as $Q_{max}$. I ...
2answers
372 views

### Can RowReduce work in this matrix?

The matrix $Q$ with dimensions $n\times2*n*m$ is structured by $$Q=[B|AB|\cdots|A^{2*n-1}B]$$ where $Q$ is an augmented matrix built from a $3\times3$ matrix, $A$, and a $3\times2$ matrix, $B$. I ...
3answers
102 views

### Compute the rank of a matrix with variable entries

Say I have a matrix like $$M=\left( \begin{array}{c c c} x & xz & w-2x \\ wz^3 & xy & z \\ y^2-z^3 & x+w & z+x^5 \end{array} \right)$$ is it possible to ask Mathematica ...
2answers
72 views

### Matrix echelon/upper diagonal form

Is there a way to find the echelon form of a matrix in Mathematica? I see there is a function to find the reduced echelon form, RowReduce[], but I can't see ...
2answers
194 views

### badly conditioned matrix (General::luc)

With some matrices I am receiving the following message Inverse::luc Result for Inverse of badly conditioned matrix (M) may contain significant numerical errors. How can I tell to Mathematica to ...
3answers
218 views

### Proving a recurrence in Mathematica

I have $$j_n=\int_0^1 x^{2n} \sin(\pi x)dx.$$ How do I show that $$j_{n+1}= \frac{1}{\pi^2}(\pi- (2n+1)(2n+2)j_n)\, ?$$ I keep getting a recurring integration by parts and I can't simplify it. ...
2answers
154 views

### Why does my matrix lose rank?

I want to check the rank of a matrix for observability, but Mathematica loses a rank if the matrix contains very large numbers. Let's say my matrix is ...
2answers
215 views

### How to extract and compute on the diagonal entities of a sparse matrix very fast?

As could be seen in the following code: ...
2answers
99 views

### Computing distance matrix for a list

Using functional programming in Mathematica, how can I compute a distance matrix for every element in a list of matrices... The distance would be computed between the item in the list and a "target ...
1answer
425 views

### Eigenvalues and Determinant of a large matrix

Can anybody kindly explain to me what is going wrong regarding a simple problem I have? I can find the eigenvalues of a large matrix using Eigenvalues[], but when I ...
0answers
101 views

### Calculating the rank of a huge sparse array

By virtue of the suggestion in my previous question, I constructed the sparse matrix whose size is $518400 \times 86400$, mostly filled with $0$ and $\pm 1$. Now I want to calculate its rank. Since ...
2answers
120 views

### Efficient ways to create matrices and solve matrix equations

I am attempting, for the first time, to use Mathematica to do some serious linear algebra. I would like to solve systems of equations of the form $$U_{n n'} f_{n'} = b_n.$$ I have an expression for ...
0answers
105 views

### 6x6 matrix NullSpace

I'm working with a 6x6 matrix. Whenever I try to find the NullSpace and FullSimplify it, I get the error No more memory ...
2answers
116 views

### Defining a non-commutative operator algebra in Mathematica

I am trying to develop a function(s) to do some commutator algebra to compute the enveloping algebra and ideals of a Lie algebra. For example if I have $SU(2)$ algebra generated by $L_i$ ($i=1,2,3$), ...
1answer
99 views

### Computing the sign of the real part of eigenvalues in a 3D linearized system with 3 parameters

So I have this dynamical system given by: $$\left\{\begin{aligned} x' &= a(y-\phi(x))\\ y' &= x-y+z\\ z' &= -by \end{aligned}\right.$$ where $\phi(x) = \mu x^3 - \nu x$ and $a,b,\mu,\nu$ ...
2answers
232 views

### Gram Schmidt Process for Polynomials

I want to implement the Gram Schimdt procedure to the vector space of polynomials of degree up to 5, i.e. I want to find an orthogonal basis from the set of vectors $v=(1,x,x^2,x^3,x^4,x^5)$. The ...
1answer
217 views

### Efficient method for inverting a block tridiagonal matrix

Is there a better method to invert a large block tridiagonal Hermitian block matrix, other than treating it as a ordinary matrix? For example: ...
1answer
330 views

### Octonions in Mathematica

Is there a package or Notebook for Mathematica that can enable me to do some numerical calculations with octonions? Maybe a way to plug-in the octonion multiplication table?
2answers
201 views

### Speed up 4D matrix/array generation

I have to fill a 4D array, whose entries are $\mathrm{sinc}\left[j(a-b)^2+j(c-d)^2-\phi\right]$ for a fixed value of $\phi$ (normally -15) and a fixed value of $j$ (normally about 0.00005). The way ...
1answer
95 views

### Why is EigenValues returning Root expressions?

This is the code I have: ...
1answer
62 views

### Why does Eigenvalues[matrix I defined] not work? [duplicate]

This is the code I have in my mathematica notebook. I want to find the eigenvalues of the matrix I created called Hmatrix as defined below. However when I type Eigenvalues[Hmatrix] I get the Hmatrix ...
1answer
118 views

### Interpolating a Bivariate Polynomial over a Finite Field

Let $F=GF(p)$ be a finite field, $p$ prime and write $F^\times=\{x_1,\ldots,x_n\}$. I'm trying to implement an earlier version of Sudan's list-decoding algorithm for Reed Solomon Codes ...
1answer
133 views

### How to get the determinant and inverse of a large sparse symmetric matrix?

For example, the following is a $12\times 12$ symmetric matrix. Det and Inverse take too much time and don't even work on my ...
2answers
606 views

### Solving a tridiagonal system of linear equations using the Thomas algorithm

I'm trying to write a function that can solve a tridiagonal system of linear equations using the Thomas algorithm. It basically solves the following equation. (Details can be found at the Wiki page ...
1answer
301 views

### TensorContract of inverse matrix

Matrix inverse in mathematica If $A$ is an invertible $n \times n$ matrix, then $A\cdot A^{-1} = I$. To get this statement in Mathematica, you need the assumption ...
1answer
66 views

### Confirming the existence of a function related to a matrix

Is it possible to get an answer to the following question in Mathematica? Let $M$ be a $n$ by $n$ matrix, is there a function $m:\mathbb{N}\times \mathbb{N}\rightarrow \mathbb{Z}$ such that ...
1answer
127 views

### Can I reduce a matrix inequality such as $\mathbf x^\prime\mathbf A\mathbf x > \mathbf x^\prime\mathbf x$?

I'm new to Mathematica. When I do linear algebra, I wonder if I can have an inequality such as $\mathbf x^\prime\mathbf A\mathbf x > \mathbf x^\prime\mathbf x$, where $\mathbf x$ is a column vector ...
0answers
94 views

### How to express this output in the form $X=A.x$?

This problem arose in my stereo vision project. I have two matrices:  A = \left( \begin{array}{ccc} \text{x1}*\text{p131}-\text{p111} & \text{x1}*\text{p132}-\text{p112} & ...
3answers
604 views

### Discrete Convolution

Ask to compute the convolution of 2 lists, I managed to do so, with what I feel is rather heavy : Let my 2 lists be : a = {1,2,3,4} b = {1,1,1,1,1,1}; The below function adds 0s on each part of ...
1answer
319 views

### Linear Solve with Modular Arithmetic

I am interested in using LinearSolve[m,b] which will find a solution to the equation $m.x=b$, where I am in mod 2 arithmetic. Is there any way to perform this ...
0answers
62 views

### Inverse problem of Eigenvalues in DSolve

For my graduation exam I must prepare system of equations to satisfy some specific conditions. I have solutions, output 2, but I need equations eq11 and eq22. So here is an example. ...
3answers
85 views

### Selecting terms containing some expression

Imagine I have an expression like a*k + (a^2)*b*c + b*e and I would like to obtain the term containing, for example, some power of a. In that case I would ...
1answer
252 views

### Decoupling system of differential equations

Here I have one task and it is preparation for small exam. I solved it by hand for first case 1), but I need to check it in $Mathematica$ and to try to implement it for both cases 1) and 2) ...
1answer
102 views

### How to create a large sparse block matrix

I need to generate a very large sparse block matrix, with blocks consisting only of ones along the diagonal. I have tried several ways of doing this, but I seem to always run out of memory. The ...
0answers
178 views

### More efficient matrix-vector product

Dear mathematica users, In my present research I am faced with a real dense $n\times n$ matrix $A$ where $n \geq 3000$ (hopefully even more). The coefficients of this matrix are fixed, but I will ...
2answers
181 views

### Compiling LinearSolve[] or creating a compilable procedural version of it

Earlier today I had a discussion with a representative at Premier Support about the 2 questions I've asked here over the past couple of days: Seeking strategies to deploy a function securely ...
3answers
233 views

### Correct way to populate a DiagonalMatrix?

I would like to create a series of correlation matrices that starts with : sensMat[[1]] = DiagonalMatrix[ { 1,1,1,1,1 } ]) // MatrixForm and iterates in 0.1 ...
0answers
82 views

### Not getting the required eigenvalues [closed]

I'm trying to use Mathematica to show that the eigenvalues of $U$ are $\pm\dfrac{1-i}{\sqrt{2}}$, where $U = (I + T + iS)(I - T- iS)^{-1}$ where \$ S = \left( \begin{matrix} 1 & 1 \\ 1 ...
2answers
1k views

### How can I improve the speed of eigenvalue decompositions for large matrices?

I often need to compute the eigenvalues of large matrices, and I invariably resort to MATLAB for these, simply because it is much faster. I'd like to change that, so that I can work entirely inside my ...
0answers
76 views

### Evaluating a function on permutations of its arguments

Say I have a function "temp" of $n+1$ variables, $y,z1,z2,z3,...,zn$. I want to test if my function has certain symmetries like swapping $y$ with square of any $z$, swapping any two of the zs, ...
2answers
438 views

### Linear equation with complex numbers

I have to solve an equation of the type $$a z+b \overline{z}=c$$ with $a,b,c\in\mathbb{C}$. My approach is to set $F(z)=a z+b \overline{z}-c$ transform $z$ to $x+i y$ and then get a real linear ...
1answer
107 views

### RowReduce Problem

Here are two examples: RowReduce[{{3, 1, a}, {2, 1, b}}] evaluates to {{1, 0, a - b}, {0, 1, -2 a + 3 b}} but ...
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 70, "mathjax_display_tex": 7, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.897631824016571, "perplexity_flag": "middle"}