Questions on the manipulation of matrices in Mathematica.
4
votes
3answers
96 views
Output to preserve dot product
I am fairly new to Mathematica and I am faced with a problem. I tried to search for the solution but it seems that I don't know how to formulate the short search request.
I need to perform a matrix ...
0
votes
0answers
30 views
Eigenvalues for large matrices without Root-Solution [duplicate]
I read some other questions and tried to implement the given answers but yet, I did not succeed to find proper solutions for my eigenvalues.
I hope someone can show me how to do this for this case, ...
-1
votes
0answers
35 views
Simplifying Expressions to minimize multiplications [duplicate]
I have a big matrix, whose coefficients mostly have the following form:
2*(Lz*q*q0+Ly*p*q2-Lx*q*q2+Lz*p*q3-Ly*q0*r-Lx*q3*r)
This was obtained with Simplify, with ...
1
vote
1answer
59 views
Hermite Normal Form in “columns” convention
After describing the Hermite Normal Form (HNF), MathWorld explains:
The Hermite normal form for integer matrices is implemented in Mathematica as ...
-1
votes
2answers
90 views
Most efficient way to sum over matrix products?
I have two lists. The first, coefficientlist, is dense and has dimension {176,176} elements. The second, ...
3
votes
0answers
85 views
Analytically solve the eigenvalue problem with infinite dimensions by Mathematica?
If I am given a symbolic expression of all the matrix elements in an infinite-dimensional space, e.g., the Hamiltonian of a quantum mechanical system, is it possible to get the symbolic expression for ...
0
votes
1answer
129 views
How to give the position of non consecutive numbers?
Give the position of non consecutive numbers
in the first column of a sorted table.
list = {{1, 3, 5}, {3, 3, 5}, {4, 3, 5}, {5, 3, 5}, {7, 3, 5}}//MatrixForm
...
2
votes
1answer
65 views
PermuteSubgraph not working? (Combinatorica)
I am trying to write a code to perform the QAP partialling analysis (here's a paper to know more) but the part in which I "scramble" the graph with PermuteSubgraph does nothing, I am actually not ...
1
vote
3answers
93 views
How to convert a spaceless data into tab delimited
I have a data set in form of:(this is just an example)
1324501020
3241030205
4332020134
the data are stored in a text file (e.g. data.txt) but I need to convert ...
0
votes
0answers
54 views
Sudden increase in computation time for similar computations
I'm doing some numerical simulations on a physical system. In the most simplest form I have now the following:
...
0
votes
0answers
45 views
Difference between matrix rapresentation [duplicate]
I've noticed different behaviour in Mathematica between matrix representation:
The matrix
a={{1,2},{3,4}}
is different from
b=a // MatrixForm
Why i obtain ...
0
votes
1answer
64 views
Pattern match with Table for matrix dimension check
In Mathematica, often an expression involving matrices will encounter dimension mismatch errors, like we are multiplying a 3x2 matrix to a 3x4 matrix. Below we define a new symbol Dim, which can be ...
2
votes
2answers
102 views
Optimizing functions taking matrix arguments
I'm looking for general information on how to optimize matrix valued functions, I have the following function I'm looking to maximize (or figure out if this is possible at all).
...
1
vote
2answers
140 views
extracting the rows of a matrix satisfying a condition (e.g. all elements negative)
I have a matrix with thousands of rows and want the submatrix comprising the rows of the original matrix that have, e.g. a negative element in column 3. How to do that?
-1
votes
1answer
65 views
0
votes
0answers
34 views
How could I find the correct values for every array that would lead me to unique summation number for every unique chain? [migrated]
I have 9 arrays, each array has 9 values, I need to get the proper values in every value's position for every array, and that would give my a completely unique summations for every value's chain from ...
2
votes
2answers
49 views
Expanding Matrix Expressions
I want Mathematica to recognize that
A.(-B.C)+A.B.C = 0
Yet FullSimplify and the like leaves the expression as it is. How do I get around this?
0
votes
1answer
144 views
Add a sub-matrix of zeros in big matrix [duplicate]
I have a matrix of size $24\times24$ composed by 8 $3\times3$ submatrices in a diagonal way. I want to add a matrices of zeros ($3\times3$) between the sub-matrices, so the final matrix would be of ...
2
votes
3answers
152 views
Saddle Point in Matrix
Here is the Problem how to find out the Saddle Point inside Matrix.
m = {{9, 3, 1, 8, 0},
{6, 5, 4, 6, 7},
{2, 4, 4, 3, 8},
{5, 6, 2, 2, 1}}
2
votes
1answer
127 views
0
votes
0answers
49 views
2
votes
2answers
105 views
Mass Symbolic Manipulation with Subscripts? (from plaintext Input)
The simplest example of the change being sought is a greek letter, typed in as plaintext nu, and its may be replaced by the symbol, ν:
expr = 3nu*kx*ky+ ...
1
vote
0answers
75 views
2
votes
1answer
84 views
Optimizing a simple calculus using a list of matrices - Repeated dot product between a vector and a list of matrices [closed]
I want to make the following operation :
$$ \begin{bmatrix} \dot q_1\\\dot q_2 \end{bmatrix} + \begin{bmatrix} \begin{bmatrix} q_1 & q_2 \end{bmatrix} \mathbf A_1 \begin{bmatrix} q_1\\ q_2 ...
2
votes
1answer
50 views
How do I access the binary matrix underlying an EdgeDetect output?
Applying EdgeDetect to an image generates a black and white edge-detected image, which I suspect corresponds to an underlying binary matrix. How can I access this ...
1
vote
1answer
170 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 ...
0
votes
2answers
89 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 ...
4
votes
4answers
228 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)$.
...
1
vote
1answer
70 views
0
votes
0answers
98 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 ...
2
votes
1answer
88 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 ...
3
votes
1answer
90 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 ...
3
votes
2answers
121 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 ...
3
votes
1answer
66 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 ...
8
votes
3answers
150 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:
...
3
votes
3answers
90 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$ ...
1
vote
1answer
45 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 ...
5
votes
4answers
272 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 ...
0
votes
1answer
107 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 ...
2
votes
0answers
67 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 ...
4
votes
3answers
116 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 ...
1
vote
2answers
93 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 ...
0
votes
0answers
81 views
Defining and Solving Systems of Equations Using Matrix Tables
I've defined a system of equations, but I been unable to get Mathematica to solve for the individual variables created by matrix tables.
...
1
vote
0answers
89 views
Dynamically filling matrix with a[[n,m]] = 1/a[[m,n]]
I'm building a square matrix, with 1s on the diagonal and elements in U the inverse of elements in L, which are random integers drawn from the sequence 1, ..., 9. Given the nature of the problem I ...
-4
votes
2answers
80 views
Ploting from Matrix [closed]
I use Import function from excel in order to get my data. My data contains 3 columns.
...
2
votes
2answers
70 views
changing a symbol into a function variable
Struggled for a while on this problem and hopefully you can help... I have a mathematical expression that currently has a symbol where I used to have a function variable. How do I make the symbol ...
1
vote
2answers
111 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 ...
6
votes
5answers
197 views
Is there a built in function to obtain the back diagonal of a matrix?
Given the following matrix:
m = Array[Subscript[a, #, #2] &, {4, 4}]
how can I find the skew diagonal or anti-diagonal or back diagonal of the matrix ...
1
vote
1answer
96 views
Weighted Kirchhoff Matrix?
I have a weighted graph and I want its graph Laplacian matrix (what Mathematica calls the Kirchhoff matrix in the unweighted case). Is there an easy way to get this?
For example, the command:
...
1
vote
2answers
146 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 ...



