{"id":5759,"date":"2020-02-14T12:00:22","date_gmt":"2020-02-14T17:00:22","guid":{"rendered":"https:\/\/blogs.mathworks.com\/cleve\/?p=5759"},"modified":"2020-02-14T13:00:18","modified_gmt":"2020-02-14T18:00:18","slug":"roundoff-patterns-from-triple-kronecker-products","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/cleve\/2020\/02\/14\/roundoff-patterns-from-triple-kronecker-products\/","title":{"rendered":"Roundoff Patterns from Triple Kronecker Products"},"content":{"rendered":"<div class=\"content\"><!--introduction--><p>While I was working on my posts about <a href=\"https:\/\/blogs.mathworks.com\/cleve\/2020\/01\/30\/pejorative-manifolds-of-polynomials-and-matrices-part-2\/\">Pejorative Manifolds<\/a>, I was pleased to discover the intriguing patterns created by the roundoff error in the computed eigenvalues of triple Kronecker products.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/mini_tkp.gif\" alt=\"\"> <\/p><!--\/introduction--><h3>Contents<\/h3><div><ul><li><a href=\"#2eff6947-1810-42ae-9086-eee9a4706107\">Kronecker Product<\/a><\/li><li><a href=\"#8da7cc39-0808-4d33-83bc-b5f5b51a2d76\">Example<\/a><\/li><li><a href=\"#2759a67c-d58f-4b9c-90bb-7e82533810f6\">Eigenvalues with high multiplicity<\/a><\/li><li><a href=\"#38e43fd2-ed1c-4ddf-8e03-527a5b90e176\">Fiedler companion matrix<\/a><\/li><li><a href=\"#33163d68-f8e6-45fd-9973-443c1527deff\">Triple Kronecker Product<\/a><\/li><li><a href=\"#4d3e3db3-71fc-4703-930f-67ba8463028d\">TKP<\/a><\/li><\/ul><\/div><h4>Kronecker Product<a name=\"2eff6947-1810-42ae-9086-eee9a4706107\"><\/a><\/h4><p>The Kronecker product of two matrices $A$ and $B$, denoted by $A \\otimes B$ and computed by <tt>kron(A,B)<\/tt>, is the large matrix containing all possible products of the elements of $B$ by those of $A$.<\/p><p>$$A \\otimes B = \\left( \\begin{array}{rrrr}\r\n        a_{1,1}B &amp; a_{1,2}B &amp; ... &amp; a_{1,n}B \\\\\r\n        a_{2,1}B &amp; a_{2,2}B &amp; ... &amp; a_{2,n}B \\\\\r\n        ... \\\\\r\n        a_{m,1}B &amp; a_{m,2}B &amp; ... &amp; a_{m,n}B\r\n       \\end{array} \\right) $$<\/p><p>The two matrices $A \\otimes B$ and $B \\otimes A$ are not equal, although they do have the same elements in different orders.<\/p><p>The two matrices $A \\otimes (B \\otimes C)$ and $(A \\otimes B) \\otimes C$ are equal.  This is the <i>triple Kronecker product<\/i>, $A \\otimes B \\otimes C$.<\/p><p>The eigenvalues of $A \\otimes B$ are all possible products of the eigenvalues of $A$ and those of $B$.<\/p><h4>Example<a name=\"8da7cc39-0808-4d33-83bc-b5f5b51a2d76\"><\/a><\/h4><p>For example, suppose $A$ is the magic square.<\/p><p>$$ A = \\left( \\begin{array}{rrr}\r\n        8 &amp; 1 &amp; 6 \\\\\r\n        3 &amp; 5 &amp; 7 \\\\\r\n        4 &amp; 9 &amp; 2\r\n       \\end{array} \\right) $$<\/p><p>And $I$ is the identity matrix.<\/p><p>$$ I = \\left( \\begin{array}{rr}\r\n        1 &amp; 0 \\\\\r\n        0 &amp; 1\r\n       \\end{array} \\right) $$<\/p><p>Then $I \\otimes A$ is block diagonal with copies of $A$ on the diagonal.<\/p><p>$$ I \\otimes A = \\left( \\begin{array}{rrrrrr}\r\n        8 &amp; 1 &amp; 6 &amp; 0 &amp; 0 &amp; 0 \\\\\r\n        3 &amp; 5 &amp; 7 &amp; 0 &amp; 0 &amp; 0 \\\\\r\n        4 &amp; 9 &amp; 2 &amp; 0 &amp; 0 &amp; 0 \\\\\r\n        0 &amp; 0 &amp; 0 &amp; 8 &amp; 1 &amp; 6 \\\\\r\n        0 &amp; 0 &amp; 0 &amp; 3 &amp; 5 &amp; 7 \\\\\r\n        0 &amp; 0 &amp; 0 &amp; 4 &amp; 9 &amp; 2\r\n       \\end{array} \\right) $$<\/p><p>And $A \\otimes I$ has the elements of $A$ distributed along multiple diagonals.<\/p><p>$$ A \\otimes I = \\left( \\begin{array}{rrrrrr}\r\n        8 &amp; 0 &amp; 1 &amp; 0 &amp; 6 &amp; 0 \\\\\r\n        0 &amp; 8 &amp; 0 &amp; 1 &amp; 0 &amp; 6 \\\\\r\n        3 &amp; 0 &amp; 5 &amp; 0 &amp; 7 &amp; 0 \\\\\r\n        0 &amp; 3 &amp; 0 &amp; 5 &amp; 0 &amp; 7 \\\\\r\n        4 &amp; 0 &amp; 9 &amp; 0 &amp; 2 &amp; 0 \\\\\r\n        0 &amp; 4 &amp; 0 &amp; 9 &amp; 0 &amp; 2\r\n       \\end{array} \\right) $$<\/p><p>The eigenvalues of both $A\\otimes I$ and $I \\otimes A$ are multiple copies of the eigenvalues of $A$.<\/p><pre class=\"codeinput\">   A = magic(3);\r\n   I = eye(2);\r\n   eig_A = eig(A)\r\n   eig_IxA = eig(kron(I,A))\r\n   eig_AxI = eig(kron(A,I))\r\n<\/pre><pre class=\"codeoutput\">eig_A =\r\n  15.000000000000004\r\n   4.898979485566361\r\n  -4.898979485566358\r\neig_IxA =\r\n  15.000000000000004\r\n   4.898979485566361\r\n  -4.898979485566358\r\n  15.000000000000004\r\n   4.898979485566361\r\n  -4.898979485566358\r\neig_AxI =\r\n   4.898979485566356\r\n  -4.898979485566355\r\n  15.000000000000002\r\n  14.999999999999998\r\n   4.898979485566359\r\n  -4.898979485566356\r\n<\/pre><h4>Eigenvalues with high multiplicity<a name=\"2759a67c-d58f-4b9c-90bb-7e82533810f6\"><\/a><\/h4><p>Our building blocks are the companion matrices of the polynomials<\/p><p>$$ (s^2-1)^p $$<\/p><p>Expansion involves binomial coefficients.  For example, <tt>p<\/tt> = 4,<\/p><p>$$ (s^2-1)^4 = s^8 - 4 s^6 + 6 s^4 - 4 s^2 + 1 $$<\/p><p>This is the characteristic polynomial of the matrix<\/p><pre class=\"codeinput\">   A = companion(4)\r\n<\/pre><pre class=\"codeoutput\">A =\r\n     0     4     0    -6     0     4     0    -1\r\n     1     0     0     0     0     0     0     0\r\n     0     1     0     0     0     0     0     0\r\n     0     0     1     0     0     0     0     0\r\n     0     0     0     1     0     0     0     0\r\n     0     0     0     0     1     0     0     0\r\n     0     0     0     0     0     1     0     0\r\n     0     0     0     0     0     0     1     0\r\n<\/pre><p>The eigenvalues of <tt>A<\/tt> are +1 and -1, each repeated <tt>p<\/tt> times; that's their <i>algebraic multiplicity<\/i>.  Their <i>geometric multiplicity<\/i> is only one; they have only one eigenvector each.<\/p><p>The eigenvalues are very sensitive to any kind of error, including roundoff error.<\/p><pre class=\"codeinput\">   format <span class=\"string\">long<\/span>\r\n   e = eig(A)\r\n<\/pre><pre class=\"codeoutput\">e =\r\n -1.000063312800363 + 0.000063312361825i\r\n -1.000063312800363 - 0.000063312361825i\r\n -0.999936687199636 + 0.000063313248591i\r\n -0.999936687199636 - 0.000063313248591i\r\n  1.000078270656946 + 0.000000000000000i\r\n  0.999999997960933 + 0.000078268622898i\r\n  0.999999997960933 - 0.000078268622898i\r\n  0.999921733421185 + 0.000000000000000i\r\n<\/pre><p>The exact eigenvalues can be recovered with<\/p><pre class=\"codeinput\">   exact = round(e)\r\n<\/pre><pre class=\"codeoutput\">exact =\r\n    -1\r\n    -1\r\n    -1\r\n    -1\r\n     1\r\n     1\r\n     1\r\n     1\r\n<\/pre><p>The computed eigenvalues lie on circles in the complex plane, centered at the exact values, with radius roughly the <tt>p<\/tt>-th root of roundoff error.  In this example, the values centered at +1 happen to be slightly more accurate than those centered at -1.<\/p><pre class=\"codeinput\">   half_fig\r\n   eigplot(-1,e)\r\n   eigplot(+1,e)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/tkp_blog_01.png\" alt=\"\"> <h4>Fiedler companion matrix<a name=\"38e43fd2-ed1c-4ddf-8e03-527a5b90e176\"><\/a><\/h4><p>An alternative to the traditional companion matrix is the <a href=\"https:\/\/blogs.mathworks.com\/cleve\/2013\/12\/23\/fiedler-companion-matrix\/\">Fiedler companion matrix.<\/a><\/p><pre class=\"codeinput\">       A = companion(4,<span class=\"string\">'fiedler'<\/span>)\r\n<\/pre><pre class=\"codeoutput\">A =\r\n     0     4     1     0     0     0     0     0\r\n     1     0     0     0     0     0     0     0\r\n     0     0     0    -6     1     0     0     0\r\n     0     1     0     0     0     0     0     0\r\n     0     0     0     0     0     4     1     0\r\n     0     0     0     1     0     0     0     0\r\n     0     0     0     0     0     0     0    -1\r\n     0     0     0     0     0     1     0     0\r\n<\/pre><p>This time the eigenvalues are computed in the opposite order and those at -1 are the more accurate.<\/p><pre class=\"codeinput\">   e = eig(A)\r\n<\/pre><pre class=\"codeoutput\">e =\r\n  1.000107000301506 + 0.000000000000000i\r\n  1.000000000805051 + 0.000107001107366i\r\n  1.000000000805051 - 0.000107001107366i\r\n  0.999892998088390 + 0.000000000000000i\r\n -1.000062156379228 + 0.000000000000000i\r\n -0.999999990704846 + 0.000062147083463i\r\n -0.999999990704846 - 0.000062147083463i\r\n -0.999937862211083 + 0.000000000000000i\r\n<\/pre><pre class=\"codeinput\">   e = flipud(e);\r\n   half_fig\r\n   eigplot(-1,e)\r\n   eigplot(+1,e)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/tkp_blog_02.png\" alt=\"\"> <h4>Triple Kronecker Product<a name=\"33163d68-f8e6-45fd-9973-443c1527deff\"><\/a><\/h4><p>Our graphic <tt>TKP<\/tt> involves $K$, the triple Kronecker matrix product<\/p><p>$$ K = A \\otimes I \\otimes B $$<\/p><p>where $A$ and $B$ are companion matrices of the polynomials $(s^2-1)^p$ and $(s^2-1)^r$ and $I$ is the $q$ -by- $q$ identity matrix.<\/p><p>The values of p, q and r are set by controls. Initially they are equal to 4, 3 and 2. The size of $K$ is four times the product of the three sizes, n = 4pqr. Computation time is $O(n^3)$. Values of n larger than about 4000 are possible, but slow.<\/p><p>Half of the eigenvalues of $K$ are equal to +1 and the other half are equal to -1, so these eigenvalues have very high multiplicity and are very sensitive to roundoff error.  The display shows the differences between the computed and the exact eigenvalues.  The structure of $K$ makes these errors produce provocative patterns on many different circles in the complex plane.<\/p><p>Two kinds of companion matrix with different roundoff behavior are possible.  The traditional companion matrix has all the polynomial coefficients in the first row of an upper Hessenberg matrix. The Fiedler companion matrix has the coefficients arranged on the super and subdiagonals of a pentadiagonal matrix.<\/p><h4>TKP<a name=\"4d3e3db3-71fc-4703-930f-67ba8463028d\"><\/a><\/h4><p>This is the computational core. The complete program with the controls is available here: <a href=\"https:\/\/blogs.mathworks.com\/images\/cleve\/tkp.m\">tkp.m<\/a>.<\/p><pre class=\"language-matlab\"><span class=\"keyword\">function<\/span> tkp(p,q,r)\r\n    A = companion(p);\r\n    I = eye(q);\r\n    B = companion(r);\r\n    K = kron(A,kron(I,B));\r\n    e = eig(K);\r\n    exact = round(e);\r\n    err = e - exact;\r\n    plot(err,<span class=\"string\">'.'<\/span>)\r\n<span class=\"keyword\">end<\/span>\r\n<\/pre><pre class=\"language-matlab\"><span class=\"keyword\">function<\/span> X = companion(p)\r\n    c = 1;\r\n    <span class=\"keyword\">for<\/span> j = 1:p\r\n        c = conv(c,[1 0 -1]);\r\n    <span class=\"keyword\">end<\/span>\r\n    m = 2*p;\r\n    X = [-c(2:m+1); eye(m-1,m)];\r\n<span class=\"keyword\">end<\/span>\r\n<\/pre><script language=\"JavaScript\"> <!-- \r\n    function grabCode_73f342fe2dd14d7982e42aabe3c3986f() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='73f342fe2dd14d7982e42aabe3c3986f ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 73f342fe2dd14d7982e42aabe3c3986f';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2020 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_73f342fe2dd14d7982e42aabe3c3986f()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2019b<br><\/p><\/div><!--\r\n73f342fe2dd14d7982e42aabe3c3986f ##### SOURCE BEGIN #####\r\n    %% Roundoff Patterns from Triple Kronecker Products\r\n% While I was working on my posts about\r\n% <https:\/\/blogs.mathworks.com\/cleve\/2020\/01\/30\/pejorative-manifolds-of-polynomials-and-matrices-part-2\/\r\n% Pejorative Manifolds>, I was pleased to discover \r\n% the intriguing patterns created by the roundoff error in the computed\r\n% eigenvalues of triple Kronecker products.\r\n%\r\n% <<mini_tkp.gif>>\r\n\r\n%% Kronecker Product\r\n% The Kronecker product of two matrices $A$ and $B$, denoted by\r\n% $A \\otimes B$ and computed by |kron(A,B)|, is the large matrix\r\n% containing all possible products of the elements of $B$ by those of $A$.\r\n\r\n%%\r\n% $$A \\otimes B = \\left( \\begin{array}{rrrr} \r\n%         a_{1,1}B & a_{1,2}B & ... & a_{1,n}B \\\\ \r\n%         a_{2,1}B & a_{2,2}B & ... & a_{2,n}B \\\\\r\n%         ... \\\\\r\n%         a_{m,1}B & a_{m,2}B & ... & a_{m,n}B\r\n%        \\end{array} \\right) $$\r\n\r\n%%\r\n% The two matrices $A \\otimes B$ and $B \\otimes A$ are not equal,\r\n% although they do have the same elements in different orders.\r\n\r\n%%\r\n% The two matrices $A \\otimes (B \\otimes C)$ and $(A \\otimes B) \\otimes C$\r\n% are equal.  This is the _triple Kronecker product_,\r\n% $A \\otimes B \\otimes C$.\r\n\r\n%%\r\n% The eigenvalues of $A \\otimes B$ are\r\n% all possible products of the eigenvalues of $A$ and those of $B$.\r\n\r\n%% Example\r\n% For example, suppose $A$ is the magic square.\r\n%\r\n% $$ A = \\left( \\begin{array}{rrr} \r\n%         8 & 1 & 6 \\\\ \r\n%         3 & 5 & 7 \\\\ \r\n%         4 & 9 & 2 \r\n%        \\end{array} \\right) $$\r\n\r\n%%\r\n% And $I$ is the identity matrix.\r\n%\r\n% $$ I = \\left( \\begin{array}{rr} \r\n%         1 & 0 \\\\ \r\n%         0 & 1 \r\n%        \\end{array} \\right) $$\r\n\r\n%%\r\n% Then $I \\otimes A$ is block diagonal with copies of $A$\r\n% on the diagonal.\r\n%\r\n% $$ I \\otimes A = \\left( \\begin{array}{rrrrrr} \r\n%         8 & 1 & 6 & 0 & 0 & 0 \\\\ \r\n%         3 & 5 & 7 & 0 & 0 & 0 \\\\ \r\n%         4 & 9 & 2 & 0 & 0 & 0 \\\\\r\n%         0 & 0 & 0 & 8 & 1 & 6 \\\\ \r\n%         0 & 0 & 0 & 3 & 5 & 7 \\\\ \r\n%         0 & 0 & 0 & 4 & 9 & 2\r\n%        \\end{array} \\right) $$\r\n\r\n%%\r\n% And $A \\otimes I$ has the elements of $A$ distributed along multiple \r\n% diagonals.\r\n%\r\n% $$ A \\otimes I = \\left( \\begin{array}{rrrrrr} \r\n%         8 & 0 & 1 & 0 & 6 & 0 \\\\ \r\n%         0 & 8 & 0 & 1 & 0 & 6 \\\\ \r\n%         3 & 0 & 5 & 0 & 7 & 0 \\\\\r\n%         0 & 3 & 0 & 5 & 0 & 7 \\\\ \r\n%         4 & 0 & 9 & 0 & 2 & 0 \\\\ \r\n%         0 & 4 & 0 & 9 & 0 & 2\r\n%        \\end{array} \\right) $$\r\n\r\n%%\r\n% The eigenvalues of both $A\\otimes I$ and $I \\otimes A$\r\n% are multiple copies of the eigenvalues of $A$.\r\n\r\n   A = magic(3);\r\n   I = eye(2);\r\n   eig_A = eig(A)\r\n   eig_IxA = eig(kron(I,A))\r\n   eig_AxI = eig(kron(A,I))\r\n   \r\n%% Eigenvalues with high multiplicity\r\n% Our building blocks are the companion matrices of the polynomials\r\n%\r\n% $$ (s^2-1)^p $$\r\n%\r\n% Expansion involves binomial coefficients.  For example, |p| = 4,\r\n%\r\n% $$ (s^2-1)^4 = s^8 - 4 s^6 + 6 s^4 - 4 s^2 + 1 $$\r\n%\r\n% This is the characteristic polynomial of the matrix\r\n\r\n   A = companion(4)\r\n   \r\n%%\r\n% The eigenvalues of |A| are +1 and -1, each repeated |p| times; that's\r\n% their _algebraic multiplicity_.  Their _geometric multiplicity_ is only\r\n% one; they have only one eigenvector each.\r\n\r\n%%\r\n% The eigenvalues are very sensitive to any kind of error, including\r\n% roundoff error.\r\n\r\n   format long\r\n   e = eig(A)\r\n\r\n%%\r\n% The exact eigenvalues can be recovered with\r\n\r\n   exact = round(e)\r\n   \r\n%%\r\n% The computed eigenvalues lie on circles in the complex plane, centered\r\n% at the exact values, with radius roughly the |p|-th root of \r\n% roundoff error.  In this example, the values centered at +1 happen\r\n% to be slightly more accurate than those centered at -1.\r\n\r\n   half_fig\r\n   eigplot(-1,e)\r\n   eigplot(+1,e)\r\n   \r\n%% Fiedler companion matrix\r\n% An alternative to the traditional companion matrix is the\r\n% <https:\/\/blogs.mathworks.com\/cleve\/2013\/12\/23\/fiedler-companion-matrix\/\r\n    % Fiedler companion matrix.>\r\n\r\n       A = companion(4,'fiedler')\r\n   \r\n%%\r\n% This time the eigenvalues are computed in the opposite order and\r\n% those at -1 are the more accurate.\r\n\r\n   e = eig(A)\r\n   \r\n%%\r\n\r\n   e = flipud(e);\r\n   half_fig\r\n   eigplot(-1,e)\r\n   eigplot(+1,e)\r\n   \r\n%% Triple Kronecker Product\r\n% Our graphic |TKP| involves $K$, the triple Kronecker matrix product\r\n%\r\n% $$ K = A \\otimes I \\otimes B $$\r\n%\r\n% where $A$ and $B$ are companion matrices of the polynomials $(s^2-1)^p$\r\n% and $(s^2-1)^r$ and $I$ is the $q$ -by- $q$ identity matrix.\r\n% \r\n% The values of p, q and r are set by controls.\r\n% Initially they are equal to 4, 3 and 2.\r\n% The size of $K$ is four times the product of the three sizes, n = 4pqr.\r\n% Computation time is $O(n^3)$. Values of n larger\r\n% than about 4000 are possible, but slow.\r\n%\r\n% Half of the eigenvalues of $K$ are equal to +1 and the other half\r\n% are equal to -1, so these eigenvalues have very high multiplicity\r\n% and are very sensitive to roundoff error.  The display shows the\r\n% differences between the computed and the exact eigenvalues.  The\r\n% structure of $K$ makes these errors produce provocative patterns on\r\n% many different circles in the complex plane.\r\n%\r\n% Two kinds of companion matrix with different roundoff behavior\r\n% are possible.  The traditional companion matrix has all the polynomial\r\n% coefficients in the first row of an upper Hessenberg matrix.\r\n% The Fiedler companion matrix has the coefficients\r\n% arranged on the super and subdiagonals of a pentadiagonal matrix.\r\n\r\n%% TKP\r\n% This is the computational core. The complete program with the controls\r\n% is available here:\r\n% <https:\/\/blogs.mathworks.com\/images\/cleve\/tkp.m tkp.m>.\r\n%\r\n%   function tkp(p,q,r)\r\n%       A = companion(p);\r\n%       I = eye(q);\r\n%       B = companion(r);\r\n%       K = kron(A,kron(I,B));\r\n%       e = eig(K);\r\n%       exact = round(e);\r\n%       err = e - exact;\r\n%       plot(err,'.')\r\n%   end\r\n%   \r\n%   function X = companion(p)\r\n%       c = 1;\r\n%       for j = 1:p\r\n%           c = conv(c,[1 0 -1]);\r\n%       end\r\n%       m = 2*p;\r\n%       X = [-c(2:m+1); eye(m-1,m)];\r\n%   end\r\n##### SOURCE END ##### 73f342fe2dd14d7982e42aabe3c3986f\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/cleve\/files\/mini_tkp.gif\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div><!--introduction--><p>While I was working on my posts about <a href=\"https:\/\/blogs.mathworks.com\/cleve\/2020\/01\/30\/pejorative-manifolds-of-polynomials-and-matrices-part-2\/\">Pejorative Manifolds<\/a>, I was pleased to discover the intriguing patterns created by the roundoff error in the computed eigenvalues of triple Kronecker products.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/cleve\/2020\/02\/14\/roundoff-patterns-from-triple-kronecker-products\/\">read more >><\/a><\/p>","protected":false},"author":78,"featured_media":5829,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[13,5,23,6,16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/5759"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/users\/78"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/comments?post=5759"}],"version-history":[{"count":6,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/5759\/revisions"}],"predecessor-version":[{"id":5825,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/5759\/revisions\/5825"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/media\/5829"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/media?parent=5759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/categories?post=5759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/tags?post=5759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}