Help with coding a matrixProblem with writting into a matrix in MathematicaHow to create a general format of a matrix with specified entries?How to verify the convexity of a function?Problem with a Positive Definite Kernel/MatrixDEigenvalues with Robin B.C. sign problemGenerating a matrixmatrix perturbation general formula with random valuesAntisymmetric Matrix Eigenvector NormalizationProblem subtracting matricesHow to compute eigenvalues of a large symbolic matrix?
Definition of 'vrit'
How do I find which software is doing an SSH connection?
What is this airplane that sits in front of Barringer High School in Newark, NJ?
Why there is a red color in right side?
Why are there no file insertion syscalls
60's (or earlier) sci-fi short story about two spacecrafts exchanging plants for gold and thinking they got the better of the exchange
Is there a polite way to ask about one's ethnicity?
How can a warlock learn from a spellbook?
Explicit song lyrics checker
Umlaut character order when sorting
How would you explain #1 and #2 below using standard quotes?
Setting up the trap
I found a password with hashcat but it doesn't work
How can I improve my violin intonation for enharmonic notes?
Why one uses 了 and the other one doesn’t?
Does there exist a non-trivial group that is both perfect and complete?
My student in one course asks for paid tutoring in another course. Appropriate?
Can the pre-order traversal of two different trees be the same even though they are different?
Is there any possible way to get these hearts as Adult Link?
What mathematical theory is required for high frequency trading?
How is the idea of "girlfriend material" naturally expressed in Russian?
sudo passwd username keeps asking for the current password
Why is it easier to balance a non-moving bike standing up than sitting down?
How is linear momentum conserved in circular motion?
Help with coding a matrix
Problem with writting into a matrix in MathematicaHow to create a general format of a matrix with specified entries?How to verify the convexity of a function?Problem with a Positive Definite Kernel/MatrixDEigenvalues with Robin B.C. sign problemGenerating a matrixmatrix perturbation general formula with random valuesAntisymmetric Matrix Eigenvector NormalizationProblem subtracting matricesHow to compute eigenvalues of a large symbolic matrix?
$begingroup$
I have a $n times n$ matrix $A$ with a full set of eigenvalues $lambda$ including repetitions.
I want to create the following $i times i$ matrix:
$$left(sum_a=2^i (a-1) |a-1⟩⟨a| right) + sum_j=1^i d_j
sum_b=j^i |b⟩⟨b-j+1| $$
where $|1⟩,...,|i⟩$ is the standard basis and $d_j (lambda) = sum_c=1^n lambda_c^j$.
Any help with coding this matrix in Mathematica would be greatly appreciated.
matrix eigenvalues
New contributor
$endgroup$
add a comment |
$begingroup$
I have a $n times n$ matrix $A$ with a full set of eigenvalues $lambda$ including repetitions.
I want to create the following $i times i$ matrix:
$$left(sum_a=2^i (a-1) |a-1⟩⟨a| right) + sum_j=1^i d_j
sum_b=j^i |b⟩⟨b-j+1| $$
where $|1⟩,...,|i⟩$ is the standard basis and $d_j (lambda) = sum_c=1^n lambda_c^j$.
Any help with coding this matrix in Mathematica would be greatly appreciated.
matrix eigenvalues
New contributor
$endgroup$
$begingroup$
You must give an explicit mathematical formula for $|b rangle langle b-j+1|$ and other terms.
$endgroup$
– David G. Stork
8 hours ago
$begingroup$
@DavidG.Stork I added a missing definition and believe I have defined all the other terms. Please let me know if any definition is unclear.
$endgroup$
– jacobi16
8 hours ago
$begingroup$
The first term $delta_i,0$ is a scalar, not a matrix, and does not fit into the formula. Does it mean that for $i=0$ you want to get the scalar 1 as the answer?
$endgroup$
– Roman
7 hours ago
$begingroup$
Does $d_j(lambda)$ depend on $j$ at all?
$endgroup$
– Roman
7 hours ago
$begingroup$
@Roman Thanks for your comments. I had mistakenly written the superscript of $x$ as $q$ instead of $j$. $delta_i,0$ would be the identity matrix when $i=0$, which makes this term irrelevant now that I think about it. Sorry for the mistake with the definition of $d_j$ and thanks for spotting out the unnecessary $delta_i,0$ factor. I have edited my question to reflect these changes.
$endgroup$
– jacobi16
2 hours ago
add a comment |
$begingroup$
I have a $n times n$ matrix $A$ with a full set of eigenvalues $lambda$ including repetitions.
I want to create the following $i times i$ matrix:
$$left(sum_a=2^i (a-1) |a-1⟩⟨a| right) + sum_j=1^i d_j
sum_b=j^i |b⟩⟨b-j+1| $$
where $|1⟩,...,|i⟩$ is the standard basis and $d_j (lambda) = sum_c=1^n lambda_c^j$.
Any help with coding this matrix in Mathematica would be greatly appreciated.
matrix eigenvalues
New contributor
$endgroup$
I have a $n times n$ matrix $A$ with a full set of eigenvalues $lambda$ including repetitions.
I want to create the following $i times i$ matrix:
$$left(sum_a=2^i (a-1) |a-1⟩⟨a| right) + sum_j=1^i d_j
sum_b=j^i |b⟩⟨b-j+1| $$
where $|1⟩,...,|i⟩$ is the standard basis and $d_j (lambda) = sum_c=1^n lambda_c^j$.
Any help with coding this matrix in Mathematica would be greatly appreciated.
matrix eigenvalues
matrix eigenvalues
New contributor
New contributor
edited 2 hours ago
jacobi16
New contributor
asked 8 hours ago
jacobi16jacobi16
113
113
New contributor
New contributor
$begingroup$
You must give an explicit mathematical formula for $|b rangle langle b-j+1|$ and other terms.
$endgroup$
– David G. Stork
8 hours ago
$begingroup$
@DavidG.Stork I added a missing definition and believe I have defined all the other terms. Please let me know if any definition is unclear.
$endgroup$
– jacobi16
8 hours ago
$begingroup$
The first term $delta_i,0$ is a scalar, not a matrix, and does not fit into the formula. Does it mean that for $i=0$ you want to get the scalar 1 as the answer?
$endgroup$
– Roman
7 hours ago
$begingroup$
Does $d_j(lambda)$ depend on $j$ at all?
$endgroup$
– Roman
7 hours ago
$begingroup$
@Roman Thanks for your comments. I had mistakenly written the superscript of $x$ as $q$ instead of $j$. $delta_i,0$ would be the identity matrix when $i=0$, which makes this term irrelevant now that I think about it. Sorry for the mistake with the definition of $d_j$ and thanks for spotting out the unnecessary $delta_i,0$ factor. I have edited my question to reflect these changes.
$endgroup$
– jacobi16
2 hours ago
add a comment |
$begingroup$
You must give an explicit mathematical formula for $|b rangle langle b-j+1|$ and other terms.
$endgroup$
– David G. Stork
8 hours ago
$begingroup$
@DavidG.Stork I added a missing definition and believe I have defined all the other terms. Please let me know if any definition is unclear.
$endgroup$
– jacobi16
8 hours ago
$begingroup$
The first term $delta_i,0$ is a scalar, not a matrix, and does not fit into the formula. Does it mean that for $i=0$ you want to get the scalar 1 as the answer?
$endgroup$
– Roman
7 hours ago
$begingroup$
Does $d_j(lambda)$ depend on $j$ at all?
$endgroup$
– Roman
7 hours ago
$begingroup$
@Roman Thanks for your comments. I had mistakenly written the superscript of $x$ as $q$ instead of $j$. $delta_i,0$ would be the identity matrix when $i=0$, which makes this term irrelevant now that I think about it. Sorry for the mistake with the definition of $d_j$ and thanks for spotting out the unnecessary $delta_i,0$ factor. I have edited my question to reflect these changes.
$endgroup$
– jacobi16
2 hours ago
$begingroup$
You must give an explicit mathematical formula for $|b rangle langle b-j+1|$ and other terms.
$endgroup$
– David G. Stork
8 hours ago
$begingroup$
You must give an explicit mathematical formula for $|b rangle langle b-j+1|$ and other terms.
$endgroup$
– David G. Stork
8 hours ago
$begingroup$
@DavidG.Stork I added a missing definition and believe I have defined all the other terms. Please let me know if any definition is unclear.
$endgroup$
– jacobi16
8 hours ago
$begingroup$
@DavidG.Stork I added a missing definition and believe I have defined all the other terms. Please let me know if any definition is unclear.
$endgroup$
– jacobi16
8 hours ago
$begingroup$
The first term $delta_i,0$ is a scalar, not a matrix, and does not fit into the formula. Does it mean that for $i=0$ you want to get the scalar 1 as the answer?
$endgroup$
– Roman
7 hours ago
$begingroup$
The first term $delta_i,0$ is a scalar, not a matrix, and does not fit into the formula. Does it mean that for $i=0$ you want to get the scalar 1 as the answer?
$endgroup$
– Roman
7 hours ago
$begingroup$
Does $d_j(lambda)$ depend on $j$ at all?
$endgroup$
– Roman
7 hours ago
$begingroup$
Does $d_j(lambda)$ depend on $j$ at all?
$endgroup$
– Roman
7 hours ago
$begingroup$
@Roman Thanks for your comments. I had mistakenly written the superscript of $x$ as $q$ instead of $j$. $delta_i,0$ would be the identity matrix when $i=0$, which makes this term irrelevant now that I think about it. Sorry for the mistake with the definition of $d_j$ and thanks for spotting out the unnecessary $delta_i,0$ factor. I have edited my question to reflect these changes.
$endgroup$
– jacobi16
2 hours ago
$begingroup$
@Roman Thanks for your comments. I had mistakenly written the superscript of $x$ as $q$ instead of $j$. $delta_i,0$ would be the identity matrix when $i=0$, which makes this term irrelevant now that I think about it. Sorry for the mistake with the definition of $d_j$ and thanks for spotting out the unnecessary $delta_i,0$ factor. I have edited my question to reflect these changes.
$endgroup$
– jacobi16
2 hours ago
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
You can also use a combination of ToeplitzMatrix
, DiagonalMatrix
, LowerTriangularize
and SparseArray
:
ClearAll[mat]
mat[n_] := Module[dd = Array[d, n],
LowerTriangularize[ToeplitzMatrix[dd, SparseArray]] +
DiagonalMatrix[SparseArray@Range[n - 1], 1]]
mat[5] // MatrixForm // TeXForm
$left(
beginarrayccccc
d(1) & 1 & 0 & 0 & 0 \
d(2) & d(1) & 2 & 0 & 0 \
d(3) & d(2) & d(1) & 3 & 0 \
d(4) & d(3) & d(2) & d(1) & 4 \
d(5) & d(4) & d(3) & d(2) & d(1) \
endarray
right)$
$endgroup$
add a comment |
$begingroup$
You can define the matrix with
M[i_Integer?Positive] := SparseArray[Band[1, 2] -> Range[i - 1],
a_, b_ /; a >= b -> d[a - b + 1],
i, i]
I don't know what to do with the first term $delta_i,0$ because it is not an operator/matrix (it is a scalar).
Also, I don't understand your definition of $d_j=$d[j]
: should it depend on $j$?
M[5] // MatrixForm
$endgroup$
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
jacobi16 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f200465%2fhelp-with-coding-a-matrix%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You can also use a combination of ToeplitzMatrix
, DiagonalMatrix
, LowerTriangularize
and SparseArray
:
ClearAll[mat]
mat[n_] := Module[dd = Array[d, n],
LowerTriangularize[ToeplitzMatrix[dd, SparseArray]] +
DiagonalMatrix[SparseArray@Range[n - 1], 1]]
mat[5] // MatrixForm // TeXForm
$left(
beginarrayccccc
d(1) & 1 & 0 & 0 & 0 \
d(2) & d(1) & 2 & 0 & 0 \
d(3) & d(2) & d(1) & 3 & 0 \
d(4) & d(3) & d(2) & d(1) & 4 \
d(5) & d(4) & d(3) & d(2) & d(1) \
endarray
right)$
$endgroup$
add a comment |
$begingroup$
You can also use a combination of ToeplitzMatrix
, DiagonalMatrix
, LowerTriangularize
and SparseArray
:
ClearAll[mat]
mat[n_] := Module[dd = Array[d, n],
LowerTriangularize[ToeplitzMatrix[dd, SparseArray]] +
DiagonalMatrix[SparseArray@Range[n - 1], 1]]
mat[5] // MatrixForm // TeXForm
$left(
beginarrayccccc
d(1) & 1 & 0 & 0 & 0 \
d(2) & d(1) & 2 & 0 & 0 \
d(3) & d(2) & d(1) & 3 & 0 \
d(4) & d(3) & d(2) & d(1) & 4 \
d(5) & d(4) & d(3) & d(2) & d(1) \
endarray
right)$
$endgroup$
add a comment |
$begingroup$
You can also use a combination of ToeplitzMatrix
, DiagonalMatrix
, LowerTriangularize
and SparseArray
:
ClearAll[mat]
mat[n_] := Module[dd = Array[d, n],
LowerTriangularize[ToeplitzMatrix[dd, SparseArray]] +
DiagonalMatrix[SparseArray@Range[n - 1], 1]]
mat[5] // MatrixForm // TeXForm
$left(
beginarrayccccc
d(1) & 1 & 0 & 0 & 0 \
d(2) & d(1) & 2 & 0 & 0 \
d(3) & d(2) & d(1) & 3 & 0 \
d(4) & d(3) & d(2) & d(1) & 4 \
d(5) & d(4) & d(3) & d(2) & d(1) \
endarray
right)$
$endgroup$
You can also use a combination of ToeplitzMatrix
, DiagonalMatrix
, LowerTriangularize
and SparseArray
:
ClearAll[mat]
mat[n_] := Module[dd = Array[d, n],
LowerTriangularize[ToeplitzMatrix[dd, SparseArray]] +
DiagonalMatrix[SparseArray@Range[n - 1], 1]]
mat[5] // MatrixForm // TeXForm
$left(
beginarrayccccc
d(1) & 1 & 0 & 0 & 0 \
d(2) & d(1) & 2 & 0 & 0 \
d(3) & d(2) & d(1) & 3 & 0 \
d(4) & d(3) & d(2) & d(1) & 4 \
d(5) & d(4) & d(3) & d(2) & d(1) \
endarray
right)$
answered 6 hours ago
kglrkglr
199k10223451
199k10223451
add a comment |
add a comment |
$begingroup$
You can define the matrix with
M[i_Integer?Positive] := SparseArray[Band[1, 2] -> Range[i - 1],
a_, b_ /; a >= b -> d[a - b + 1],
i, i]
I don't know what to do with the first term $delta_i,0$ because it is not an operator/matrix (it is a scalar).
Also, I don't understand your definition of $d_j=$d[j]
: should it depend on $j$?
M[5] // MatrixForm
$endgroup$
add a comment |
$begingroup$
You can define the matrix with
M[i_Integer?Positive] := SparseArray[Band[1, 2] -> Range[i - 1],
a_, b_ /; a >= b -> d[a - b + 1],
i, i]
I don't know what to do with the first term $delta_i,0$ because it is not an operator/matrix (it is a scalar).
Also, I don't understand your definition of $d_j=$d[j]
: should it depend on $j$?
M[5] // MatrixForm
$endgroup$
add a comment |
$begingroup$
You can define the matrix with
M[i_Integer?Positive] := SparseArray[Band[1, 2] -> Range[i - 1],
a_, b_ /; a >= b -> d[a - b + 1],
i, i]
I don't know what to do with the first term $delta_i,0$ because it is not an operator/matrix (it is a scalar).
Also, I don't understand your definition of $d_j=$d[j]
: should it depend on $j$?
M[5] // MatrixForm
$endgroup$
You can define the matrix with
M[i_Integer?Positive] := SparseArray[Band[1, 2] -> Range[i - 1],
a_, b_ /; a >= b -> d[a - b + 1],
i, i]
I don't know what to do with the first term $delta_i,0$ because it is not an operator/matrix (it is a scalar).
Also, I don't understand your definition of $d_j=$d[j]
: should it depend on $j$?
M[5] // MatrixForm
answered 7 hours ago
RomanRoman
11.3k11944
11.3k11944
add a comment |
add a comment |
jacobi16 is a new contributor. Be nice, and check out our Code of Conduct.
jacobi16 is a new contributor. Be nice, and check out our Code of Conduct.
jacobi16 is a new contributor. Be nice, and check out our Code of Conduct.
jacobi16 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f200465%2fhelp-with-coding-a-matrix%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
You must give an explicit mathematical formula for $|b rangle langle b-j+1|$ and other terms.
$endgroup$
– David G. Stork
8 hours ago
$begingroup$
@DavidG.Stork I added a missing definition and believe I have defined all the other terms. Please let me know if any definition is unclear.
$endgroup$
– jacobi16
8 hours ago
$begingroup$
The first term $delta_i,0$ is a scalar, not a matrix, and does not fit into the formula. Does it mean that for $i=0$ you want to get the scalar 1 as the answer?
$endgroup$
– Roman
7 hours ago
$begingroup$
Does $d_j(lambda)$ depend on $j$ at all?
$endgroup$
– Roman
7 hours ago
$begingroup$
@Roman Thanks for your comments. I had mistakenly written the superscript of $x$ as $q$ instead of $j$. $delta_i,0$ would be the identity matrix when $i=0$, which makes this term irrelevant now that I think about it. Sorry for the mistake with the definition of $d_j$ and thanks for spotting out the unnecessary $delta_i,0$ factor. I have edited my question to reflect these changes.
$endgroup$
– jacobi16
2 hours ago