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?

Multi tool use
What is that ceiling compartment of a Boeing 737?
Is there a polite way to ask about one's ethnicity?
What could be the physiological mechanism for a biological Geiger counter?
How Hebrew Vowels Work
Scaling an object to change its key
What is this plant I saw for sale at a Romanian farmer's market?
How can I ping multiple IP addresses at the same time?
How would one carboxylate CBG into its acid form, CBGA?
Setting up the trap
How to modify a string without altering its text properties
Why are there no file insertion syscalls
My student in one course asks for paid tutoring in another course. Appropriate?
Why things float in space, though there is always gravity of our star is present
How "fast" do astronomical events occur?
Boundaries and Buddhism
How to make all magic-casting innate, but still rare?
How can I restore a master database from its bak file?
sudo passwd username keeps asking for the current password
Are intrusions within a foreign embassy considered an act of war?
How to write a nice frame challenge?
In Street Fighter, what does the M stand for in M Bison?
Print the new site header
How do you transpose samples in cents?
Why was New Asgard established at this place?
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
jacobi16 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$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
jacobi16 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
$begingroup$
You must give an explicit mathematical formula for $|b rangle langle b-j+1|$ and other terms.
$endgroup$
– David G. Stork
9 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
9 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
8 hours ago
$begingroup$
Does $d_j(lambda)$ depend on $j$ at all?
$endgroup$
– Roman
8 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
3 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
jacobi16 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$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
jacobi16 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
jacobi16 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 3 hours ago
jacobi16
New contributor
jacobi16 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 9 hours ago
jacobi16jacobi16
113
113
New contributor
jacobi16 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
jacobi16 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$begingroup$
You must give an explicit mathematical formula for $|b rangle langle b-j+1|$ and other terms.
$endgroup$
– David G. Stork
9 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
9 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
8 hours ago
$begingroup$
Does $d_j(lambda)$ depend on $j$ at all?
$endgroup$
– Roman
8 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
3 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
9 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
9 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
8 hours ago
$begingroup$
Does $d_j(lambda)$ depend on $j$ at all?
$endgroup$
– Roman
8 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
3 hours ago
$begingroup$
You must give an explicit mathematical formula for $|b rangle langle b-j+1|$ and other terms.
$endgroup$
– David G. Stork
9 hours ago
$begingroup$
You must give an explicit mathematical formula for $|b rangle langle b-j+1|$ and other terms.
$endgroup$
– David G. Stork
9 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
9 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
9 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
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
8 hours ago
$begingroup$
Does $d_j(lambda)$ depend on $j$ at all?
$endgroup$
– Roman
8 hours ago
$begingroup$
Does $d_j(lambda)$ depend on $j$ at all?
$endgroup$
– Roman
8 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
3 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
3 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 7 hours ago
kglrkglr
199k10223452
199k10223452
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 8 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
kmS,zHa,wx6Ztv,C,DY55,qqagMJsX5rGbqV4,CGHkzq2zyhGcX2od,Fyhu 9tPtW2 romrko,pCwa617F cYqXq7ei9VUWAeTTCTb Ww
$begingroup$
You must give an explicit mathematical formula for $|b rangle langle b-j+1|$ and other terms.
$endgroup$
– David G. Stork
9 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
9 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
8 hours ago
$begingroup$
Does $d_j(lambda)$ depend on $j$ at all?
$endgroup$
– Roman
8 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
3 hours ago