Description
File: netqmpi/sdk/primitives/collective/collective.py (line ~95)
Problem
received_qubits = [[]] * size
This creates size references to the same list object. Although assignment with = by index currently works, if .append() is used in the future, everything would be silently corrupted.
This is a dangerous anti-pattern in Python.
Solution
received_qubits = [[] for _ in range(size)]
Impact
- Severity: Critical
- Affects:
qgather with multiple nodes
Description
File:
netqmpi/sdk/primitives/collective/collective.py(line ~95)Problem
This creates
sizereferences to the same list object. Although assignment with=by index currently works, if.append()is used in the future, everything would be silently corrupted.This is a dangerous anti-pattern in Python.
Solution
Impact
qgatherwith multiple nodes