Quan­tum com­put­ing

Mats Tage Ax­els­son in­tro­duces you to quan­tum com­put­ing, the coolest tech around. Learn how it works and how you can get started.

Linux Format - - CONTENTS -

Locked in his su­per-cooled com­put­ing base­ment Mats Tage Ax­els­son ex­plains how mere mor­tals can get work­ing with lit­er­ally the coolest tech around…

Quan­tum com­put­ing has caught the at­ten­tion of large com­pa­nies, aca­demics and hob­by­ists. This ar­ti­cle will 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 then 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­minium 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 will help vi­su­alise 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­mi­sa­tion, sim­u­la­tion and data­base searches. In cryp­tog­ra­phy, many al­go­rithms are safe be­cause fac­toris­ing large prime num­bers with clas­si­cal com­put­ers will take far too long for prac­ti­cal use. Shor’s quan­tum al­go­rithm can do it in min­utes. Op­ti­mi­sa­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 faster data­base searches, ma­chine learn­ing also be­comes much faster.

The his­tory of quan­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­iour. These two dis­cov­er­ies later led to quan­tum physics. Yet the deeper sci­en­tists dove 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 the phe­nom­e­non 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 op­er­a­tion. The cat in the box The fa­mous physi­cist Schrödinger created 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.

An­other phe­nom­e­non is en­tan­gle­ment, where two par­ti­cles can have in­ter­twined states. This means that the state of one par­ti­cle will al­ways be 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, de­scribed as 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 at­tempted 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­gan­ised by MIT and IBM. Other in­ter­est­ing de­vel­op­ments in­cluded quan­tum cryp­tog­ra­phy and the first univer­sal quan­tum com­puter.

To make use of 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 coun­ter­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­cist created 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

Schrödinger was a cat per­son “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, the cat is both alive and dead”

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.

Bose, Ein­stein and Joseph walk into a bar

To date there are a range of quan­tum com­put­ers in use. Re­searchers are us­ing ion traps, light-based and mi­crowave con­trolled Bose-Ein­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 and keep the ion trapped and to “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, with 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 Bose-Ein­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 solution 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 dif­fer­ent 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.

D-wave’s ma­chine uses Joseph­son junc­tions. These are su­per­con­duct­ing Nio­bium and alu­minium-ox­ide gates. At tem­per­a­tures near ab­so­lute zero, a SQUID mea­sures their mag­netic prop­er­ties. A SQUID is a sen­si­tive mag­ne­tome­ter. 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’s solution is Nu­clear Mag­netic Res­o­nance (NMR). The qubit is still a Joseph­son gate. That solution 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 solution 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­mi­sa­tion and ma­chine learn­ing – no won­der Google al­ready has one of its own D-wave quan­tum com­put­ers.

More is less work

As men­tioned ear­lier, 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 that are in­volved. As most Lin­uxFor­mat read­ers will know, 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 ac­cord­ingly.

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 op­er­a­tion. Note that one op­er­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 scenario 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 solution 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 2048 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. Note the dif­fer­ence is that 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 visual 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 that spin in the clas­si­cal sense, the math­e­mat­ics de­scribe it well. When the equip­ment mea­sures an elec­tron, it’ll be 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. So, if you mea­sure x, you lose all in­for­ma­tion about the spin state on the z- and y-axis.

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 qubits 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 prob­a­ble an­swer.

A ma­trix con­tains the co­or­di­nates that show the ar­rows 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, so keep that in mind when you try to un­der­stand.

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 both the x value and the z value. This gate is both 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 cir­cle 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 that you’ll en­counter as you start out. On the IBM Q Ex­pe­ri­ence, you have the op­por­tu­nity to also cre­ate sub­rou­tines. A bet­ter idea, though, is to use a de­vel­op­ment kit. There are many kits avail­able, and you can ex­tend your IDE with them. Eclipse, Net­beans and Visual Stu­dio have mod­ules. They use sev­eral clas­si­cal 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 you will have a lot of fun – we guar­an­tee it!

take a chance on me “In con­trast, quan­tum com­put­ing in­volves all an­swers have a prob­a­bil­ity at­tached to them. No an­swer is cer­tain – rather, it’s prob­a­bilis­tic”

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.