# Questions tagged [matrix]

Questions on the manipulation of matrices in Mathematica.

2,922 questions
Filter by
Sorted by
Tagged with
3 views

### How to solve for matrix equation X . A . X^{T} = B?

I need to find a matrix $X$ such that it belongs to $O(D,D)$ and satisfies the equation $X A X^{T} = B$, where $A$ and $B$ are known. I have no idea how to easily do this in Mathematica. Any tips? ...
24 views

### How does one specify that an input variable is an integer?

Essentially, I want to combine 4 square matrices using the ArrayFlatten command. However, I am specifying the matrix dimensions as an input variable as follows, ...
36 views

### Grouping vectors into groups of 3 by attribute

Three groups are given, each with eight $3 \times3$-vectors: ...
37 views

### How to generate random matrices with contraints?

I have a matrix mat = {{Sqrt[(1 + a0 + a3)/2], (a1 - I a2)/Sqrt[2 (1 + a0 + a3)]}, {0, Sqrt[(1 + a0 - a3)/2 - (a1^2 + a2^2)/(2 (1 + a0 + a3))]}}; How can I randomly ...
32 views

### A linear algebra problem about the multiplication count for given matrixs [closed]

This is a problem from Introduction to Linear Algebra 4th edition Problem: Section 2.4. Problem 36: Suppose A is m by n, B is n by p, and C is p by q. Then the multiplication count for (AB)C is mnp + ...
94 views

### Find transformations for two non-square matrices $A$ and $B$

Given two matrices $A$ and $B$: What transformation needs to be applied to transform matrix $A$ into matrix $B$? ...
158 views

### Vectors do not define a plane when constructing a RotationMatrix

The following code: RotationMatrix[{{0, 1, 0}, {0, -1, 0}}] Gives an assertion message: ...
75 views

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

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

...
38 views

### Reducing to Irreducible Representations

Group Theory Background / Utilities Suppose I give you a list G of matrices which represent some group, in that the matrices are closed under multiplication. In ...
34 views

31 views

### Real antisymmetric matrix implementation

$x$ is a real antisymmetric matrix and is defined as: ...
51 views

### Transform a Matrix as an expression

If I have a matrix that I know it can be written as (xi.xi)*KroneckerProduct(H,xi), where xi and H are vectors. Is there a way to obtain this expression from a given matrix?
111 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 ...
61 views

### Derivative matrix by vector in Mathematica

This is an excerpt from the article https://www.sciencedirect.com/science/article/abs/pii/S0094114X10000418. How do I write this using vector-matrix operations (...
40 views

81 views

### Symmetric matrix from a vector

There is a function VectorToSymmetricMatrix that does the following: ...
42 views

### Compute the correlation of eigenvalues of a Gaussian Random Matrix

Background Let $M$ be a $N\times N$ random symmetric matrix, which is drawn from a Gaussian distribution of mean $\mu=0$ and variance $\sigma^2=1/N$. The first level correlation is defined by: \begin{...
216 views

### Make matrixes with numbered name

Suppose I have two matrixes M1 = {{0, 0}, {0, 0}} M2 = {{0, 0}, {0, 0}} Now I wanna have $N$ matrixes in this form called M1, M2, M3, M4,...MN How to code to ...
121 views

### Eigenvalue and SparseArray

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

### Bug in FunctionLayer for matrix products

I am trying to figure out if this is a bug or if I do not understand something about FunctionLayer. For reference this is: Mathematica v12.3.0.0 Define the matrices:...
51 views

### Solving a matrix differential equation by using a function that takes a matrix as its argument

I have a function g of the form g[y_]:=A.y.B where y is a 2-by-2 matrix whose elements are ...
303 views

247 views

### Generating a weighted oriented lattice

I have a periodic lattice, and I would like to associate some phase parameters connecting to the neighbors that can be thought of as a hopping parameter. Now the choice of these phase parameters is ...
48 views

### Error in plotting a quantity involving integral!

With my limited knowledge of Mathematica, I tried but could not figure out the issues in the following few-line code: ...
152 views

### Create a matrix without definition of dimensions

is it possible to define a matrix without giving its dimensions in Mathematica, e.g. First line: mattest[[1,2]] = 1; Second line: ...
151 views

### Creating a matrix

I have a function as follows: f[x_, t_] := x + t; Table[{x, t, f[x, t]}, {x, 0, 1}, {t, 0, 2}] When I write MatrixForm[%], I ...