Skip to content

Commit d4cbaad

Browse files
authored
Fix instruction duration unit in estimated success probability calculation (#445)
## Description Fixes instruction duration unit in estimated success probability calculation in `src/mqt/predictor/reward.py`, as the default unit is `"dt"` instead of `"s"`: [https://github.com/Qiskit/qiskit/blob/stable/2.1/qiskit/transpiler/target.py#L415-L430](url)
1 parent ad5ae0b commit d4cbaad

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning], with the exception that minor rel
1111

1212
### Changed
1313

14+
- 🐛 Fix instruction duration unit in estimated success probability calculation ([#445]) ([**@Shaobo-Zhou**])
1415
- ✨ Remove support for custom names of trained models ([#489]) ([**@bachase**])
1516
- 🔥 Drop support for x86 macOS systems ([#421]) ([**@denialhaag**])
1617

@@ -44,6 +45,7 @@ _📚 Refer to the [GitHub Release Notes](https://github.com/munich-quantum-tool
4445

4546
<!-- PR links -->
4647

48+
[#445]: https://github.com/munich-quantum-toolkit/predictor/pull/445
4749
[#489]: https://github.com/munich-quantum-toolkit/predictor/pull/489
4850
[#421]: https://github.com/munich-quantum-toolkit/predictor/pull/421
4951
[#406]: https://github.com/munich-quantum-toolkit/predictor/pull/406
@@ -61,6 +63,7 @@ _📚 Refer to the [GitHub Release Notes](https://github.com/munich-quantum-tool
6163
[**@flowerthrower**]: https://github.com/flowerthrower
6264
[**@denialhaag**]: https://github.com/denialhaag
6365
[**@bachase**]: https://github.com/bachase
66+
[**@Shaobo-Zhou**]: https://github.com/Shaobo-Zhou
6467

6568
<!-- General links -->
6669

src/mqt/predictor/reward.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,10 @@ def estimated_success_probability(qc: QuantumCircuit, device: Target, precision:
203203
if first_qubit_idx not in active_qubits:
204204
continue
205205

206+
dt = device.dt # instruction durations are stored in unit dt
206207
res *= np.exp(
207208
-instruction.duration
209+
* dt
208210
/ min(device.qubit_properties[first_qubit_idx].t1, device.qubit_properties[first_qubit_idx].t2)
209211
)
210212
continue

0 commit comments

Comments
 (0)