Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

1
vote
2answers
21 views

Plotting points using adjacency matrix

Given an adjacency matrix on n vertices and a polygon on n vertices, how to add edges from adjacency matrix on the Polygon? eg: if polygon is {(0,0),(0,1),(1,0),(1,1)} and the adjacency matrix has 1 ...
0
votes
0answers
21 views

Solving for five unknowns in a 3 x 3 matrix

I know that matrix.Transpose[matrix] = IdentityMatrix[3] matrix = {{0.8111, 0.4867, -0.3244}, {a,b,0}, {c,d,e}} I tried ...
-1
votes
0answers
14 views

how to choose from M a point which will be the center of the circle, and in that circle must be a minimum of points [on hold]

C programming on a plane are given a set of points M. Choose from M a point which will be the center of the circle, and in that circle must be a minimum of points
0
votes
1answer
24 views

Probems using 2 For and a AppendTo to cycle through my Equation to solve some matrixes

I am trying to solve a few problems here. I have an equation with multiple variables that I am trying to solve in For loop method. I will attach the file below. In addition I am trying to get it to ...
-2
votes
0answers
52 views

How can I write the coding in mathematica based on time?

Hi, I need some help for my problems. May anyone help me in coding I want to make For loop based on time for this matrix. I want to change to look the changes of alpha3 when increasing of time with ...
2
votes
2answers
440 views

Convert DelaunayTriangulation-> Graph->AdjacencyMatrix

Is there a way to convert a Delaunay Triangulation into a Graph structure so that one can generate an AdjacenyMatrix of the Delaunay?
0
votes
0answers
35 views

Rotation of basis system [on hold]

I have a 16x16 matrix HCF hamiltonian with symbolic entries depending on 8 parameters Bxx. Now I add anoter hamiltonian which is a zeeman hamiltonian HZ with a symbolic angle [\theta] entry .But if i ...
2
votes
1answer
37 views

Finding an Integer, Unimodular Matrix that connects two given matrices

I have two symmetric, integer matrices, $K$ and $K_2$ which have the same determinant and the same signature (number of positive - number of negative eigenvalues). I want to find an integer valued ...
0
votes
0answers
26 views

Eigenvalues of a symbolic matrix using interpolating function

I have a 6x6 matrix with entries that depend on dependent and independent variables of an interpolating function. I would like to be able to evaluate the eigenvalues of this matrix using the ...
1
vote
0answers
46 views

Map over multidimensional matrix [on hold]

Suppose I have a 8by6by4by2by2 matrix called m. There is in total 8*6*4 2by2 matrices. I want to map a function over these 2by2 matrices. Each dimension in ...
72
votes
3answers
3k views

Flatten command: matrix as second argument

One thing I could never wrap my head around is how Flatten works when provided with a matrix as the second argument, and the Mathematica help isn't particularly ...
-3
votes
0answers
40 views
0
votes
2answers
63 views

Interpolation of a vector [closed]

How can we use a sample data for interpolation of a function within a domain. But I need all interpolated values at once in a vector format. For instance, below I create a range of values for ...
5
votes
1answer
61 views

What's up with PauliMatrix with a string argument?

Looking at the definition of PauliMatrix (not the documentation), I realized that it is defined for arguments 0, ...
1
vote
1answer
87 views

Is it possible to decouple this Matrix A to matrix multiplication of two matrixs B and C?

I want to decouple this matrix A into two matrixs B and C, with A=B*C. And B is functions of r, C is functions of n. Is it possible or not? Can I use Mathematica to do this? Any help or advise is ...
2
votes
1answer
77 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 ...
0
votes
1answer
87 views

Accessing the elements in a table is slower than calculating each time?

This is a follow-up of How to accelerate combinations and sum calculations here? I have tried all tricks but when N reaches 35 the time is still intimidating in a 16-core server, which is far better ...
3
votes
1answer
135 views

Defining a matrix with elements acting as operators

This question is directly related with my previous one. I'll try to be more specific here. I have a matrix {{a[x],b},{c,d}}, where ...
6
votes
2answers
249 views

Find a condition that b must satisfy so that Ax=b has solution

I'm new to Mathematica, so I'm sorry if this is really simple. I am trying to find the condition that vector b must satisfy so that Ax=b has solution. I would like to learn a general method, but I'll ...
0
votes
0answers
18 views

How to plot eigenvalues as a function of parameters in a dynamic module?

I am trying to make a fancy interactive plot that shows how the eigenvalues of a matrix mat change under variation of parameters ...
2
votes
2answers
87 views

Dynamically sized $n\times n$ checkboxes corresponding to a matrix

I was wondering if it was possible to do to following: have an input field for an integer where you input the $n$ have an $n\times n$ matrix of checkboxes that would correspond to an $n\times n$ ...
2
votes
7answers
329 views

How to repeat a matrix on it's side?

I have the following matrix in Mathematica: mat = {{0,0,1,1}, {0,1,0,1}} I want to repeat this matrix N number of times on the side. For example if N = 3 then ...
0
votes
1answer
61 views

Eigensystem with orthogonal elements in matrix

I have a matrix with 16 elements: matrix = {{f1, -f2, -f2, f3 }, {f4, -f1, -f1, f2}, {f4, -f1, -f1, f2}, {f5, -f4, -f4, f1}} I would like to calculate ...
0
votes
0answers
44 views

Objects of unequal length

