Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

10
votes
0answers
123 views

Efficient solution of huge sparse linear system

I'm trying to improve efficiency of my code in which main task is a solution to huge (~$10^4\times 10^4$) but sparse linear system $$Ax=b$$ (In fact my aim is to solve nonlinear equations $F(x)=0$, ...
9
votes
0answers
158 views

Bug in PositiveDefiniteMatrixQ?

Fixed in 10.1.0. Exists in at least 9.0.1 -- 10.0.2. This seems like a bug in PositiveDefiniteMatrixQ to me: ...
8
votes
0answers
138 views

Why has Version 10.3 precision reduced?

In version 7.0.1.0 and versions 10.0 and 10.1 the following is produced: ...
7
votes
0answers
141 views

Examples of using Mathematica to solve matrix equations symbolically

Suppose we want to solve a linear system like $$\left\lbrack\begin{array}{cc}M& S\\ -S^\mathrm{T}&0 \end{array} \right\rbrack \left\lbrack \begin{array}{c} x\\y\end{array}\right\rbrack = \...
6
votes
0answers
74 views

How to instruct MatrixLog to work with singular matrices?

How to instruct MatrixLog to work with singular matrices by ignoring the zero eigenvalues (thus only acting on a subspace orthogonal to the matrix kernel)? I'm ...
6
votes
0answers
335 views

Inverse of a large sparse Hermitian block matrix

I am looking for a method (if it exists) for the inverse of a large sparse Hermitian block matrix. The off diagonal sparse matrices, named δ are 4x4, and they have ...
5
votes
0answers
427 views

How to invert a matrix with 100 trillion elements?

I have a $10^{7}\times 10^{7}$ matrix with the following properties: it is sparse it is gamma-5 it is almost Hermitian. If $M$ is the matrix we are trying to invert, we know $M=A M^{\dagger} A$ ...
5
votes
0answers
239 views

Discriminant of Characteristic Polynomial

I'm doing a calculation which finds the characteristic polynomial of a matrix with rather complex entries and then determines the discriminant of that polynomial. For smaller matrices up to around 7x7 ...
5
votes
0answers
718 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 ...
4
votes
0answers
180 views

Finding eigenvalues in Mathematica: why so slow?

I am trying to find the eigensystem of a large sparse real symmetric matrix, and I only need the lowest 40 or so eigenstates. The relevant code is as follows: ...
4
votes
0answers
147 views

How can I force the use of sparse diagonalization methods?

When I evaluate the Eigenvalues function on a very large (e.g. 2^16 x 2^16) sparse matrix, Mathematica says something like: Because finding 65536 out of the ...
4
votes
0answers
566 views

Fast principal component analysis

I'd like to speed up a principal value value analysis. The data contains a large set of vectors with a large dimension. Both are in the range of 1000. I want to obtain the loadings matrix for further ...
4
votes
0answers
729 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 ...
4
votes
0answers
181 views

How to accelerate updating some parts of sparse matrices?

I am trying to update some parts of an specific matrix as rapidly as possible. In what follows, I first set up the basics things that I want to use ...
3
votes
0answers
41 views

Sparse matrix multiplication mod p

Let A and B be sparse matrices with integer coefficients between 0 and ...
3
votes
0answers
71 views

Why does Eigenvalues work for a matrix $\{M\}$ but not $\{\{M\}\}$?

Suppose I have a matrix {{1, 2}, {3, 4}} which I'll call mat. In a blur of human error, I computed the eigenvalues of ...
3
votes
0answers
89 views

How to force Series[] to compute expansions by considering non commutative multiplication?

I wish to compute the Taylor series expansion of the following iteration method $x_{k+1}=x_k-f'(x_k)^{-1}f(x_k)$ up to four terms of error ($e_k=x_k-\alpha$). When this is a scalar iteration, I very ...
3
votes
0answers
87 views

Real Canonical Form of Arbitrary Size Matrices

