Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
S. Bettelli, T. Calarco and L. Serafini- Toward an architecture for quantum programming

S. Bettelli, T. Calarco and L. Serafini- Toward an architecture for quantum programming

Ratings:
(0)
|Views: 29|Likes:
Published by Gholsas

More info:

Published by: Gholsas on Dec 02, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

12/02/2011

pdf

text

original

 
Eur. Phys. J. D
25
, 181–200 (2003)DOI: 10.1140/epjd/e2003-00242-2
T
HE
E
UROPEAN
P
HYSICAL
J
OURNAL
D
Toward an architecture for quantum programming
S. Bettelli
1
,
a
, T. Calarco
2
,
3
,
b
, and L. Serafini
4
,
c
1
Laboratoire de Physique Quantique, Universit´e Paul Sabatier, 118 route de Narbonne, 31062 Cedex Toulouse, France
2
National Institute of Standards and Technology, 100 Bureau Drive, Stop 8423, Gaithersburg, MD 20899-8423, USA
3
ECT*, European Centre for Theoretical Studies in Nuclear Physics and Related Areas, Villa Tambosi,Strada delle Tabarelle 286, 38050 Villazzano, Italy
4
Istituto Trentino di Cultura, Centro per la Ricerca Scientifica e Tecnologica (ITC-IRST), Via Sommarive 18 - Loc. Pant`e,38050 Povo, ItalyReceived 25 June 2002Published online 30 July 2003 –c
EDP Sciences, Societ`a Italiana di Fisica, Springer-Verlag 2003
Abstract.
It is becoming increasingly clear that, if a useful device for quantum computation will ever bebuilt, it will be embodied by a classical computing machine with control over a truly quantum subsystem,this apparatus performing a mixture of classical and quantum computation. This paper investigates apossible approach to the problem of programming such machines: a template high level quantum language ispresented which complements a generic general purpose classical language with a set of quantum primitives.The underlying scheme involves a run-time environment which calculates the byte-code for the quantumoperations and pipes it to a quantum device controller or to a simulator. This language can compactlyexpress existing quantum algorithms and reduce them to sequences of elementary operations; it also easilylends itself to automatic, hardware independent, circuit simplification. A publicly available preliminaryimplementation of the proposed ideas has been realised using the
C++
language.
PACS.
03.67.Lx Quantum computation
1 Quantum programming
1.1 Introduction and previous results
In the last decade the field of quantum computing hasraised large interest among physicists, mathematiciansand computer scientists due to the possibility of solving atleast some “hard” problems exponentially faster than withthe familiar classical computers [1]. Relevant efforts havebeen concentrated in two directions: on one hand a (stillnot so large) set of quantum algorithms exploiting featuresinherent to the basic postulates of quantum mechanics hasbeen developed [2]; on the other hand a number of exper-imental schemes have been proposed which could supportthe execution of these algorithms, moving quantum com-putation from the realm of speculation to reality (see areview of basic requirements in DiVincenzo [3]).The link between these two areas is a framework fordescribing feasible quantum algorithms, namely a compu-tational model, which appears to have settled down to thequantum circuit model
1
, due to Deutsch [4], Bernstein and
a
e-mail:
bettelli@irsamc.ups-tlse.fr
b
e-mail:
Tommaso.Calarco@nist.gov
c
e-mail:
serafini@itc.it
1
Different computational models, involving physical systemswith continuous-variable quantum systems used as computa-tional spaces, are far less developed and will not be consid-ered in this paper. It should be noted however that any such
Vazirani [5] and Yao [6]. Though this is satisfactory fromthe point of view of computational complexity theory, it isnot enough for a practical use (programming) of quantumcomputers, once they will become available.A few papers can be found in literature concerningthe problem of 
scalable
quantum programming.An unpub-lished report by Knill [7], gatheringcommon wisdom of theperiod about the
QRAM 
model (see Sect. 2.1), moved thefirst steps towards a standardised notation for quantumpseudo-code pointing out some basic features of a quan-tum programming language (as an extension of a conven-tional classical language), though the interest was focusedmainly on quantum registers (see Sect. 3.1). This reporthowever did not propose any scheme for implementing an
automatic
translation of the high level notation into cir-cuit objects.Sanders and Zuliani [8] extended the probabilistic ver-sion of an imperative language (
pGCL
) to include threehigh level quantum primitives (initialisation, evolutionand finalisation). The resulting language (
qGCL
) is expres-sive enough to program a universal quantum computer,though its aim is more to be a tool for verification of theprocedures against their specifications
2
(
i.e.
for verifying
quantum device will most likely require very different interfaceabstractions from quantum circuits.
2
This work was extended in Zuliani’s DPhil thesis (OxfordUniversity) submitted in July 2001, which however was notavailable at the time of writing.
 
182 The European Physical Journal D
that a program really implements the desired algorithm)than to be the starting point for translation of quantumspecifications to low level primitives. A related paper byZuliani [9] showed an interesting technique for transform-ing a generic
pGCL
program into an equivalent but re-versible one, which has a direct application to the problemof implementing quantum oracles for classical functions(see Sect. 5.2).¨Omer [10,11] developed a procedural formalism (
QCL
)which shares many common points with the approach pre-sented in this article about the treatment of quantum reg-isters
3
.
QCL
is however an interpreted environment and isnot built on the top of a standard classical language. Inthis language, just like in
qGCL
, non trivial unitary op-erations are functions (
qufunct
or
operator
) instead of objects (see Sects. 3.2 and 5.1), so that their manipulationis subject to the function call syntax; hence automatic op-erator construction (
e.g.
controlled operators) and simpli-fication are very difficult to implement, if not impossible.Last, no notion of parallelism for independent operatorsis present (see Sect. 3.3).In the following section, building on top of these pre-vious works, a list of desirable features for a quantumprogramming language is presented.
2 Desiderata for a quantum programminglanguage
A common theme in the field of quantum computation isthe attempt to think about algorithms in the new “quan-tum way”, without being misled by classical intuition. Itcould seem that describing quantum computer algorithmsin an almost entirely classical way would hide rather thanemphasise the difference between quantum and classicalcomputing. The point of this common objection is not, of course, about criticising the assumption that the controlsystem which drives the evolution of the quantum devicedoes not behave according to classical mechanics. Rather,it could be originated by the guess that regarding a partof the quantum resources as
program 
and another one as
data 
, a sort of quantum von Neumann machine, could leadmore naturally to quantum algorithms. This guess hashowever been disproved by Chuang and Nielsen [12], whoshowed
4
that, if the program is to be executed determin-istically, nothing can be gained by specifying it through
3
Quantum registers in
QCL
are however dealt with in a nonuniform fashion: in addition to
qureg
, two other register typesare present, the
quvoid
and the
quscratch
, which, for a propertype checking, require the knowledge of the quantum devicestate.
4
The authors of [12] showed that a programmable quan-tum gate array,
i.e.
a quantum machine with a fixed evolu-tion
G
which deterministically implements the transformation
|
d
|
|
d
|
, is such that if 
1
and
2
aredistinct unitary evolutions up to global phase changes, then
|
1
and
|
2
are orthogonal.
|
here plays the role of the “program” and determines which operation
is to be ex-ecuted on the “data” register prepared in the state
|
d
. The
a quantum state instead of through a classical one. Theseconsiderationscan be summarised by saying that quantumalgorithms are specified inherently by means of classicalprogramming.Subject of this article is the investigation and specifica-tion of the desirable features of a quantum programminglanguage. The following list is a summary of the mainpoints:
completeness
: the language must be powerful enough toexpress the quantum circuit model. This means thatit must be possible to code every valid quantum algo-rithm and, conversely, every piece of code must corre-spond to a valid quantum algorithm;
classical extension
: the language must include (
i.e.
bean extension of) a high level
classical computing paradigm 
in order to integrate quantum computing andclassical pre- and post-processing with the smallest ef-fort.
Ad hoc
languages, with a limited implementationof classical primitives and facilities, would inevitablyfall behind whenever “standard” programming tech-nologies improve;
separability
: the language must keep classical program-ming and quantum programming separated, in orderto be able to move to a classical machine all those com-putations which do not need, or which do not enjoy anyspeedup in being executed on, a quantum device;
expressivity
: the language must provide a set of highlevel constructs which make the process of codingquantum algorithms closer to the programmer’s wayof thinking and to the pseudo-code modular notationof current research articles. The language must allowan automated scalable procedure for translating andoptionally optimising the high level code down to asequence of low level control instructions for quantummachines;
hardware independence
: the language must be inde-pendent from the actual hardware implementation of the quantum device which is going to be exploited.This allows “recompilation” of the code for differentquantum architectures without the programmer’s in-tervention.The next sections are organised along the followinglines. After a general introduction about the computa-tional model (Sect. 2.1), the guidelines for the envisionedlanguage (Sect. 2.2) are presented, together with a discus-sion on hardware requirements (Sect. 2.3). Section 3 thendescribes the syntax for high level constructs (Sects. 3.1and 3.2) as well as the low level, but still hardware inde-pendent, primitives to which these constructs get reduced(Sect. 3.3). Section 4 shows some code samples to clarifythe language layout. Section 5 discusses with more detailssome of the choices for the operator syntax (Sect. 5.1)and the open problem of the implementation of opera-tors for classical functions (Sect. 5.2). Appendixes (A.1,A.2, A.3) present possible approaches for implementingthe high level primitives previously described.
orthogonality of program states means that the program spec-ification is indeed a classical specification.
 
