Skip to content

Commit

Permalink
Removed some code that is never executed and an unused parameter (#2314)
Browse files Browse the repository at this point in the history
* For #2305

* Removed the release notes for the change
  • Loading branch information
aromanro authored Feb 9, 2025
1 parent f1edeed commit fa271c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ std::vector<SampleVector> State::sample_measure_all(uint_t shots,

#pragma omp parallel for if (getenv("PRL_PROB_MEAS"))
for (int_t i = 0; i < static_cast<int_t>(shots); i++) {
auto single_result = qreg_.sample_measure(shots, rng);
auto single_result = qreg_.sample_measure(rng);
all_samples[i].from_vector(single_result);
}
return all_samples;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,7 @@ reg_t MPS::sort_measured_values(const reg_t &input_outcome,
// probability. We then update 'mat' by contracting it with the suitable
// matrix (0 or 1).

reg_t MPS::sample_measure(uint_t shots, RngEngine &rng) const {
reg_t MPS::sample_measure(RngEngine &rng) const {
double prob = 1;
reg_t current_measure(num_qubits_);
cmatrix_t mat;
Expand Down Expand Up @@ -1683,10 +1683,6 @@ uint_t MPS::sample_measure_single_qubit(uint_t qubit, double &prob, double rnd,
// measurement outcome
if (qubit == 0) {
mat = q_reg_[qubit].get_data(measurement);
if (qubit != 0) // multiply mat by left lambda
for (uint_t col = 0; col < mat.GetColumns(); col++)
for (uint_t row = 0; row < mat.GetRows(); row++)
mat(row, col) *= lambda_reg_[qubit - 1][row];
} else {
mat = mat * q_reg_[qubit].get_data(measurement);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ class MPS {

reg_t apply_measure(const reg_t &qubits, const rvector_t &rnds);
reg_t apply_measure_internal(const reg_t &qubits, const rvector_t &rands);
reg_t sample_measure(uint_t shots, RngEngine &rng) const;
reg_t sample_measure(RngEngine &rng) const;

//----------------------------------------------------------------
// Function name: initialize_from_statevector_internal
Expand Down

0 comments on commit fa271c7

Please sign in to comment.