I have been searching the site and the Mathematica documentation, but have not found anything regarding this. If we find the Jordan Form of the following matrix, we get complex values, but I would ...
3
votes
0answers
52 views

FindInstance of Matrices

I'm trying to use FindInstance to find examples of matrices that complete an expression. However, it seems like I need to specify atomics as my variables to the function. So, here's a really simple ...
3
votes
0answers
80 views

Diagonalisation of equations for NDSolve

I have a linear matrix differential equation and I wish to speed up evaluation by diagonalising using eigenvectors. There is an example in Help for finite elements under "swinging beam" that is ...
3
votes
0answers
161 views

The CorrelationMatrix is equal to corrcoef of Matlab?

How can I generate a matrix which is equivalent to the results of the "correlation coefficients" command (corrcoef) in Matlab? When I make a LinearModelFit, I can get a CorrelationMatrix, but is this ...
3
votes
0answers
578 views

Symbolic matrix calculus: What's new in Version 9

I have seen some of the related posts, which ask about doing matrix calculation on tensors unknown dimensions. One of the posts mentioned that version 9 has some capability, but it was concerned about ...
3
votes
0answers
230 views

Mathematica Complains about Non Symmetric Covariance matrix, when it's not the case

I was doing some fitting with Mathematica7 using NonlinearModelFit. It's quite long the program to do the fit and that's why I am not displaying here ... It goes ok, and I can get the fit parameters ...
2
votes
0answers
28 views

Using Arnoldi Method with Multiple Options

I have a matrix with many complex eigenvalues, but I only need a few near a particular complex number. I am only looking at the imaginary parts, so I need the few closest on the imaginary scale to my ...
2
votes
0answers
46 views

Optimization for iterating and plotting a matrix product and its elements?

I have an iterative matrix product of this type Since i didnt knew how to do it, I explicitly wrote the product as {Ayn + Bxn, Cyn + Dxn} and evaluated it with the NestList construct ...
2
votes
0answers
125 views

Parallel evaluation of symbolic matrix eigenvalues

I'm trying to find eigenvalues of symbolic hermitian 40x40 block matrix. It is made from 20 2x2 matrices like this: ArrayFlatten[Table[M[m,n],{m,1,20},{n,1,20}]] ...
2
votes
0answers
84 views

MatrixRank of a large but sparse matrix

I want to find the rank of a very sparse, quite rectangular matrix mat, but I'm running out of RAM (I have 16 GB) if I try to use ...
2
votes
0answers
290 views

Fast export of large numerical data

Edit It seems that the bottelneck is not due to eigen value problem. I will esit the question soon. I have a 6000by6000 matrix which I got after some calculations. I want to get the eigenvalues and ...
2
votes
0answers
248 views

Best way to create symmetric matrices with block structure and additional symmetries of the submatrices

Update: you can now skip the "My attempted solution" part and jump to "My first attempt for improvement" in the end of the question. My question is related to Best way to create symmetric matrices . ...
2
votes
0answers
124 views

A math function similar to “LatticeReduce” for finding linear independent basis

We would like to ask a math function similar to "LatticeReduce" for finding linear independent basis. The input is a list of vectors $M=\{v_1,v_2,v_3,\dots\}$, with the following property: There is a ...
2
votes
0answers
426 views

Eigenvectors for a large symbolic matrix

I'm trying to compute the eigenvectors for a 42x42 symbolic matrix (with one variable) in Mathematica. I get the following error: Eigenvectors::eivec0: Unable to find all eigenvectors. >> and the ...
2
votes
0answers
232 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 ...
1
vote
0answers
44 views

Remove columns basing on binary sequence

Possibly it is duplicate, still I could not find here elegant way to remove matrix columns basing on binary sequence. i.e. if I apply {1,1,0,0,1,0,1} to matrix it should delete columns 3,4 and 6.
1
vote
0answers
46 views

Generating random Kraus operators

