Skip to content

Commit 3f37d93

Browse files
committed
feat(block-encoding): added paper implementation as per Issue 1267
1 parent 5ef3e51 commit 3f37d93

13 files changed

+971
-0
lines changed
32.6 KB
Loading
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
qfunc subtractor_mod(a: qnum) {
2+
a += -1;
3+
}
4+
5+
qfunc adder_mod(a: qnum) {
6+
a += 1;
7+
}
8+
9+
qfunc main(output j: qnum, output l: qnum) {
10+
allocate(5, j);
11+
allocate(2, l);
12+
apply_to_all(H, l);
13+
apply_to_all(Z, l);
14+
l_arr: qbit[];
15+
l -> l_arr;
16+
control (l_arr[0] == 0) {
17+
subtractor_mod(j);
18+
}
19+
control (l_arr[1] == 1) {
20+
adder_mod(j);
21+
}
22+
l_arr -> l;
23+
apply_to_all(H, l);
24+
apply_to_all(Z, l);
25+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"constraints": {
3+
"max_gate_count": {},
4+
"max_width": 18,
5+
"optimization_parameter": "depth"
6+
},
7+
"preferences": {
8+
"custom_hardware_settings": {
9+
"basis_gates": [
10+
"tdg",
11+
"z",
12+
"sx",
13+
"u1",
14+
"cx",
15+
"h",
16+
"p",
17+
"x",
18+
"ry",
19+
"s",
20+
"cy",
21+
"t",
22+
"r",
23+
"cz",
24+
"u",
25+
"rx",
26+
"y",
27+
"id",
28+
"sdg",
29+
"u2",
30+
"rz",
31+
"sxdg"
32+
],
33+
"is_symmetric_connectivity": true
34+
},
35+
"debug_mode": true,
36+
"machine_precision": 8,
37+
"optimization_level": 1,
38+
"output_format": ["qasm"],
39+
"pretty_qasm": true,
40+
"random_seed": 185454979,
41+
"synthesize_all_separately": false,
42+
"timeout_seconds": 300,
43+
"transpilation_option": "auto optimize"
44+
}
45+
}
18.2 KB
Loading
20.1 KB
Loading
21.5 KB
Loading
23.3 KB
Loading
75.4 KB
Loading

0 commit comments

Comments
 (0)