Skip to content
Open
395 changes: 395 additions & 0 deletions community/paper_implementation_project/b92/b92_implementation.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"friendly_name": "B92 protocol",
"description": "B92 Quantum Key Distribution Protocol for secure key generation using two non-orthogonal quantum states",
"qmod_type": ["algorithms"],
"problem_domain_tags": [],
"level": ["basic", "demos"]
}
20 changes: 20 additions & 0 deletions community/paper_implementation_project/b92/b92_implementation.qmod
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
qfunc b92(message: bool[], bob_bases: bool[], qba: qbit[]) {
repeat (i: message.len) {
if (message[i] == 1) {
H(qba[i]);
}
}
repeat (i: bob_bases.len) {
if (bob_bases[i] == 0) {
X(qba[i]);
} else {
H(qba[i]);
X(qba[i]);
}
}
}

qfunc main(output qba: qbit[]) {
allocate(8, qba);
b92([0, 0, 1, 1, 0, 0, 0, 1], [1, 1, 0, 1, 1, 1, 0, 1], qba);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"constraints": {
"max_gate_count": {},
"optimization_parameter": "no_opt"
},
"preferences": {
"machine_precision": 8,
"custom_hardware_settings": {
"basis_gates": [
"cx",
"sx",
"r",
"u1",
"u",
"cz",
"rx",
"rz",
"id",
"ry",
"cy",
"y",
"x",
"u2",
"z",
"sdg",
"h",
"tdg",
"s",
"p",
"sxdg",
"t"
],
"is_symmetric_connectivity": true
},
"debug_mode": true,
"synthesize_all_separately": false,
"optimization_level": 3,
"output_format": [
"qasm"
],
"pretty_qasm": true,
"transpilation_option": "auto optimize",
"timeout_seconds": 300,
"random_seed": 1735422602
}
}
Loading