Skipping indices in a product The Next CEO of Stack OverflowWhat's the best way to generate all the upper triangular matrix whose singular values are given?What is the fastest way to obtain the eigenvalues of a Wishart matrix?Evaluating the product of a matrix sequenceMapping over two indices with a conditionOuter product using the quantum mathematica packageWhy does Eigenvalues work for a matrix $M$ but not $M$?Conditions on a productHow to put conditions on indices of productProduct of matrices with symbolic boundsInverting a matrix when its elements are given by difficult expressions?

Really confused on what inner tube would fit my BF’s new bike?

Return the Closest Prime Number

How to make a variable always equal to the result of some calculations?

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

FBX seems to be empty when imported into Blender

Non-deterministic sum of floats

Novel about a guy who is possessed by the divine essence and the world ends?

Can I equip Skullclamp on a creature I am sacrificing?

If the heap is initialized for security, then why is the stack uninitialized?

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin

Why did we only see the N-1 starfighters in one film?

WOW air has ceased operation, can I get my tickets refunded?

Can we say or write : "No, it'sn't"?

Anatomically Correct Strange Women In Ponds Distributing Swords

Hindi speaking tourist to UK from India

Why does standard notation not preserve intervals (visually)

Written every which way

Is it professional to write unrelated content in an almost-empty email?

What happened in Rome, when the western empire "fell"?

Giving the same color to different shapefiles in QGIS

A "random" question: usage of "random" as adjective in Spanish

Is it possible to search for a directory/file combination?

Beyond letters and diaries—exercises to explore characters' personalities and motivation

At which OSI layer a user-generated data resides?



Skipping indices in a product



The Next CEO of Stack OverflowWhat's the best way to generate all the upper triangular matrix whose singular values are given?What is the fastest way to obtain the eigenvalues of a Wishart matrix?Evaluating the product of a matrix sequenceMapping over two indices with a conditionOuter product using the quantum mathematica packageWhy does Eigenvalues work for a matrix $M$ but not $M$?Conditions on a productHow to put conditions on indices of productProduct of matrices with symbolic boundsInverting a matrix when its elements are given by difficult expressions?










1












$begingroup$


I have a matrix $A$ for which I want to compute the quantity $Tlambda_j = Pi_lambda_ine lambda_j fracA - lambda_i Ilambda_j-lambda_i$, where $lambda_i$ ($lambda_j$) denote the eigenvalues of $A$. How can this be implemented in Mathematica? Just gave a try here:



A = 1, 0, 0, 1,0, 1, 2, 0,1, 1, 0, 2,0, 0, 0, 1;
Eigenvalues[A]



2, -1, 1, 1




Tj = Product[(A - Eigenvalues[A][[i]] IdentityMatrix[4])/(
Eigenvalues[A][[j]] - Eigenvalues[A][[i]]), i, 1, 4]









share|improve this question











$endgroup$











  • $begingroup$
    in which part exactly you want to exclude it in Tj !??
    $endgroup$
    – Alrubaie
    1 hour ago










  • $begingroup$
    do you want it to be skipped put not Zero right !?
    $endgroup$
    – Alrubaie
    1 hour ago










  • $begingroup$
    @Alrubaie, there was a typo in my post. Just edited it. I want the denominator to be non-zero and hence avoid the case for which $i=j$.
    $endgroup$
    – Tobias Fritzn
    1 hour ago










  • $begingroup$
    @Alrubaie, my $i$ and $j$ are not the indices in my question. They are the eigenvalues. I should have used something like $lambda_i$ and $lambda_j$.
    $endgroup$
    – Tobias Fritzn
    1 hour ago






  • 2




    $begingroup$
    That product is presumably a matrix multiplication?
    $endgroup$
    – J. M. is slightly pensive
    1 hour ago















1












$begingroup$


I have a matrix $A$ for which I want to compute the quantity $Tlambda_j = Pi_lambda_ine lambda_j fracA - lambda_i Ilambda_j-lambda_i$, where $lambda_i$ ($lambda_j$) denote the eigenvalues of $A$. How can this be implemented in Mathematica? Just gave a try here:



A = 1, 0, 0, 1,0, 1, 2, 0,1, 1, 0, 2,0, 0, 0, 1;
Eigenvalues[A]



2, -1, 1, 1




