Monthly Archives: January 2025
Tower of Hanoi on a HP-41CV
It was much more fun to program this on my old HP calculator (not necessarily an optimal solution, but I wrote this around 40 years ago, my very first version…): LBL “HANOI” “N?” PROMPT STO 01 “A” ASTO 02 “B” ASTO 03 “C” ASTO 04 10 STO 00 XEQ “INFIX” STOP LBL “INFIX” 1 RCL … Continue reading
Tower of Hanoi on a TI-84 Plus CE-T
The Tower of Hanoi is something I “have to” do on any calculator I encounter, but using Python feels almost like cheating, it is just too easy. Unfortunately there is little else of interest for this task on this calculator. def hanoi(n,a,b,c): if n==1: print(a,” >> “,b) else: hanoi(n-1,a,c,b) hanoi(1,a,b,c) hanoi(n-1,c,b,a) hanoi(3,1,2,3) To fit it … Continue reading
Quantum Teleportation Part IV
Here you can see the program running: The numbers can of course be complex, so let us try a different input:
Quantum Teleportation Part III
Believe it or not, even with their strict limitations, the fairly simplistic functions from the last post are sufficient building blocks to demonstrate a simple quantum circuit. Now we just have to declare the necessary quantum gates and initialize the three input qubits and we are ready to actually “build” the circuit. This is the … Continue reading
Quantum Teleportation Part II
We will need a few functions to do necessary mathematical operations on qubits (or more specifically on the state vector or probability vector of a quantum system). Note that I follow what I believe is the most common numbering of inputs with qubit 0 being the first input from above in the circuit and the … Continue reading