Mats Tage Axelsson in­tro­duces you to quan­tum com­put­ing, the coolest tech around; learn how it works, and how you can get started


An in­tro­duc­tion to the coolest tech around; learn how it works, and how to get started.

QUAN­TUM COM­PUT­ING has caught the at­ten­tion of large com­pa­nies, aca­demics, and hob­by­ists. We’re go­ing to cover the his­tory, the dif­fer­ent ways to make a quan­tum com­puter, and the logic be­hind pro­gram­ming. You’ll also learn about some pro­gram­ming tool­kits that you can use to get started.

To run a quan­tum com­puter, the physics has to be un­der­stood, so pro­gram­mers can ma­nip­u­late and mea­sure the fi­nal re­sults. Sci­en­tists have ob­served quan­tum ef­fects in pho­tons, elec­trons, and iso­topes of many ma­te­ri­als. This means en­gi­neers use su­per­con­duct­ing ma­te­ri­als, such as nio­bium and alu­minum, to con­struct work­able quan­tum com­put­ing sys­tems.

The logic gates are made of sil­i­con wafers, and are con­trolled us­ing mi­crowave emit­ters. These so­lu­tions may not be the best in the long run, but they’re the ones that are run­ning now. To use quan­tum com­put­ers, you need logic that takes ad­van­tage of the two core con­cepts: su­per­po­si­tion and en­tan­gle­ment. When you start ex­plor­ing these con­cepts, the Bloch sphere helps visu­al­ize what to do with dif­fer­ent gates. Pro­gram­mers can use clas­si­cal bit gates to­gether with quan­tum gates to cre­ate the al­go­rithms needed.

The main­stream me­dia hails quan­tum com­put­ers as sig­nif­i­cantly faster than cur­rent mod­els. It turns out they’re only fast in spe­cific ar­eas: cryp­tog­ra­phy, op­ti­miza­tion, sim­u­la­tion, and data­base searches. In cryp­tog­ra­phy, many al­go­rithms are safe, be­cause fac­tor­iz­ing large prime num­bers with clas­si­cal com­put­ers takes far too long to be prac­ti­cal. Shor’s quan­tum al­go­rithm can do it in min­utes. Op­ti­miza­tion and sim­u­la­tions can ben­e­fit from a quan­tum com­puter’s abil­ity to test many so­lu­tions at once.

Data­base searches are faster by a fac­tor of four. And with speed­ier data­base searches, ma­chine learn­ing also be­comes much faster.

The­his­to­ry­ofquan­tum­com­put­ers be­gins with quan­tum physics. In 1900, Max Planck first pro­posed

that light comes in dis­crete pack­ets, called quanta. This dis­cov­ery later led Ein­stein to show that Planck was right. When mea­sur­ing the pho­to­elec­tric ef­fect, sci­en­tists could ob­serve packet be­hav­ior. These two dis­cov­er­ies later led to quan­tum physics. Yet the deeper sci­en­tists dived into the quan­tum na­ture of things, the harder it got to ex­plain how it works. For quan­tum com­put­ing, the most in­ter­est­ing de­vel­op­ments are en­tan­gle­ment and su­per­po­si­tion.

Su­per­po­si­tion is where a par­ti­cle ex­ists in many po­si­tions at the same time. Con­sid­er­ing this, sci­en­tists con­cluded that a quan­tum com­puter should be pos­si­ble to build. A quan­tum com­puter is one that can do many cal­cu­la­tions per oper­a­tion.

THE CAT IN THE BOX The fa­mous physi­cist Schrödinger cre­ated a thought ex­per­i­ment. In it, he de­scribes a cat and a gas con­tainer in­side a box. The gas will poi­son the cat af­ter the ra­dioac­tive de­cay of an atom that re­leases the gas. The process is ran­dom, so ob­servers won’t know if the cat is dead or alive un­til they open the box. In quan­tum physics, this means that the cat is both alive and dead be­fore any­one ob­serves it. In the case of the cat, this is ab­surd, but in quan­tum physics, it’s nor­mal. What Schrödinger was say­ing was that there must be an­other ex­pla­na­tion— one as yet undis­cov­ered.

