Skip to content

Commit

Permalink
minor fix after tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Patataman committed May 30, 2023
1 parent f1bd469 commit 8aa1f92
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/simulators/matrix_product_state/svd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ void lapack_csvd_wrapper(cmatrix_t &A, cmatrix_t &U, rvector_t &S, cmatrix_t &V)
if (strcmp(getenv("QISKIT_LAPACK_SVD"), "DC") == 0) {
int iwork[8*min_dim] = {0};
double rwork[5*min_dim*min_dim+5*min_dim] = {0.0};
#ifndef MKL
lwork = -1;

zgesdd_(
Expand All @@ -603,14 +604,17 @@ void lapack_csvd_wrapper(cmatrix_t &A, cmatrix_t &U, rvector_t &S, cmatrix_t &V)
rwork, iwork, &info);

lwork = (int)work[0].real();
#endif
complex_t work_[lwork] = {0.0};

zgesdd_(
"A", &m, &n, lapackA, &m, lapackS,
lapackU, &m, lapackV, &n, work_, &lwork,
rwork, iwork, &info);
} else {
// Default execution follows original method
double rwork[5*min_dim] = {0.0};

zgesvd_(
"A", "A", &m, &n, lapackA, &m, lapackS,
lapackU, &m, lapackV, &n, work, &lwork,
Expand Down

0 comments on commit 8aa1f92

Please sign in to comment.