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?

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?













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















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













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
















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










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









          kglrkglr

          199k10223452




          199k10223452





















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

                      ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

                      Кампала Садржај Географија Географија Историја Становништво Привреда Партнерски градови Референце Спољашње везе Мени за навигацију0°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.340°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.34МедијиПодациЗванични веб-сајту

                      19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу