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
According to the docstring of circuit_from_qasm, the user can set a "maximum allowed width of classical registers" with maxwidth. However, circuits that generate auxiliar tk_SCRATCH_BIT registers seem to skip this constraint.
Here is an example QASM file telep_Z_Z.txt. To reproduce, run:
from pytket.qasm import circuit_from_qasm
pytket_circuit = circuit_from_qasm("telep_Z_Z.txt", maxwidth=64)
The resulting pytket_circuit has a tk_SCRATCH_BIT register with more than 100 bits in it, violating the maxwidth=64 set by the user.
This is problematic in a pipeline where the pytket circuit is then converted to PHIR to be run in PECOS. For now, as a work around, I am using rename_units to convert each tk_SCRATCH_BIT[idx] to tk_SCRATCH_BIT_idx[0]. However, I would expect a better approach to create scratch registers of up to maxwidth size, and create new ones when the previous one is filled.
The text was updated successfully, but these errors were encountered:
According to the docstring of
circuit_from_qasm
, the user can set a "maximum allowed width of classical registers" withmaxwidth
. However, circuits that generate auxiliartk_SCRATCH_BIT
registers seem to skip this constraint.Here is an example QASM file telep_Z_Z.txt. To reproduce, run:
The resulting
pytket_circuit
has atk_SCRATCH_BIT
register with more than 100 bits in it, violating themaxwidth=64
set by the user.This is problematic in a pipeline where the pytket circuit is then converted to PHIR to be run in PECOS. For now, as a work around, I am using
rename_units
to convert eachtk_SCRATCH_BIT[idx]
totk_SCRATCH_BIT_idx[0]
. However, I would expect a better approach to create scratch registers of up tomaxwidth
size, and create new ones when the previous one is filled.The text was updated successfully, but these errors were encountered: