I'm still a bit obsessed with the GHZ experiment. This is the one where you prepare a GHZ state $\lvert 000 \rangle + \lvert 111 \rangle$ and send one qubit to each of 3 protagonists: Alice, Bob, and Charlie. (I will be ignoring shared normalizer constants throughout this post, as I find they don't add anything to the understanding.) If you do the maths it turns out that when all three choose to measure in the $\lvert + \rangle$, $\lvert - \rangle$ basis (shorthand for $\lvert 0 \rangle + \lvert 1\rangle$ and $\lvert 0 \rangle - \lvert 1\rangle$) then they are guarranteed to get a parity zero result. On the other hand if only one measures in this basis and the other two measure in the $\lvert +i\rangle$, $\lvert -i\rangle$ basis (shorthand for $\lvert 0 \rangle + i\lvert 1\rangle$ and $\lvert 0 \rangle - i\lvert 1\rangle$) they are guarranteed to get a parity one result. As I showed in an earlier post this appears to be incompatible with the outcomes being prede...
I did a little embedded project recently. Years ago I bought a binary coded decimal clock which no longer works, and I thought I could replace it with one I built myself. (In reality this was simply an excuse to play with programming a Raspberry Pi Pico.) Broken BCD clock (left) and home grown replacement (right). The LEDs are in 6 columns and represent time in hh:mm:ss format, with each decimal digit represented in binary. During the project I realised I needed to create a little Finite State Machine to enable setting of the time using the bootsel button. So I searched around on the internet and found tens of different libraries, but each with its own drawbacks. Some required a wizard executable to auto-generate code which you then edit, which has the drawback that if you change the input to the wizard you then need to manually merge new auto-generated code with your changes. Other libraries, had this strange thing where each state had its own "enter" and...
I've discovered an excellent tool in asciiflow.com . The website makes it really easy to create ASCII box diagrams like this They put these things in fruit machines you know! This is ideal for source code banners, which I think should contain helpful documentation - but most programmers think it's a good place for the COPYRIGHT information and nothing else. But wait! we can make it beautifuller... and easier to read... by replacing some of the ASCII characters with ones available in UTF-8: There! Isn't that better? (Although some purists may object to non-ASCII characters in your code base.) SOURCE CODE: #!/usr/bin/python2 # coding: utf-8 # + gets converted in different ways depending on it's 4 neighbours # # . N . { nsew(N,S,E,W) has bit 3 set if N in "+|<>" # W + E { nsew(N,S,E,W) has bit 2 set if S in "+|<>" # . S . { nsew(N,S,E,W) has bit 1 set if W in "+-^v" # { nsew(N,S,E,W) has bit 0 set if E ...
Comments
Post a Comment