<jupyter_start><jupyter_text>Teleportation https://en.wikipedia.org/wiki/Quantum_teleportation  Imports<jupyter_code>%matplotlib inline
from sympy import init_printing
init_printing(use_latex=True)
from sympy import sqrt, symbols, Rational
from sympy import expand, Eq, Symbol, simplify, exp, sin
from sympy.physics.quantum import *
from sympy.physics.quantum.qubit import *
from sympy.physics.quantum.gate import *
from sympy.physics.quantum.grover import *
from sympy.physics.quantum.qft import QFT, IQFT, Fourier
from sympy.physics.quantum.circuitplot import circuit_plot<jupyter_output><empty_output><jupyter_text>Teleportation<jupyter_code>a,b = symbols('a b', real=True)
state = Qubit('000')*a + Qubit('001')*b
state
entangle1_2 = CNOT(1,2)*HadamardGate(1)
entangle1_2
state = qapply(entangle1_2*state)
state
entangle0_1 = HadamardGate(0)*CNOT(0,1)
entangle0_1
circuit_plot(entangle0_1*entangle1_2, nqubits=3);
state = qapply(entangle0_1*state)
state
result = measure_partial(state, (0,1))
state = (result[2][0]*2).expand()
state
state = qapply(XGate(2)*state)
state<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11887477313974591, 'fraction_numerical': 0.03176043557168784, 'mean_word_length': 8.591304347826087, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '482168', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 435, 'n_tokens_neox': 414, 'n_words': 76, 'path': 'notebooks/teleportation.ipynb', 'repo_name': 'gvvynplaine/quantum_notebooks', 'size': '1102'}