Tj = Product[(A - Eigenvalues[A][[i]] IdentityMatrix[4])/(
Eigenvalues[A][[j]] - Eigenvalues[A][[i]]), i, 1, 4]









share|improve this question











$endgroup$











  • $begingroup$
    in which part exactly you want to exclude it in Tj !??
    $endgroup$
    – Alrubaie
    1 hour ago










  • $begingroup$
    do you want it to be skipped put not Zero right !?
    $endgroup$
    – Alrubaie
    1 hour ago










  • $begingroup$
    @Alrubaie, there was a typo in my post. Just edited it. I want the denominator to be non-zero and hence avoid the case for which $i=j$.
    $endgroup$
    – Tobias Fritzn
    1 hour ago










  • $begingroup$
    @Alrubaie, my $i$ and $j$ are not the indices in my question. They are the eigenvalues. I should have used something like $lambda_i$ and $lambda_j$.
    $endgroup$
    – Tobias Fritzn
    1 hour ago






  • 2




    $begingroup$
    That product is presumably a matrix multiplication?
    $endgroup$
    – J. M. is slightly pensive
    1 hour ago













1












1








1





$begingroup$


I have a matrix $A$ for which I want to compute the quantity $Tlambda_j = Pi_lambda_ine lambda_j fracA - lambda_i Ilambda_j-lambda_i$, where $lambda_i$ ($lambda_j$) denote the eigenvalues of $A$. How can this be implemented in Mathematica? Just gave a try here:



A = 1, 0, 0, 1,0, 1, 2, 0,1, 1, 0, 2,0, 0, 0, 1;
Eigenvalues[A]



2, -1, 1, 1




Tj = Product[(A - Eigenvalues[A][[i]] IdentityMatrix[4])/(
Eigenvalues[A][[j]] - Eigenvalues[A][[i]]), i, 1, 4]









share|improve this question











$endgroup$




I have a matrix $A$ for which I want to compute the quantity $Tlambda_j = Pi_lambda_ine lambda_j fracA - lambda_i Ilambda_j-lambda_i$, where $lambda_i$ ($lambda_j$) denote the eigenvalues of $A$. How can this be implemented in Mathematica? Just gave a try here:



A = 1, 0, 0, 1,0, 1, 2, 0,1, 1, 0, 2,0, 0, 0, 1;
Eigenvalues[A]



2, -1, 1, 1




Tj = Product[(A - Eigenvalues[A][[i]] IdentityMatrix[4])/(
Eigenvalues[A][[j]] - Eigenvalues[A][[i]]), i, 1, 4]






matrix operators products






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 36 mins ago









That Gravity Guy

2,1311615




2,1311615










asked 1 hour ago









Tobias FritznTobias Fritzn

1745




1745











  • $begingroup$
    in which part exactly you want to exclude it in Tj !??
    $endgroup$
    – Alrubaie
    1 hour ago










  • $begingroup$
    do you want it to be skipped put not Zero right !?
    $endgroup$
    – Alrubaie
    1 hour ago










  • $begingroup$
    @Alrubaie, there was a typo in my post. Just edited it. I want the denominator to be non-zero and hence avoid the case for which $i=j$.
    $endgroup$
    – Tobias Fritzn
    1 hour ago










  • $begingroup$
    @Alrubaie, my $i$ and $j$ are not the indices in my question. They are the eigenvalues. I should have used something like $lambda_i$ and $lambda_j$.
    $endgroup$
    – Tobias Fritzn
    1 hour ago






  • 2




    $begingroup$
    That product is presumably a matrix multiplication?
    $endgroup$
    – J. M. is slightly pensive
    1 hour ago
















  • $begingroup$
    in which part exactly you want to exclude it in Tj !??
    $endgroup$
    – Alrubaie
    1 hour ago










  • $begingroup$
    do you want it to be skipped put not Zero right !?
    $endgroup$
    – Alrubaie
    1 hour ago










  • $begingroup$
    @Alrubaie, there was a typo in my post. Just edited it. I want the denominator to be non-zero and hence avoid the case for which $i=j$.
    $endgroup$
    – Tobias Fritzn
    1 hour ago










  • $begingroup$
    @Alrubaie, my $i$ and $j$ are not the indices in my question. They are the eigenvalues. I should have used something like $lambda_i$ and $lambda_j$.
    $endgroup$
    – Tobias Fritzn
    1 hour ago






  • 2




    $begingroup$
    That product is presumably a matrix multiplication?
    $endgroup$
    – J. M. is slightly pensive
    1 hour ago















$begingroup$
in which part exactly you want to exclude it in Tj !??
$endgroup$
– Alrubaie
1 hour ago




$begingroup$
in which part exactly you want to exclude it in Tj !??
$endgroup$
– Alrubaie
1 hour ago












$begingroup$
do you want it to be skipped put not Zero right !?
$endgroup$
– Alrubaie
1 hour ago




$begingroup$
do you want it to be skipped put not Zero right !?
$endgroup$
– Alrubaie
1 hour ago












$begingroup$
@Alrubaie, there was a typo in my post. Just edited it. I want the denominator to be non-zero and hence avoid the case for which $i=j$.
$endgroup$
– Tobias Fritzn
1 hour ago




$begingroup$
@Alrubaie, there was a typo in my post. Just edited it. I want the denominator to be non-zero and hence avoid the case for which $i=j$.
$endgroup$
– Tobias Fritzn
1 hour ago












$begingroup$
@Alrubaie, my $i$ and $j$ are not the indices in my question. They are the eigenvalues. I should have used something like $lambda_i$ and $lambda_j$.
$endgroup$
– Tobias Fritzn
1 hour ago




$begingroup$
@Alrubaie, my $i$ and $j$ are not the indices in my question. They are the eigenvalues. I should have used something like $lambda_i$ and $lambda_j$.
$endgroup$
– Tobias Fritzn
1 hour ago




2




2




$begingroup$
That product is presumably a matrix multiplication?
$endgroup$
– J. M. is slightly pensive
1 hour ago




$begingroup$
That product is presumably a matrix multiplication?
$endgroup$
– J. M. is slightly pensive
1 hour ago










3 Answers
3






active

oldest

votes


















3












$begingroup$

Here is my pedestrian implementation of your formula:



a = 1, 0, 0, 1, 0, 1, 2, 0, 1, 1, 0, 2, 0, 0, 0, 1;

ClearAll[t]
t[amat_, j_] := Module[
evals, usable,
evals = Eigenvalues[amat];
usable = DeleteDuplicates@Cases[evals, Except@evals[[j]] ];
Dot @@
Table[
(amat - i IdentityMatrix[Length[amat]])/(evals[[j]] - i),
i, usable
]
]

t[a, 4]


Mathematica graphics



You do not provide an example of desired output, so I will let you check whether this is what you expect.






share|improve this answer









$endgroup$












  • $begingroup$
    Thanks, @MarcoB. It leads precisely to the expected result. However, it looks too complicated. Nevertheless, it is fine as it works.
    $endgroup$
    – Tobias Fritzn
    48 mins ago



















2












$begingroup$

Something like this?



Clear[A, evals, T]
A = 1, 0, 0, 1, 0, 1, 2, 0, 1, 1, 0, 2, 0, 0, 0, 1;
T[A_?MatrixQ, j_Integer] := With[
evals = Eigenvalues[A], id = IdentityMatrix@Length@A,
Dot @@ Table[
If[evals[[j]] - evals[[i]] == 0, id, (A - evals[[i]] id)/(evals[[j]] - evals[[i]])],
i, Length@A
]
]

