You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running the latest versions of pyQuil and the Forest SDK
I checked to make sure that this bug has not already been reported
Issue Description
program.measure_all() defines classical bits more than required based on the highest qubit index value in the circuit. Instead it should use max(qubitindex) - min(qubitindex) + 1 (Suggestion).
The following circuit has only one gate on one qubit but is assigned 6555 classical bits.
The bug is also a potential security issue where it could crash the quantum device / simulator. For example the same circuit with any arbitrary integer for the qubit index.
I was able to crash the QVM by running the following circuit in parallel which resulted in following state:
from pyquil import get_qc, Program
p = Program('X 65537')
p.measure_all()
qc = get_qc("9q-square-qvm")
result = qc.run(p.wrap_in_numshots_loop(1000))
result.readout_data.get("ro")
print(result)
Pre-Report Checklist
Issue Description
program.measure_all() defines classical bits more than required based on the highest qubit index value in the circuit. Instead it should use
max(qubitindex) - min(qubitindex) + 1
(Suggestion).The following circuit has only one gate on one qubit but is assigned 6555 classical bits.
The bug is also a potential security issue where it could crash the quantum device / simulator. For example the same circuit with any arbitrary integer for the qubit index.
I was able to crash the QVM by running the following circuit in parallel which resulted in following state:
from pyquil import get_qc, Program
With qvm stuck in unresponsive state.
Environment Context
Operating System:
Python Version (
python -V
): 3.11Quilc Version (
quilc --version
): 1.23.0QVM Version (
qvm --version
): 1.17.1Latest version of pyquil.
The text was updated successfully, but these errors were encountered: