Questions tagged [matrix]

Questions on the manipulation of matrices in Mathematica.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

How do I construct a matrix using table command. I can not form it's function

I have to form a matrix like this. How ever I can not directly input. I have to form a function and then use the table command. I am stuck. {{2,5,10},{9,12,17},{28,31,36}}
1
vote
2answers
26 views

Concatenate matrices in a specific way

Is there an elegant way to start with a matrix of the form $$ A = (B,C) $$ where B and C have dimensions n x m, and construct a large matrix that looks like $$ \begin{pmatrix} B & C & \mathbf{...
0
votes
1answer
34 views

Turn vector equation into matrix multiplication

I have physical equations of motion that describe the dependence of one vector field on the components of another vector field. Without getting too much into detail, my differential equations involve ...
2
votes
1answer
28 views

How do you ask someone to input the values of a matrix?

I'm trying to set up code that basically asks the user to input the values of a matrix with a certain key size. I want them to first enter the keysize and then ask for all of the entries necessary to ...
2
votes
1answer
36 views

NDSolve matrix of differential equations

If I have a system of differential equations that I can write in matrix form $$\frac{\text{d}\mathbf{X}(t)}{\text{d}t} = \mathbf{A}\cdot \mathbf{X}(t),$$ with known initial conditions ($\mathbf{X}(0)=\...
3
votes
4answers
125 views

Generating all symmetric binary matrices of order up to 7?

I want to create all symmetric binary matrix with order up to 7. Can anybody help in creating this? I want to obtain the subset of all symmetric matrices, with all diagonal entries being zero.
0
votes
0answers
29 views

Testing Matrix inequalities

I was wondering how one might check whether matrix inequalities are true/false the same way it can be done for scalar variables (like in this post). Say I want to test the obvious inequality A,B are ...
5
votes
3answers
186 views

Build the following symmetric array

My mind is a bit cloudy and I can't quite pinpoint the pattern here that will allow me to write an elegant piece of code to build the following symmetric matrix of for a given size ...
0
votes
0answers
15 views

Multiply Covariance matrix with weights [closed]

when I apply weight.CovarianceMatrix.weight. I get the correct output for single sample of stocks. However, when i apply the same to the Covariance matrix of 25 samples of stock weight is shown in the ...
0
votes
1answer
55 views

How can I get rid of Abs?

In the following code, the functions WP[t] and WS[t] are real. Time also is a positive parameter. As you can see, MATHEMATICA enters Abs in the calculations. Including Abs only complicates the next ...
0
votes
0answers
18 views

Rank of the matrix [closed]

Let S be the set of all 3*3 real matrices A=a[i][j] such that the matrix M = (cube of (a[i][j])) has rank one. Define a set R ={rank(A): A belongs to S}. what can we say about set R?
3
votes
3answers
80 views

Mean values of skew diagonals of a $(n+1,n)$ matrix

How mean values of skew diagonals of a $(n+1,n)$ matrix can be computed efficiently? Here is my naive implementation: ...
1
vote
0answers
27 views

Reducing generalized eigenvalue problem to regular eigenvalue problem

I expected generalized eigenvalue problem on $(A, B)$ to reduce to eigenvalue problem on $B^{-1} A$ when $A$, $B$ are full rank (Section 7.1 of generalized eigenvalue tutorial), but I get different ...
3
votes
2answers
132 views

Generating a random density matrix in Mathematica

I am interested in using Mathematica to generate random $N\times N$ density matrices describing pure quantum states; for the less physics-oriented folks, a density matrix is positive semi-definite, ...
3
votes
2answers
102 views

Logarithm of singular matrices

I wanted to calculate following quantity: $X=Tr[\rho_1 \log[\rho_2]]$, as in the relative entropy. Here, $\rho_1, \rho_2$ are positive semidefinite matrices with non-orthogonal support (so that the ...
0
votes
0answers
36 views

how can I correct this code? [duplicate]

I need to calculate matrix m1 according to following algorithm. Then, I have to put it in the differential equation. However, matrix m1 is complex and therefore the differential equation does not work....
-1
votes
2answers
40 views

Diagonalization of a perturbed matrix with degeneracy

I'm looking for a way tho change the output of the Eigensystem function in case of degeneracy. Consider the following example: ...
1
vote
2answers
52 views

Finding equal values in a list

Is there a way to take equal elements out of a list and their position??? An example can be ...
0
votes
0answers
51 views

How can I correct this code to get an answer? [duplicate]

I need to calculate matrix m1 according to following algorithm. Then, I have to put it in the differential equation. However, matrix m1 is complex and therefore the differential equation does not work....
0
votes
0answers
70 views

How to solve the following equation numerically?

In the following code, if the matrix "n = (-I*(m1)) + (m2)" in the differential equation contains only the matrix "m1", I will get the answer, but if the matrix "n" is ...
0
votes
1answer
31 views

Degenerate matrix diagonalization

When you diagonalize a matrix, and two eigenvalues are degenerate, is there a way to ask Mathematica for specific eigenvectors? Thanks
0
votes
0answers
63 views

Transforming a tensor expression

I have the expression $\qquad\sqrt{\det[\gamma^{\mu \nu} F_{\mu \nu}]}$ Basiclly, I need to expand this expression in some form like : $trF^4 + (trF^2)^2 + \sqrt{\det[F_{\mu \nu}]}$, where $\gamma^{\...
3
votes
1answer
46 views

Rows within a norm

Is there a way to take a matrix and select the rows (or columns) with norm lesser than a certain amount max. Thanks
1
vote
2answers
54 views

Create matrix of derivatives

Given the following definitions, ...
1
vote
1answer
37 views

Excel output append

I currently have the following codes: ...
2
votes
0answers
49 views

Map Inverse Ordering on Matrix [duplicate]

I have an matrix (symmetric, but any $n \times n$ will do) $$A = \begin{bmatrix} 0 & 4.5 & 6 & 5.5 \\ 4.5 & 0 & 4 & 3 \\ 6 & 4 & 0 & 5 \\ 5.5 & 3 & 5 &...
0
votes
1answer
89 views

How can I calculate the determinant of a 40$\times$40 symbolic matrix?

I tried to find the characteristic equation of the 40$\times$40 symbolic function by calculating its determinant in Mathematica. But Mathematica does not return me any output after long time ...
4
votes
1answer
108 views

Implementation of quantum Uhlmann Fidelity in Mathematica

I want to implement the quantum Uhlmann fidelity $$F(\rho, \sigma) := \mathrm{tr} \left[\sqrt{\sqrt{\rho} \sigma \sqrt{\rho}} \right]^2.$$ in Mathematica as a measure of "closeness" between ...
-1
votes
1answer
38 views

What is the inverse Jacobian of a 4D model? [closed]

For a Jacobian Matrix where the elements are represented as J11 J12 J13 J14 J21 J22 J23 J24 J31 J32 J33 J34 J41 J42 J43 J44 what is the inverse jacobian of this Matrix?
0
votes
0answers
26 views

How can I parallaize expresion that contains ParallelSum?

I have this code where the last part contains ParallelSum ...
0
votes
1answer
25 views

Problem for defining continously Eigenvectors from Kane and Mele model

The model is a simple eigenvalue problem. A matrix that depends on some parameters kx, ky, t, defined by: ...
-2
votes
2answers
124 views

How to simplify the result of matrix according to the operation rules specified in the textbook?

We know that the inverse and transposition of composite matrices follow certain calculation rules. For example, $(ABC)^{-1}=(C^{-1})(B^{-1})(A^{-1})$, $(ABC)^T=C^TB^TA^T$, $ABC=E \Rightarrow BCA=E$. <...
2
votes
0answers
38 views

Determine a negative semidefinite 5*5 matrix

I'd like to find the real parameters $\left\{p,\alpha ,a_{24},c_3,c_7,c_9,c_{10}\right\}$ in $M$, which is a $5\times 5$ real symmetric matrix, such that $M$ is negative semidefinite. My code for $M$: ...
0
votes
1answer
41 views

Can the WishartMatrixDistribution command be used for generating random density matrices?

I am interested in generating random members of two classes of $n \times n$ positive-definite matrices $A$ and $B$--the former symmetric in nature, the latter, Hermitian. The standard (Ginibre-matrix-...
2
votes
0answers
44 views

How to simplify a matrix with detailed steps?

When I simplify a matrix with a parameter, for example: (PS: it's the answer to the textbook) When I use RowReduce[] to simplify this matrix. it seems going too far to its simplest form: So, My ...
1
vote
1answer
52 views

Determine a positive semidefinite 5*5 matrix

I'd like to find the real parameters $\left\{a_{14},c_6,c_8,c_{10},c_{12},c_{13},c_{14},c_{15},\alpha \right\}$ in M, which is a $5\times 5$ real symmetric matrix, such that M is positive semidefinite....
2
votes
0answers
112 views

How can I use Compile to Evalaute a trace of a sympolic Matrix?

I would like to evaluate a trace of a matrix of size 4Wn×4Wn at different point (x,y). with <...
2
votes
0answers
39 views

Getting a submatrix of a larger matrix [closed]

This should be straightforward, but the Mathematica documentation does not seem to help with this. Suppose I have a $10 \times 10$ matrix and want to get the $3 \times3$ submatrix define by the ...
2
votes
1answer
43 views

Issues when applying list of indices to a matrix

I am interested in generating a 1D list of the upper-triangle elements of a matrix. I can grab the indices of these elements by doing: ...
7
votes
3answers
318 views

Applying a function to every item in a column of a matrix

A problem that arises more often than I care for is that I want to modify specific elements nested lists. Examples may be wanting to add 1 to the second value, get ...
1
vote
0answers
81 views

Determining Choices for Solution of a Matrix Equation Through NullSpace Function

I am trying to see how Mathematica chooses the basis vectors of the nullspace computed through: ...
0
votes
0answers
21 views

How to use the function `Resolve` to verify this conclusion?

Let A be a non-zero square matrix of order n, $ A^{*}$ be the adjugate matrix of A, and $A^{T}$ be the transposition matrix of <...
0
votes
1answer
64 views

How to find some matrices that satisfy the constraints

I know that the three eigenvalues of the real third order matrix A are -1, 1, ...
-2
votes
1answer
39 views

what is the difference between two Eigenvalue[…] outputs

Can someone explain the difference between two types of Eigenvalue[...] operations: ...
0
votes
1answer
98 views

Symbolic Matrix Exponential of Large (500x500) Matrix

I am trying to build a sort of time propagator matrix. I have a matrix $H$ that is 500x500 and i am trying to evaluate $\exp(-H t)$. I need to find this in a symbolic way because i will need to do $\...
2
votes
1answer
83 views

How to solve this kind of matrix equation related to rank

I saw a post here to solve the rank relation equation of matrix: ...
0
votes
1answer
81 views

How to transform a matrix into a diagonal matrix by Schmidt orthogonalization

I want to diagonalize a matrix by orthogonalization, but the following method cannot get the correct result: ...
0
votes
1answer
28 views

How to find multiple groups of solutions that meet the requirements

I want to find multiple nonzero real matrices A, B that satisfy $A.B=\mathbf{0}$ condition. ...
2
votes
0answers
119 views

How can I numerically evaluate the trace of a large matrix to speed up the code?

I have a large matrix (4Wn*4Wn) resulted from multiplication of different matrices and I would like to evaluate the trace numerically to speed up the process. Here ...
2
votes
3answers
115 views

Split matrix expression into multiple lines

Given a matrix expression testm = {a + b, c + d, e}; {# , testm[[ # ]] // Simplify} & /@ Range[ Length[testm] ] // MatrixForm \begin{equation}\begin{pmatrix} ...

1
2 3 4 5
54