How Do I Build a Quantum Computer in My House?
Tags: Babies, Health, Culture, Life, Coronavirus

This could be you! (Image credit: Russell Huffman)

By Ryan F. Mandelbaum, Senior Technical Writer, Qiskit

Open-access frameworks like Qiskit let you program a quantum computer over the cloud, and you’re an enterprising person who has a familiarity with quantum computers. So, if you happen to find yourself in need of something to do, how about trying to program a quantum computer that you built yourself?

It should be mentioned before I start that technically, you cannot build a fully-functioning quantum computer that runs quantum algorithms in your home (unless you have millions of dollars, access to fabrication and research facilities, and lots of dedicated time, in which case we probably need your help, rather than the other way around). However, with a big enough budget, free time, and perhaps some lessons on DIY optics and electronics, you could build a simple quantum system and program it to run a few quantum gates. You can even use Qiskit to control your device, with a little work. So, let’s get started:

What is a Quantum Computer?

http://tanum.actiup.com/nue/Video-jagiellonia-bialystok-v-gornik-zabrze-v-pl-pl-1sls-6.php

https://test2.activesilicon.com/fdm/video-rayo-vallecano-v-las-palmas-v-es-es-1rks2-18.php

http://mix.gruposio.es/gci/video-modena-v-alma-juventus-fano-v-it-it-1cum-3.php

http://tanum.actiup.com/nue/videos-jagiellonia-bialystok-v-gornik-zabrze-v-pl-pl-1oya-6.php

http://tanum.actiup.com/nue/Video-jagiellonia-bialystok-v-gornik-zabrze-v-pl-pl-1qlx-9.php

https://test2.activesilicon.com/fdm/v-ideos-Standard-Liege-Royal-Excel-Mouscron-v-en-gb-1ega-18.php

http://tanum.actiup.com/nue/videos-jagiellonia-bialystok-v-gornik-zabrze-v-pl-pl-1btf-15.php

http://mix.gruposio.es/gci/video-casertana-v-viterbese-castrense-v-it-it-1rsp2-3.php

https://test2.activesilicon.com/fdm/videos-Standard-Liege-Royal-Excel-Mouscron-v-en-gb-1zxg-14.php

https://test2.activesilicon.com/fdm/video-Standard-Liege-Royal-Excel-Mouscron-v-en-gb-1wbf-11.php

http://mix.gruposio.es/gci/video-casertana-v-viterbese-castrense-v-it-it-1mef2-3.php

https://test2.activesilicon.com/fdm/Video-Rayo-Vallecano-Las-Palmas-v-en-gb-1qac-11.php

https://test2.activesilicon.com/fdm/videos-Rayo-Vallecano-Las-Palmas-v-en-gb-1bvi-7.php

http://tanum.actiup.com/nue/Video-virtus-francavilla-v-bisceglie-v-it-it-1xkk-2.php

http://mix.gruposio.es/gci/Video-casertana-v-viterbese-castrense-v-it-it-1rxk2-2.php

http://mix.gruposio.es/gci/videos-casertana-v-viterbese-castrense-v-it-it-1qoj2-14.php

http://multi.provecracing.com/pfs/video-Arouca-SC-Covilha-v-en-gb-mrd-.php

https://test2.activesilicon.com/fdm/v-ideos-Rayo-Vallecano-Las-Palmas-v-en-gb-1dtq-10.php

https://kleinoot.nl/yry/videos-Arouca-SC-Covilha-v-en-gb-vte-.php

http://tanum.actiup.com/nue/videos-virtus-francavilla-v-bisceglie-v-it-it-1syz-12.php

http://tanum.actiup.com/nue/videos-virtus-francavilla-v-bisceglie-v-it-it-1zap2-11.php

http://mix.gruposio.es/gci/videos-casertana-v-viterbese-castrense-v-it-it-1woi2-7.php

https://test2.activesilicon.com/fdm/Video-manchester-iunaited-v-lids-v-yt2-1yjv-12.php

