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?













2












$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.










share|improve this question









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
    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















2












$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.










share|improve this question









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
    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













2












2








2





$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.










share|improve this question









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






share|improve this question









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.










share|improve this question









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.








share|improve this question




share|improve this question








edited 2 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 8 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
    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$
    @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










2 Answers
2






active

oldest

votes


















2












$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)$







share|improve this answer









$endgroup$




















    1












    $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


    enter image description here






    share|improve this answer









    $endgroup$













      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.









      draft saved

      draft discarded


















      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









      2












      $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)$







      share|improve this answer









      $endgroup$

















        2












        $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)$







        share|improve this answer









        $endgroup$















          2












          2








          2





          $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)$







          share|improve this answer









          $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)$








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 6 hours ago









          kglrkglr

          199k10223451




          199k10223451





















              1












              $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


              enter image description here






              share|improve this answer









              $endgroup$

















                1












                $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


                enter image description here






                share|improve this answer









                $endgroup$















                  1












                  1








                  1





                  $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


                  enter image description here






                  share|improve this answer









                  $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


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 7 hours ago









                  RomanRoman

                  11.3k11944




                  11.3k11944




















                      jacobi16 is a new contributor. Be nice, and check out our Code of Conduct.









                      draft saved

                      draft discarded


















                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      Popular posts from this blog

                      Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                      Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                      Ласкавець круглолистий Зміст Опис | Поширення | Галерея | Примітки | Посилання | Навігаційне меню58171138361-22960890446Bupleurum rotundifoliumEuro+Med PlantbasePlants of the World Online — Kew ScienceGermplasm Resources Information Network (GRIN)Ласкавецькн. VI : Літери Ком — Левиправивши або дописавши її