Skip to main content

# 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,618 questions
Filter by
Sorted by
Tagged with
0 votes
1 answer
62 views

### How to convert a $2 \times 2$ matrix with entries of $4 \times 4$ matrices into a regular $8 \times 8$ matrix

I have tried to create the following matrix $$\begin{bmatrix} 0_{4} & \mathbb{I}_{4} \\ \mathbb{I}_{4} & 0_{4} \end{bmatrix}.$$ I have used the following code ...
• 629
0 votes
1 answer
53 views

### Problems with defining a R(c)-linear operator

My objective is to define an opeartor op such that for every rational function $f(c)$ of a fixed symbol c, $op(f(c) x)=f(c) op(x)$. What is a good way to implement ...
1 vote
2 answers
300 views

• 575
0 votes
1 answer
57 views

### Finding kernel of a set of polynomial functions [closed]

I have a list of polynomials fi[x_] and polynomial fractions qi[x_] (with i as an iterator) ...
• 45
3 votes
2 answers
153 views

### Solving three equations with two unknowns with constant parameters

I have the following two equations: 'r1andr2. Here,n, x, ...
• 575
1 vote
2 answers
52 views

### How to get all possible multiplicative combinations of $5$ matrices with unique output

I have a list of five $256 \times 256$ matrices. These are called generator matrices as their multiplicative combinations generate a "Stabilizer group" ...
• 629
2 votes
2 answers
88 views

### Subsets command not working as expected with dot product of matrices

My understanding is that Subsets[Dot[a,b],{1,2}] gives the output ${a, b, a.b }$ But for some reason, this does not work when I try to do it with matrices. ...
• 629
0 votes
2 answers
117 views

### How to solve a linear equation set in matrix form? [closed]

I am trying to solve a linear equation set in the matrix form. For example, A={x+y,x-y},B={2,0}, the equation is ...
2 votes
0 answers
49 views

### Calculating time too long for $A\succeq I$, minimize $tr(A)$ when $A$ is of dimension 4

Suppose $A_0$ is a 4*4 matrix, the constraint is $A_0\succeq I$, which means $A_0-I$ is semidefinite positive. The target function is maximum of 1-tr($A_0$), and the answer is -3 when $A_0=I$. However,...
• 121
1 vote
2 answers
87 views

### How to find all the possible products from a list of commutative $2 \times 2$ matrices?

Say if I have a list of commutative $2 \times 2$ matrices. I'll call these $2 \times 2$ matrices $A, B, C, D$. Mylist=List[A,B,C,D] Say if I want to find all ...
• 629
0 votes
1 answer
53 views

### How to confirm that these tensor-product matrices commute [closed]

So I want to show that these "stabilizer operators" commute. These operators are the tensor products of $8$ $2 \times 2$ matrices. As such the operators themselves are $256 \times 256$ ...
• 629
1 vote
0 answers
74 views

### Dot product of every pair of rows of a matrix

I have some code to get the cosine of the angle between vectors given by every pair of rows in a large rectangular matrix, ...
• 2,195
3 votes
1 answer
85 views

### Find more relationships with LatticeReduce

I'm using LatticeReduce to find linear relationships in these trigonometric expressions, ...
• 7,148
2 votes
3 answers
166 views

### Converting an algebric expression into a matrix form

Consider the following expression: a1 b1 c1 + a4 b2 c1 + a7 b3 c1 + a2 b1 c2 + a5 b2 c2 + a8 b3 c2 + a3 b1 c3 + a6 b2 c3 + a9 b3 c3 Can Mathematica convert it ...
• 575
0 votes
0 answers
36 views

### Calculating determinant and adjoint of a matrix of arbitrary dimensions

I am trying to compute the determinant and adjoint/adjugate of a matrix with each entry a polynomial in symbolic variables a[1],...,a[k] and dimension some ...
1 vote
1 answer
94 views

### The central product and the permutation representation of the Pauli group of order 16

I am interested in obtaining a permutation representation of the Pauli Group $G_1 = \langle X, Y, Z \rangle$. I think this would be easy enough as a "Regular representation" but then I learn ...
0 votes
0 answers
44 views

### Formal solution to large system of equations using Reduce

I'm trying to solve a large system of equations (there are 12 equations with 12 complex variables, hence I'm expecting to be able to write 12 real components as functions of the remaining). I tried to ...
2 votes
2 answers
141 views

### Plotting 3x3 Linear System

I am trying to plot the following linear system ($3\times 3$) in different ways. My question is what wrong have I done to my last code? ...
1 vote
1 answer
54 views

### Solving algebraic equations perturbatively (using function series)

I have linearised some equations and trying to solve them perturbatively in powers of small parameter $e$. Here is my script ...
• 163
0 votes
0 answers
66 views