http://mix.gruposio.es/gci/Video-Man-United-Leeds-v-en-gb-1afn-.php

http://tanum.actiup.com/nue/Video-virtus-francavilla-v-bisceglie-v-it-it-1khi2-1.php

https://test2.activesilicon.com/fdm/videos-manchester-iunaited-v-lids-v-yt2-1xfe-18.php

http://esc.vidrio.org/clr/video-Arouca-SC-Covilha-v-en-gb-jnf-.php

http://mix.gruposio.es/gci/videos-Man-United-Leeds-v-en-gb-1zas-11.php

https://test2.activesilicon.com/fdm/video-manchester-iunaited-v-lids-v-yt2-1hen-6.php

http://tanum.actiup.com/nue/Video-virtus-francavilla-v-bisceglie-v-it-it-1xmy2-1.php

http://mix.gruposio.es/gci/Video-Man-United-Leeds-v-en-gb-1dmc-17.php

https://test2.activesilicon.com/fdm/video-manchester-iunaited-v-lids-v-yt2-1ibf-13.php

http://tanum.actiup.com/nue/Video-modena-v-alma-juventus-fano-v-it-it-1lzt2-14.php

http://mix.gruposio.es/gci/video-Manchester-United-Leeds-United-v-en-gb-1dmv-.php

https://test2.activesilicon.com/fdm/Video-manchester-iunaited-v-lids-v-yt2-1sii-4.php

http://mix.gruposio.es/gci/v-ideos-Manchester-United-Leeds-United-v-en-gb-1gwe-4.php

http://tanum.actiup.com/nue/Video-modena-v-alma-juventus-fano-v-it-it-1dlo-9.php

https://cartaodosus.info/video.php?video=Video-lorient-v-rennes-v-fr-fr-1moe-16.php

http://tanum.actiup.com/nue/v-ideos-modena-v-alma-juventus-fano-v-it-it-1yeu-10.php

https://cartaodosus.info/video.php?video=v-ideos-lorient-v-rennes-v-fr-fr-1dnp-8.php

http://mix.gruposio.es/gci/v-ideos-Manchester-United-Leeds-United-v-en-gb-1fmj-3.php

http://tanum.actiup.com/nue/Video-modena-v-alma-juventus-fano-v-it-it-1szp-11.php

https://kleinoot.nl/yry/v-ideos-Arouca-SC-Covilha-v-en-gb-gwl-.php

https://cartaodosus.info/video.php?video=Video-lorient-v-rennes-v-fr-fr-1bbe-15.php

https://test2.activesilicon.com/fdm/v-ideos-Gil-Vicente-FC-S.L.-Benfica-v-en-gb-oqn-.php

https://cartaodosus.info/video.php?video=Video-lorient-v-rennes-v-fr-fr-1fja-17.php

http://tanum.actiup.com/nue/videos-modena-v-alma-juventus-fano-v-it-it-1gsa-14.php

http://mix.gruposio.es/gci/video-legnago-salus-v-mantova-v-it-it-1kyo2-12.php

https://cartaodosus.info/video.php?video=Video-Lorient-Stade-Rennes-v-en-gb-1fei-17.php

http://mix.gruposio.es/gci/v-ideos-legnago-salus-v-mantova-v-it-it-1bzm-13.php

https://test2.activesilicon.com/fdm/Video-Gil-Vicente-FC-S.L.-Benfica-v-en-gb-ann-.php

https://kleinoot.nl/yry/videos-ujpest-v-budapest-honved-v-hu-hu-1aow-11.php

https://kleinoot.nl/yry/v-ideos-ujpest-v-budapest-honved-v-hu-hu-1lcx-10.php

https://cartaodosus.info/video.php?video=v-ideos-Lorient-Stade-Rennes-v-en-gb-1toa-13.php

