Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

0
votes
0answers
14 views

How to invert a matrix with 100 trillion elements?

I have a 10^7 by 10^7 matrix with the following properties: it is sparse, it is gamma-5 and almost hermitian (If M is the matrix we are trying to invert, we know M=A(Hermitian Conjugate M)A and ...
6
votes
3answers
175 views

How to build a matrix from a set of vectors and other matrices using ArrayFlatten

I want to build a 6 by 3 matrix, from the following: one vector is 3 by 1, then a matrix, which is 3 by 2. These will go to the top 3 rows. Now the bottom 3 rows, I'll have 3 vectors each is 3 by 1. ...
1
vote
2answers
84 views

Solving matrix equation

How can I solve the forward equation S[t]=C+A*S[t+1]*(Inverse((I-B*S(t+1)))*A for t=1 to t=10 and ...
1
vote
0answers
55 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
2answers
55 views

Diagonal minors of matrix

I need to calculate the minor of a matrix. I am going to use Mathematica example here, In[1]:= (mat = Table[i^2 + i j + j^3, {i, 4}, {j, 4}]) // MatrixForm; Minors[mat, 3, Identity] // MatrixForm; ...
3
votes
3answers
113 views

List manipulation: Dropping first or last row or column of a matrix

How do I drop the first/last row or first/last column from a matrix? The general case is answered here but I am new to Mathematica and it the arbitrary case is unnecessarily complex. Suppose I am ...
0
votes
1answer
34 views

Elements inside arrays seem to be strings rather than signed numbers

When I have code like b = Array[Subscript[be, #] &, {3, 1}] b = b /. {Subscript[be, k_] :> Subscript[-be, k] /; k > 1} I am noticing that Mathematica ...
4
votes
3answers
145 views

Replace elements in matrix to make it symmetric using automated procedure

I am generating a matrix using (mat2 = Array[Subscript[a, ##] &, {4, 4}]) // MatrixForm but would like to force Mathematica to make it symmetric. Thereby I ...
2
votes
1answer
94 views

Force Mathematica to return numerical answer to (relatively) complicated differential function

I am trying to take the Laplacian of the LogDet of a 2x2 matrix that I call V\[ConjugateTranspose].V, and actually get a number out at the end. Why does Mathematica ...
0
votes
1answer
44 views

How to plot first and second row from matrix to a graph

i have this function: ...
0
votes
0answers
20 views

Manipulating nested matrices columnwise [duplicate]

I have a project that requires analyzing large volumes of excel sheets at the same time. I have been having trouble figuring out how to index the imported files and manipulating them. The way I am ...
0
votes
1answer
55 views

How to obtain a convergent solution iteratively for a linear system of equations

I am working on a problem that requires an iterative procedure to solve a linear system of equations, the system of equations in matrix form is: $$\underbrace{\begin{bmatrix} r_{11} & r_{12} ...
0
votes
1answer
24 views

Why Table is not giving me the same sequence for eigenvalues of matrix

Let consider a matrix and evaluate the time dependent eigenvalues M[t_]:={{Sin[t],Cos[t]},{t,t*t}}; e1[t_]:= Eigenvalues[M[t]] Now If I evaluate ...
1
vote
0answers
58 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 ...
0
votes
1answer
23 views

Reduce Vector/Matrix mod N [closed]

If I have a vector such as below and want to reduce it mod a number, how can I do this? V = {{176}, {648}}; MatrixForm[V] MatrixForm[V, Modulus -> 26] Both ...
0
votes
0answers
87 views

Solving Symbolically Equations with Vectors and Matrices

I want to solve equations with vector variables and vector/matrix parameters symbolically. As a basic example I would like to be able to solve something like $[I-aG]x=b$ where $a,b \in \mathbb{R}^l$ ...
5
votes
4answers
490 views

Elegant mehod of generating this matrix?

Good evening, I need to determine an elegant (as possible) method of computing an nxn matrix below (the matrix shown is just a 16x16 example). I've been toying with For loops, Tables, Bands, ...
0
votes
1answer
161 views

Code efficiency improvement needed solving problem 499 in Project Euler

I am trying to solve https://projecteuler.net/problem=499 by constructing a transition matrix and finding its steady state. Here is my code: ...
1
vote
1answer
72 views

How to paste matrix to website and Email?

I tried to copy matrix from Mathematica to website, only end up with lots of garabge like this: ...
2
votes
2answers
51 views

How to edit a list according to the other list? [duplicate]

Gday guys. This problem troubles me, and I hope you can help me solve it. Say I have two random lists L1={{2},{5},{1},{0},{4},{7},{8}} L2={2,5,1,0,4,7,8} and ...
4
votes
2answers
136 views

How to check whether elements of a list meet a condition without generating the whole list first?

I have to find the number of elements satisfying a given condition from the set: Tuples[Tuples[Tuples[{0,1},n],n],m] The condition for $n=3,m=3$ is: ...
5
votes
2answers
499 views

The magic square function

There're some matrices that the sum of columns, sum of rows, and sum of diagonals are the same value. Here is an example: ...
0
votes
0answers
31 views

Failure to evaluate functions of derivatives of Theta functions

I define a variant of the EllipticTheta function (multiplied by a constant factor) : ...
0
votes
0answers
75 views

Solving a system of equations involving partial derivatives for a wave

Before saying anything about the problem, I have checked "How to solve a system of partial differential equations?" yet it does not actually answers my question, as I have a 10x10 matrix to work on. ...
4
votes
3answers
228 views

Get Eigensystem to return orthogonal eigenvectors for Hermitian matrix

I have a Hermitian matrix, and I would like to get a list of orthogonal eigenvectors and corresponding eigenvalues. But when there are degenerate eigenvalues, sometimes Eigensystem/Eigenvectors ...
8
votes
7answers
283 views

Input a square matrix and return a list of the matrix entries read by antidiagonals

I have a square matrix: {{1,2,3},{4,5,6},{7,8,9}} and I want to get a list: {1,2,4,3,5,7}
1
vote
3answers
61 views

Form a matrix to have inequality elements

It looks like a silly question, but I could not find any answers online. Your help is greatly appreciated! Say I have two lists now. ...
0
votes
0answers
31 views

Does Mathematica support Laguerre Polynomials of Matrix Argument?

I am wondering whether Mathematica can also compute the Laguerre polynomials of matrix argument as the appear in multivariate statistics? For example, they appear in this paper here: ...
1
vote
1answer
60 views

Wrong generalized eigenvalues of large numeric matrices

I've been working on a toy model of a variational method of a Hamiltonian H with an overlap matrix S. The point is that when H and S are small enough, Mathematica gives the correct eigenvalues (≈ ...
5
votes
1answer
163 views

Largest matrix size supported by Mathematica 10

I have need to store large square matrices in memory, some times sparse, some times not. I have used up to $2^{15}$ by $2^{15}$ as my upper bound so far, and Mathematica has handled it even if it took ...
1
vote
1answer
47 views

Defining a matrix with the symmetry Transpose[A(q)]=A(-q)

I am trying to construct a symbolic matrix with the following property- $$ \left(D_{3\times3}(q)\right)^T = D_{3\times3}(-q) $$ Note that for $q\in \mathbb{R}$, $D(q)$ would be hermitian. So far i ...
1
vote
1answer
67 views

Getting a part of a matrix Inverse for later use

I was trying to get an element of a matrix, and use in further computation of my program. Problem was that its not reading the value unless and until I specify it again. My code is: ...
1
vote
2answers
62 views

Insert an element to AdjacencyGraph

I'm not able to insert an element to mine AdjacencyGraph. I suppose that i should modify my AdjcencyMatrix: ...
0
votes
1answer
59 views
4
votes
3answers
205 views

How can I suppress zero or nonzero values in a matrix?

So, if I have something like: F[IdentityMatrix[3] // MatrixForm, 1] I'd like F[] to display: $$\begin{pmatrix} 1 & ...
5
votes
4answers
239 views

Replacing parts of a matrix

I'm a beginner to Mathematica and to writing scripts in general. I'm currently trying to write a code that will take any element in a matrix higher than a certain threshold value n and set it equal to ...
1
vote
0answers
110 views

I need some GPU benchmark for Mathematica

I am considering to buy a GPU. I need to know two things: Is it possible to solve a system of differential equations using GPU and Mathematica's functions? I need to know how much faster would be ...
0
votes
0answers
21 views

'MatrixForm' problem [duplicate]

I prefer to use 'MatrixForm' because the form looks better in matrix manipulation. But my current problem is that after the use of 'MatrixForm', subsequent matrix calculations like 'Det' or 'Inverse' ...
3
votes
1answer
135 views

Calculate efficiently an expensive hermitian matrix

I want to compute a matrix $M_{pq}$, for which the calculation of each coefficients $M_{pq} = f(p,q)$ is an expensive function. I know that my matrix is hermitian, so that $M_{qp} = M_{pq}^{*}$. As a ...
0
votes
0answers
97 views

How to speed up my code with constructing matrices

I have run this program for a long time to get the result for n = 2048(about 5hours) and no more result till now (can't run with n = 4096). I would know how to make it more efficient. Any help or ...
4
votes
2answers
152 views

Finding the Position of the Minimum Neighbor for Each Element in a Large Matrix

I have a large matrix ($6020\times 8452$), and I want to create a new matrix where the relative position of the minimum neighbor is each element in the matrix. For example, if I had the matrix ...
3
votes
1answer
93 views

Making table of matrix product and efficiency

I want to make a table in which each element is a matrix product: ...
3
votes
1answer
133 views

Polar Decomposition

I'm new to Mathematica 10 (half-a-month user). I'm looking for a function of polar decomposition but for now I cannot find it. Can anyone tell me about related functions. Thanks in advance.
1
vote
1answer
55 views

Computation time depends on the matrix elements!

Consider these two lists of matrices, matrix and matrix2: ...
15
votes
2answers
393 views

Why is my data 10 times slower than random data when doing matrix multiplication

I have some data generated from some program, and it appears that matrix multiplication on these data are about 10 times slower than on some random data: ...
1
vote
1answer
77 views

Efficient method of raising matrix to a variable power?

I have a $2 \times 2$ matrix $A$, where each element is a 12th order polynomial in a parameter $a$. I need to raise this matrix $A$ to the $-t/T$ power, where $T$ is a known scalar (for this ...
2
votes
2answers
101 views

specified matrix query

can you tell me a way (best?) to get a matrix with i=N,j=N dimensions (quadratic) according to the following rules: variables: N , M, n the diagonal must contain zeros it must contain exactly M ...
4
votes
1answer
176 views

Table and memory efficiency

Consider these two types of creating matrices: Table[Table[i*j,{i,1,10}],{j,1,10}] Table[i*j,{i,1,10},{j,1,10}] I want to know if there is any difference ...
4
votes
1answer
141 views

Fast matrix multiplication in MMA and GPU

Matlab multiplies two 3000by3000 matrix around 0.18s faster than MMA. While for just a few matrix multiplications the speed difference is not important, it becomes crucial when I want to do those ...