dense_coding.ipynb
1 line
| 1.0 KiB
| text/plain
|
TextLexer
Dense Coding
In [2]:
%load_ext sympy_printing
In [3]:
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
In [4]:
psi = Qubit('00')/sqrt(2) + Qubit('11')/sqrt(2); psi
In [20]:
circuits = [H(1)*CNOT(1,0), H(1)*CNOT(1,0)*X(1), H(1)*CNOT(1,0)*Z(1), H(1)*CNOT(1,0)*Z(1)*X(1)]
In [21]:
for circuit in circuits:
circuit_plot(circuit, nqubits=2)
display(Eq(circuit*psi,qapply(circuit*psi)))
In [28]:
%notebook save dense_coding.ipynb