S. Bettelli
et al.
: Toward an architecture for quantum programming 183
Quantumresources(local or shared)Classicalhardware andsoftwareCode for elementaryquantum operationsResults of mesurements
Master Slave
Logical representationof quantum resourcesPhysical implementationof quantum resources
Fig. 1.
Simplified scheme of a
QRAM 
machine. The classical hardware drives the quantum resources in a master-slave config-uration; it also performs pre-processing and post-processing of quantum data. The only feedback from the quantum subsystemis the result of measurements.
2.1 The QRAM model
Before describing the structure of the proposed quantumlanguage, the quantum computer architecture which itis based on must be clarified. Quantum algorithms arecurrently described by (more or less implicitly) resort-ing to the
QRAM 
model (see
e.g.
Knill [7], Knill andNielsen [13]).A
QRAM 
machine is an extension of a classical ran-dom access machine which can exploit quantum resourcesand which is capable of all kinds of purely classical com-putations. This classical machine plays two roles: it bothperforms pre-processing and post-processing of data forthe quantum algorithms (trying to keep the quantum pro-cessing part as limited in time as possible in order to helppreventing decoherence), and controls the quantum sub-system by “setting” the Hamiltonian which generates therequired unitary evolution, performing initialisations andcollecting the results of measurements. In this scheme thequantum subsystem plays a slave role, while the masterclassical machine uses it as a black-box co-processing unit.This is summarised in the diagram in Figure 1.It must be noted that quantum resources are notnecessarily local
5
; they can be shared among different
QRAM 
machines for quantum type communication orquantum distributed computing. This can be handled bythe
QRAM 
model if the machine is given access to thehetero-controlled subsystem and to a classical synchro-nisation system (a quantum network interface), but thisarticle will not delve into the details of these situationsfurther.The quantum resource, independently from its actualhardware implementation, is treated as a collection of identical elementary units termed
qubits
; a qubit is anabstract quantum system whose state space is the setof the normalised vectors of the two dimensional Hilbertspace
C
2
, and can encode as much information as a point
5
Knill [7] notes that situations arising in quantum com-munication schemes “require operating on quantum registersin states prepared by another source (for example a quan-tum channel, or a quantum transmission overheard by aneavesdropper)”. It is likely however that these communicationschemes will require quite different hardware, so that one wouldend up with two quantum subsystems better than with one butmore complicated.
on the surface of a unit sphere (the Bloch sphere). Due tothe structure of the quantum state space, a qubit can en-code a superposition of the two boolean digits and is thusmore powerful than a classical bit, though the state cannot be read out directly. A collection of identical qubitsis not subject to the fermion or boson statistics, since thestate space of the qubits is in general only a portion of thestate space of the quantum system carrying the qubits, towhich the statistics applies.
2.2 A scheme for a quantum programming language
As already said, in order to perform a quantum computa-tion, the classical core of the
QRAM 
machine must modifythe state of the elements of the quantum subsystem it con-trols. In the proposed language these elements are indexedby addresses. Though in the following these addresses aretreated like unsigned integer numbers, thus abstractingthe underlying quantum device to a linear structure, itis by no means assumed that quantum memory is physi-cally organised as an array
6
. The goal of the addresses forquantum elements is simply to hide to the programmerthe details of the memory handling.It is well-known that the
no-cloning 
theorem excludesthe possibility of replicating the state of a generic quan-tum system
7
. Since the call-by-value paradigm is basedon the
copy 
primitive, this means that quantum program-ming can not use call-by-value; therefore a mechanism foraddressing parts of already allocated quantum data mustbe supplied by the language.In view of these considerations, a new basic data type,the
quantum register 
, is introduced in the proposed quan-tum computing language. Quantum register objects arearbitrary collections of distinct qubit addresses. Arbitrarymeans both that the size is bounded only by the amount of available quantum resources and that the addresses neednot be contiguous. Moreover, different quantum registers
6
It was so in very early schemes, like the seminal linearion trap by Cirac and Zoller [14], but many recent proposalswith a concern to scalability are geared toward an at least twodimensional implementation.
7
In other words, the transformation
|
φ
|
0
|
φ
|
φ
,where
|
0
is some fixed state and
|
φ
is variable, is prohibitedin quantum mechanics, because it is not linear.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->