Skip to content

Commit 37ec88c

Browse files
OriRothClassiqNadav Ben Ami
authored andcommitted
Update qmods
1 parent 7731ee6 commit 37ec88c

24 files changed

+325
-220
lines changed

algorithms/dqi/dqi_max_xorsat.qmod

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ qfunc binary_to_one_hot_expanded___0(input binary: qnum<2, False, 0>, output one
2121
inplace_binary_to_one_hot_expanded___0(one_hot);
2222
}
2323

24-
qfunc iteration_lambda___0_0_expanded___0(qvar___3_captured__inplace_one_hot_to_unary__5: qbit, qvar___2_captured__inplace_one_hot_to_unary__5: qbit) {
25-
CX(qvar___3_captured__inplace_one_hot_to_unary__5, qvar___2_captured__inplace_one_hot_to_unary__5);
24+
qfunc iteration_0_lambda___0_0_expanded___0(qvar___3_captured__inplace_one_hot_to_unary__4: qbit, qvar___2_captured__inplace_one_hot_to_unary__4: qbit) {
25+
CX(qvar___3_captured__inplace_one_hot_to_unary__4, qvar___2_captured__inplace_one_hot_to_unary__4);
2626
}
2727

28-
qfunc iteration_lambda___0_0_expanded___1(qvar___2_captured__inplace_one_hot_to_unary__5: qbit, qvar___1_captured__inplace_one_hot_to_unary__5: qbit) {
29-
CX(qvar___2_captured__inplace_one_hot_to_unary__5, qvar___1_captured__inplace_one_hot_to_unary__5);
28+
qfunc iteration_0_lambda___0_0_expanded___1(qvar___2_captured__inplace_one_hot_to_unary__4: qbit, qvar___1_captured__inplace_one_hot_to_unary__4: qbit) {
29+
CX(qvar___2_captured__inplace_one_hot_to_unary__4, qvar___1_captured__inplace_one_hot_to_unary__4);
3030
}
3131

32-
qfunc iteration_lambda___0_0_expanded___2(qvar___1_captured__inplace_one_hot_to_unary__5: qbit, qvar___0_captured__inplace_one_hot_to_unary__5: qbit) {
33-
CX(qvar___1_captured__inplace_one_hot_to_unary__5, qvar___0_captured__inplace_one_hot_to_unary__5);
32+
qfunc iteration_0_lambda___0_0_expanded___2(qvar___1_captured__inplace_one_hot_to_unary__4: qbit, qvar___0_captured__inplace_one_hot_to_unary__4: qbit) {
33+
CX(qvar___1_captured__inplace_one_hot_to_unary__4, qvar___0_captured__inplace_one_hot_to_unary__4);
3434
}
3535

3636
qfunc inplace_one_hot_to_unary_expanded___0(qvar: qbit[4]) {
37-
iteration_lambda___0_0_expanded___0(qvar[3], qvar[2]);
38-
iteration_lambda___0_0_expanded___1(qvar[2], qvar[1]);
39-
iteration_lambda___0_0_expanded___2(qvar[1], qvar[0]);
37+
iteration_0_lambda___0_0_expanded___0(qvar[3], qvar[2]);
38+
iteration_0_lambda___0_0_expanded___1(qvar[2], qvar[1]);
39+
iteration_0_lambda___0_0_expanded___2(qvar[1], qvar[0]);
4040
X(qvar[0]);
4141
}
4242

@@ -165,37 +165,37 @@ qfunc prepare_dick_state_unary_input_expanded___5(qvar: qbit[6]) {
165165
prepare_dick_state_unary_input_expanded___4(qvar[1:6]);
166166
}
167167

168-
qfunc iteration_lambda___0_0_expanded___3(y___0_captured__vector_product_phase__3: qbit) {
169-
Z(y___0_captured__vector_product_phase__3);
168+
qfunc iteration_1_lambda___0_0_expanded___0(y___0_captured__vector_product_phase__2: qbit) {
169+
Z(y___0_captured__vector_product_phase__2);
170170
}
171171

172-
qfunc iteration_lambda___0_0_expanded___4(y___1_captured__vector_product_phase__3: qbit) {
173-
Z(y___1_captured__vector_product_phase__3);
172+
qfunc iteration_1_lambda___0_0_expanded___1(y___1_captured__vector_product_phase__2: qbit) {
173+
Z(y___1_captured__vector_product_phase__2);
174174
}
175175

176-
qfunc iteration_lambda___0_0_expanded___5(y___2_captured__vector_product_phase__3: qbit) {
177-
Z(y___2_captured__vector_product_phase__3);
176+
qfunc iteration_1_lambda___0_0_expanded___2(y___2_captured__vector_product_phase__2: qbit) {
177+
Z(y___2_captured__vector_product_phase__2);
178178
}
179179

180-
qfunc iteration_lambda___0_0_expanded___6(y___3_captured__vector_product_phase__3: qbit) {
181-
Z(y___3_captured__vector_product_phase__3);
180+
qfunc iteration_1_lambda___0_0_expanded___3(y___3_captured__vector_product_phase__2: qbit) {
181+
Z(y___3_captured__vector_product_phase__2);
182182
}
183183

184-
qfunc iteration_lambda___0_0_expanded___7(y___4_captured__vector_product_phase__3: qbit) {
185-
Z(y___4_captured__vector_product_phase__3);
184+
qfunc iteration_1_lambda___0_0_expanded___4(y___4_captured__vector_product_phase__2: qbit) {
185+
Z(y___4_captured__vector_product_phase__2);
186186
}
187187

188-
qfunc iteration_lambda___0_0_expanded___8(y___5_captured__vector_product_phase__3: qbit) {
189-
Z(y___5_captured__vector_product_phase__3);
188+
qfunc iteration_1_lambda___0_0_expanded___5(y___5_captured__vector_product_phase__2: qbit) {
189+
Z(y___5_captured__vector_product_phase__2);
190190
}
191191

192192
qfunc vector_product_phase_expanded___0(y: qbit[6]) {
193-
iteration_lambda___0_0_expanded___3(y[0]);
194-
iteration_lambda___0_0_expanded___4(y[1]);
195-
iteration_lambda___0_0_expanded___5(y[2]);
196-
iteration_lambda___0_0_expanded___6(y[3]);
197-
iteration_lambda___0_0_expanded___7(y[4]);
198-
iteration_lambda___0_0_expanded___8(y[5]);
193+
iteration_1_lambda___0_0_expanded___0(y[0]);
194+
iteration_1_lambda___0_0_expanded___1(y[1]);
195+
iteration_1_lambda___0_0_expanded___2(y[2]);
196+
iteration_1_lambda___0_0_expanded___3(y[3]);
197+
iteration_1_lambda___0_0_expanded___4(y[4]);
198+
iteration_1_lambda___0_0_expanded___5(y[5]);
199199
}
200200

201201
qfunc matrix_vector_product_expanded___0(y: qbit[6], output out: qbit[6]) {
@@ -277,37 +277,37 @@ qfunc syndrome_decode_lookuptable_expanded___0(syndrome: qnum<6, False, 0>, erro
277277
}
278278
}
279279

280-
qfunc iteration_lambda___0_0_expanded___9(target___0_captured__apply_to_all__4: qbit) {
281-
H(target___0_captured__apply_to_all__4);
280+
qfunc iteration_2_lambda___0_0_expanded___0(target___0_captured__apply_to_all__3: qbit) {
281+
H(target___0_captured__apply_to_all__3);
282282
}
283283

284-
qfunc iteration_lambda___0_0_expanded___10(target___1_captured__apply_to_all__4: qbit) {
285-
H(target___1_captured__apply_to_all__4);
284+
qfunc iteration_2_lambda___0_0_expanded___1(target___1_captured__apply_to_all__3: qbit) {
285+
H(target___1_captured__apply_to_all__3);
286286
}
287287

288-
qfunc iteration_lambda___0_0_expanded___11(target___2_captured__apply_to_all__4: qbit) {
289-
H(target___2_captured__apply_to_all__4);
288+
qfunc iteration_2_lambda___0_0_expanded___2(target___2_captured__apply_to_all__3: qbit) {
289+
H(target___2_captured__apply_to_all__3);
290290
}
291291

292-
qfunc iteration_lambda___0_0_expanded___12(target___3_captured__apply_to_all__4: qbit) {
293-
H(target___3_captured__apply_to_all__4);
292+
qfunc iteration_2_lambda___0_0_expanded___3(target___3_captured__apply_to_all__3: qbit) {
293+
H(target___3_captured__apply_to_all__3);
294294
}
295295

296-
qfunc iteration_lambda___0_0_expanded___13(target___4_captured__apply_to_all__4: qbit) {
297-
H(target___4_captured__apply_to_all__4);
296+
qfunc iteration_2_lambda___0_0_expanded___4(target___4_captured__apply_to_all__3: qbit) {
297+
H(target___4_captured__apply_to_all__3);
298298
}
299299

300-
qfunc iteration_lambda___0_0_expanded___14(target___5_captured__apply_to_all__4: qbit) {
301-
H(target___5_captured__apply_to_all__4);
300+
qfunc iteration_2_lambda___0_0_expanded___5(target___5_captured__apply_to_all__3: qbit) {
301+
H(target___5_captured__apply_to_all__3);
302302
}
303303

304304
qfunc apply_to_all_expanded___0(target: qbit[6]) {
305-
iteration_lambda___0_0_expanded___9(target[0]);
306-
iteration_lambda___0_0_expanded___10(target[1]);
307-
iteration_lambda___0_0_expanded___11(target[2]);
308-
iteration_lambda___0_0_expanded___12(target[3]);
309-
iteration_lambda___0_0_expanded___13(target[4]);
310-
iteration_lambda___0_0_expanded___14(target[5]);
305+
iteration_2_lambda___0_0_expanded___0(target[0]);
306+
iteration_2_lambda___0_0_expanded___1(target[1]);
307+
iteration_2_lambda___0_0_expanded___2(target[2]);
308+
iteration_2_lambda___0_0_expanded___3(target[3]);
309+
iteration_2_lambda___0_0_expanded___4(target[4]);
310+
iteration_2_lambda___0_0_expanded___5(target[5]);
311311
}
312312

313313
qfunc hadamard_transform_expanded___0(target: qbit[6]) {

algorithms/dqi/dqi_max_xorsat.synthesis_options.json

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,37 @@
77
"machine_precision": 8,
88
"custom_hardware_settings": {
99
"basis_gates": [
10-
"z",
10+
"rz",
11+
"cx",
12+
"h",
1113
"u1",
12-
"p",
13-
"cy",
1414
"r",
15-
"id",
16-
"y",
17-
"sdg",
18-
"x",
19-
"u2",
15+
"sx",
2016
"s",
21-
"ry",
22-
"cx",
23-
"rz",
24-
"h",
17+
"rx",
18+
"y",
19+
"cy",
2520
"tdg",
26-
"cz",
21+
"ry",
22+
"u2",
2723
"u",
28-
"rx",
24+
"x",
25+
"cz",
26+
"z",
27+
"sxdg",
28+
"sdg",
2929
"t",
30-
"sx",
31-
"sxdg"
30+
"p",
31+
"id"
3232
],
3333
"is_symmetric_connectivity": true
3434
},
3535
"debug_mode": true,
3636
"synthesize_all_separately": false,
37-
"output_format": [
38-
"qasm"
39-
],
37+
"output_format": ["qasm"],
4038
"pretty_qasm": true,
4139
"transpilation_option": "auto optimize",
4240
"timeout_seconds": 300,
43-
"random_seed": 3679731798
41+
"random_seed": -1
4442
}
4543
}

algorithms/grover/3_sat_grover/3_sat_grover.qmod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ qfunc sat_oracle(x: qbit[], res: qbit) {
33
}
44

55
qfunc main(output x: qbit[3]) {
6-
allocate(3, x);
6+
allocate(x.len, x);
77
grover_search(1, lambda(vars) {
88
phase_oracle(sat_oracle, vars);
99
}, x);
Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
{
22
"constraints": {
3-
"max_width": 20
3+
"max_width": 20,
4+
"max_gate_count": {},
5+
"optimization_parameter": "no_opt"
6+
},
7+
"preferences": {
8+
"machine_precision": 8,
9+
"custom_hardware_settings": {
10+
"basis_gates": [
11+
"rz",
12+
"cx",
13+
"h",
14+
"u1",
15+
"r",
16+
"sx",
17+
"s",
18+
"rx",
19+
"y",
20+
"cy",
21+
"tdg",
22+
"ry",
23+
"u2",
24+
"u",
25+
"x",
26+
"cz",
27+
"z",
28+
"sxdg",
29+
"sdg",
30+
"t",
31+
"p",
32+
"id"
33+
],
34+
"is_symmetric_connectivity": true
35+
},
36+
"debug_mode": true,
37+
"synthesize_all_separately": false,
38+
"output_format": ["qasm"],
39+
"pretty_qasm": true,
40+
"transpilation_option": "auto optimize",
41+
"timeout_seconds": 300,
42+
"random_seed": -1
443
}
544
}

algorithms/grover/3_sat_grover/3_sat_grover_large.qmod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ qfunc sat_oracle_large(x: qbit[], res: qbit) {
33
}
44

55
qfunc main(output x: qbit[4]) {
6-
allocate(4, x);
6+
allocate(x.len, x);
77
grover_search(2, lambda(vars) {
88
phase_oracle(sat_oracle_large, vars);
99
}, x);
Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
{
22
"constraints": {
3-
"max_width": 24
3+
"max_width": 24,
4+
"max_gate_count": {},
5+
"optimization_parameter": "no_opt"
6+
},
7+
"preferences": {
8+
"machine_precision": 8,
9+
"custom_hardware_settings": {
10+
"basis_gates": [
11+
"rz",
12+
"cx",
13+
"h",
14+
"u1",
15+
"r",
16+
"sx",
17+
"s",
18+
"rx",
19+
"y",
20+
"cy",
21+
"tdg",
22+
"ry",
23+
"u2",
24+
"u",
25+
"x",
26+
"cz",
27+
"z",
28+
"sxdg",
29+
"sdg",
30+
"t",
31+
"p",
32+
"id"
33+
],
34+
"is_symmetric_connectivity": true
35+
},
36+
"debug_mode": true,
37+
"synthesize_all_separately": false,
38+
"output_format": ["qasm"],
39+
"pretty_qasm": true,
40+
"transpilation_option": "auto optimize",
41+
"timeout_seconds": 300,
42+
"random_seed": -1
443
}
544
}

algorithms/grover/grover_max_cut/grover_max_cut.qmod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ qfunc cut_oracle(cut_size: int, nodes: qbit[], res: qbit) {
33
}
44

55
qfunc main(output nodes: qbit[5]) {
6-
allocate(5, nodes);
6+
allocate(nodes.len, nodes);
77
grover_search(3, lambda(vars) {
88
phase_oracle(lambda(vars, res) {
99
cut_oracle(4, vars, res);
Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
{
22
"constraints": {
3-
"max_width": 22
3+
"max_width": 22,
4+
"max_gate_count": {},
5+
"optimization_parameter": "no_opt"
6+
},
7+
"preferences": {
8+
"machine_precision": 8,
9+
"custom_hardware_settings": {
10+
"basis_gates": [
11+
"rz",
12+
"cx",
13+
"h",
14+
"u1",
15+
"r",
16+
"sx",
17+
"s",
18+
"rx",
19+
"y",
20+
"cy",
21+
"tdg",
22+
"ry",
23+
"u2",
24+
"u",
25+
"x",
26+
"cz",
27+
"z",
28+
"sxdg",
29+
"sdg",
30+
"t",
31+
"p",
32+
"id"
33+
],
34+
"is_symmetric_connectivity": true
35+
},
36+
"debug_mode": true,
37+
"synthesize_all_separately": false,
38+
"output_format": ["qasm"],
39+
"pretty_qasm": true,
40+
"transpilation_option": "auto optimize",
41+
"timeout_seconds": 300,
42+
"random_seed": -1
443
}
544
}

algorithms/hhl/hhl/hhl_exact.qmod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
qfunc unitary_with_power_logic(pw: int, matrix: real[][], target: qbit[]) {
2-
power (pw) {
3-
unitary(matrix, target);
4-
}
5-
}
6-
71
qfunc load_b(amplitudes: real[], output state: qbit[], bound: real) {
82
prepare_amplitudes(amplitudes, bound, state);
93
}
@@ -30,6 +24,12 @@ qfunc hhl(rhs_vector: real[], bound: real, precision: int, hamiltonian_evolution
3024
}
3125
}
3226

27+
qfunc unitary_with_power_logic(pw: int, matrix: real[][], target: qbit[]) {
28+
power (pw) {
29+
unitary(matrix, target);
30+
}
31+
}
32+
3333
qfunc main(output res: qnum, output phase: qnum, output indicator: qbit) {
3434
hhl([
3535
0.18257418583505536,

0 commit comments

Comments
 (0)