Thursday, September 15, 2011

Augmented Reality in the Dark

A few months ago, I was preparing my Second Head for a Crash Space demo table at an event. I was unsure of the lighting, and thought it might be pretty dark there. ARtoolkit does a good job of augmented reality in good lighting, but if the lighting is not good, the system does not perform well.

So I decided to try to put a large EL panel behind my paper marker to backlight it. I purchased a large white EL panel from EL-Works and a battery-powered inverter. It worked great in dim light, even in the dark, as you can see in this video:

Saturday, September 10, 2011

Trivial quantum computing with QCF

Here is the same trivial quantum computing example I did in QCL in QCF running on Octave.

Again, I start with a two-qubit register psi, initialized to zero. I perform the Hadamard on it to create an equal superposition of states. Then I measure it, getting a different result each time I try it.

Note the two different quantum state notations used. Vector notation is used be default in QCF as it makes computation simpler. But as a human, I prefer binary ket notation, so I go from binary ket to vector notation using bin2vec(), and vector to binary ket notation using pretty().

Also measurement in QCF does not collapse the wavefunction explicitly (although you could do psi=measure(psi) to be more realistic about the measurement process collapsing the waveform).

octave-3.2.3:132> addpath("/pathtoqcf/qcf")
octave-3.4.0:133> psi=bin2vec("00")
psi =

1
0
0
0

octave-3.4.0:134> pretty(psi)
ans = 1|00>
octave-3.4.0:135> psi=hadamard(2)*psi
psi =

0.50000
0.50000
0.50000
0.50000

octave-3.4.0:136> pretty(psi)
ans = 0.5|00> + 0.5|01> + 0.5|10> + 0.5|11>
octave-3.4.0:137> pretty(measure(psi))
ans = 1|10>
octave-3.4.0:138> pretty(measure(psi))
ans = 1|01>
octave-3.4.0:139> pretty(measure(psi))
ans = 1|11>
octave-3.4.0:140> pretty(measure(psi))
ans = 1|01>




Wednesday, September 07, 2011

Messing around with Quantum Computing

If you want to start messing around with Quantum Computing simulators (ahead of actual Quantum Computers being developed), there are a couple of options:

Bernhard Omer's QCL language, developed specifically for QC simulation.

QCF toolbox of Quantum Computing Functions for Matlab and Octave (a free clone of Matlab).

Matt Purkeypile's Cove framework, that could potentially be extended to any language, but currently really only works with C#. He has a number of YouTube videos about it.

Here is a short (and useless) QCL example, where we put a 2-Qbit register into a superposition of states, then measure the Qbits. The first time we try this, we get a 3, the second time we try it, we get a 2:
qcl> qureg s[2]; // set up 2-Qbit register s, initially all zero
qcl> H(s); // apply Hadamard operator to create equal superposition of states
[2/32] 0.5 |0> + 0.5 |1> + 0.5 |2> + 0.5 |3>
qcl> measure s; // now actually measure and collapse wavefunction
[2/32] 1 |3> // result is 3 (0b11)
qcl> reset; // reset Qbits to zero
[2/32] 1 |0>
qcl> H(s); // apply Hadamard operator again
[2/32] 0.5 |0> + 0.5 |1> + 0.5 |2> + 0.5 |3>
qcl> measure s; // measure again
[2/32] 1 |2> // result is 2 (0b10)



Friday, September 02, 2011

$35 Linux PC with Ethernet?

Check out the Raspberry Pi, which for $25 will [when released "later in 2011"] get you:
  • 700MHz ARM11
  • 128MB or 256MB of SDRAM
  • OpenGL ES 2.0
  • 1080p30 H.264 high-profile decode
  • Composite and HDMI video output
  • USB 2.0
  • SD/MMC/SDIO memory card slot
  • General-purpose I/O
  • Optional integrated 2-port USB hub and 10/100 Ethernet controller
  • Open software (Ubuntu, Iceweasel, KOffice, Python)
  • ...and for $35 a 10/100 wired Ethernet (though they claim you might be able to use a WiFi USB dongle on the $25 board).

    Regarding GPIO, they say:

    There are approximately 16 spare GPIOs, which are brought out to 1.27mm pin-strip. Voltage levels are 3v3. The connector choice is deliberately annoying to connect to directly; there is no over-voltage protection on the board so the intention is that people interested in serious interfacing will use an external board with buffers, level conversion and analog I/O rather than soldering directly onto the main board.

    We also bring 2x I2C (3v3), I2S and an SPI (3v3) interface out to the same connector. We support one slave interface for I2C and one for SPI.