This is my first single-qubit quantum circuit I wrote today:
dev = qml.device("default.qubit", wires=1) @qml.qnode(dev) def apply_hxh(state): if state: qml.PauliX(wires=0) qml.Hadamard(wires=0) qml.PauliX(wires=0) qml.Hadamard(wires=0) return qml.state() print(apply_hxh(0)) print(apply_hxh(1))
It applies a sequence of Hadamard–X–Hadamard gates with optional initial X to a single qubit and returns the resulting quantum state.
I started learning quantum mechanics out of pure enthusiasm. I have absolutely no purpose whatsoever from learning quantum computation. Not everything in life should carry a purpose. To be more precise, not everything in life should start with a purpose. It's not always obvious how a specific path leads to something great.
I believe that's one of the key differences between theory and practice. Mathematicians and engineers. Usually, engineers are building something or improving what they've built. There is always some clear outcome expected after their work. But mathematicians are solving problems or proving theorems that do not have any application at all (for now). They discover new lands we have not yet called home. The fun part is, the technologies engineers use today are the result of the work done by these enthusiastic theorists.
I think this general principle applies to life, too. Our time on Earth is far too short to learn everything or to explore ideas today with the guarantee they'll be useful years down the line. But every now and then, diving into a new science, hobby, or activity completely at random can open doors in ways you’d never imagine. That’s exactly what I’m doing right now.