Tuesday, June 22, 2010

Simulating Quantum Computers

Here's a good blog post by Tucci: Best Heavy Duty Quantum Computer Simulators. He basically breaks them down into two categories: super computers and distributed grids (like BOINC). For anything heavy duty that is a simulation on a classical computer, those types of approaches are the only real solutions.

There are some approaches to help on a modern PC, although your still much more limited than the above. A quantum register is represented by 2^n complex numbers, where an operation on that register is a 2^n x 2^n matrix of complex numbers. The simple approach is just that, but as you can see, the memory requirements are large: you'll need 2^n complex numbers for the initial state of the register, the 2^n x 2^n complex matrix for the operation, and 2^n complex numbers for the output. One way to cut down the memory needed is to only do the matrix multiplication one row at a time. Doing so you need only 2^n complex numbers for the matrix instead of the entire thing. This is how the current implementation of Cove, my framework for programming quantum computers, currently works. Of course, there are much more elaborate tricks out there for improving the efficiency of quantum computers.

Another area I've been toying with for some time is to utilize more than one core on a system. The easiest approach with the current implementation of Cove would be just to spawn extra threads to do the matrix multiplication pieces. This would come at the cost of the extra 2^n complex numbers for each thread running. So there is a trade off between memory use and faster execution of the simulation. The execution time has been the bottle neck for a lot of the sets of a few handfuls of qubits I've been playing with, so this is something I'll probably get to eventually.

The previous paragraph being said, my goal has always been the creation of a usable framework for quantum computer programming. The simulation has always been something that will allow me to play with existing code, so my focus has never been on making it incredibly efficient.

Cove is setup where a user writes their code against a set of interfaces. With the current incarnation of Cove, the implementation is this simulation I've been talking about. The idea is however, that the simulation implementation could eventually be swapped out with one that runs on an actual quantum computer. In doing so a users code could switch between various implementations (actual quantum computer, my simulation, super computer, grid, etc) with only switching a reference and using statement.

No comments:

Post a Comment