Skip to content

Commit

Permalink
Fix some extra compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseclectic committed Jun 6, 2024
1 parent f8b950f commit b47cf05
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/simulators/circuit_executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ void Executor<state_t>::measure_sampler(InputIterator first_meas,
Utils::apply_omp_parallel_for((npar > 1), 0, npar, copy_samples_lambda,
npar);

for (int_t i = 0; i < npar; i++) {
for (uint_t i = 0; i < npar; i++) {
result.combine(std::move(par_results[i]));
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/simulators/density_matrix/densitymatrix_executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1329,10 +1329,10 @@ Executor<densmat_t>::sample_measure(const reg_t &qubits, uint_t shots,
std::vector<SampleVector> all_samples(shots, SampleVector(qubits.size()));

auto convert_to_bit_lambda = [this, &local_samples, &all_samples, shots,
qubits, npar](int_t i) {
qubits, npar](int_t k) {
uint_t ishot, iend;
ishot = local_samples.size() * i / npar;
iend = local_samples.size() * (i + 1) / npar;
ishot = local_samples.size() * k / npar;
iend = local_samples.size() * (k + 1) / npar;
for (; ishot < iend; ishot++) {
SampleVector allbit_sample;
allbit_sample.from_uint(local_samples[ishot], qubits.size());
Expand Down
6 changes: 3 additions & 3 deletions src/simulators/density_matrix/densitymatrix_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1009,10 +1009,10 @@ std::vector<SampleVector> State<densmat_t>::sample_measure(const reg_t &qubits,
std::vector<SampleVector> all_samples(shots, SampleVector(qubits.size()));

auto convert_to_bit_lambda = [this, &allbit_samples, &all_samples, shots,
qubits, npar](int_t i) {
qubits, npar](int_t k) {
uint_t ishot, iend;
ishot = shots * i / npar;
iend = shots * (i + 1) / npar;
ishot = shots * k / npar;
iend = shots * (k + 1) / npar;
for (; ishot < iend; ishot++) {
SampleVector allbit_sample;
allbit_sample.from_uint(allbit_samples[ishot], qubits.size());
Expand Down
2 changes: 1 addition & 1 deletion src/simulators/matrix_product_state/svd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ void lapack_csvd_wrapper(cmatrix_t &A, cmatrix_t &U, rvector_t &S,
V = cmatrix_t::move_from_buffer(n, n, lapackV);

S.clear();
for (int i = 0; i < min_dim; i++)
for (size_t i = 0; i < min_dim; i++)
S.push_back(lapackS[i]);

// Activated by default as requested in the PR
Expand Down
2 changes: 1 addition & 1 deletion src/simulators/parallel_state_executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ void ParallelStateExecutor<state_t>::measure_sampler(InputIterator first_meas,
Utils::apply_omp_parallel_for((npar > 1), 0, npar, copy_samples_lambda,
npar);

for (int_t i = 0; i < npar; i++) {
for (uint_t i = 0; i < npar; i++) {
result.combine(std::move(par_results[i]));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/simulators/stabilizer/stabilizer_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ std::vector<SampleVector> State::sample_measure(const reg_t &qubits,
// table
auto qreg_cache = BaseState::qreg_;
std::vector<SampleVector> samples(shots);
for (int_t ishot = 0; ishot < shots; ishot++) {
for (uint_t ishot = 0; ishot < shots; ishot++) {
samples[ishot].from_vector(apply_measure_and_update(qubits, rng));
BaseState::qreg_ = qreg_cache; // restore pre-measurement data from cache
}
Expand Down
6 changes: 3 additions & 3 deletions src/simulators/statevector/statevector_executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1247,10 +1247,10 @@ Executor<state_t>::sample_measure(const reg_t &qubits, uint_t shots,
std::vector<SampleVector> all_samples(shots, SampleVector(qubits.size()));

auto convert_to_bit_lambda = [this, &local_samples, &all_samples, shots,
qubits, npar](int_t i) {
qubits, npar](int_t k) {
uint_t ishot, iend;
ishot = local_samples.size() * i / npar;
iend = local_samples.size() * (i + 1) / npar;
ishot = local_samples.size() * k / npar;
iend = local_samples.size() * (k + 1) / npar;
for (; ishot < iend; ishot++) {
SampleVector allbit_sample;
allbit_sample.from_uint(local_samples[ishot], qubits.size());
Expand Down
6 changes: 3 additions & 3 deletions src/simulators/statevector/statevector_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,10 +1050,10 @@ std::vector<SampleVector> State<statevec_t>::sample_measure(const reg_t &qubits,
std::vector<SampleVector> all_samples(shots, SampleVector(qubits.size()));

auto convert_to_bit_lambda = [this, &allbit_samples, &all_samples, shots,
qubits, npar](int_t i) {
qubits, npar](int_t k) {
uint_t ishot, iend;
ishot = shots * i / npar;
iend = shots * (i + 1) / npar;
ishot = shots * k / npar;
iend = shots * (k + 1) / npar;
for (; ishot < iend; ishot++) {
SampleVector allbit_sample;
allbit_sample.from_uint(allbit_samples[ishot], qubits.size());
Expand Down

0 comments on commit b47cf05

Please sign in to comment.