Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

0
votes
0answers
7 views

Value Iteration (Recursive iteration) to Minimize (Optimize) a Function

I have a function that I call as "Value". I am trying to find the minimum of this function and this function is a function of 4 other functions. One these four functions is recursive based on the ...
0
votes
0answers
15 views

Find the minimum element of a row of a matrix and its column index for each row

I am trying to find the minimum value of a row of a matrix and its corresponding column. For instance, I have three functions: ...
1
vote
1answer
125 views

How do you solve a linear equation of matrices?

The function Solve works fine for scalars: In[]:= Solve[A x - x B + C == 0, x] Out[]= {{x -> -(C/(A - B))}} When using matrices however, ...
1
vote
1answer
67 views

Evaluate pure function through round brackets

In have some matrices of pure functions or numbers which I multiply by other matrices or vectors. I would like the functions to be evaluated in the result, but all that I get is something like this: ...
1
vote
1answer
29 views

A question on JordanDecomposition in Mathematica

How can I have Mathematica show me also the inverse matrix of the similarity matrix of JordanDecomposition of a matrix? Obviously I need to use here the ...
1
vote
1answer
48 views

Define a 4d matrix without for loop

I was wondering if there is a way to avoid for loop here: I want to define a 4d matrix H(i,j,k,l), and each entry in the matrix is calculated through a complex function, say Do_H(i,j,k,l), depending ...
2
votes
1answer
34 views

Square bracketed matrices in Mathematica - precision markers?

I'm trying to display Matrices with square brackets in Mathematica. I've found this post from a mailing list in 2009 http://forums.wolfram.com/mathgroup/archive/2009/Aug/msg00458.html and it seems to ...
7
votes
1answer
102 views

Why FoldList 5 times faster than Apply for matrix multiplication?

Consider this list of $2x2$ matrices: list=RandomReal[{-2,2},{500,2,2}]; Now compare timings of Apply and ...
5
votes
1answer
126 views

Calculate the ESP Grid based on Density Grid

I want to build a fast way to convert a density grid file into a grid file of the respective electrostatic potential (ESP; also known as MEP, the molecular electrostatic potential). This ...
0
votes
0answers
51 views

Mathematica 10 cannot use EulerMatrix? [on hold]

I am using Mathematica 10 on Linux 64-bit and the function EulerMatrix does not work. Is it related with an unloaded package or something? Does every copy of ...
5
votes
4answers
437 views

How to simplify block of multiple repetitive If statements?

