pip install qiskit

# required imports:
from qiskit.visualization import array_to_latex
from qiskit.quantum_info import Statevector, random_statevector

ket0 = [[1],[0]] #defining the ket |0>

array_to_latex(ket0)

ket1 = [[0],[1]] #defining the ket |1>

array_to_latex(ket1)

bra0 = [1,0]
array_to_latex(bra0)

bra1 = [0,1]
array_to_latex(bra1)

sv_bra0 = Statevector(bra0)
sv_bra0

sv_bra1 = Statevector(bra1)
sv_bra1

sv_ket1 = Statevector(ket1)
sv_ket1

sv_ket0 = Statevector(ket0)
sv_ket0

sv_eq = Statevector([1/2, 3/4, 4/5, 6/8])

sv_eq.draw('latex')

sv_eq.is_valid()

from qiskit.quantum_info.operators import Operator, Pauli

op_bra0 = Operator(bra0)

op_bra0

op_ket0 = Operator(ket0)
op_bra0.tensor(op_ket0)

pauli_x = Pauli('X')

array_to_latex(pauli_x)

pauli_y = Pauli('Y')

array_to_latex(pauli_y)

pauli_z = Pauli('Z')

array_to_latex(pauli_z)

import numpy as np
test1 = np.dot(pauli_x,pauli_y)
test2 = np.dot(pauli_y,pauli_x)
array_to_latex(test1)

array_to_latex(test1-test2)

op_x = Operator(pauli_x) #operator representation of the Pauli X operator

op_x

op_y = Operator(pauli_y) #operator representation of the Pauli Y operator

op_y

op_z = Operator(pauli_z) #operator representation of the Pauli Y operator

op_z

op_new = np.dot(op_x,ket0)

array_to_latex(op_new)

op_new = np.dot(op_y,ket0)

array_to_latex(op_new)

op_new = np.dot(op_z,ket0)

array_to_latex(op_new)