I have this error which I don't know why. The number of components in each matrix are equal but why it says that Objects of unequal length and cannot be combined?
3
votes
4answers
118 views

mapping a smaller matrix in a greater matrix with a specific sequence

I have a matrix 300x300 i need to map the values ina greater matrix (900x900) in the positions given by the sequence $$({3*i-1,3*j-1)}$$ while everything else remain empty, how can achieve this ...
1
vote
3answers
59 views

How to Import and Export as a multidimensional array

I have 10000 matrices and each matrix is 3x3. So Dimensions[data] gives me {10000,3,3}. I saved this into a file with Export["mydata.dat",data,"Table"] Then when I imported it using ...
0
votes
2answers
62 views

Output the tensor product of two matrix as a matrix

How do I output the matrix form like the RHS without the tensor product sign remaining $\otimes$? I need it for display purpose where I can see easily what the form of the whole product matrix is. ...
7
votes
3answers
372 views

Can't find the eigenvectors of a simple 2x2 matrix

Bug introduced in 8.0 or earlier and fixed in 10.3.0 Why can't Mathematica find the eigenvectors of this matrix? ...
2
votes
1answer
55 views

How to accelerate combinations and sum calculations here?

I have a 4d matrix H defined as below (embedded with combinations and sums) ...
1
vote
1answer
48 views

Fast Eigensystem calculation

I have a code which finds the eigensystem for a matrix H = H0 + x HInt, where x is a variable which turns on the interaction. H0 is diagonal, and HInt is a sparse matrix (with about 400 states, I hope ...
0
votes
1answer
297 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
2answers
247 views

Dynamical system problem x(t+1) = Ax(t)

I have a problem that have been trying to solve but it's not going so good. I would like some guidelines on how to work myself around this problem: Two neighboring countries spy on each other and ...
0
votes
0answers
36 views

Matrix with equations as entries - how to choose them and solve them

I have a matrix in Mathematica, which I have built using Normal[SparseArray]. Each entry of this matrix is an equation in one variable. What I need to do is 1) to select some of the entries of the ...
3
votes
2answers
114 views

Replacing multiplication of matrix elements by application of these elements as functions

I want to realize the following idea in Mathematica. I've got a matrix {{a,b},{c,d}} which is multiplied to a vector {h,k} ...
2
votes
2answers
81 views

Building an $m \times n$ matrix from element-wise from two other such matches

I am a beginner with Mathematica. I have two matrices, s1 and s2, and I am building a third matrix from them. ...
8
votes
3answers
367 views

Noise filtering in images with PCA

I have a stack of images (usually ca 100) of the same sample. The images have intrinsic variation of the sample, which is my signal, and a lot of statistical noise. I did a principal components ...
2
votes
0answers
77 views

How does Mathematica compute the determinant of a matrix? [closed]

I have been trying to write efficient code for calculating the matrix determinant for some time now. I noticed last night that Mathematica is able to compute the determinant of a $200 \times 200$ ...
3
votes
1answer
152 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 ...
1
vote
1answer
58 views

Save a fraction matrix in Mathematica into C++ friendly format

In MMA I have a 2d matrix whose each entry is a irrational number(in fraction format in MMA). Say: ...
14
votes
3answers
5k views

Solving a time-dependent Schrödinger equation

I want to solve the time-dependent Schrödinger equation: $$ i\partial_t \psi(t) = H(t)\psi(t)$$ for matrix, time-dependent $H(t)$ and vector $\psi$. What is an efficient way of doing this so that ...
0
votes
0answers
7 views

mathematical question on the block-diagonalization [migrated]

since my last question is thought by someone to be a physical question. Now I re-express it in a pure mathematical way here because there is nobody can give me an answer in physics.se. Suppose we ...
0
votes
1answer
59 views

Unexpected result: Numerical and analytical results do not match! [closed]

I am calculating the eigenvalues and eigenvectors of a matrix. This is my code: ...
4
votes
3answers
232 views

Get the coefficient matrix from a quadratic form

Suppose I have a quadratic form of qf = a x^2 + b y^2 + c z^2 + 2 d x y + 2 e x z + 2 f y z How can I easily to get the symmetric matrix A, such that ...
1
vote
1answer
49 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 ...
11
votes
1answer
149 views

Why FoldList 5 times faster than Apply for matrix multiplication? [duplicate]

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

Optimize a parametric matrix to get a lowest possible eigenvalue

This question is a followup of Plot the lowest eigenvalues of a parametric matrix Now I can get the lowest eigenvalue LowEign(t) of the matrix for a given t numerically. When I plot the LowEign ...
0
votes
2answers
62 views

Automatic process to replace missing values, coming from a second matrix

I have a large starting matrix with missing values in different columns. I want to replace this missing data as follow. First I have to check the group (last column in starting matrix) and go to a ...
2
votes
1answer
61 views

Plot the lowest eigenvalues of a parametric matrix

The question here is somewhat related to the comments in Computing eigenvectors and eigenvalues I have a matrix M, say 400 by 400, and all elements depend explicitly on one parameter t in a ...
25
votes
2answers
6k views

How to form a block-diagonal Matrix from a list of matrices?

For example, like this: I know join[...] works, but it is a bit troublesome for multiple matrices. I also tried DiagonalMatrix[...], but DiagonalMatrix can only form a matrix from a list of ...
0
votes
3answers
82 views

How do I create a circulant matrix? [closed]

How do I create an $n \times n$ circulant matrix? I couldn't make ToeplitzMatrix do it for me.