En­tan­gle­ment is where two par­ti­cles can have in­ter­twined states. This means that the state of one par­ti­cle is al­ways the op­po­site of the other, even when they are apart. In quan­tum com­put­ers, the soft­ware cre­ates en­tan­gle­ment; a CNOT gate cre­ates this state.

To make use of all the phe­nom­ena demon­strated in quan­tum physics, sci­en­tists needed a way to de­scribe what hap­pens on a small scale. To pro­gram a com­puter, it needs log­i­cal op­er­a­tions, or log­i­cal gates. Quan­tum gates and clas­si­cal logic gates are the same only up to a point. Quan­tum gates add fea­tures for chang­ing states and en­tan­gle­ment.

It took un­til the 1970s for the first at­tempt at a the­ory to use quan­tum ef­fects for com­put­ers. Shan­non in­for­ma­tion the­ory de­scribes clas­si­cal gates and other as­pects of data pro­cess­ing. For quan­tum com­put­ers, this is in­suf­fi­cient, be­cause it doesn’t specif­i­cally de­scribe quan­tum ef­fects.

Quan­tum in­for­ma­tion the­ory was first tried in 1976. Dur­ing the 1980s, sci­en­tists made more progress, in part thanks to quan­tum com­put­ing con­fer­ences or­ga­nized by MIT and IBM. Other de­vel­op­ments in­cluded quan­tum cryp­tog­ra­phy and the first univer­sal quan­tum com­puter.

To use all the states of the par­ti­cle you mea­sure, pro­gram­mers need a for­mal lan­guage. Quan­tum in­for­ma­tion the­ory needed to im­prove. The dif­fer­ent gates are the foun­da­tion for such a scheme.

Keep­ing track of what the dif­fer­ent quan­tum states are is

con­fus­ing. First of all, the way it works is counter-in­tu­itive at best. Sec­ond, there are many dif­fer­ent spin axles to keep track of. The sys­tem isn’t com­pli­cated, but it in­volves atyp­i­cal ap­proaches that are tricky to grasp. To make sense of all the state tran­si­tions, physi­cists cre­ated the Bloch sphere.

Peter Shor dis­cov­ered Shor’s al­go­rithm in 1994. This al­go­rithm solves the prob­lem of find­ing the prime fac­tors of large num­bers. The ba­sis of all en­cryp­tion is that you can’t, in a rea­son­able time, solve this prob­lem. Quan­tum com­put­ers may solve this prob­lem in min­utes. In­ter­est in quan­tum com­put­ers sub­se­quently sky-rock­eted.

Shortly af­ter Shor’s dis­cov­ery, Lov Grover in­vented the Grover al­go­rithm. This is best known as the data­base search al­go­rithm, but it’s also use­ful for other tasks.

Through the com­ing decades, sci­en­tists in­vented new fea­tures. Quan­tum er­ror cor­rec­tion and fault-tol­er­ant quan­tum com­put­ers were among the ma­jor ones. The first demon­stra­tion of a quan­tum com­puter took place in 1998. Af­ter this, de­vel­op­ment ac­cel­er­ated.


To date, there is a range of quan­tum com­put­ers in use. Re­searchers are us­ing ion traps, light-based, and mi­crowave-con­trolled BoseEin­stein con­den­sates. These types need dif­fer­ent con­trol mech­a­nisms. The ion traps use an elec­tro­mag­netic field to trap the ions. Lasers cre­ate the field, keep the ion trapped, and “pump” the state of the elec­tron of the ion. The elec­tron will emit light only when the state matches the laser’s fre­quency.

