Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

3
votes
3answers
73 views

how to update elements in a matrix with position identified in a list

I am new to mathematica. Could you pls help me on how to write this: I have a $5\times 10$ matrix, for example, ap = ConstantArray[0.001, {5, 10}] I have the ...
0
votes
1answer
15 views

How can we assign value given by Eigenvalue command to variables?

I want to assign value of eigen value given by eigenvalue command in mathematica to variables so I can use further in programme.
2
votes
1answer
72 views

How to define the following matrix

How to define the following matrix in Mathematica? $$A(n) = \begin{pmatrix} B_{1} & B_{2} & \cdots & B_{n} & 1 \\ B_{n} & B_{1} & \cdots & B_{n-1} &1 \\ \...
0
votes
0answers
26 views

Expectation of summation with symbolic indices

I am working on symbolic computations with mathematica. I faced an issue with taking expectation of a large expression involving summations with symbolic indices. Is it possible to take expectation ...
0
votes
1answer
54 views

How to code the partial trace of a matrix

I want to compute a partial trace using formula $\rho_A=\sum\langle B|\rho_{AB}|B\rangle$ . Example, $\rho_{AB}= $$ \begin{pmatrix} a & b & c & d\\ e & f & g & h\\ i &...
1
vote
1answer
53 views

Kronecker product

I have a problem, I want to compute kronecker product as given below; ...
0
votes
0answers
49 views

How to automate a computation and save the outputs?

I'm working with neutrino oscillations in matter and i'm computing the oscillation probabilities as functions of the Energy. This is what i have ...
0
votes
1answer
51 views

Dynamic input for Complex, Determinant output problems [duplicate]

I'm having trouble using Complex with Dynamic real and imaginary inputs. The inputs come from a matrix of popup menus: ...
0
votes
1answer
62 views

Plotting Matrix versus Matrix [on hold]

So I recently started using Mathematica and I haven't been able to figure out how to simply plot elements of one matrix versus another matrix which are not directly related or are not a function of ...
2
votes
1answer
52 views

Antrisymmetrized product of matrices

Let $X_{1},...,X_{N}$ be $N$ matrices. I want to compute an antisymmetrized product of $X_{i}$'s in mathematica: $X_{[a_{1}...a_{N}]} \equiv \tfrac{1}{N!}\sum_{\sigma}(-1)^{P}X_{\sigma(a_{1})}X_{\...
1
vote
2answers
91 views

Group matrix values by column [closed]

Original Question: I have a list {{a, 1}, {b, 3}, {c, 1}, {d, 2}, {e, 3}}. I want to be able to group the the first number in each pair that has the same second ...
3
votes
1answer
97 views

Efficiently compute this Table of NullSpace

I have two $(2n,2n)$ matrices, $A_1$ and $A_2$, and I would like to compute $$\ker(A_1^p A_2^q -I)$$ for $p,q\leq 2n$. Both matrices are orthogonal and have exactly four non-zeros values on each ...
2
votes
5answers
190 views

Finding the most common n-tuples of a list of lists where order does not matter

I am still learning to use Mathematica and I need some help. How could I get the most common pair, and generally the most common n-tuple of a list (row vector) given a list of lists of ...
1
vote
2answers
224 views

MatrixPower performs slower than Do loop

I have two almost identical pieces of code: one with MatrixPower responsible for matrix multiplication and another with Do loop. Why the latter performs much faster? It looks counterintuitive... <...
2
votes
1answer
145 views

How to sort eigenvalues?

I am trying to find Eigenvalues to a 12x12 Matrix ($H$) dependent on two variables $x$ and $y$. Later I want to do a 3D plot of one eigenvalue ($E$) over $x$ and $y$. An analytical solution is not ...
1
vote
1answer
59 views

Matrix equations solving