https://test2.activesilicon.com/fdm/v-ideos-Gil-Vicente-FC-S.L.-Benfica-v-en-gb-daq-.php

http://mix.gruposio.es/gci/videos-legnago-salus-v-mantova-v-it-it-1coh2-6.php

http://tanum.actiup.com/nue/video-casertana-v-viterbese-castrense-v-it-it-1ppj2-9.php

https://cartaodosus.info/video.php?video=video-Lorient-Stade-Rennes-v-en-gb-1kgr-6.php

http://tanum.actiup.com/nue/Video-casertana-v-viterbese-castrense-v-it-it-1les2-5.php

http://mix.gruposio.es/gci/videos-legnago-salus-v-mantova-v-it-it-1elp-7.php

https://kleinoot.nl/yry/v-ideos-ujpest-v-budapest-honved-v-hu-hu-1ugi-6.php

http://multi.provecracing.com/pfs/Video-Arouca-SC-Covilha-v-en-gb-lpd-.php

https://kleinoot.nl/yry/videos-ujpest-v-budapest-honved-v-hu-hu-1eoo-18.php

http://tanum.actiup.com/nue/videos-casertana-v-viterbese-castrense-v-it-it-1oeb2-19.php

http://mix.gruposio.es/gci/Video-legnago-salus-v-mantova-v-it-it-1hte2-18.php

https://test2.activesilicon.com/fdm/v-ideos-cadiz-v-getafe-v-es-es-1pqg-10.php

http://mix.gruposio.es/gci/videos-Atalanta-Roma-v-en-gb-1ddf-.php

https://test2.activesilicon.com/fdm/Video-cadiz-v-getafe-v-es-es-1dxk-15.php

http://tanum.actiup.com/nue/Video-casertana-v-viterbese-castrense-v-it-it-1fkk2-16.php

https://cartaodosus.info/video.php?video=video-austria-wien-v-lask-v-at-at-1vfe-16.php

http://multi.provecracing.com/pfs/Video-ujpest-v-budapest-honved-v-hu-hu-1rtn-11.php

http://esc.vidrio.org/clr/Video-Arouca-SC-Covilha-v-en-gb-ldl-.php

https://cartaodosus.info/video.php?video=video-austria-wien-v-lask-v-at-at-1qst-18.php

http://tanum.actiup.com/nue/videos-casertana-v-viterbese-castrense-v-it-it-1dmm2-14.php

http://mix.gruposio.es/gci/v-ideos-Atalanta-Roma-v-en-gb-1lbm-2.php

https://test2.activesilicon.com/fdm/videos-cadiz-v-getafe-v-es-es-1xpb-3.php

http://multi.provecracing.com/pfs/video-ujpest-v-budapest-honved-v-hu-hu-1wko-14.php

http://multi.provecracing.com/pfs/videos-ujpest-v-budapest-honved-v-hu-hu-1eej-7.php

http://mix.gruposio.es/gci/v-ideos-Atalanta-Roma-v-en-gb-1apw-11.php

http://tanum.actiup.com/nue/video-Man-United-Leeds-v-en-gb-1lzv-14.php

https://test2.activesilicon.com/fdm/Video-cadiz-v-getafe-v-es-es-1qsu2-2.php

https://kleinoot.nl/yry/v-ideos-ujpest-Budapest-Honved-v-en-gb-fhp-.php

https://cartaodosus.info/video.php?video=Video-austria-wien-v-lask-v-at-at-1qhj-12.php

http://tanum.actiup.com/nue/videos-Man-United-Leeds-v-en-gb-1ttq-16.php

https://kleinoot.nl/yry/videos-ujpest-Budapest-Honved-v-en-gb-iiy-.php

https://test2.activesilicon.com/fdm/video-cadiz-v-getafe-v-es-es-1vmc2-14.php

http://multi.provecracing.com/pfs/videos-ujpest-v-budapest-honved-v-hu-hu-1gac-11.php

