Skip to content

Commit 6fd6ffb

Browse files
Add drops to qubits in teleportation to avoid auto-uncomputataion
1 parent e358bc1 commit 6fd6ffb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

algorithms/quantum_teleportation/quantum_teleportation.ipynb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,11 @@
238238
" prepare_test_state(alice_qubit)\n",
239239
"\n",
240240
" # Perform teleportation\n",
241-
" quantum_teleportation(alice_qubit, bob_qubit, bell_pair_qubit)"
241+
" quantum_teleportation(alice_qubit, bob_qubit, bell_pair_qubit)\n",
242+
"\n",
243+
" # Drop qubits to avoid uncomputation\n",
244+
" drop(alice_qubit)\n",
245+
" drop(bell_pair_qubit)"
242246
]
243247
},
244248
{

algorithms/quantum_teleportation/quantum_teleportation.qmod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ qfunc main(output bob_qubit: qbit) {
2727
allocate(1, bob_qubit);
2828
prepare_test_state(alice_qubit);
2929
quantum_teleportation(alice_qubit, bob_qubit, bell_pair_qubit);
30+
drop(alice_qubit);
31+
drop(bell_pair_qubit);
3032
}

0 commit comments

Comments
 (0)