Commit 2f49dc17 authored by Nguyen, Thien Minh's avatar Nguyen, Thien Minh
Browse files

The acquire pulse must use memory slots from 0, not the measured qubit



This may cause issue when only a subset of qubits are measured.
Signed-off-by: Nguyen, Thien Minh's avatarThien Nguyen <nguyentm@ornl.gov>
parent 71d19270
......@@ -99,7 +99,15 @@ std::vector<xacc::ibm_pulse::Instruction> alignMeasurePulseInstructions(
if (!acquiredBits.empty()) {
auto mergedAcquire = acquireInsts.front();
mergedAcquire.set_qubits(acquiredBits);
mergedAcquire.set_memory_slot(acquiredBits);
// Use the same logic as QASM-based measurements:
// i.e. use memory slots from 0 onward.
// This is important for the AcceleratorBuffer to summarize the bit count
// later.
// e.g. when only measure qubit 1 (acquire pulse), we need to map the result
// to memory slot 0, not 1.
std::vector<int64_t> memory_slots(acquiredBits.size());
std::iota(std::begin(memory_slots), std::end(memory_slots), 0);
mergedAcquire.set_memory_slot(memory_slots);
result.emplace_back(mergedAcquire);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment