Common Lisp, Development, LISP, Python, Quantum Computing, Quantum Programming, Technology

Hacking D-Wave One in Common Lisp

Mostly for my own amusement, I’ve tried a variety of approaches to hacking D-Wave’s python pack in Common Lisp, from existing Python/Lisp bridges to Python-in-Lisp implementations to decompiling the binary in order to recreate C++ header files that could then be used as a basis for a direct CFFI bridge, without much success. Being that the D-Wave Developer Portal only ever offered a simulator of the company’s D-Wave One hardware for the Python language, and no C/C++ library with associated header files, this was a fairly significant problem as support for Python–Lisp bridges has always been extremely limited, and until very recently, such bridges did not support CPython libraries such as D-Wave’s Python Pack, or its dependencies such as Numpy. Enter burgled-batteries.

With the burgled-batteries library, I was hacking away at D-Wave’s Python Pack within the SBCL REPL in a matter of minutes. And according to the library’s author, it’s only the beginning. Support for Python introspection and calling Lisp from Python are in the works—but in the mean time, handy macros such as RUN and DEFPYFUN allow you to get at all aspects of a Python library in a manner familiar to those used to working with the CLPython or CFFI Common Lisp libraries.

Using burgled-batteries in its present state, it will now be a fairly straightforward task to recreate the Python Pack’s API in Common Lisp. Sadly, registration to D-Wave’s developer portal has been closed for some time (and very few developers registered for it in the first place), so the only person that will get to enjoy hacking away at a quantum computer in Common Lisp (as far as I know) is me.

That being said, I look forward to the continued development of burgled-batteries, and think it will become an invaluable tool for Lisp and Python hackers everywhere. Just think of all the libraries and frameworks we’ll get to add to Lisp!

Development, Django, Python

Deployment

It has been a long three months of non-stop coding benders, but it’s finally deployment week for the Django/jQuery UI data-driven web app I’ve been building. I hope to post some screenshots and a list of features soon, if I can get permission from the client. Anyway, this is exciting for several reasons: first, because satisfaction in life only ever comes from accomplishing a difficult task (which in this case was primarily due to time constraints), and second, now that the core web app is pretty much done (there’s some minor ui touch-ups to take care of while our database guy completes the MS SQL to PostgreSQL migration), I can return to a normal work schedule and start putting some serious thought into other projects I’ve been toying with along the way.

Continue reading

Development, Python, Quantum Computing, Quantum Programming, Technology

D-Wave Python Pack 1.4.0-alpha1 Trial 2

I decided to take a break from this long weekend’s coding bender to get back to the D-Wave developer tutorials. Taking a break from one coding project by working on another may seem counter-intuitive to non-programmers, but it’s actually a great way of getting a fresh perspective when one function starts blurring into another.

I decided to take a look at some of the new tutorials, namely Travelling Salesman and the Hadamard Matrix search. I’m pleased to report that they function exactly as advertised (despite some criticism from a certain user on the D-Wave forums).

Continue reading

Development, Python, Quantum Computing, Quantum Programming, Technology

D-Wave Python Pack 1.4.0-alpha1 Trial 1

Today I’ve been benched by a double-whammy sinus cold plus migraine, so there’s really not much I can do. Yesterday, however, I did get to try out the D-Wave Python Pack (Win32/Python2.7 1.4.0-alpha1)—and I was pleasantly surprised by its speed and apparent stability. Oddly, the “Hello Multiverse” tutorial script wouldn’t run as is (and I didn’t have the time to stop and figure out why), but the neural net scripts (which I’m more interested in anyway), worked exactly as advertised. Altogether I’m pleased with the developer beta, and I’m looking forward to the Quantum Cloud service.

I’ve decided, of course, that I need to be up and running in a Windows environment ASAP, so that I can put as much of my free time as possible into quantum programming. This means moseying on over to FutureShop once I’m over my cold and picking up a copy of Windows to install on my MacBook Pro via Bootcamp. At this point, I can’t worry about building a new PC. As much as I happen to enjoy assembling and fine-tuning my own computers, I simply don’t have the time—I know myself, and I won’t be satisfied just throwing something together; I’ll have to hunt down the best components for the best price, tweak the processors, set up my operating systems… (and since my favourite flavour of Linux happens to be Gentoo, that is a time-consuming process on its own). That’s a project for when I’m finished my current development contract. Plus, I really want a six-up display, and that’s kind of a waste of money unless the computer it’s attached to costs at least the same price.

Continue reading

Development, Python, Quantum Computing, Quantum Programming, Technology

D-Wave Developer Portal

I got my access to the D-Wave developer portal beta yesterday—only to be thwarted by a lack of an OS X version of their python pack. Luckily, I have access to a Windows PC during the week, so it’s not a complete fail—but it would have been nice to devote some real time to quantum programming over the weekend. Unfortunately, for a more permanent solution I’ll either have to get a PC of my own, or taint my macbook pro with a bootcamp installation of windows.

There is a linux version as an .egg distribution, which could probably be bootstrapped to work under OS X through Fink, unfortunately it’s only compatible with Python 2.6, and Lion comes with Python 2.7.1. Not entirely a happy day.

I’ll post more when I get a chance to try out the D-Wave python pack.