You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 21, 2024. It is now read-only.
$⟨ψ|Φ⟩ =
\begin{bmatrix}
α^*
β^*
\end{bmatrix}
\begin{bmatrix}
γ \
δ
\end{bmatrix} =
α^*γ + β^*δ
$
it's a inner product also called as bra-ket
$⟨Φ|ψ⟩ = ⟨ψ|Φ⟩^*$
$⟨ψ|ψ⟩ =
\begin{bmatrix}
α^*
β^*
\end{bmatrix}
\begin{bmatrix}
α \
β
\end{bmatrix} =
|α^2| + |β^2| = 1
$ $⟨Uψ|Uψ⟩ = ⟨ψ|U^{\dagger}U|ψ⟩ = ⟨ψ|ψ⟩ = 1 $
if the result of $⟨ψ|ψ⟩$ is $1$ so the state is normalized
$⟨+|-⟩ = ⟨0|1⟩ = ⟨i|-i⟩ = 0$
if the result is 0, so these states are orthogonal
if you test the states and they are normalized and orthogonal, so you have a orthonormal basis
$|ψ⟩ = ⟨0|ψ⟩|0⟩ + ⟨1|ψ⟩|1⟩$
$|ψ⟩ = α|a⟩ + β|b⟩$ $α = ⟨a|ψ⟩$ $β = ⟨b|ψ⟩$ $⟨a|ψ⟩$ is a projection of |ψ⟩ on |a⟩
$|ψ⟩ = α|a⟩ + β|b⟩$ $|ψ⟩ = ⟨a|ψ⟩|a⟩ + ⟨b|ψ⟩|b⟩$ $|ψ⟩ = |ψ⟩|a⟩⟨a| + |ψ⟩|b⟩⟨b|$ $|ψ⟩ = (|a⟩⟨a| + |b⟩⟨b|)|ψ⟩$ $|ψ⟩ = I|ψ⟩$
If you can do this with an orthonormal basis, this is an complete orthonormal basis
Tensor product (Kronecker product)
$|0⟩ ⊗ |0⟩ = |00⟩$ $⟨0| ⊗ ⟨0| = ⟨00|$
$c_{0}|00⟩ + c_{1}|01⟩ + c_{2}|10⟩ + c_{3}|11⟩$
The probability of each state is $|c_{x}|^2$
$|0⟩^{⊗n} = |0⟩ ⊗ |0⟩ ⊗\dots⊗|0⟩ = |0^{n}⟩$
$⟨01|00⟩ = ⟨0|0⟩⟨1|0⟩$
Kronecker product, it's the tensor product for linear algebra
$|ψ⟩ = \sum_{j=0}^{n-1} c_{j}|j⟩ = c_{0}|0⟩ + c_{1}|1⟩ + c_{2}|2⟩ + \dots + c_{n-1}|n-1⟩$ $⟨ψ| = \sum_{j=0}^{n-1} c_{j}⟨j| = c_{0}⟨0| + c_{1}⟨1| + c_{2}⟨2| + \dots + c_{n-1}⟨n-1|$
where $n$ is the number of qubits
In a 3 qubits circuit, with the collapsed state for the last and middle qubits are both 0, the state will be
$c_{0}|000⟩ + c_{1}|001⟩ \over \sqrt{|c_{0}|^2 + |c_{1}|^2}$
An entangled state can't be factored. Because of that, for classical computers, it's difficult to map all the amplitudes, once in a entangled state you need to map all $2^n$ possible states, but with no entangled states you only need to map $2n$
the $CNOT$ with the $H$ gate, can create a entangled state
$CNOT|+⟩|0⟩ = {1\over\sqrt2}(|00⟩ + |11⟩) = |Φ^+⟩$ $CNOT|-⟩|0⟩ = {1\over\sqrt2}(|00⟩ - |11⟩) = |Φ^-⟩$ $CNOT|+⟩|1⟩ = {1\over\sqrt2}(|01⟩ + |10⟩) = |ψ^+⟩$ $CNOT|-⟩|1⟩ = {1\over\sqrt2}(|01⟩ - |10⟩) = |ψ^-⟩$
These are the bell states
consecutive measurements in different basis the result is always 1/2 for both states
${1 \over \sqrt{2}}|00⟩ + {1 \over 2}|01⟩ + {\sqrt{3} \over 4}|10⟩ + {1 \over 4}|11⟩$
The probability of $|x0⟩$ is $|{1 \over \sqrt{2}}|^2 + |{\sqrt{3} \over 4}|^2$
If we measured the first qubit(rightmost in little endian system) and the result is zero, so the state of the circuit is $A({1 \over \sqrt{2}}|00⟩ + {1 \over 2}|01⟩)$
The states can also be measured sequentially
$Prob(|00⟩) = Prob(|0⟩)Prob(|0⟩)$
α need to be a positive real number and β a complex number $α = cos({θ \over 2})$ $β = e^{iθ}sin({θ \over 2})$
Ancillas
Ancillas need to be reset.
Bloch sphere
θ is the angle between the poles (z-axis)
Φ is the angle between x and y axis (this is present in $e^{iΦ}$)
to know if two states are in opposite sides in the bloch sphere $θb = π - θa$ $Φb = Φa + π$
cartesian coordinates in the bloch sphere $z = cosθ$ $y = sinΦ sinθ$ $x = cosΦ sinθ$
${\displaystyle \mathbf {\hat {n}} } = n _{x}{\displaystyle \mathbf {\hat {x}} } + n _{y}{\displaystyle \mathbf {\hat {y}} } + n _{z}{\displaystyle \mathbf {\hat {z}} }$ ${\displaystyle \mathbf {\hat {n}} }$ is a unit vector that represents a rotation on bloch sphere $n _{(x,y,z)}$ represents the rotation number for each axis ${\displaystyle \mathbf {\hat {x}} }$,${\displaystyle \mathbf {\hat {y}} }$ and ${\displaystyle \mathbf {\hat {z}} }$ represents points on the sphere
also $|n _{x}|^2 + |n _{y}|^2 +|n _{z}|^2 = 1$
Gates
A gate, need to be always unitary and reversible
The number of outputs of a gate needs to be the same of the inputs to be reversible and map all possible results
$X^{100} = I$ $X^{101} = X$
$X|0⟩ = |1⟩$ $X|1⟩ = |0⟩$
$XY = iZ$
$Y|0⟩ = i|1⟩$ $Y|1⟩ = -i|0⟩$
Y gate is not a classical gate, since it has a $i$ and $-i$ phase
Y, X, Z gates rotate 180° on its axis(x, y, z respectively)
$S|0⟩ = |0⟩$ $S|1⟩ = i|1⟩$ $S = \sqrt{Z}$ or $S^2 = Z$
S gate rotates 90° on the Z axis
$T|0⟩ = |0⟩$ $T|1⟩ = e^{iπ \over 4}|1⟩$ $T^2 = S$ $T^4 = Z$
T gate is also called $π \over 8$ gate
T gate rotates 45° on the Z axis\
$H|0⟩ = {1 \over \sqrt{2}}(|0⟩ + |1⟩) = |+⟩$ $H|1⟩ = {1 \over \sqrt{2}}(|0⟩ - |1⟩) = |-⟩$
H gate is also called Hadamard gate
H gate rotates 180° between X and Y axis
$X^2 = Y^2 = S^4 = T^8 = H^2 = I$
$U = e^{iγ}[cos({θ \over 2})I - isin({θ \over 2})(n _{x}X + n _{y}Y + n _{z}Z)]$
Where $γ$ is the global phase
$αU|0⟩ + βU|1⟩ = U(α|0⟩ + β|1⟩) = αe^{iγ}[cos({θ \over 2})I - isin({θ \over 2})(n _{x}X + n _{y}Y + n _{z}Z)]|0⟩ + βe^{iγ}[cos({θ \over 2})I - isin({θ \over 2})(n _{x}X + n _{y}Y + n _{z}Z)]|1⟩$
$U|0⟩ = a|0⟩ + b|1⟩ = \begin{bmatrix}
a\
b
\end{bmatrix}$
$U|1⟩ = c|0⟩ + d|1⟩ = \begin{bmatrix}
c\
d
\end{bmatrix}$
$U = \begin{bmatrix}
a \space c \
b \space d
\end{bmatrix}$
CNOT (CX) inverts the right qubit(target) if the left qubit(control) is 1 $CNOT(|10⟩) = |11⟩$
the control qubit is not changed because it has a XOR $CNOT|a⟩|b⟩ = |a⟩|a ⊗ b⟩$ $CNOT(c_{0}|00⟩ + c_{1}|01⟩ + c_{2}|10⟩ + c_{3}|11⟩) = c_{0}|00⟩ + c_{1}|01⟩ + c_{2}|11⟩ + c_{3}|10⟩$ it inverts the $c_{2}$ with the $c_{3}$ amplitude $CNOT = CNOT_{ij} = CNOT_{10}$ where $i$ is the control and $j$ the target $(H ⊗ H) CNOT_{01} (H ⊗ H) = CNOT_{10}$ it inverts the control with the target
$(X ⊗ I) CNOT (X ⊗ I)$ it is called $anti \space CNOT$
Controlled U (CU), it applies U in the right qubit, when the left qubit is 1 $CU|00⟩ = |00⟩$ $CU|01⟩ = |01⟩$ $CU|10⟩ = |1⟩ ⊗ U|0⟩$ $CU|11⟩ = |1⟩ ⊗ U|1⟩$
SWAP, the swap inverts two qubits positions, but differently from CNOT, it can't create entangled states $SWAP|00⟩ = |00⟩$ $SWAP|01⟩ = |10⟩$ $SWAP|10⟩ = |01⟩$ $SWAP|11⟩ = |11⟩$
it also invert amplitudes
$SWAP(c_{0}|00⟩ + c_{1}|01⟩ + c_{2}|10⟩ + c_{3}|11⟩) = c_{0}|00⟩ + c_{1}|10⟩ + c_{2}|01⟩ + c_{3}|11⟩$ $SWAP = CNOT \space CNOT_{01} \space CNOT$
Toffoli gate (CCX), inverts the right qubit if the other two are 1 $Toffoli|111⟩ = |110⟩$ $Toffoli|110⟩ = |111⟩$
An unknown quantum state can't be reproduced(replicated) if we don't know each amplitude $|ψ⟩|0⟩ = |ψ⟩|ψ⟩$ $U|ψ⟩|0⟩ = |ψ⟩|ψ⟩$ there's no operator $U$ that can pass $|ψ⟩$ state to the right qubit, once the result is $|ψ⟩^2$ which isn't linear
But for $(I ⊗ H)|+⟩|0⟩ = |+⟩|+⟩$ we can clone, $|+⟩$, once we know the amplitudes
Generally $U$ can only copy states that are orthogonal $(I ⊗ H)|+⟩|0⟩ = |+⟩|+⟩$ $(x ⊗ H)|-⟩|0⟩ = |-⟩|-⟩$ $(I ⊗ I)|0⟩|0⟩ = |0⟩|0⟩$ $(I ⊗ X)|1⟩|0⟩ = |1⟩|1⟩$ $(I ⊗ Y)|i⟩|0⟩ = |i⟩|i⟩$ $(X ⊗ Y)|-i⟩|0⟩ = |-i⟩|-i⟩$