Skip to content

Commit

Permalink
Fix for #1918 (#1922)
Browse files Browse the repository at this point in the history
* Fix for #1918

* Removed prelude section in release note
  • Loading branch information
aromanro authored Sep 7, 2023
1 parent 4fb99dd commit 5e77fc8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
fixes:
- |
Fixes an issue when compiling a release version on windows with vc++,
also unrolls a for, avoiding an unnecessary switch inside it.
The fix is for https://github.com/Qiskit/qiskit-aer/issues/1918
22 changes: 6 additions & 16 deletions src/simulators/statevector/qv_avx2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,22 +770,12 @@ inline void _apply_matrix_double_avx_q0q1(RealVectorView<double> &reals,
for (size_t i = 0; i < (1ULL << num_qubits); i += 4) {
auto index = indexes[i];
_mm_load_twoarray_complex(reals[index], imags[index], vreals[i], vimags[i]);
for (size_t j = 1; j < 4; ++j) {
switch (j) {
case 1:
vreals[i + j] = _mm256_permute4x64_pd(vreals[i], PERM_D_Q0Q1_0);
vimags[i + j] = _mm256_permute4x64_pd(vimags[i], PERM_D_Q0Q1_0);
break;
case 2:
vreals[i + j] = _mm256_permute4x64_pd(vreals[i], PERM_D_Q0Q1_1);
vimags[i + j] = _mm256_permute4x64_pd(vimags[i], PERM_D_Q0Q1_1);
break;
case 3:
vreals[i + j] = _mm256_permute4x64_pd(vreals[i], PERM_D_Q0Q1_2);
vimags[i + j] = _mm256_permute4x64_pd(vimags[i], PERM_D_Q0Q1_2);
break;
}
}
vreals[i + 1] = _mm256_permute4x64_pd(vreals[i], PERM_D_Q0Q1_0);
vimags[i + 1] = _mm256_permute4x64_pd(vimags[i], PERM_D_Q0Q1_0);
vreals[i + 2] = _mm256_permute4x64_pd(vreals[i], PERM_D_Q0Q1_1);
vimags[i + 2] = _mm256_permute4x64_pd(vimags[i], PERM_D_Q0Q1_1);
vreals[i + 3] = _mm256_permute4x64_pd(vreals[i], PERM_D_Q0Q1_2);
vimags[i + 3] = _mm256_permute4x64_pd(vimags[i], PERM_D_Q0Q1_2);
}

size_t mindex = 0;
Expand Down

0 comments on commit 5e77fc8

Please sign in to comment.