http://tanum.actiup.com/nue/v-ideos-Man-United-Leeds-v-en-gb-1pbb-2.php

https://test2.activesilicon.com/fdm/v-ideos-Cadiz-Getafe-v-en-gb-1hdr-14.php

https://kleinoot.nl/yry/video-ujpest-Budapest-Honved-v-en-gb-rwu-.php

http://mix.gruposio.es/gci/v-ideos-wolfsburg-v-stuttgart-v-de-de-1ovs-7.php

http://tanum.actiup.com/nue/videos-Manchester-United-Leeds-United-v-en-gb-1nhr-2.php

https://test2.activesilicon.com/fdm/Video-Cadiz-Getafe-v-en-gb-1rjw-16.php

http://mix.gruposio.es/gci/v-ideos-wolfsburg-v-stuttgart-v-de-de-1dqu-12.php

https://kleinoot.nl/yry/v-ideos-istanbulspor-v-bursaspor-v-tr-tr-1qoe-18.php

https://cartaodosus.info/video.php?video=video-Austria-Wien-LASK-Linz-v-en-gb-unv-.php

http://multi.provecracing.com/pfs/v-ideos-ujpest-Budapest-Honved-v-en-gb-qcw-.php

https://cartaodosus.info/video.php?video=Video-Austria-Wien-LASK-Linz-v-en-gb-urx-.php

http://tanum.actiup.com/nue/v-ideos-Manchester-United-Leeds-United-v-en-gb-1qav-19.php

http://mix.gruposio.es/gci/Video-wolfsburg-v-stuttgart-v-de-de-1hvw-8.php

It would help to know what a quantum computer is before trying to build one, of course. Quantum computers are systems that store and manipulate data by representing it with the properties innate to quantum systems. Basically, classical computers calculate with bits, 0 and 1 states represented by voltage across a transistor; quantum computers calculate with quantum bits or qubits, 0 and 1 states represented by two different states of a quantum system, like an electron filling one of two atomic energy levels.

The power of the quantum computer comes from the fact that during a calculation, qubits interact using the same mathematics that govern how subatomic particles like electrons or photons behave. This constrained form of linear algebra-plus-probability describes how qubits enter superposition, meaning they assuming multiple states at the same time, entangle, meaning the quantum states of two qubits are more strongly correlated than a pair of unrelated flipping coins, and interfere, meaning certain combinations of qubit states might become more likely while others become forbidden upon measurement. The outcome of a quantum computation will always be 0s and 1s.

Controlling a quantum system is far more easily said than done. Physicist David DiVincenzo famously proposed a set of five criteria that a device must satisfy in order to truly earn the “quantum computer” moniker. One must be able to construct qubits that they can control, that can scale, that maintain their quantum-ness long enough to actually do calculations, that they can perform a universal set of operations (gates) on, and each of which must be able to be measured. After decades of research and lots of money, researchers have only recently begun producing devices that can meet these criteria.

Given the challenge that quantum computers have posed to researchers, it’s safe to say that one can’t simply whip together a homemade quantum device that adheres to DiVincenzo’s criteria. So let’s set our sights a little lower. Let’s just try to devise quantum systems we can control, manipulate, and measure, using parts or resources we can buy ourselves.

Build Qubits from Photons and Optical Components

An optical setup used in a real photonic quantum computing lab (Image credit: Ben Burridge, Quantum Engineering CDT, University of Bristol)

Today, physicists at academic institutions, national laboratories, and companies are pursuing a quantum computing architecture called photonic quantum computing, which stores data on the properties of photons, or light particles. Given the fact that optical components are relatively easy to buy, photonic quantum computers are a good quantum system to try recreating on your own.

