File tree Expand file tree Collapse file tree 3 files changed +19
-12
lines changed
pytket/extensions/quantinuum/backends Expand file tree Collapse file tree 3 files changed +19
-12
lines changed Original file line number Diff line number Diff line change 4
4
5
5
# Changelog
6
6
7
+ ## Unreleased
8
+
9
+ - Update pytket-qir minimum version requirement to 0.24.1.
10
+
7
11
## 0.48.0 (May 2025)
8
12
9
13
- Update pytket minimum version requirement to 2.4.1.
Original file line number Diff line number Diff line change 74
74
)
75
75
from pytket .qasm import circuit_to_qasm_str
76
76
from pytket .qir import QIRFormat , QIRProfile , pytket_to_qir
77
+ from pytket .qir .conversion .api import ClassicalRegisterWidthError
77
78
from pytket .unit_id import _TEMP_BIT_NAME
78
79
from pytket .utils import prepare_circuit
79
80
from pytket .utils .outcomearray import OutcomeArray
@@ -1220,18 +1221,20 @@ def process_circuits( # noqa: PLR0912, PLR0915
1220
1221
profile = QIRProfile .PYTKET
1221
1222
else :
1222
1223
profile = QIRProfile .ADAPTIVE
1223
-
1224
- quantinuum_circ = b64encode (
1225
- cast (
1226
- "bytes" ,
1227
- pytket_to_qir (
1228
- c0 ,
1229
- "circuit generated by pytket-qir" ,
1230
- QIRFormat .BINARY ,
1231
- profile = profile ,
1232
- ),
1224
+ try :
1225
+ qir = pytket_to_qir (
1226
+ c0 ,
1227
+ "circuit generated by pytket-qir" ,
1228
+ QIRFormat .BINARY ,
1229
+ profile = profile ,
1233
1230
)
1234
- ).decode ("utf-8" )
1231
+ except ClassicalRegisterWidthError as e :
1232
+ raise ValueError (
1233
+ "Unable to convert pytket circuit to QIR as "
1234
+ f"it contains a classical register of width { e .width } : "
1235
+ f"maximum allowed width is { e .max_width } ."
1236
+ ) from None
1237
+ quantinuum_circ = b64encode (cast ("bytes" , qir )).decode ("utf-8" )
1235
1238
1236
1239
for name , count in Counter (
1237
1240
bit .reg_name for bit in c0 .bits if not _is_scratch (bit )
Original file line number Diff line number Diff line change 46
46
include_package_data = True ,
47
47
install_requires = [
48
48
"pytket >= 2.4.1" ,
49
- "pytket-qir >= 0.23.0 " ,
49
+ "pytket-qir >= 0.24.1 " ,
50
50
"requests >= 2.32.2" ,
51
51
"types-requests" ,
52
52
"websockets >= 13.1" ,
You can’t perform that action at this time.
0 commit comments