<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic LAPACK_zheev with matrix_layout=LAPACK_ROW_MAJOR in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/LAPACK-zheev-with-matrix-layout-LAPACK-ROW-MAJOR/m-p/1174533#M28829</link>
    <description>&lt;P&gt;There seems to be a bug in the routine LAPACK_zheev in MKL 2019 update 3 version. This routine is used for finding eigenvectors and eigenvalues of a Hermitian matrix 'a'. Its syntax is:&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark; wrap-lines:false;"&gt;lapack_int LAPACKE_zheev ( int matrix_layout , char jobz , char uplo , lapack_int n , lapack_complex_double* a , lapack_int lda , double* w );&lt;/PRE&gt;

&lt;P&gt;The problem seems to occur for only "matrix_layout = LAPACK_ROW_MAJOR" argument with jobz = 'V'. The eigenvectors are outputted in 'a' by rewriting it. However, the routine rewrites only upper triangular portion of 'a' and the rest of the matrix is unchanged.&lt;/P&gt;
&lt;P&gt;For example, the following code calculates the eigenvectors of the 2x2 Pauli matrix sigma_x.&lt;/P&gt;
&lt;P&gt;filename: lapack_zheev&lt;/P&gt;

&lt;PRE class="brush:cpp; class-name:dark;"&gt;#include &amp;lt;iostream&amp;gt;
#include &amp;lt;complex&amp;gt;
#define MKL_Complex16 std::complex&amp;lt;double&amp;gt;
#include "mkl.h"
#include "mkl_types.h"

using namespace std;

int main() {
    complex&amp;lt;double&amp;gt; a[4];
    a[0] = 0;
    a[1] = 1;
    a[2] = 1;
    a[3] = 0;

    double eigs[2];

    int info = LAPACKE_zheev(LAPACK_ROW_MAJOR, 'V', 'U', 2, a, 2, eigs);

    cout &amp;lt;&amp;lt; "Info = " &amp;lt;&amp;lt; info &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; a[0] &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; a[1] &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; a[2] &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; a[3] &amp;lt;&amp;lt; endl;
}
&lt;/PRE&gt;

&lt;P&gt;I compile it with:&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;icpc -std=c++14 -qopenmp -DMKL_ILP64 -m64 -I${MKLROOT}/include -O3 -DNDEBUG -ansi-alias -o lapack_zheev.out lapack_zheev.cpp -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -liomp5 -lpthread -lm -ldl

./lapack_zheev.out&lt;/PRE&gt;

&lt;P&gt;The output is:&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;Info = 0
(-0.707107,0) (0.707107,0)
(1,0) (0.707107,0)&lt;/PRE&gt;

&lt;P&gt;while it is supposed to be:&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;Info = 0
(-0.707107,0) &amp;nbsp; (0.707107,0)
(0.707107,0) &amp;nbsp; (0.707107,0)&lt;/PRE&gt;

&lt;P&gt;Replacing&amp;nbsp;LAPACK_ROW_MAJOR by&amp;nbsp;LAPACK_COL_MAJOR produces the correct output.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Mar 2019 01:16:11 GMT</pubDate>
    <dc:creator>kumar__prashant</dc:creator>
    <dc:date>2019-03-22T01:16:11Z</dc:date>
    <item>
      <title>LAPACK_zheev with matrix_layout=LAPACK_ROW_MAJOR</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/LAPACK-zheev-with-matrix-layout-LAPACK-ROW-MAJOR/m-p/1174533#M28829</link>
      <description>&lt;P&gt;There seems to be a bug in the routine LAPACK_zheev in MKL 2019 update 3 version. This routine is used for finding eigenvectors and eigenvalues of a Hermitian matrix 'a'. Its syntax is:&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark; wrap-lines:false;"&gt;lapack_int LAPACKE_zheev ( int matrix_layout , char jobz , char uplo , lapack_int n , lapack_complex_double* a , lapack_int lda , double* w );&lt;/PRE&gt;

&lt;P&gt;The problem seems to occur for only "matrix_layout = LAPACK_ROW_MAJOR" argument with jobz = 'V'. The eigenvectors are outputted in 'a' by rewriting it. However, the routine rewrites only upper triangular portion of 'a' and the rest of the matrix is unchanged.&lt;/P&gt;
&lt;P&gt;For example, the following code calculates the eigenvectors of the 2x2 Pauli matrix sigma_x.&lt;/P&gt;
&lt;P&gt;filename: lapack_zheev&lt;/P&gt;