Building such a quantum computer requires a light source that produces consistent, controllable photons, and as few as possible — like a laser emitting tiny pulses or, if you’ve got some cash, a single photon emitter. You can store quantum information based on the photons’ polarization states, or simply by asking which of two optical fibers a photon has traveled through. You’ll also need optical components that can put photons into superposition and apply gates, like a beam splitter that splits photons into one of two paths and a device that can change the phase of the photons as they take on their respective paths. Finally, you need a camera or detector to determine what the final state of the photon is. This kind of photon-based quantum computer already has a name: the KLM protocol, named for physicists Emanuel Knill, Raymond Laflamme, and Gerard James Milburn and published in 2001. It’s one of several different optical quantum computing architectures currently under development.

How you proceed with actually building this device is a matter of how much control you’re hoping to have over the qubits. You can buy an optical table, state-of-the-art optical components like a pre-built Mach-Zender interferometer, single photon emitters, and sensitive detectors. Or you can go relatively DIY — Noah Wood, founder of quantum computing startup Spooky Manufacturing that offers solutions for quantum hobbyists, details how he built a cheap KLM-type quantum computer using a pulsed laser diode, a beam splitter that separates photons based on their polarization, and photoresistors here.

Merely putting photons into a superposition isn’t hard — The real challenge is producing entanglement, since photons don’t interact with each other, said Alex Moylett, Research Software Developer at Quantum Software company Riverlane. The computer generates entanglement by routing photons through series of optical fibers and applying phase shifts, after which the observer must also apply postselection schemes. Basically, the observer tosses out any computational outcomes that don’t demonstrate that entanglement occurred. Other adaptive schemes will measure some of the photons earlier on in the computation, re-applying the gate until entanglement has succeeded.

But if you were hoping for something a little less familiar than optical components, perhaps you can try controlling and manipulating another particle’s quantum properties: an electron’s spin.

Build Qubits the Old Fashioned Way: Using Nuclear Magnetic Resonance

A water sample next to a homemade NMR device (Image credit: Abe Asfaw)

An early front-runner in quantum computing architecture was based on nuclear magnetic resonance (NMR)— the same concept behind MRI machines. NMR devices aren’t as capable as today’s superconducting and trapped ion quantum computers, but scientists still employ techniques taken from NMR quantum computing in modern devices.

NMR quantum computers consist of a medium, often a liquid, held in a strong, constant magnetic field, perturbed with specially-tuned radio frequency pulses. The computer encodes information into an innate quantum property of atomic nuclei called their spin states, which you can think of as the base unit of a substance’s magnetism. Some atomic isotopes, like the hydrogen atoms in water and carbon-13, can serve as individual qubits with two spin states, usually called up and down. RF pulses can change the states of these qubits or cause their states to entangle between nuclei.

But unlike other quantum computing architectures where you control individual qubits, NMR requires the user to act on an ensemble of lots of molecules at the same time. This means that, instead of getting single-qubit measurements, a calculation returns an average of the behavior of every molecule in the medium, each of which serves as a tiny quantum processor. These ensemble measurements mean that NMR quantum computers are noisy and not very scalable. “That, and you’re stuck with the properties of the molecules that nature gives you,” said Sarah Sheldon, IBM Quantum Research Staff Member. And unlike superconducting quantum computers where you begin with all of your qubits in the ground state, an NMR computer requires additional postprocessing to emulate a qubit in the ground state.

But we’re not trying to build a good quantum computer — we’re trying to control and measure quantum states in our house.

Constructing an NMR quantum computer obviously requires the strongest electromagnet you can buy or build in order to maximize the signal you get out of the molecules. Inside that magnet, you can build a relatively simple setup — another solenoid whose wire is hooked up to an LC circuit that you use to tune the device to the proper frequency and read out the nuclei’s reaction to the pulses. You’ll also need an RF signal generator and an FPGA to customize the pulses.

Feel free to experiment with the medium, but possibilities include ethanol, acetone, glycerin, carbon-13 enriched chloroform, or even just the hydrogen atoms floating around in water (though you’ll only have one qubit to work with, in that case). The amount you spend to build your device depends on the magnet and the electronics you plan to use, but there are plenty of tutorials that will help you put together the basics. You can even just buy a pulsed-NMR device and take it apart.

