-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Milestone
Description
Description
Files: communicator.py, p2p.py, collective.py
Problem
No validation is performed to check that:
dest_rank/src_rankis in the range[0, size)rank_senderis consistent- The qubit list is not empty
Any out-of-range value produces cryptic NetQASM errors instead of a clear message.
Solution
Add validations at the beginning of qsend, qrecv, qscatter, qgather:
def qsend(self, qubits: List[Qubit], dest_rank: int):
if not 0 <= dest_rank < self.size:
raise ValueError(f"dest_rank {dest_rank} out of range [0, {self.size})")
if dest_rank == self.rank:
raise ValueError("Cannot send to self")
if not qubits:
raise ValueError("qubits list must not be empty")
...Impact
- Severity: High
- Improvement: Clear error messages and fail-fast behavior
Reactions are currently unavailable