I'm building a boardgame...game in Mathematica. I have the board state represented as a matrix. It's a two player game, and each player (let's call them A & B) only has one type of piece or ...
0
votes
2answers
84 views

I'm trying to solve a system of complex equations

I'm simply trying to solve a system of equations and mathematica can't do it for all values over the region of interest. I have a 3x3 matrix that has a specific parametrization and after squaring the ...
1
vote
2answers
85 views

Plot values of an $m\times n$ matrix on the complex plane with color varying along $m$

Let's say I have a complex valued matrix $\begin{pmatrix}1+I&2+2I&3+3I\\4+4I&5+5I&6+6I\end{pmatrix}$ represented by a list: ...
3
votes
1answer
102 views

Drawing dynamical trajectories diagram in Mathematica

I've a Boolean gene regulation system composed of vectors(corresponding to cellular phenotypes). Their components are binary numbers such as $\{1,0,0,1\}$. A vector can change its statement in ...
10
votes
9answers
715 views

Forming an upper triangular matrix from the elements of a list

I asked this question before, but i was closed because it the question was not comprehensible enough. So i reworded it, hope that's ok. I have a list with 6 elements. ...
1
vote
0answers
41 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 ...
0
votes
1answer
29 views

Iterating KroneckerProduct[] and returning the result from a function

I am trying to write a function which will take a matrix m and an integer i as inputs. Then it will compute the Kronecker product of m with itself i times and return the result. The code is as ...
2
votes
1answer
54 views

Accuracy limitations of singular value decomposition?

in the process of working on a physics problem I have found the need to use the singular value decomposition function built into Mathematica. I have encountered what seem to be limitations to the ...
0
votes
0answers
38 views

Nested system of equations [closed]

I was actually trying to do several functional ways of calculating matrices. The system is given in the figure \begin{align} \begin{pmatrix} \mathbf{p}_{1} \\ \mathbf{p}_{2} \\ \vdots \\ ...
1
vote
0answers
50 views

Dealing with answers that have Root[ …] when finding an Eigensystem [duplicate]

This is a 3x3 matrix and I think it should solve for the expressions in terms of radicals. I am not sure what to do with this.
1
vote
0answers
143 views

Request for clarification of Eigensystem::eivn message

What causes the problem of "two eigenvectors associated to one single multiplicity eigenvalue" that I am experiencing? After several transformations to simplify an unwieldy matrix, I end up with the ...
0
votes
0answers
95 views

Is Eigensystem::eivin message a bug?

I noticed that in the question Request for clarification of Eigensystem::eivn message the error message Eigensystem::eivn: Incorrect number 2 of eigenvectors for eigenvalue ...
0
votes
1answer
86 views

How to get rid of # in answer (eigensystem)? [duplicate]

I was trying to find the eigensystem of the following matrix (act as if the second character is in subscript): \begin{pmatrix} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ ...
6
votes
4answers
3k views

I need to multiply a series of matrices

I need to perform a dot product on a large number of 2 x 2 matrices that I have defined to differ by even/odd subscripts (Ex: D-odd=x but D-even=y). The $\Pi$ function will not work because it does ...
0
votes
0answers
80 views

How can we compute a factorization for symmetric indefinite matrices?

I want to compute the factorization of (real) symmetric indefinite matrices in Mathematica. For symmetric positive definite matrices, we can use a permuted version of Cholesky factorization, ...
0
votes
0answers
26 views

factoring a phrase of matrix elements and calculating main eigenvalues

I have a question containg two parts: 1-If we have a matrix as ...
0
votes
1answer
44 views

Inverse of a Fourier matrix [closed]

I am trying to find the inverse of a Fourier matrix but I am getting confusing results. If R is a Fourier matrix, then ...
5
votes
3answers
244 views

Indicate minimal path sum

Described on the page: http://www.mathblog.dk/project-euler-81-find-the-minimal-path-sum-from-the-top-left-to-the-bottom-right-by-moving-right-and-down/ It is an example of the solution indicated in ...
0
votes
1answer
47 views

How to pad numbers to the border of the Matrix?

I want to pad the numbers,but it throws an error Part::partw,so I use Quiet to suppress this error. ...
0
votes
4answers
50 views

insert elements into 2 D array [duplicate]

say I have a 2 dimensionsal array like a={{1,2,3},{4,5,6},{7,8,9}} and a vector like v={10,11,12} I want the result to be ...
1
vote
1answer
64 views

Help on order of evaluation within plot function

it is my first time asking a question here so please let me know if there's anything I should be doing that I'm unaware of. I'm sure the answer to my question already exists on the site but I'm having ...
1
vote
0answers
46 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 ...
3
votes
0answers
65 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 ...
0
votes
1answer
89 views

How to turn a subroutine into a function?

I've written a subroutine that takes in 6 matrices and after some manipulation returns back 3 new ones. I will use this subroutine fairly often in this notebook so I think it would be easier to turn ...
-1
votes
1answer
63 views

Real and Imaginary matrix

I have a 2 by 2 matrix T: {{x, y}, {-y, x}} where x is the real part of some complex number and y is the imaginary part of something complex number. Let's say z1 = ...
0
votes
1answer
275 views

Finite Field matrix rank calculation

How does one define a matrix over $\mathrm{GF}(p^r)$ in Mathematica in order to compute rank? I am working with $\mathrm{GF}(2)$?
1
vote
0answers
34 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 ...
2
votes
0answers
67 views

Unexpected behavior from applying ToRadicals to eigenvalues [closed]

I am trying to get the symbolic form of a $10 \times 10$ matrix (I know, that is generally too large). ...
1
vote
1answer
57 views

replacing values in a matrix

I am a beginner with Mathematica. I have two matrix s1 and s2 and I am building a third matrix from the previous 2 ...
5
votes
3answers
240 views

Assumptions for RotationMatrix

I'm making C++ program, and in my program I need a rotation matrix around any vector. I wanted to extract RotationMatrix[fi,{x,y,z}] output and put it in my ...
3
votes
0answers
71 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 ...
1
vote
0answers
68 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
2answers
60 views

Trouble implementing logarithmic matrix norm

I wanted to write a quick function that calculates the logarithmic matrix norm with respect to the spectral norm. The formula is $$ \mu_2(A) = \lambda_\mathrm{max}\left(\frac{A + A^T}2\right). $$ So ...
2
votes
0answers
45 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 ...
11
votes
4answers
478 views

How do I extract a matrix of only positive numbers given a set of assumptions?

I want to divide a matrix: mat = {{a, 0, -b}, {d, a, 0}, {0, 0, -a}} with the following assumptions: ...
-1
votes
0answers
10 views

Prove over matrix norm and eigenvalues [migrated]

I am trying to prove following inequality but I fail to do it. I think I know how to prove the right hand side inequality |lambda| <= ||A||, but I still don't know how to prove the left hand side ...
0
votes
1answer
46 views

Overriding Subscript operator creates its own variables?

I tried to override the Subscript operator to make matrix indexing a bit more "user-friendly" in complex expressions with the following code according to the ...
4
votes
1answer
75 views

GaussianMatrix function issue

Here is my implementation of the built-in GaussianMatrix function. ...
10
votes
10answers
680 views

Matrix indexed by one number

I'm trying to find a generic way (for arbitrary dimensions) to create a matrix like so a[1] a[2] a[3] a[4] i.e where it is indexed by one number, instead of say ...
3
votes
2answers
76 views

Perform matrix/tensor contractions more efficiently

Problem: explicit index contractions for matrices using the Sum command take too long, and I want to improve the performance for complicated computations. Let me ...