I am trying to generate (randomly) set of square matrices $\{K_m\}$ with the properties that $$\sum_{i=1}K_i^{\dagger}.K_i=I_n,$$ where $I_n$ is the identity matrix of order $n$. So, the input should ...
1
vote
0answers
47 views

Working with matrix

Considering the 3x3 matrix: m = {{0, -(I/Sqrt[2]), 0}, {I/Sqrt[2], 0, -(I/Sqrt[2])}, {0, I/Sqrt[2], 0}} How would I find its normalized vectors eigenvectors u_i ...
1
vote
0answers
45 views

Getting the row/column reduction matrix of a matrix m

Is there a simple way to get the row reduction matrix for a matrix m? As in, a matrix a such that ...
1
vote
0answers
107 views

Outer product using the quantum mathematica package

I am using the quantum Mathematica package and am trying to do computations that require me to use the outer (tensor) products of Pauli matrices. I would define this as, for example, ...
1
vote
0answers
84 views

How to speed up the construction of a large matrix

As a part of a physics problem that I'm working on, I need to construct a rather large matrix. The matrix is a real symmetric $2^{m}\times 2^{m}$ matrix for some integer $m$, which we would like to ...
1
vote
0answers
61 views

Calculating in the group ring $Q[GL_n(Z)]$

I am trying to use Mathematica to check some identities in the group ring $Q[GL_n(Z)]$. Is there a package/function of Mathematica to do this? Thanks a lot in advance!
1
vote
0answers
62 views

Exponential Matrix Diffentiation

I have been struggling with the following question while solving an optimization problem in $\mathbb{R}_{+}^G$. Basically, I have $$\min_{y \in \mathbb{R}_{+}^G} F(y) = y^{T}\mathcal{K} + \exp(-y^{T} \...
1
vote
0answers
50 views

Mapping over two indices with a condition

How can I use Map over two indices with a condition? I am trying to calculate second derivative of an eigenvalue, $\lambda_i(x)$, of $n \times n$ matrix $M(x)$ ...
1
vote
0answers
63 views

Multivariate Path Construction using Sobol numbers

I am sharing my code,which I have tried to perform as per the instruction mentioned below. Please correct it so that I could get my output. Instruction: Use the first m dimensions of the Sobol vector ...
1
vote
0answers
130 views

Speed matrix multiplications

I am trying to run this function ...
1
vote
0answers
48 views

matrix multiplication performance

I would like to evaluate $$ f(x,y)=\sum_{i=1}^{N} X_i(x)\,Y_i(y) $$ where $X_i(x)$ and $Y_i(y)$ are known functions for all $i=1,\ldots,N$, and $x$ and $y$ are from the rectangle $[0,A]\times[0,B]$, $...
1
vote
0answers
66 views

Getting an approximate analytical form for eigenvalues of a matrix

I have a 20x20 matrix: ...
1
vote
0answers
91 views

Calculate the matrix M such M.X=omega

I would like to determine the matrix M[3,3] such as M.X=w. ...
1
vote
0answers
105 views

Find algorithm or generator formula with automated procedure and pattern recognition

I am trying to find a generator formula for the discriminant of a polynomial and believe it would be an interesting problem for the Mathematica community to know how to automate evaluation of certain ...
1
vote
0answers
126 views

How to find Pauli matrices

I wanted to find the Pauli matrices, so i wrote down this code: z = {{a, b}, {c, d}} i = {{1, 0}, {0, 1}} Solve[z.z == i, {a, b, c, d}] and mathematica gave me ...
1
vote
0answers
156 views

Replace part of a matrix

I have to generate a ne numbers of matrices with 1 and 0 and then replace some elements. ...
1
vote
0answers
46 views

How to show Output of matrix in FortranForm with “&” character?

I have a matrix. and i have shown the output of matrix one by one element in FortranForm. the problem is i want to put "&" continuation charater in output because when i am copying the data into ...