Quantum Computing Week 2 Update
I am back. The second week was a little different from week one. To be honest, I did not study all seven days; I had to skip two days due to my cats not letting me sleep and hence sleep deprivation (not another excuse, Akansha!!).
I started with the IBM course Basics of Quantum Information. I started with the video on the Introduction page, but realised I relate more to the textual content; it helps me focus better. So to make sure I was not missing anything, I decided to watch the video, and after 40 minutes, I moved to the textual content to see if the content was the same as in the video. And it was the same.
So I resumed with the textual content. It was a little overwhelming. I learned about ket and bra. A ket is a column vector, whereas a bra is a row vector. I learned about the unitary operation and installed Qiskit, and here is the first piece of code from this journey. I also learned what Jupyter Notebook is, and how to use it inside Visual Studio Code and the browser.
import numpy as np
from qiskit.visualization import array_to_latex
from IPython.display import display
ket0 = np.array([[1], [0]])
ket1 = np.array([[0], [1]])
M1 = np.array([[1,1], [0,0]])
M2 = np.array([[1,0], [0,1]])
mull = np.matmul(M1, M2)
display(array_to_latex(np.matmul(M1, M2)))
from qiskit.quantum_info import Statevector
from numpy import sqrt
u = Statevector([1 / sqrt(2), 1 / sqrt(2)])
v = Statevector([(1 + 2.0j) / 3, -2 / 3])
w = Statevector([1 / 3, 2 / 3])
display(u.draw("text"))
display(u.draw("latex"))
display(u.draw("latex_source"))
outcome, state = v.measure()
print(f"Measured: {outcome}\nPost-measurement state:")
display(state.draw("latex"))
from qiskit.visualization import plot_histogram
statistics = v.sample_counts(1000)
plot_histogram(statistics)
I would not say it was the best week learning-wise, but it was good. Now I am looking forward to continuing on this journey and seeing what is in there for me. I plan to read Multiple Systems this week.
That’s it for now. See you next Sunday!