Skip to content

Commit

Permalink
fix: use omp_i instead of int
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhaoyilunnn committed Jan 17, 2024
1 parent 214e481 commit 3a55f83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/qfvm/statevector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ double StateVector<real_t>::expect_pauli(string paulistr,
size_t rsize = size_;
double val = 0.;
#pragma omp parallel for reduction(+ : val)
for (int j = 0; j < rsize; ++j) {
for (omp_i 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 (int j = 0; j < rsize; ++j) {
for (omp_i 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 3a55f83

Please sign in to comment.