can you explain me the easiest way for solving this matrix equation? I have this matrix: a={{-4,1,3,0},{-2,7,1,-1},{1,-1,9,-3},{-1,0,5,-10} and the Equation is: ...
0
votes
1answer
54 views

How to generate a random matrix and its average value is a specified value

I want to generate a random matrix whose average value is a specified value,such as 5.5. I found these function here.But I don't know how to use it to do this.I think ...
0
votes
1answer
66 views

How to map data from one set to another set

I have a set of numbers that has a non-injective, surjective correspondence to another set of numbers and I would like to quickly create a list of the output. For example, suppose I have ...
2
votes
0answers
27 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 ...
-1
votes
2answers
52 views

Rearranging the columns of a matrix [duplicate]

How do I rearrange the columns of a matrix? I really have o idea how to do this. Thankfs for any suggestions!
3
votes
1answer
46 views

Use of Inverse Matrix

I solved a matrix as follows: {{0,1,1},{0,2,4},{0,3,9}}.{{0},{25},{20}} Resulting: {{45},{130},{255}} I tried to use an ...
8
votes
2answers
303 views

Why is IdentityMatrix not defined as a SparseArray by default?

Simple (possibly silly) question: why are IdentityMatrix, DiagonalMatrix, ConstantArray ...
1
vote
1answer
43 views

Solve matrix equation for matrix

Is there any function like Solve but designed to deal with matrix equations? Something like: ...
3
votes
1answer
92 views

Irreducible representations for the symmetry group $T_d$

I am trying to get the explicit two dimensional irreducible representation matrices for the symmetry group $T_d$. I need the matrix representation for each element in the group. Are there any ...
1
vote
1answer
68 views

generating random algebraic matrix using elementary operations

I generate several algebraic matrices of 12x12 where each element is a combination no repeat of the variables x, y, z and operations +, -, *, /, power, establishment (square root), any of them or any ...
3
votes
2answers
79 views

Creating a constant-valued matrix having the same dimensions as previously defined matrix

I have the dimensions of a matrix A. I would like to create a matrix B (say, of only 0's) of the same size as A. But A's dimensions are variable. Is there an efficient way using ...
0
votes
1answer
50 views

How can we do LDU decomposition modulo $p$?

If we have an $n \times n$ matrix, with all entries taken modulo $p$, how can we output the three matrixes in LDU decomposition, with all entries again modulo $p$? We can assume the input matrix is ...
3
votes
1answer
74 views

Implementing the Cimmino method [closed]

What am I doing wrong? I am trying to implement the Cimmino method, an iterative method for the solution of linear algebraic systems. The final output should be a vector. Here is a description of the ...
-1
votes
1answer
55 views

How to solve trigonometric matrix

I need help for my problem according to matrix. Given a matrix, ...
3
votes
2answers
164 views

How to Convert a Matrix into an Association?

I have a matrix like this one: test = {{1, "a"}, {3, "b"}} and I want to convert it into an association like this ...
0
votes
0answers
3 views

Gaussian process for machine learnig [migrated]

Here is my question in the equation 2.11 A is N by N matrix, so there is not feasible if N is large the textbook say in the euqation 2.12, we only need to invert size n by n. But I think K is 1 by ...
2
votes
1answer
71 views

Symbolic vector addition

I'm trying to figure out a nice way to add a mix of symbolic and explicit vectors/matrices without mathematica treating the symbolic vectors as scalars and promoting them to constant arrays. For ...
0
votes
1answer
49 views

Evaluate polinom with matrices [closed]

Let's say that I have the following polynom f = a+b+ab I want to evaluate this expression like this: ...
1
vote
0answers
36 views

extracting families with their representatives and number of repetition [closed]

There is a matrix: {{1,1,1},{1,2,1},{2,1,1},{-2,-1,-1},{1,1,-2},{1,-2,2},{2,1,-2},{1,-2,2},{-2,2,1},{1,2,2},{2,2,2}} How we can extract another matrix which ...
1
vote
2answers
52 views

Random distribution of some Lists on a distinct matrix

I have 3 functions as below ...
3
votes
1answer
52 views

Constructing tensors with arbitrary rank and dimension [closed]

How can I create a tensor with arbitrary rank n and m components in each dimension? I am looking for a command in which I insert n and m and it spits out the corresponding tensor with random entries (...
3
votes
1answer
47 views

check content of a Matrix

I have a matrix which contain rotated ellipses and points, how can I check if the element in the position {i,j} is either a point or an ellipse? the code is a bit longer but the structure is like: ...
1
vote
1answer
68 views

Nonlinear Markov chain (numerical simulation)

Suppose you have a linear Markov process, and you can write it as x(t+1) = Ax(t). Here x is the vector of values, and A is the transition matrix. Since this is linear, it can be solved analytically, ...
0
votes
0answers
8 views

ALS Matrix Convergence [migrated]

I came across this statement in some MapR documentation on ML in Spark: ALS is an iterative algorithm. During each iteration, the algorithm alternatively fixes one factor matrix and solves for ...
-1
votes
1answer
65 views

How to correctly calculate symbolic eigenvectors

I give a minimalistic example of my problem: I have a matrix: m[a_,b_]:={{0,-a+b},{b,0}}; I define the eigenvectors as: ...
2
votes
1answer
79 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
vote
2answers
49 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
1answer
32 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
1answer
51 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
32 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
50 views

Map over multidimensional matrix [closed]

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 ...
5
votes
1answer
65 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, ...
3
votes
1answer
150 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 ...
0
votes
1answer
88 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 ...
1
vote
1answer
92 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 ...