This is the log­i­cal 1 state, while the log­i­cal 0 state is the op­po­site. This makes it sim­ple to mea­sure, but achiev­ing pre­ci­sion is still a chal­lenge. Man­u­fac­tur­ing is also ex­pen­sive us­ing cur­rent tech­nolo­gies. Mean­while, a BoseEin­stein con­den­sate is a gas cooled to mil­likelvin tem­per­a­tures. When the gas reaches this tem­per­a­ture, all elec­trons take the same quan­tum state. Uses for this so­lu­tion are, so far, lim­ited to sim­u­la­tors—any ac­tual com­put­ers are pipe dreams.

The in­ter­est­ing types are the Joseph­son junc­tion types; these ac­tu­ally are run­ning in prac­ti­cal set­ups. IBM’s ver­sions are even avail­able for any­one who reg­is­ters on the Q Ex­pe­ri­ence web page.

The D-wave ma­chine uses Joseph­son junc­tions. These are su­per­con­duct­ing nio­bium and alu­minum-ox­ide gates. At tem­per­a­tures near ab­so­lute zero, a sen­si­tive mag­ne­tome­ter mea­sures their mag­netic prop­er­ties. The val­ues show the quan­tum state of the junc­tion, mak­ing the cir­cuit a qubit. The prin­ci­ple this com­puter uses is quan­tum an­neal­ing.

IBM uses Nu­clear Mag­netic Res­o­nance (NMR). The qubit is still a Joseph­son gate. That so­lu­tion uses mi­crowave trans­mit­ters to in­ter­act with the qubit.

The dif­fer­ence be­tween the two is that the IBM so­lu­tion con­trols qubits to a higher de­gree. This has made it eas­ier for Cana­dian com­pany D-Wave to man­u­fac­ture big­ger chips. At the same time, this lim­its D-wave to fewer ap­pli­ca­tions. For ex­am­ple, an an­neal­ing sys­tem can’t run Shor’s al­go­rithm or Grover’s. It’s use­ful for op­ti­miza­tion and ma­chine learn­ing—no won­der Google al­ready has one of its own D-wave quan­tum com­put­ers.


As men­tioned, the al­go­rithms in quan­tum com­put­ers are dif­fer­ent. To ex­plain what the dif­fer­ence is, you must bear in mind the physics in­volved. You prob­a­bly al­ready know that a con­ven­tional com­puter uses gates. The sys­tem uses Boolean logic to cre­ate the al­go­rithms for cal­cu­lat­ing ev­ery­thing. The most im­por­tant as­pect of this is that it’s de­ter­min­is­tic, so we only deal in cer­tain­ties. The an­swer is ei­ther yes or no—at least on the cir­cuit level.

In con­trast, quan­tum com­put­ing in­volves all an­swers hav­ing a prob­a­bil­ity at­tached to them. No

an­swer is cer­tain—rather, it is prob­a­bilis­tic. For this to be ef­fi­cient, the al­go­rithms must be adapted.

Quan­tum gates have an ef­fect on one or sev­eral qubits at a time. When you mea­sure qubits, the sys­tem usu­ally does a com­plete anal­y­sis of the en­tire sys­tem. So, if you’re search­ing for one qubit, that one will stick out like a sore thumb in one oper­a­tion. Note that one oper­a­tion is made up of many shots of the same gates. This is one of the rea­sons why quan­tum com­put­ers are faster than a con­ven­tional one.

The most com­mon sce­nario is to find the spe­cial num­ber of many, such as a data­base search. The other most cited case is for break­ing en­cryp­tion. Us­ing Shor’s al­go­rithm, you mea­sure the so­lu­tion by the ac­tion of the gates. The gates run the in­put a fixed num­ber of times be­fore find­ing the an­swer. That num­ber doesn’t change when the in­put is a higher num­ber. A clas­si­cal com­puter forces you to test all pos­si­ble an­swers. This means that when the num­ber reaches 2,048 you are fac­ing a po­ten­tial mil­lion years to solve it. More num­bers mean an ex­po­nen­tial work­load in­crease. The ef­fort to solve the prob­lem does not in­crease in a quan­tum com­puter.