### JacobianMatrix function flattens input in column order

The JacobianMatrix function appears to flatten its input in column order. Both of the following queries (Wolfram Alpha syntax) give the same result: Q1: "JacobianMatrix of {{a_1+a_2, a_1+ a_2, ...
0 votes
2 answers
86 views

### Get transformation matrix from transformations

I want to find a matrix corresponding to certain transformations I already know. Basically I have a set of vectors $x_i$ and I need the matrix $m$ that transforms $x_i$ to another set of vectors $b_i$ ...
1 vote
0 answers
60 views

### Nullspace etc using a different inner product over finite fields [closed]

In the context of coding theory, linear codes over finite fields make repeated use of kernels/nullspaces for creating e.g. parity check matrices. However, often the "dot" product between two ...
• 11
3 votes
3 answers
205 views

### Finite Differences:

I am having difficulty implementing finite differences in the correct columns of my code. ...
4 votes
2 answers
86 views

### How do I generate a table of cofactors from minors of a matrix?

I'm trying to figure out how to find the determinant of a 5x5 matrix by co-factor expansion in the second row. I have already calculated the minors of the matrix using ...
4 votes
1 answer
171 views

### Writing a matrix as a linear combination of matrices

Suppose I have two matrices A and B. After some calculations, I arrive at a matrix M and ...
0 votes
1 answer
80 views

• 7,875
5 votes
1 answer
88 views

### Saving solutions of equations with indexed variables to a table

I am trying to solve a set of equations which are very ugly and have indexed variables. I have a vector of expressions ...
• 411
1 vote
0 answers
124 views

### The first step to Speed Up using GPU

If we run the following code, mathematica kernel uses only CPU : LinearOptimization[ x + y, {x + 2 y >= 3, x >= -1, y >= -1}, {x, y}] I want the ...
• 4,325
1 vote
1 answer
96 views

### Solving a large system of linear equations

I am very new to Mathematica (started two weeks ago), and I am trying to solve a system of linear equations consisting of nine equation. My matrices A and ...
• 11
1 vote
1 answer
103 views

### Fit a point that defines a 90° angle

I'm trying to come up with a fit that will give me x,y coordinates of a point, that best fit in 2 slopes, the 2 slopes intercepting at 90°. At the moment I fit individually 2 lines to a 2 sets of ...
• 159
4 votes
1 answer
96 views

### Tensor product inside the compiler

The compiler does not have support for tensor product, are there any packages that implements the tensor product in a way that can be compiled? I need to take the tensor product of several numeric ...
• 609
5 votes
1 answer
148 views

### What is computed by LinearAlgebraPrivateMatrixConditionNumber?

The following returns 51/7, even though the condition number is actually 9. I'm curious, what does 51/7 correspond to for this matrix? ...
• 7,875
0 votes
0 answers
84 views

### Break symbolic eigenvalue calculation early

I am computing eigenvalues of matrices with single monomial entries (x,y,z, etc.) and for efficiency, need to truncate calculations early if any eigenvalues contain non-linear (x^{2}, \sqrt(x),x*y etc....
8 votes
2 answers
388 views

### Given square matrices A and B, how to solve T obeys Transpose[T]. A . T = B?

Dear Mathematica experts, Given two square matrices, A and B, how do we use Mathematica to solve a matrix T such that T satisfies this matrix equation? (Here we have A,B,T $\in$ general linear matrix ...
• 251
4 votes
1 answer
74 views

### Is there a non-allocating way to modify elements of single-reference packed arrays?

I need to repeatedly increment cuboidal chunks of a 3D image. The image is large - on the order of 1G elements. The only way I know of doing it using built-in Image functions is: ...
1 vote
0 answers
92 views

### Output a 24 by 24 Leech lattice

Input a rank-8 $E_8$ lattice,  M_{E_8}=\begin{pmatrix} 2 & -1 & 0 & 0 & 0 & 0 & 0 & 0 \\ -1 & 2 & -1& 0 & 0 & 0 & 0 & 0 \\ 0 &...
• 251
0 votes
1 answer
76 views

### A simpler way of identifying which elements of Tuples[{0,1,2,3},6] multiply with each of my codewords to give zero?

So I have a list of codewords. The codewords have length 64, so there are 64 codewords in my code. My code is over an alphabet of 4 (the code can be thought of as having four elements $0,1,2,3$ and ...
• 629
2 votes
1 answer
90 views

### How to create a vector as a tensor object for different euclidean bases?

The components of a tensor are always displayed with respect to one or multiple basis vectors. For a tensor of rank 1, a vector, in 3D-euclidean space, we resort to three orthonormal basis vectors. ...
• 45