PyOR Quantum
Author: Vineeth Thalakottoor
Introduction to Bloch vector
[1]:
# Define the source path
SourcePath = '/media/HD2/Vineeth/PostDoc_Simulations/Github/PyOR_V1/PyOR_Combined/PyOR/Source_Doc'
# Add source path
import sys
sys.path.append(SourcePath)
# Import PyOR package
from PyOR_QuantumLibrary import QuantumLibrary
QLib = QuantumLibrary()
[2]:
# Bloch Vector:
vec1 = QLib.Bloch_Vector(theta = 0.0, phi = 0.0)
vec1.matrix
[2]:
$\displaystyle \left[\begin{matrix}1.0\\0\end{matrix}\right]$
[3]:
# Bloch Vector:
vec2 = QLib.Bloch_Vector(theta = 180.0, phi = 0.0)
vec2.matrix
[3]:
$\displaystyle \left[\begin{matrix}6.12323399573677 \cdot 10^{-17}\\1.0\end{matrix}\right]$
[4]:
# Bloch Vector:
vec3 = QLib.Bloch_Vector(theta = 90.0, phi = 0.0)
vec3.matrix
[4]:
$\displaystyle \left[\begin{matrix}0.707106781186548\\0.707106781186547\end{matrix}\right]$
[5]:
# Bloch Vector:
vec4 = QLib.Bloch_Vector(theta = 90.0, phi = 180.0)
vec4.matrix
[5]:
$\displaystyle \left[\begin{matrix}0.707106781186548\\-0.707106781186547 + 8.65956056235493 \cdot 10^{-17} i\end{matrix}\right]$