Unverified Commit 60617daf authored by Mccaskey, Alex's avatar Mccaskey, Alex Committed by GitHub
Browse files

Merge pull request #456 from tnguyen-ornl/tnguyen/fix-pulse-acquire-memory-slot

The acquire pulse must use memory slots from 0, not the measured qubit
parents 71d19270 2f49dc17
Pipeline #147721 passed with stage
in 17 minutes and 31 seconds
......@@ -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