Questions tagged [matrix]

Questions on the manipulation of matrices in Mathematica.

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

Lanczos method to tridagonalize a matrix

I want to tridagonalize a sparse matrix using the Lanczos algorithm. I am working with a very large sparse matrix and I need some speed. In the following for example ...
0
votes
0answers
17 views
2
votes
0answers
53 views

Typing the value of matrix elements in matrix plot [duplicate]

I want to type the value of matrix elements when plotting it on the topside of the bar. Example: $$M=\left(\begin{matrix} 0.77 & 0.04 & 0.01 & 0.0\\ 0.04 & 0.81 & 0.0 & 0.0\\ 0....
0
votes
0answers
51 views

matrix problem: evaluation of column values which depend on a variable

I do not use Mathematica for a long time and I have a question about a matrix problem. I add here the code: ...
1
vote
0answers
76 views

Null Christoffel symbols associated to the FLRW metric obtained via Mathematica [closed]

I'm trying to make a mathematica notebook that computes the Christoffel symbols associated to the Friedmann-Lemaître-Robertson-Walker metric (noted FLRW in the notebook) describing an homogenous and ...
0
votes
0answers
52 views

How to find the eigenvalues of a matrix [closed]

I'm new to mathematica so don't have alot of experience with it. I'm currently trying to make code to find the eigenvalues of this matrix but keep getting an incorrect answer - could someone let me ...
1
vote
1answer
63 views

Concatenating matrices using headings

New to Mathematica. I want to create and combine K1, K2, and K3 (shown in the first picture below) into the 8x8 matrix shown in the second picture below and keep the heading as shown if possible: ...
5
votes
1answer
136 views

Conditional sorting of columns in a matrix

I have a matrix with ten columns, and I want to rearrange these columns with three conditions. Column 1+2n and 2+2n (0<=n=<4) always remain together and in the same order (1+2n before 2+2n). ...
1
vote
1answer
69 views

How do i create a function which returns a table/matrix in mathematica?

I'm trying to create a matrix which will be of size 2N by 2N and have entries which will depend on the column and row number (u and v here). I'm sure this is a very trivial question but i'm really ...
3
votes
5answers
163 views

how to add rows to a matrix to achieve a given order

I have a large number of matrices having equal numbers of columns but different numbers of rows. Say, their order is n X 4, Where n can be any integer between 1000 to 1050. How to tell Mathematica to ...
2
votes
0answers
70 views

Extract the dynamical map from the density matrix

I am working on open quantum systems and have been wondering whether there is a way to extract the dynamical map using mathematica. Say we have a density matrix $\rho(t) = \begin{bmatrix} p_{00} + (1 -...
2
votes
0answers
72 views

dot product of one thousand matrices [closed]

I have a time dependent matrix. In a thousand different times with the same time intervals I get the values of the matrices. Now, how can I DOT Product these thousand matrices in time order??
0
votes
0answers
43 views

Block Matrix Algebra of Implicit Matricies

I get some unexpected behaviour from building block matrices of implicit matrices in Mathematica. Using this initial setup ...
2
votes
0answers
75 views

Building a Matrix as a piecewise-function of the indices without for loops [closed]

I'm very new to Mathematica and this site. I've read that building matrices with For loops is slow, and I have experienced this myself on the current project. I'm trying to wrap my head around ...
1
vote
1answer
67 views

Matrix differential equation with DSolve doesn't work

I'm trying to solve matrix differential equation with DSolve, but I got an error. ...
0
votes
2answers
80 views

How to find a matrix satisfying following equation

I have a $N \times 1$ vector $F(t)$ for $0\leq t \leq 1$. I want to find a $N\times N$ Matrix $C$ (a real-valued matrix) satisfying the following equation: $$\int_0^t F(t_0)dt_0= C.F(t)$$ If it ...
0
votes
2answers
53 views

Can I save data as a three-column matrix?

I need to store values of a function of x and y defined as f[x_, y_] := Sin[Pi*x/3]*Sin[Pi*y/3] at the following points ...
1
vote
1answer
45 views

How do I make Mathematica to always evaluate Log[0, x] as Power[0, x]?

So, sometimes Mathematica cannot evaluate the base-0 logarithm of certain matrices. But we know that the expressions $0^x$ and $\log_0 x$ are always equivalent. What can I do so that Mathematica ...
0
votes
1answer
61 views

How do I improve this code for hyperbolic numbers so to allow equation-solving?

I have the following code, which allows evaluating expressions with split-complex unity J: ...
0
votes
0answers
51 views

Selecting a matrix element with [[ ]] doesn't work [duplicate]

I am trying to select a matrix element using Part or [[ ]] but somehow it doesn't work. ...
0
votes
1answer
41 views
0
votes
1answer
54 views

Basics for recursive functions [duplicate]

I am new to Mathematica and try to define a simple recursive formula which is illustrated as below: ...
2
votes
1answer
100 views

How to find a transformation matrix between two set of operators?

The following set of operators $P_1,P_2,P_3,P_4$ and $Q_1,Q_2,Q_3,Q_4$ are related as $P_i=\sum_j w_{ij} Q_j$. How can I find the matrix $W=[w_{ij}]$? ...
1
vote
1answer
71 views

Can we show that two matrices are unitarily equivalent?

Is it possible to show that matrix a1 defined as ...
1
vote
1answer
48 views

Matrix multiplication with non-commuting objects (Quantum)

Given a matrix A = {{0,a,a,0},{b,0,0,a},{b,0,0,a},{0,b,b,0}}, where $a$ and $b$ do not commute, how do I calculate $A^2$ in Mathematica? (Later on, I would like to ...
1
vote
1answer
36 views

Phenomena between ill-conditioned and well-condtioned

Given that I have the following sparse matrix: ...
0
votes
2answers
71 views

How can I multiply two 2-dim. matrices? [closed]

If I have the given below matrix d1[7,7], how can I multiply d1 by d1 to get the square matrix d2=d1.d1 ? ...
1
vote
1answer
44 views

How can I get matrices and text to show up in the same table with MatrixForm?

I'd like to be able to display matrices in the usual written MatrixForm in a table alongside text (or anything that isn't a matrix). Here is an example: ...
3
votes
1answer
51 views

Converting Association to Matrix

Imagine I have the following association, where the keys are given as pairs of natural numbers ...
1
vote
1answer
77 views

Matlab code to Mathemtica, Tensor

I am trying to convert a Matlab code to Mathematica. I have a tensor, RF (a,b,c,d) which is constructed from Hamiltonian (Hs) and 2x2 identity matrix (DS): ...
1
vote
0answers
23 views

'Tag in is protected' error in eigenvaules for large size Hamiltonian [closed]

I am trying to compute the eigenvalues for any size Hamiltonian matrix. To do this, I first manually compute the first few cases for N=2,3. However, when I want to see what happens for N=4, I meet ...
2
votes
1answer
70 views

How to Write a matrix Laurent polynomial $A_{-5}t^{-5} + A_{-4}t^{-4} + ...+ A_0 + A_1 t + A_2 t^2....$ in mathematica [closed]

I need to write in mathematica programming language a matrix Laurent Polynomial $$ T = \sum_{i=-5}^{5} A_i t ^i $$ where the $A_i$ are $n \times n$ matrices (I want the entries to be symbolic) which ...
1
vote
0answers
52 views

How can I extract a sub matrix of order 4*4 from four 2*2 corner blocks of a 6*6 matrix? [closed]

Let mat = RandomInteger[10, {6, 6}]; mat // MatrixForm I can access elements as follows ...
0
votes
2answers
81 views

How to build my desire matrix using SparseArray?

I have built some lists as follows: ...
0
votes
1answer
63 views

Construct a matrix from its elements and solve the eigenvalue problem

I want to construct a 10 by 10 matrix whose elements are given by $$ H_{nm}=\delta_{nm}\left (n^2+v[b_1-b_0-h(2m,b_0,b_1)]\right) \\ +v(1-\delta_{nm})\left (h(n-m,b_0,b_1)-h(n+m,b_0,b_1)\right) $$ ...
0
votes
0answers
42 views

Equation issue: Solve gives an empty output

I need c1,c2....c9 values. Why is Solve returning an empty list? How i can fix it? Thanks for any advice. ...
0
votes
0answers
31 views

Matrix modification with constraint on it

$q$ is a real antisymmetric matrix and can be defined as: ...
0
votes
1answer
73 views

Problem with the plots of eigenvalues of the Matrix

I am trying to plot the eigenvalues of the following matrix ...
3
votes
2answers
103 views

Creating a matrix of dimension d with constraints on indices

Is there a way to create a matrix $q$ of dimension $d$ with constraints on the indices given by: $$d\longrightarrow dimension$$ $i,j $ are indices $$q_{i,j}=\begin{cases} -b & j=i+d,\\ c & j=...
3
votes
1answer
78 views

Implementing empty matrix?

Matlab is famous for having implementation of empty matrices. The Matlab tutorial says "As far as we know, the literature on the algebra of empty matrices is itself empty. We’re not sure we’ve ...
2
votes
0answers
40 views

JordanDecomposition not evaluating

When there are very small differences between entries in a diagonal matrix, sometimes JordanDecomposition does not evaluate and gives an error message: ...
3
votes
1answer
71 views

Performing matrix tensor product and getting a sum of its negative entries

I am given a $3 \times 3$ matrix $M$, which only has real entries. Is there an efficient way to do the following two operations with $M$? For a given input $n$, compute the $n$-fold tensor product $M^...
0
votes
1answer
72 views

sum of symmetric matrix is not symmetric

Within the development of a Markov Chain Montecarlo algorithm, I need to do the Cholesky decomposition of a matrix. The matrix is the sum of two matrices m1=Transpose[a].a and m2=Transpose[b].b; A ...
0
votes
2answers
43 views

Data wrangling to create a matrix from lists

I have a super simple data wrangling question that I can't seem to figure out (I am new to Mathematica). Basically I'm not sure what function to use. I have two parameters, ...
2
votes
1answer
29 views
3
votes
1answer
129 views

How to implement Drazin inverse?

Wolfram site says it will be implemented in the future as DrazinInverse[m] function. But what to do now?
1
vote
0answers
31 views

Trajectory Design Matrix

I've been tasked with creating a small demonstration for educational purposes of the Morris Screening Method but am having trouble implementing the trajectory design matrix in Mathematica. It's a ...
1
vote
2answers
100 views

Taking a diagonal cut through a matrix

Lets say I have a gaussian data matrix, e.g. x=GaussianMatrix[20] I would like to take a cut through this matrix at a 45 degree angle to get its intensity profile, ...
1
vote
0answers
63 views

How do I carry out a partial row reduction of a matrix? [closed]

I have a large matrix with more columns than rows. I have attempted to row reduce the matrix using Mathematica's RowReduce command. I have been able to do this ...
2
votes
1answer
52 views

Ordering is not able to sort eigenvalues correctly! [closed]

I have a matrix as below one: ...

1
2 3 4 5
60