Build Qubits By Trapping Ions

A 3D-printed particle trap (Image credit: Janna Zoe Vischer/Julia Woithe/CERN)

What if one wanted to build a more advanced quantum computer, like those that receive the bulk of the news media hype and that corporations are racing to build? Is that possible?

The two most advanced quantum architectures today are probably superconducting and trapped ion quantum computers. Superconducting qubits are beyond the realm of a hobbyist, given that they require lots of specially fabricated components and a dilution refrigerator. But at least one enterprising hacker, Yann Allain, is attempting to put together a trapped ion quantum computer at a “99% discount.”

Ions are a pretty straightforward quantum system — electronic states, like an atom in the ground state or an excited state, can serve as the qubit states. A system of AC- and DC- electrodes producing radio frequency fields called a Paul trap can confine the ions. Lasers are responsible for cooling the ions, ionizing the source particles, and reading out the ions’ states, and a microwave source (or more lasers) send pulses which initialize and send gates to the ions in order to control them. The whole thing needs to go inside a vacuum chamber to keep the noise down. That requires vacuum pumps, as well.

Your biggest challenge will likely be achieving a strong enough vacuum, creating your microwave or laser control setup, and in creating your Paul trap for trapping ions — perhaps start with trapping dust particles, and then go from there. Allain built his Paul trap using a Kickad design and a CNC (computer numerical control) subtractive manufacturing machine to etch his 2D trap into a ceramic chip. He said in his talk that he struggled to build the laser control system (he attempted to build his laser system from scratch for around 2,000 euros, rather than purchase a pre-built system for 25,000 euros). While brainstorming our own ion trap quantum computer using only commercial parts, University of California postdoc Sara Mouradian estimated that we could probably build a simple device that traps and can perform a few gates (with lackluster fidelity) for less than a hundred thousand dollars.

If you’re hoping to build something even more impressive, well, it’s a great excuse to go back to graduate school and get a physics degree. Perhaps you could even work on IBM’s quantum computers!

How Do I Control This Thing?

A figure demonstrating an interface between a quantum device — perhaps your homemade quantum device! — and OpenPulse. (Image credit: McKay et al, arxiv:1809.03452 (2018))

Your newly hacked-together device sitting on your workbench probably doesn’t feel like a computer if you’re programming it by turning knobs and pressing buttons on the panels of your control electronics. But that’s why companies are developing software that you can use to control your quantum device. And even though IBM’s own quantum computing hardware consists of superconducting qubits, Qiskit is meant to be hardware-agnostic.

“Whatever qubit you’re talking about — provided you’re doing gate-based computation and Qiskit understands the gates — it should work,” said Paul Nation, IBM Quantum Software Delivery Lead. But it’s going to be a lot of work on your end. For IBM’s own devices, there are several back-end steps that convert Qiskit code into the waveform that creates the pulse for the superconducting qubit. For your own machine, you’ll need to determine exactly what it means to apply simple quantum gates, like the X-gate that flips between the two qubit states or the Hadamard gate that puts the qubit into an equal superposition of the two states, and create the interface so Qiskit and your device can talk to each other. You can use the Qiskit Pulse feature to calibrate and calculate the coherence time of your qubits as well as send custom pulses where you control the pulse shape, frequency, and duration. You can learn more about interfacing between a quantum device and Qiskit as well as the OpenPulse language here.

—

Quantum computers take a lot of time, effort, and person-power to build, which is why companies and research institutions have entire dedicated teams trying to construct and understand these devices. But they’re not outside the realm of DIY tinkering. You really can build a quantum system using commercially available parts, and you can even control and program your device using open-source software like Qiskit. So, why not try it?

Were you able to craft your own quantum device and program it with Qiskit? We want to know! Email me at ryanfmandelbaum@ibm.com and we’d love to show off your creation on the Qiskit blog!