LET’S HAVE A BLOCH PARTY Once you know how many states and tran­si­tions you have in each qubit, it’s time to code. Not so fast, though—there’s a vis­ual way to de­scribe the gates. The Bloch sphere is the ba­sis for all gates. The graph looks like a mu­sic score, so it’s called a quan­tum score. It looks a bit dif­fer­ent depend­ing on the plat­form, but in gen­eral, the strings across are qubits. When you want to change the state of a qubit, you place a gate on the string. To cre­ate en­tan­gle­ment be­tween two qubits, you drop the gate on one string and con­nect it to the other.

To de­scribe the quan­tum state of a par­ti­cle, you use spin, like a spin­ning ball. More pre­cisely, the an­gle the “ball” spins. Even though there are no balls in the clas­si­cal sense, the math de­scribes it well. When the equip­ment mea­sures an elec­tron, it’s in spin up or spin down in one axis. The sys­tem can only mea­sure in one di­men­sion at a time. The three are x, y, and z. If you mea­sure x, you lose all in­for­ma­tion about the spin state on the z and y axes. When you de­scribe the quan­tum state, you use an imag­i­nary ar­row in the Bloch sphere.

The top of the sphere rep­re­sents the qubit’s log­i­cal 0 and the bot­tom is log­i­cal 1. These are the only two states that the sys­tem can mea­sure with 100 per­cent cer­tainty. To get a re­sult in a quan­tum com­puter, you make many “shots” and get the most probable an­swer.

A matrix con­tains co-or­di­nates that show the ar­row’s an­gle. The length of the ar­row is al­ways 1. The val­ues we use to cal­cu­late the prob­a­bil­ity de­scribe the com­po­nents of the axes for the ar­row. The Bloch sphere rules the gates and their nam­ing.

The avail­able gates de­pend on the ap­pli­ca­tion and type of quan­tum com­puter. But the fol­low­ing are the com­mon ones. The Pauli X gate ro­tates the state around the x-axis, chang­ing the value of z. This gate is also a bit-flip gate. The Pauli Y gate ro­tates around the y-axis, chang­ing the x value and the z value. This gate is a bit-flip and a phase-flip gate.

So far, the gates only flip the bits and phases. These don’t deal with su­per­po­si­tion or en­tan­gle­ment. The Hadamard gate puts the qubit in a su­per­po­si­tion. To make that clear, the qubit will have a 50 per­cent chance of be­ing 0 or 1, flip­ping be­tween X and Z.

It will act like a dice, only us­ing two in a row will al­ways give the start­ing value. More gates that ex­tend the Hadamard gate are S and its trans­formed con­ju­gate.

To use en­tan­gle­ment, you use a CNOT gate, usu­ally de­picted with a plus sign in a circle and a line down to an­other qubit. The gate flips the tar­get qubit when the con­trol is 1.

Those are the ba­sic gates you’ll en­counter as you start out. On the IBM Q Ex­pe­ri­ence, you have the chance to also cre­ate sub­rou­tines. A bet­ter idea, though, is to use a de­vel­op­ment kit. There are many avail­able, and you can ex­tend your IDE with them. Eclipse, Net­beans, and Vis­ual Stu­dio have mod­ules. They use sev­eral lan­guages. The pro­gram­ming tools for Python, for ex­am­ple, are avail­able from IBM. Note that the rou­tines pre­pare scripts for the quan­tum com­puter— it doesn’t run Python on it.

So get crack­ing! You won’t cre­ate much at first, but we guar­an­tee you will have a lot of fun.

Pro­gram­mers use the Bloch sphere to il­lus­trate how quan­tum gates ma­nip­u­late the qubits.

When start­ing out, pro­gram­mers use a score, like a mu­sic score. The pic­ture shows Quirk, an on­line sim­u­la­tor. The cir­cuit is show­ing a Quan­tum Fourier trans­form.

Here, we’re em­ploy­ing Eclipse to de­velop our own quan­tum com­put­ing pro­grams. Note that this par­tic­u­lar tool­kit is us­ing Python as the sup­port­ing pro­gram­ming lan­guage.

Newspapers in English

Newspapers from Australia

© PressReader. All rights reserved.