The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [matrix]

Questions on the manipulation of matrices in Mathematica.

2,314 questions
Filter by
Sorted by
Tagged with
324 views

Why is arithmetic faster for inexact arithmetic?

I have been trying to compute eigenvalues of a rather sizable matrix A, about $500 \times 500$ (but sparse). I asked Mathematica to compute ...
234 views

Import matrices side-by-side separated by TAB

The problem is 0(TAB)0 interpreted falsely as a dark red square although it should be a dark red square surrounded by zeroes/ones. Import has different data-formats ...
2k 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)$. <...
1k views

How to normalize parts of matrix elements?

To normalize the last 2 or more columns of a matrix, ...
964 views

Solve equations real and imaginary part separately

For my system of equations, the procedure described in Solving complex equations of using Reduce works no more. How can I separate the real and imaginary part of ...
336 views

How do I plot Numerical Range of two hermitian matrices

Let $A_1$ and $A_2$ be two $3\times 3$ hermitian matrices. Then their numerical range is defined as two-dimensional set \begin{align} \mathbb{S}=\{\left[u^HA_1u,u^HA_2u\right]\in \mathbb{R}^2,u^Hu=1\}...
250 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 ...
1k views

Export matrix to $\LaTeX$ with style

Is it possible to export a matrix to $\LaTeX$ with style? For example this code will create a matrix with equal spacing matrix and with background colors in some cell, is it possible to export that ...
315 views

How to rewrite this function to be faster: Find sub-matrixes of boolean board which imply a given boolean pattern

I have Boolean matrix A (called "board") and Boolean matrix B with smaller dimensions (called "pattern"). I am trying to find sub-matrixes C of A such that C has same dimensions as B, and TableImplies[...
193 views

Defining an Implies operation that works for Boolean matrices

I have two Boolean matrices, that both have dimensions m x n. I want to create a function TableImplies, which would return True ...
490 views

Declaration of abstract matrices to perform series expansion on them

I would like to have abstract matrices M and S to get out the coefficients of matrix power series however it treats M and S as numbers even if i checked that M.S - S.M != 0. I attach my code below: <...
744 views

Matrix multiplication that includes a tensor

How would I best express the following in Mathematica: $\begin{pmatrix}2 & 4\end{pmatrix} \begin{pmatrix}r_1 & r_2\\r_3 & r_4\end{pmatrix} \begin{pmatrix}6 \\ 8\end{pmatrix}$, where $r_i$ ...
703 views

68 views

Symbolic Calculations with formal matrices [duplicate]

I want to make calculations with matrices in the form (for lovers of statistical mechanics, is just the first step replica symmetry breaking) ...