Skip to content

Commit c5279c5

Browse files
authored
feat!: Rename tket2.* HUGR extensions to tket.* (#988)
In contrast to #987, this is not a breaking API change but a breaking _serialization_ change. I bumped the extension versions even if not strictly necessary. BREAKING CHANGE: Renamed the `tket2.*` HUGR extensions to `tket.*`
1 parent c3bc67f commit c5279c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+384
-384
lines changed

test_files/eccs/nam_4_2.rwr

-74 Bytes
Binary file not shown.

test_files/eccs/nam_6_3.rwr

-11.9 KB
Binary file not shown.

test_files/eccs/small_eccs.rwr

47 Bytes
Binary file not shown.

test_files/ordered_qalloc.hugr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ HUGRiHJv?@{
7575
{
7676
"parent": 5,
7777
"op": "Extension",
78-
"extension": "tket2.quantum",
78+
"extension": "tket.quantum",
7979
"name": "QAlloc",
8080
"signature": {
8181
"t": "G",
@@ -93,7 +93,7 @@ HUGRiHJv?@{
9393
{
9494
"parent": 5,
9595
"op": "Extension",
96-
"extension": "tket2.quantum",
96+
"extension": "tket.quantum",
9797
"name": "QFree",
9898
"signature": {
9999
"t": "G",
@@ -140,7 +140,7 @@ HUGRiHJv?@{
140140
{
141141
"parent": 5,
142142
"op": "Extension",
143-
"extension": "tket2.quantum",
143+
"extension": "tket.quantum",
144144
"name": "QAlloc",
145145
"signature": {
146146
"t": "G",
@@ -158,7 +158,7 @@ HUGRiHJv?@{
158158
{
159159
"parent": 5,
160160
"op": "Extension",
161-
"extension": "tket2.quantum",
161+
"extension": "tket.quantum",
162162
"name": "MeasureFree",
163163
"signature": {
164164
"t": "G",
-11.9 KB
Binary file not shown.

tket-exts/src/tket_exts/__init__.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,57 @@
1313

1414
@functools.cache
1515
def opaque_bool() -> Extension:
16-
return load_extension("tket2.bool")
16+
return load_extension("tket.bool")
1717

1818

1919
@functools.cache
2020
def debug() -> Extension:
21-
return load_extension("tket2.debug")
21+
return load_extension("tket.debug")
2222

2323

2424
@functools.cache
2525
def guppy() -> Extension:
26-
return load_extension("tket2.guppy")
26+
return load_extension("tket.guppy")
2727

2828

2929
@functools.cache
3030
def rotation() -> Extension:
31-
return load_extension("tket2.rotation")
31+
return load_extension("tket.rotation")
3232

3333

3434
@functools.cache
3535
def futures() -> Extension:
36-
return load_extension("tket2.futures")
36+
return load_extension("tket.futures")
3737

3838

3939
@functools.cache
4040
def qsystem() -> Extension:
41-
return load_extension("tket2.qsystem")
41+
return load_extension("tket.qsystem")
4242

4343

4444
@functools.cache
4545
def qsystem_random() -> Extension:
46-
return load_extension("tket2.qsystem.random")
46+
return load_extension("tket.qsystem.random")
4747

4848

4949
@functools.cache
5050
def qsystem_utils() -> Extension:
51-
return load_extension("tket2.qsystem.utils")
51+
return load_extension("tket.qsystem.utils")
5252

5353

5454
@functools.cache
5555
def quantum() -> Extension:
56-
return load_extension("tket2.quantum")
56+
return load_extension("tket.quantum")
5757

5858

5959
@functools.cache
6060
def result() -> Extension:
61-
return load_extension("tket2.result")
61+
return load_extension("tket.result")
6262

6363

6464
@functools.cache
6565
def wasm() -> Extension:
66-
return load_extension("tket2.wasm")
66+
return load_extension("tket.wasm")
6767

6868

6969
def load_extension(name: str) -> Extension:

tket-exts/src/tket_exts/data/tket2/bool.json renamed to tket-exts/src/tket_exts/data/tket/bool.json

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"version": "0.1.0",
3-
"name": "tket2.bool",
2+
"version": "0.2.0",
3+
"name": "tket.bool",
44
"types": {
55
"bool": {
6-
"extension": "tket2.bool",
6+
"extension": "tket.bool",
77
"name": "bool",
88
"params": [],
99
"description": "An opaque bool type",
@@ -15,23 +15,23 @@
1515
},
1616
"operations": {
1717
"and": {
18-
"extension": "tket2.bool",
18+
"extension": "tket.bool",
1919
"name": "and",
20-
"description": "Logical AND between two tket2.bools.",
20+
"description": "Logical AND between two tket.bools.",
2121
"signature": {
2222
"params": [],
2323
"body": {
2424
"input": [
2525
{
2626
"t": "Opaque",
27-
"extension": "tket2.bool",
27+
"extension": "tket.bool",
2828
"id": "bool",
2929
"args": [],
3030
"bound": "C"
3131
},
3232
{
3333
"t": "Opaque",
34-
"extension": "tket2.bool",
34+
"extension": "tket.bool",
3535
"id": "bool",
3636
"args": [],
3737
"bound": "C"
@@ -40,7 +40,7 @@
4040
"output": [
4141
{
4242
"t": "Opaque",
43-
"extension": "tket2.bool",
43+
"extension": "tket.bool",
4444
"id": "bool",
4545
"args": [],
4646
"bound": "C"
@@ -51,23 +51,23 @@
5151
"binary": false
5252
},
5353
"eq": {
54-
"extension": "tket2.bool",
54+
"extension": "tket.bool",
5555
"name": "eq",
56-
"description": "Equality between two tket2.bools.",
56+
"description": "Equality between two tket.bools.",
5757
"signature": {
5858
"params": [],
5959
"body": {
6060
"input": [
6161
{
6262
"t": "Opaque",
63-
"extension": "tket2.bool",
63+
"extension": "tket.bool",
6464
"id": "bool",
6565
"args": [],
6666
"bound": "C"
6767
},
6868
{
6969
"t": "Opaque",
70-
"extension": "tket2.bool",
70+
"extension": "tket.bool",
7171
"id": "bool",
7272
"args": [],
7373
"bound": "C"
@@ -76,7 +76,7 @@
7676
"output": [
7777
{
7878
"t": "Opaque",
79-
"extension": "tket2.bool",
79+
"extension": "tket.bool",
8080
"id": "bool",
8181
"args": [],
8282
"bound": "C"
@@ -87,9 +87,9 @@
8787
"binary": false
8888
},
8989
"make_opaque": {
90-
"extension": "tket2.bool",
90+
"extension": "tket.bool",
9191
"name": "make_opaque",
92-
"description": "Convert a Hugr bool_t (a unit sum) into an tket2.bool.",
92+
"description": "Convert a Hugr bool_t (a unit sum) into an tket.bool.",
9393
"signature": {
9494
"params": [],
9595
"body": {
@@ -103,7 +103,7 @@
103103
"output": [
104104
{
105105
"t": "Opaque",
106-
"extension": "tket2.bool",
106+
"extension": "tket.bool",
107107
"id": "bool",
108108
"args": [],
109109
"bound": "C"
@@ -114,16 +114,16 @@
114114
"binary": false
115115
},
116116
"not": {
117-
"extension": "tket2.bool",
117+
"extension": "tket.bool",
118118
"name": "not",
119-
"description": "Negation of a tket2.bool.",
119+
"description": "Negation of a tket.bool.",
120120
"signature": {
121121
"params": [],
122122
"body": {
123123
"input": [
124124
{
125125
"t": "Opaque",
126-
"extension": "tket2.bool",
126+
"extension": "tket.bool",
127127
"id": "bool",
128128
"args": [],
129129
"bound": "C"
@@ -132,7 +132,7 @@
132132
"output": [
133133
{
134134
"t": "Opaque",
135-
"extension": "tket2.bool",
135+
"extension": "tket.bool",
136136
"id": "bool",
137137
"args": [],
138138
"bound": "C"
@@ -143,23 +143,23 @@
143143
"binary": false
144144
},
145145
"or": {
146-
"extension": "tket2.bool",
146+
"extension": "tket.bool",
147147
"name": "or",
148-
"description": "Logical OR between two tket2.bools.",
148+
"description": "Logical OR between two tket.bools.",
149149
"signature": {
150150
"params": [],
151151
"body": {
152152
"input": [
153153
{
154154
"t": "Opaque",
155-
"extension": "tket2.bool",
155+
"extension": "tket.bool",
156156
"id": "bool",
157157
"args": [],
158158
"bound": "C"
159159
},
160160
{
161161
"t": "Opaque",
162-
"extension": "tket2.bool",
162+
"extension": "tket.bool",
163163
"id": "bool",
164164
"args": [],
165165
"bound": "C"
@@ -168,7 +168,7 @@
168168
"output": [
169169
{
170170
"t": "Opaque",
171-
"extension": "tket2.bool",
171+
"extension": "tket.bool",
172172
"id": "bool",
173173
"args": [],
174174
"bound": "C"
@@ -179,16 +179,16 @@
179179
"binary": false
180180
},
181181
"read": {
182-
"extension": "tket2.bool",
182+
"extension": "tket.bool",
183183
"name": "read",
184-
"description": "Convert a tket2.bool into a Hugr bool_t (a unit sum).",
184+
"description": "Convert a tket.bool into a Hugr bool_t (a unit sum).",
185185
"signature": {
186186
"params": [],
187187
"body": {
188188
"input": [
189189
{
190190
"t": "Opaque",
191-
"extension": "tket2.bool",
191+
"extension": "tket.bool",
192192
"id": "bool",
193193
"args": [],
194194
"bound": "C"
@@ -206,23 +206,23 @@
206206
"binary": false
207207
},
208208
"xor": {
209-
"extension": "tket2.bool",
209+
"extension": "tket.bool",
210210
"name": "xor",
211-
"description": "Logical XOR between two tket2.bools.",
211+
"description": "Logical XOR between two tket.bools.",
212212
"signature": {
213213
"params": [],
214214
"body": {
215215
"input": [
216216
{
217217
"t": "Opaque",
218-
"extension": "tket2.bool",
218+
"extension": "tket.bool",
219219
"id": "bool",
220220
"args": [],
221221
"bound": "C"
222222
},
223223
{
224224
"t": "Opaque",
225-
"extension": "tket2.bool",
225+
"extension": "tket.bool",
226226
"id": "bool",
227227
"args": [],
228228
"bound": "C"
@@ -231,7 +231,7 @@
231231
"output": [
232232
{
233233
"t": "Opaque",
234-
"extension": "tket2.bool",
234+
"extension": "tket.bool",
235235
"id": "bool",
236236
"args": [],
237237
"bound": "C"

tket-exts/src/tket_exts/data/tket2/debug.json renamed to tket-exts/src/tket_exts/data/tket/debug.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"version": "0.1.0",
3-
"name": "tket2.debug",
2+
"version": "0.2.0",
3+
"name": "tket.debug",
44
"types": {},
55
"operations": {
66
"StateResult": {
7-
"extension": "tket2.debug",
7+
"extension": "tket.debug",
88
"name": "StateResult",
99
"description": "Report the state of given qubits in the given order.",
1010
"signature": {

0 commit comments

Comments
 (0)