&lt;PRE class="brush:cpp; class-name:dark;"&gt;#include &amp;lt;iostream&amp;gt;
#include &amp;lt;complex&amp;gt;
#define MKL_Complex16 std::complex&amp;lt;double&amp;gt;
#include "mkl.h"
#include "mkl_types.h"

using namespace std;

int main() {
    complex&amp;lt;double&amp;gt; a[4];
    a[0] = 0;
    a[1] = 1;
    a[2] = 1;
    a[3] = 0;

    double eigs[2];

    int info = LAPACKE_zheev(LAPACK_ROW_MAJOR, 'V', 'U', 2, a, 2, eigs);

    cout &amp;lt;&amp;lt; "Info = " &amp;lt;&amp;lt; info &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; a[0] &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; a[1] &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; a[2] &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; a[3] &amp;lt;&amp;lt; endl;
}
&lt;/PRE&gt;

&lt;P&gt;I compile it with:&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;icpc -std=c++14 -qopenmp -DMKL_ILP64 -m64 -I${MKLROOT}/include -O3 -DNDEBUG -ansi-alias -o lapack_zheev.out lapack_zheev.cpp -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -liomp5 -lpthread -lm -ldl

./lapack_zheev.out&lt;/PRE&gt;

&lt;P&gt;The output is:&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;Info = 0
(-0.707107,0) (0.707107,0)
(1,0) (0.707107,0)&lt;/PRE&gt;

&lt;P&gt;while it is supposed to be:&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;Info = 0
(-0.707107,0) &amp;nbsp; (0.707107,0)
(0.707107,0) &amp;nbsp; (0.707107,0)&lt;/PRE&gt;

&lt;P&gt;Replacing&amp;nbsp;LAPACK_ROW_MAJOR by&amp;nbsp;LAPACK_COL_MAJOR produces the correct output.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 01:16:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/LAPACK-zheev-with-matrix-layout-LAPACK-ROW-MAJOR/m-p/1174533#M28829</guid>
      <dc:creator>kumar__prashant</dc:creator>
      <dc:date>2019-03-22T01:16:11Z</dc:date>
    </item>
    <item>
      <title>Yes, this is an known issue</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/LAPACK-zheev-with-matrix-layout-LAPACK-ROW-MAJOR/m-p/1174534#M28830</link>
      <description>&lt;P&gt;Yes, this is an known issue which was introduced the last update. We will fix this into on the future updates. As a work-around - please try e.x the version of MKL&amp;nbsp; 2019.0.&lt;/P&gt;&lt;P&gt;We will keep this tread updated when the fix of the problem will be available into product version of MKL.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2019 03:24:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/LAPACK-zheev-with-matrix-layout-LAPACK-ROW-MAJOR/m-p/1174534#M28830</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2019-03-23T03:24:26Z</dc:date>
    </item>
    <item>
      <title>the small remark - the latest</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/LAPACK-zheev-with-matrix-layout-LAPACK-ROW-MAJOR/m-p/1174535#M28831</link>
      <description>&lt;P&gt;the small remark - the latest correct update - MKL 2019 u1.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2019 04:07:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/LAPACK-zheev-with-matrix-layout-LAPACK-ROW-MAJOR/m-p/1174535#M28831</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2019-03-23T04:07:30Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/LAPACK-zheev-with-matrix-layout-LAPACK-ROW-MAJOR/m-p/1174536#M28832</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Even in the older version of MKL there is bug which gives incorrect values when using&amp;nbsp;LAPACK_ROW_MAJOR. In the version 18.04 that I am using the signs (+/-) of the elements of the matrix are incorrect, even though the absolute values are correct. The incorrectness is not uniform, i.e I can't&amp;nbsp;take the negative(-) of the elements to reverse their signs to the correct values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the only configuration that works is&amp;nbsp;LAPACK_COLUMN_MAJOR.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 20:42:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/LAPACK-zheev-with-matrix-layout-LAPACK-ROW-MAJOR/m-p/1174536#M28832</guid>
      <dc:creator>Mishra__Ashirbad</dc:creator>
      <dc:date>2019-06-11T20:42:40Z</dc:date>
    </item>
    <item>
      <title>please try to check version</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/LAPACK-zheev-with-matrix-layout-LAPACK-ROW-MAJOR/m-p/1174537#M28833</link>
      <description>&lt;P&gt;please try to check version 2019 u4&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 03:45:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/LAPACK-zheev-with-matrix-layout-LAPACK-ROW-MAJOR/m-p/1174537#M28833</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2019-06-13T03:45:20Z</dc:date>
    </item>
  </channel>
</rss>