MatrixForm /@ Array[T[A, #] &, 4]


enter image description here






share|improve this answer









$endgroup$




















    0












    $begingroup$

    This



    A = 1, 0, 0, 1,0, 1, 2, 0,1, 1, 0, 2,0, 0, 0, 1;
    e=Eigenvalues[A];
    Map[(A-e[[#[[1]]]]*IdentityMatrix[4])/(e[[#[[2]]]]-e[[#[[1]]]])&,
    DeleteCases[Tuples[Range[4],2],i_,i_]]


    generates your twelve matricies with i not equal to j.



    Put Dot@@ in front of that Map to form the dot product of the 12 matricies.



    That works by forming every possible distinct i,j pair and then using those in the Map



    If it might be easier to read you can also write it this way



    Map[(ei=e[[#[[1]]]];ej=e[[#[[2]]]];
    (A-ei*IdentityMatrix[4])/(ej-ei))&,
    DeleteCases[Tuples[Range[4],2],i_,i_]]





    share|improve this answer











    $endgroup$












    • $begingroup$
      Should e[[#[[2]]]]-e[[[[1]]]] be e[[#[[2]]]]-e[[#[[1]]]]?
      $endgroup$
      – That Gravity Guy
      23 mins ago










    • $begingroup$
      @ThatGravityGuy Yes! Good catch. Thank you! Corrected.
      $endgroup$
      – Bill
      21 mins ago











    Your Answer





    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

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



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f194194%2fskipping-indices-in-a-product%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3












    $begingroup$

    Here is my pedestrian implementation of your formula:



    a = 1, 0, 0, 1, 0, 1, 2, 0, 1, 1, 0, 2, 0, 0, 0, 1;

    ClearAll[t]
    t[amat_, j_] := Module[
    evals, usable,
    evals = Eigenvalues[amat];
    usable = DeleteDuplicates@Cases[evals, Except@evals[[j]] ];
    Dot @@
    Table[
    (amat - i IdentityMatrix[Length[amat]])/(evals[[j]] - i),
    i, usable
    ]
    ]

    t[a, 4]


    Mathematica graphics



    You do not provide an example of desired output, so I will let you check whether this is what you expect.






    share|improve this answer









    $endgroup$












    • $begingroup$
      Thanks, @MarcoB. It leads precisely to the expected result. However, it looks too complicated. Nevertheless, it is fine as it works.
      $endgroup$
      – Tobias Fritzn
      48 mins ago
















    3












    $begingroup$

    Here is my pedestrian implementation of your formula:



    a = 1, 0, 0, 1, 0, 1, 2, 0, 1, 1, 0, 2, 0, 0, 0, 1;

    ClearAll[t]
    t[amat_, j_] := Module[
    evals, usable,
    evals = Eigenvalues[amat];
    usable = DeleteDuplicates@Cases[evals, Except@evals[[j]] ];
    Dot @@
    Table[
    (amat - i IdentityMatrix[Length[amat]])/(evals[[j]] - i),
    i, usable
    ]
    ]

    t[a, 4]


    Mathematica graphics



    You do not provide an example of desired output, so I will let you check whether this is what you expect.






    share|improve this answer









    $endgroup$












    • $begingroup$
      Thanks, @MarcoB. It leads precisely to the expected result. However, it looks too complicated. Nevertheless, it is fine as it works.
      $endgroup$
      – Tobias Fritzn
      48 mins ago














    3












    3








    3





    $begingroup$

    Here is my pedestrian implementation of your formula:



    a = 1, 0, 0, 1, 0, 1, 2, 0, 1, 1, 0, 2, 0, 0, 0, 1;

    ClearAll[t]
    t[amat_, j_] := Module[
    evals, usable,
    evals = Eigenvalues[amat];
    usable = DeleteDuplicates@Cases[evals, Except@evals[[j]] ];
    Dot @@
    Table[
    (amat - i IdentityMatrix[Length[amat]])/(evals[[j]] - i),
    i, usable
    ]
    ]

    t[a, 4]


    Mathematica graphics



    You do not provide an example of desired output, so I will let you check whether this is what you expect.






    share|improve this answer









    $endgroup$



    Here is my pedestrian implementation of your formula:



    a = 1, 0, 0, 1, 0, 1, 2, 0, 1, 1, 0, 2, 0, 0, 0, 1;

    ClearAll[t]
    t[amat_, j_] := Module[
    evals, usable,
    evals = Eigenvalues[amat];
    usable = DeleteDuplicates@Cases[evals, Except@evals[[j]] ];
    Dot @@
    Table[
    (amat - i IdentityMatrix[Length[amat]])/(evals[[j]] - i),
    i, usable
    ]
    ]

    t[a, 4]


    Mathematica graphics



    You do not provide an example of desired output, so I will let you check whether this is what you expect.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 56 mins ago









    MarcoBMarcoB

    38.1k556114




    38.1k556114











    • $begingroup$
      Thanks, @MarcoB. It leads precisely to the expected result. However, it looks too complicated. Nevertheless, it is fine as it works.
      $endgroup$
      – Tobias Fritzn
      48 mins ago

















    • $begingroup$
      Thanks, @MarcoB. It leads precisely to the expected result. However, it looks too complicated. Nevertheless, it is fine as it works.
      $endgroup$
      – Tobias Fritzn
      48 mins ago
















    $begingroup$
    Thanks, @MarcoB. It leads precisely to the expected result. However, it looks too complicated. Nevertheless, it is fine as it works.
    $endgroup$
    – Tobias Fritzn
    48 mins ago





    $begingroup$
    Thanks, @MarcoB. It leads precisely to the expected result. However, it looks too complicated. Nevertheless, it is fine as it works.
    $endgroup$
    – Tobias Fritzn
    48 mins ago












    2












    $begingroup$

    Something like this?



    Clear[A, evals, T]
    A = 1, 0, 0, 1, 0, 1, 2, 0, 1, 1, 0, 2, 0, 0, 0, 1;
    T[A_?MatrixQ, j_Integer] := With[
    evals = Eigenvalues[A], id = IdentityMatrix@Length@A,
    Dot @@ Table[
    If[evals[[j]] - evals[[i]] == 0, id, (A - evals[[i]] id)/(evals[[j]] - evals[[i]])],
    i, Length@A
    ]
    ]

    MatrixForm /@ Array[T[A, #] &, 4]


    enter image description here






    share|improve this answer









    $endgroup$

















      2












      $begingroup$

      Something like this?



      Clear[A, evals, T]
      A = 1, 0, 0, 1, 0, 1, 2, 0, 1, 1, 0, 2, 0, 0, 0, 1;
      T[A_?MatrixQ, j_Integer] := With[
      evals = Eigenvalues[A], id = IdentityMatrix@Length@A,
      Dot @@ Table[
      If[evals[[j]] - evals[[i]] == 0, id, (A - evals[[i]] id)/(evals[[j]] - evals[[i]])],
      i, Length@A
      ]
      ]

      MatrixForm /@ Array[T[A, #] &, 4]


      enter image description here






      share|improve this answer









      $endgroup$















        2












        2








        2





        $begingroup$

        Something like this?



        Clear[A, evals, T]
        A = 1, 0, 0, 1, 0, 1, 2, 0, 1, 1, 0, 2, 0, 0, 0, 1;
        T[A_?MatrixQ, j_Integer] := With[
        evals = Eigenvalues[A], id = IdentityMatrix@Length@A,
        Dot @@ Table[
        If[evals[[j]] - evals[[i]] == 0, id, (A - evals[[i]] id)/(evals[[j]] - evals[[i]])],
        i, Length@A
        ]
        ]

        MatrixForm /@ Array[T[A, #] &, 4]


        enter image description here






        share|improve this answer









        $endgroup$



        Something like this?



        Clear[A, evals, T]
        A = 1, 0, 0, 1, 0, 1, 2, 0, 1, 1, 0, 2, 0, 0, 0, 1;
        T[A_?MatrixQ, j_Integer] := With[
        evals = Eigenvalues[A], id = IdentityMatrix@Length@A,
        Dot @@ Table[
        If[evals[[j]] - evals[[i]] == 0, id, (A - evals[[i]] id)/(evals[[j]] - evals[[i]])],
        i, Length@A
        ]
        ]

        MatrixForm /@ Array[T[A, #] &, 4]


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 48 mins ago









        That Gravity GuyThat Gravity Guy

        2,1311615




        2,1311615





















            0












            $begingroup$

            This



            A = 1, 0, 0, 1,0, 1, 2, 0,1, 1, 0, 2,0, 0, 0, 1;
            e=Eigenvalues[A];
            Map[(A-e[[#[[1]]]]*IdentityMatrix[4])/(e[[#[[2]]]]-e[[#[[1]]]])&,
            DeleteCases[Tuples[Range[4],2],i_,i_]]


            generates your twelve matricies with i not equal to j.



            Put Dot@@ in front of that Map to form the dot product of the 12 matricies.



            That works by forming every possible distinct i,j pair and then using those in the Map



            If it might be easier to read you can also write it this way



            Map[(ei=e[[#[[1]]]];ej=e[[#[[2]]]];
            (A-ei*IdentityMatrix[4])/(ej-ei))&,
            DeleteCases[Tuples[Range[4],2],i_,i_]]





            share|improve this answer











            $endgroup$












            • $begingroup$
              Should e[[#[[2]]]]-e[[[[1]]]] be e[[#[[2]]]]-e[[#[[1]]]]?
              $endgroup$
              – That Gravity Guy
              23 mins ago










            • $begingroup$
              @ThatGravityGuy Yes! Good catch. Thank you! Corrected.
              $endgroup$
              – Bill
              21 mins ago















            0












            $begingroup$

            This



            A = 1, 0, 0, 1,0, 1, 2, 0,1, 1, 0, 2,0, 0, 0, 1;
            e=Eigenvalues[A];
            Map[(A-e[[#[[1]]]]*IdentityMatrix[4])/(e[[#[[2]]]]-e[[#[[1]]]])&,
            DeleteCases[Tuples[Range[4],2],i_,i_]]


            generates your twelve matricies with i not equal to j.



            Put Dot@@ in front of that Map to form the dot product of the 12 matricies.



            That works by forming every possible distinct i,j pair and then using those in the Map



            If it might be easier to read you can also write it this way



            Map[(ei=e[[#[[1]]]];ej=e[[#[[2]]]];
            (A-ei*IdentityMatrix[4])/(ej-ei))&,
            DeleteCases[Tuples[Range[4],2],i_,i_]]





            share|improve this answer











            $endgroup$












            • $begingroup$
              Should e[[#[[2]]]]-e[[[[1]]]] be e[[#[[2]]]]-e[[#[[1]]]]?
              $endgroup$
              – That Gravity Guy
              23 mins ago










            • $begingroup$
              @ThatGravityGuy Yes! Good catch. Thank you! Corrected.
              $endgroup$
              – Bill
              21 mins ago













            0












            0








            0





            $begingroup$

            This



            A = 1, 0, 0, 1,0, 1, 2, 0,1, 1, 0, 2,0, 0, 0, 1;
            e=Eigenvalues[A];
            Map[(A-e[[#[[1]]]]*IdentityMatrix[4])/(e[[#[[2]]]]-e[[#[[1]]]])&,
            DeleteCases[Tuples[Range[4],2],i_,i_]]


            generates your twelve matricies with i not equal to j.



            Put Dot@@ in front of that Map to form the dot product of the 12 matricies.



            That works by forming every possible distinct i,j pair and then using those in the Map



            If it might be easier to read you can also write it this way



            Map[(ei=e[[#[[1]]]];ej=e[[#[[2]]]];
            (A-ei*IdentityMatrix[4])/(ej-ei))&,
            DeleteCases[Tuples[Range[4],2],i_,i_]]





            share|improve this answer











            $endgroup$



            This



            A = 1, 0, 0, 1,0, 1, 2, 0,1, 1, 0, 2,0, 0, 0, 1;
            e=Eigenvalues[A];
            Map[(A-e[[#[[1]]]]*IdentityMatrix[4])/(e[[#[[2]]]]-e[[#[[1]]]])&,
            DeleteCases[Tuples[Range[4],2],i_,i_]]


            generates your twelve matricies with i not equal to j.



            Put Dot@@ in front of that Map to form the dot product of the 12 matricies.



            That works by forming every possible distinct i,j pair and then using those in the Map



            If it might be easier to read you can also write it this way



            Map[(ei=e[[#[[1]]]];ej=e[[#[[2]]]];
            (A-ei*IdentityMatrix[4])/(ej-ei))&,
            DeleteCases[Tuples[Range[4],2],i_,i_]]






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 7 mins ago

























            answered 31 mins ago









            BillBill

            5,87569




            5,87569











            • $begingroup$
              Should e[[#[[2]]]]-e[[[[1]]]] be e[[#[[2]]]]-e[[#[[1]]]]?
              $endgroup$
              – That Gravity Guy
              23 mins ago










            • $begingroup$
              @ThatGravityGuy Yes! Good catch. Thank you! Corrected.
              $endgroup$
              – Bill
              21 mins ago
















            • $begingroup$
              Should e[[#[[2]]]]-e[[[[1]]]] be e[[#[[2]]]]-e[[#[[1]]]]?
              $endgroup$
              – That Gravity Guy
              23 mins ago










            • $begingroup$
              @ThatGravityGuy Yes! Good catch. Thank you! Corrected.
              $endgroup$
              – Bill
              21 mins ago















            $begingroup$
            Should e[[#[[2]]]]-e[[[[1]]]] be e[[#[[2]]]]-e[[#[[1]]]]?
            $endgroup$
            – That Gravity Guy
            23 mins ago




            $begingroup$
            Should e[[#[[2]]]]-e[[[[1]]]] be e[[#[[2]]]]-e[[#[[1]]]]?
            $endgroup$
            – That Gravity Guy
            23 mins ago












            $begingroup$
            @ThatGravityGuy Yes! Good catch. Thank you! Corrected.
            $endgroup$
            – Bill
            21 mins ago




            $begingroup$
            @ThatGravityGuy Yes! Good catch. Thank you! Corrected.
            $endgroup$
            – Bill
            21 mins ago

















            draft saved

            draft discarded
















































            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%2f194194%2fskipping-indices-in-a-product%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

            Благоевград Съдържание География | История | Население | Политика | Икономика и инфрастуктура | Здравеопазване | Образование и наука | Култура и забавления | Забележителности | Личности | Литература | Външни препратки | Бележки | Навигация42°01′18.99″ с. ш. 23°05′51″ и. д. / 42.021944° с. ш. 23.0975° и. д.*БлагоевградразширитередактиранеОфициален уебсайт на община БлагоевградНовинарски портал на Благоевград – blagoevgrad.euСайтове за БлагоевградНационален статистически институтdariknews.bgГригоровичъ, Викторъ. „Очеркъ путешествія по Европейской Турціи“. Москва, 1877.Стрезов, Георги. Два санджака от Източна Македония. Периодично списание на Българското книжовно дружество в Средец, кн. XXXVII и XXXVIII, 1891, стр. 18 – 19.Македония. Етнография и статистикаГаджанов, Димитър Г. Мюсюлманското население в Новоосвободените земи, в: Научна експедиция в Македония и Поморавието 1916, Военноиздателски комплекс „Св. Георги Победоносец“, Университетско издателство „Св. Климент Охридски“, София, 1993, стр. 244.паметник на незнайния четник&cd=18&hl=en&ct=clnk&client=firefox-a „История на днешен Благоевград“, взето от www.museumblg.com на 16 март 2010 г.„Справка за населението на град Благоевград, община Благоевград, област Благоевград, НСИ“„The population of all towns and villages in Blagoevgrad Province with 50 inhabitants or more according to census results and latest official estimates“„Ethnic composition, all places: 2011 census“История на Неврокопска епархия.Национален статистически институтМюсюлманско изповедание. Главно мюфтийствоНационален публичен регистър на храмовете в БългарияМюсюлманско изповедание. Главно мюфтийствоwww.dnes.bg Джамията в Благоевград не била паленаwww.sesc-bg.orgСписък на побратимени градовеТехническо побратимяванеГУМ грейва в цветовете на нощен Лас Вегас под името „Largo“, „МОЛ Благоевград“..., в. „Струма“grabo.bgwww.cinemaxbg.comррр4238731-067cad53a-0546-417b-a3d3-51e49b1d2232147736077147736077

            What is the best defense strategy for Survival in Grand Theft Auto Online?What is JP used for in Grand Theft Auto Online?How do I setup a Crew HQ in Grand Theft Auto Online?How does stealth work in Grand Theft Auto Online?Is it possible to own more than 10 cars in Grand Theft Auto online?Where to find truck/trailers in Grand Theft Auto OnlineWhat are some of the best missions to do on Grand Theft Auto 5 onlineFastest Car in Grand Theft Auto V PCHow to setup a Crew vs Crew online session in Grand Theft Auto Online?Grand theft auto 5 crossplayingRestart Grand Theft Auto V Online?

            How does Billy Russo acquire his 'Jigsaw' mask? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why does Bane wear the mask?Why does Kylo Ren wear a mask?Why did Captain America remove his mask while fighting Batroc the Leaper?How did the OA acquire her wisdom?Is Billy Breckenridge gay?How does Adrian Toomes hide his earnings from the IRS?What is the state of affairs on Nootka Sound by the end of season 1?How did Tia Dalma acquire Captain Barbossa's body?How is one “Deemed Worthy”, to acquire the Greatsword “Dawn”?How did Karen acquire the handgun?