Skip to content

Commit

Permalink
fix: openmp typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhaoyilunnn committed Jan 17, 2024
1 parent b9eae0a commit 214e481
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/qfvm/statevector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1302,8 +1302,8 @@ double StateVector<real_t>::expect_pauli(string paulistr,
if (!flip_mask) {
size_t rsize = size_;
double val = 0.;
#pragma omp paraleel for reduction(+ : val)
for (size_t j = 0; j < rsize; ++j) {
#pragma omp parallel for reduction(+ : val)
for (int j = 0; j < rsize; ++j) {
uint z_phase_num = Qfutil::popcount(j & z_mask) % 2;
int sign = 1 - 2 * z_phase_num;
val += (data_[j] * std::conj(data_[j])).real() * sign;
Expand All @@ -1313,7 +1313,7 @@ double StateVector<real_t>::expect_pauli(string paulistr,
double val = 0.;
size_t rsize = size_ >> 1;
#pragma omp parallel for reduction(+ : val)
for (size_t j = 0; j < rsize; ++j) {
for (int j = 0; j < rsize; ++j) {
size_t i0 = (j & ((1ll << flip_q) - 1)) | (j >> flip_q << flip_q << 1);
size_t i1 = i0 ^ flip_mask;
uint z_phase_num = Qfutil::popcount(i0 & z_mask) % 2;
Expand Down

0 comments on commit 214e481

Please sign in to comment.