0% found this document useful (0 votes)
48 views40 pages

A Lambda Calculus For Quantum Computation

This document introduces a quantum lambda calculus as an alternative model of quantum computation. The calculus combines benefits of the quantum circuit and Turing machine models. It is closely related to linear lambda calculi used in studying Linear Logic. The calculus is set up with a computational model and proof system, and is argued to be equivalent to the quantum Turing machine. Examples show how known quantum algorithms can be expressed as simple programs in this calculus.

Uploaded by

tylerni7
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views40 pages

A Lambda Calculus For Quantum Computation

This document introduces a quantum lambda calculus as an alternative model of quantum computation. The calculus combines benefits of the quantum circuit and Turing machine models. It is closely related to linear lambda calculi used in studying Linear Logic. The calculus is set up with a computational model and proof system, and is argued to be equivalent to the quantum Turing machine. Examples show how known quantum algorithms can be expressed as simple programs in this calculus.

Uploaded by

tylerni7
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

a

r
X
i
v
:
q
u
a
n
t
-
p
h
/
0
3
0
7
1
5
0
v
5


3

A
p
r

2
0
0
4
A Lambda Calculus for Quantum
Computation
Andre van Tonder
Department of Physics, Brown University
Box 1843, Providence, RI 02906
[email protected]
July 15, 2003
Revised version: March 24, 2004
Abstract
The classical lambda calculus may be regarded both as a programming
language and as a formal algebraic system for reasoning about com-
putation. It provides a computational model equivalent to the Turing
machine, and continues to be of enormous benet in the classical the-
ory of computation. We propose that quantum computation, like its
classical counterpart, may benet from a version of the lambda calcu-
lus suitable for expressing and reasoning about quantum algorithms.
In this paper we develop a quantum lambda calculus as an alternative
model of quantum computation, which combines some of the benets
of both the quantum Turing machine and the quantum circuit mod-
els. The calculus turns out to be closely related to the linear lambda
calculi used in the study of Linear Logic. We set up a computational
model and an equational proof system for this calculus, and we argue
that it is equivalent to the quantum Turing machine.
AMS Subject classications: 81P68, 68N18, 68Q10, 03B70
Keywords: Quantum Computation, Lambda Calculus, Linear Logic,
Models of Computation
Brown preprint: BROWN-HET-1366
1
1 Introduction
Currently there exist two main approaches to the theory of quantum com-
putation: The quantum Turing machine, introduced by Benio and Deutsch
[1, 2], and the quantum circuit model, introduced by Deutsch [3]. These two
approaches were shown to be essentially equivalent by Yao [4].
The quantum Turing machine provides a fundamental model of quantum
computation that may be regarded as a baseline for dening universality.
However, reasoning about Turing machines can be a cumbersome process,
requiring word-at-a-time thinking while keeping track of complicated ma-
chine and tape states. Turing machine programs do not satisfy a simple
algebra.
For this reason, the quantum circuit model is more popular in the practi-
cal investigation of quantum algorithms. Quantum circuits are visual, com-
positional, and may be manipulated algebraically. However, no single nite
quantum circuit is universal. Indeed, Yaos proof of Turing equivalence relies
on the concept of uniform circuit families generated by classical computation
[4, 5]. To dene what we mean by such a circuit family, we need to rely on a
separate model of classical computation not described by any nite quantum
circuit.
In classical computation, the lambda calculus provides an alternative
computational model, equivalent to the Turing machine, which continues to
be of enormous utility in the theory of computation, in mathematical logic,
and in the study of computer languages and their semantics [6, 7, 8, 9, 10].
Due to its simplicity and expressive power, the lambda calculus has been
used as the basis of several powerful computer languages, including Lisp,
Scheme, ML and Haskell [11, 12, 13, 14].
In this article, we propose that quantum computing, like its classical
counterpart, may benet from an alternative computational model based on
a version of the lambda calculus suitable for expressing and reasoning about
quantum algorithms. We develop such a calculus, which turns out to be
closely related to the linear lambda calculi used in the study of Linear Logic.
We set up its computational model and equational proof system, and argue
that the computational model is equivalent to the quantum Turing machine.
The quantum lambda calculus combines some of the benets of both
quantum circuits and the quantum Turing machine. The quantum lambda
calculus describes functions that may be composed and manipulated alge-
braically, like quantum circuits. Programs can be algebraically transformed
2
into equivalent programs, and one can solve equations whose unknowns are
programs, in much the same way as one solves equations in high school al-
gebra [15]. Unlike quantum circuits, the quantum lambda calculus provides
a unied framework that is universal for quantum computation without the
need to rely on a separate model of classical computation.
In a practical vein, we show how various known quantum algorithms
may be expressed as simple programs in the lambda calculus. Indeed, the
calculi described in this paper may be used as a programming language for
prototyping quantum algorithms. In fact, the algorithms exhibited in this
article were transcribed into Scheme for testing. The simulator, which was
also written in Scheme, is available upon request from the author.
Since the rst version of this paper was written, some progress has been
made by the author in devising a typed version, with accompanying deno-
tational semantics, of a fragment of the quantum calculus described here
[16].
2 The classical lambda calculus
We begin by providing a reasonably self-contained introduction to concepts
and constructions in the classical lambda calculus that will be used in the
rest of the paper. The intended audience for this section includes physicists
and general computer scientists. The expert may skip this section and refer
back as needed.
The classical lambda calculus may be regarded both as a programming
language and as a formal algebraic system for reasoning about computation.
It was originally introduced by Church in the study of the foundations of
mathematics [17, 18]. Church postulated that it provides a universal model
of computation, which was later shown by Turing to be equivalent to the
Turing machine [19].
As a formal system, the lambda calculus has axioms and rules of inference,
and lends itself to analysis using the language and tools of mathematical logic.
Computation may be regarded as guided deduction in this formal system.
This provides a directed form of equational reasoning that corresponds to
symbolic evaluation of programs via a sequence of algebraic simplications
called reductions [6, 7, 8, 9, 10].
The syntax of the classical untyped lambda calculus is as follows: Ex-
pressions (also called terms) are constructed recursively from variables x, y,
3
z, . . . , parentheses, spaces, the period, and the symbol , according to the
grammar of gure 1.
t ::= terms:
x variable
(x. t) abstraction
(t t) application
Figure 1: Syntax of the lambda calculus
A term of the form (x. t) is called a functional abstraction. It represents
the function x t. For example, the identity function x x is written as
(x. x)
The dummy variable x here is called a bound variable, and conforms to
the usual rules governing bound variables in mathematical formulae. For
example, we identify expressions that dier only in the renaming of bound
variables.
A term of the form (t t) represents a function application. The sole means
of computation in the lambda calculus is the operation of applying a function
to its argument consistent with the following axiom:
((x. t) v) = t [v/x] ()
Here v denotes a value, to be dened shortly. Reading this axiom from left
to right denes an algebraic rewrite rule for transforming terms, substituting
the argument v in place of the variable x into the function body. This
transformation is called beta reduction. We will use the arrow to indicate
one (and sometimes more than one) beta reduction step. A reducible term
is called a redex.
Unabridged lambda terms can be painful to read. For this reason, we will
often introduce abbreviations using the symbol . In addition, we will often
omit parentheses according to the convention that nested lambda abstrac-
tions associate to the right and applications associate to the left.
Consider the simple program ((x. x) apple) where apple stands for some
term in our language. With the abbreviation id (x. x), this may be
4
written more legibly as (id apple), which should evaluate to apple. Indeed,
beta reduction gives
((x. x) apple) apple
in a single step.
In general, a computation consists of a sequence of beta reductions exe-
cuted according to some deterministic strategy until the resulting term can-
not be reduced any further, at which point the computation terminates.
A slightly more complicated example, which serves to show how multiple-
argument functions can represented in terms of nested single-argument func-
tions (a technique known as currying), is given by
apply f. x. (f x)
f. (x. (f x))
which represents a function that applies its rst argument f, which should
be a function, to its second argument x. Applying the identity function
to banana should give banana. To see this, the program (apply id banana),
which is shorthand for ((apply id) banana), is now executed by the following
sequence of beta reductions (underlining redexes)
((apply id) banana) (((f. (x. (f x))) id) banana)
((x. (id x)) banana)
(id banana)
banana
Often there is more than one reducible subterm at any given step and a
strategy is required to make the process unambiguous. For deniteness, we
will use a call by value strategy. This works as follows: Abstractions (terms of
the form (x. t)) are considered values and may not be reduced any further.
A function application (t t) may only be reduced if both the operator and the
operand are values. Otherwise the operator and operand must be reduced
rst. We will call the resulting calculus the call-by-value lambda calculus
v
.
Formally, we state the syntax for values [20, 21] in gure 2.
The reduction rules are listed in gure 3.
5
v ::= values:
x variable
(x. t) abstraction value
Figure 2: Values in the call-by-value calculus
v
,
t
1
t

1
(t
1
t
2
) (t

1
t
2
)
(app
1
)
t
2
t

2
(v
1
t
2
) (v
1
t

2
)
(app
2
)
(x. t) v t [v/x] ()
Figure 3: Reduction rules for the call-by-value calculus
v
We will denote by t the term, when it exists, obtained by fully reducing t
to a value.
We will often use a less cumbersome informal notation when dening
functions. For example, the apply function above satises the following prop-
erty
apply f x (f x)
under beta reduction. Given this specication, the translation into a lambda
term is straightforward.
How do we represent data in the lambda calculus? Since all we have at
our disposal are lambda terms, we need a way of encoding data as lambda
abstractions with specied properties. There is a technique which can be used
for any kind of data structure, which we will illustrate with two examples:
Natural numbers and lists.
Let us rst consider how the natural numbers may be represented. As
with any kind of data, we need a way to construct natural numbers and a
way to deconstruct them, extracting their constituents.
One possible encoding is as the sequence
0, 1 succ 0, 2 succ 1, . . . ,
6
where
0 x. y. (x id)
succ n. x. y. (y n)
are the constructors.
1
The above denitions were motivated by the need to
be able to dene a case expression (deconstructor)
case t
1
of (0 t
2
, succ m t
3
)
which may now be taken as an abbreviation for
t
1
(z. t
2
) (m. t
3
)
Here z denotes a variable that does not appear free in t
2
. This expression
allows us to deconstruct a natural number, extracting the ingredients that
went into its construction, i.e., either 0 or its predecessor m. It is indeed not
dicult to verify the following behavior under beta reduction:
case 0 of (0 t
2
, succ m t
3
) t
2
case succ t
0
of (0 t
2
, succ m t
3
) t
3
[t
0
/m]
As an example, it is now trivial to dene the predecessor function (with the
convention that pred 0 = 0)
pred n. case n of
_
0 0
succ m m
In order to program arbitrary computations, we need to verify that the
lambda calculus is suciently powerful to represent recursive functions. In-
deed, recursion can be used to represent any kind of iterative or looping
computation.
1
Explicitly
0 x. y. (x (w. w))
1 x. y. (y x. y. (x (w. w)))
2 x. y. (y x. y. (y x. y. (x (w. w))))
.
.
.
7
For example, in order to dene addition, we need an expression add which
behaves as follows under beta reduction:
add m n case m of
_
0 n
succ k add k (succ n)
where the subterm denoted by add on the left has copied itself into the body
of the term on the right hand side. One of the simplest ways of achieving
this is to dene [22]
add (t t) (1)
where
t f.
_
m. n. case m of
_
0 n
succ k (f f) k (succ n)
_
(2)
In other words, t is an abstraction consisting of the body of the addition
function with the combination (f f) in the position where add should insert
itself after reduction. It is a simple exercise to show that add indeed has the
specied behavior under beta reduction. This method can be applied to any
recursive function.
The computation of the program (add 2 2) then proceeds via the following
sequence of beta reductions:
add 2 2 add succ 1 2
case succ 1 of (0 2, succ k add k (succ 2))
add 1 succ 2 add succ 0 3
case succ 0 of (0 3, succ k add k (succ 3))
add 0 succ 3 add 0 4
case 0 of (0 4, succ k add k (succ 4))
4
The above technique can be generalized to arbitrary data structures. For
example, lists can be represented by the following constructors, which are
entirely analogous to those of the natural numbers
() x. y. (x id)
cons h. t. x. y. ((y h) t)
8
where () denotes the empty list and cons constructs a list consisting of a
rst (head) element h followed by a list t (the tail) containing the rest of
the elements. Again, the above denitions were motivated by the need to be
able to dene a deconstructor
case t
1
of (() t
2
, cons h t t
3
)
which may now be taken as an abbreviation for
t
1
(z. t
2
) (h. t. t
3
)
We will often abbreviate h : t (cons h t). We can dene tuples in terms
of lists as (x
1
, . . . , x
n
) x
1
: x
2
: : x
n
: (). Under beta reduction, we have
the behavior
case () of (() t
2
, h : t t
3
) t
2
case t
0
: t
1
of (() t
2
, h : t t
3
) t
3
[t
0
/h, t
1
/t]
showing how the case expression may be used to deconstruct the list, ex-
tracting its head and tail. To see how these abstractions are used, consider
the following recursive function
map f list case list of
_
() ()
h : t (f h) : (map f t)
which takes as input a function and a list and applies the function to each
element of the list. The reader may verify that, for example,
map double (4, 7, 2) (8, 14, 4), double x. (add x x)
Finally, we introduce some convenient notation. Since we can represent tuples
as lists, we can dene functions on tuples using notation such as
(x, y). t u. case u of
_
_
_
() ()
x : t

case t

of
_
() ()
y : t

t
For example, ((x, y). (add x y)) (7, 7) evaluates to 14. It is also useful to
have a notation for representing intermediate results. The let notation
let (x
1
, . . . , x
n
) = (t
1
, . . . , t
n
) in t
((x
1
, . . . , x
n
). t) (t
1
, . . . , t
n
)
9
allows us to write terms such as
let x = 1 in
let (y, z) = (2, 3) in
add x (add y z)
which evaluates to 6.
3 A quantum computational model
In this section we will construct a computational model, based on the lambda
calculus, suitable for describing quantum computations. The language used
will be an adaptation of the classical lambda calculus, extended with a set of
quantum primitives. We will denote it by
i
where the subscript stands for
intermediate. For reasons to be discussed in the next section, this language
is not suitable as a formal system. In particular, reduction in
i
does not
correspond to a simple system for equational reasoning. In section 5 we will
correct these deciencies to obtain the full quantum lambda calculus
q
.
In the classical lambda calculus, beta reduction consumes the program
to give the result. At each step, information is discarded, which makes the
process irreversible. For quantum computing, we need reduction rules that
take computational states to superpositions of states in a way that is unitary
and reversible.
Bennett [23] showed that any classical computation can be transformed
into a reversible computation. The construction, adapted to our situation,
is as follows: Let x denote the term being computed, and let : x (x)
denote a single beta reduction step. Instead of the non-invertible function ,
one considers the function x (x, (x)), which is invertible on its range. In
its simplest version, the computation proceeds as
x (x, (x)) (x, (x),
2
(x)) (x, (x),
2
(x),
3
(x))
More complicated schemes exist that reversibly erase the intermediate steps,
saving space at the expense of running time. Although this process does
not end by itself, we may observe it and regard the computation as having
terminated when
n+1
(x) =
n
(x), at which time we may stop the machine
by external intervention.
Although this scheme can be used to reversibly implement computations
in the classical lambda calculus, we will soon see that it does not work un-
modied in the quantum case.
10
In order to represent computations involving qubits, we will add a few
constant symbols as additional primitives to our language as in gure 4.
t ::= terms:
x variable
(x. t) abstraction
(t t) application
c constant
c ::= constants:
0 | 1 | H | S | R
3
| cnot | X | Y | Z | . . .
Figure 4: Syntax of the intermediate language
i
The symbols 0 and 1 here are primitives and should not be confused
with the abbreviations 0 and 1 of the previous section. Additional constants
H, S, . . . , will denote elementary gate operations on qubits. These should
include symbols for a universal set of elementary quantum gates [3, 24, 25].
For example, the set consisting of the Hadamard gate H, the phase gate
S, the /8 gate R
3
, and the controlled-not gate cnot is universal [25, 5].
Additional primitives, such as the the Pauli gates X, Y and Z, may be
added for convenience.
We now allow the state of a computation to be a quantum superposition of
terms in this language. As a model, one may imagine lambda terms encoded
as strings of symbols on the tape of a quantum Turing machine.
As a rst example, consider an initial state written in ket notation as
|(H 0) .
We would like to choose the transition rules of the quantum computer in
such a way that this string will evaluate to the Hadamard operator applied
to |0, which should give the superposition
1

2
(|0 +|1) of the states |0 and
|1 containing unit-length strings. The candidate reduction rule
|(H 0)
1

2
(|0 +|1)
|(H 1)
1

2
(|0 |1)
11
is not reversible. To make it reversible, we rst try the same trick as in the
classical case
|(H 0)
1

2
(|(H 0); 0 +|(H 0); 1)
=|(H 0)
1

2
(|0 +|1)
where we have factored out the common substring. The semicolon denotes
string concatenation. In this simple example, the answer indeed factors out
on the right. However, notice what happens if we apply this method to the
term
|(H (H 0))
1

2
(|(H (H 0)); (H 0) +|(H (H 0)); (H 1))

1
2
|(H (H 0))

_
|(H 0); 0 +|(H 0); 1 +|(H 1); 0 |(H 1); 1
_
Here the answer does not factor out. The fully reduced rightmost term is
entangled with the intermediate term in the history.
Note, however, that this scheme keeps more information than necessary.
For reversibility, it is sucient to record at each step only which subterm
has been reduced, and the operation that has been applied to it. We may
encode this in our example as follows (to be formalized below):
|(H (H 0))
1

2
(|( (H )); (H 0) +|( (H )); (H 1))

1
2
|( (H ))

_
|(H ); 0 +|(H ); 1 +|(H ); 0 |(H ); 1
_
=|( (H )); (H ) |0
Here we have at each step replaced subterms that do not need to be recorded
by the constant placeholder symbol . Now the answer does indeed factor out
on the right as required, consistent with H
2
|0 = |0. It is also clear that at
each step we have kept enough information to reconstruct the previous step,
thus ensuring reversibility.
12
v ::= values:
x variable
c constant
(x. t) abstraction value
Figure 5: Values in the intermediate language
i
The computational model may now be formalized with the following rules:
First, we extend our denition of values to include constants as in gure 5.
The computational state is taken to be a quantum superposition of sequences
of the form
h
1
; . . . ; h
n
; t
where h
1
; . . . ; h
n
will be called the history track and t will be called the
computational register. The classical subset of the transition rules is shown
in gure 6.
t
1
h
1
; t

1
H; (t
1
t
2
) H; (h
1
); (t

1
t
2
)
(app
1
)
t
2
h
2
; t

2
H; (v
1
t
2
) H; ( h
2
); (v
1
t

2
)
(app
2
)
H; ((x. t) v) H; ((x. t
x
) ); t [v/x] (
1
) if x appears free in t
H; ((x. t) v) H; ((x. ) v); t (
2
) if x not free in t
H; t H; ; t (Id) otherwise
Figure 6: Operational model for the classical subset of
i
In these rules H denotes the (possibly empty) history track, and t
x
is
obtained from t by recursively replacing all subterms that do not contain x
13
with the placeholder symbol and keeping x. More formally
t
x
if x not free in t
(y. t)
x
( . t
x
)
(t t

)
x
(t
x
t

x
)
x
x
x
(3)
These rules are sucient to make classical computations reversible, provided
that lambda terms which dier only by renaming of bound variables have
been identied. In this regard, we note here that in a quantum Turing
machine model, it is possible to represent terms on the tape of the quantum
Turing machine in an unambiguous way (e.g., using De Bruijn indices instead
of bound variables) [7, 8].
Here is an example computation:
|((apply id) banana) (((f. (x. (f x))) (z. z)) banana)
|(((f. ( . (f ))) ) ); ((x. ((z. z) x)) banana)
|(((f. ( . (f ))) ) ); ((x. ( x)) ); ((z. z) banana)
|(((f. ( . (f ))) ) ); ((x. ( x)) ); ((z. z) ); banana
|(((f. ( . (f ))) ) ); ((x. ( x)) ); ((z. z) ); ; banana
|(((f. ( . (f ))) ) ); ((x. ( x)) ); ((z. z) ); ; ; banana

At each step just enough information is kept to reconstruct the previous step.
Although in this particular example, termination can be tested by observing
and comparing the last expression in the history with , in general we do
not have a well-dened criterion for termination in the calculus
i
, due to
the fact that the state may involve a superposition of several computational
histories, some of which have terminated and others not. Thus, to observe
termination would potentially disturb the state. This problem will be solved
in the quantum calculus
q
of section 5.
In addition, we have some extra reduction rules involving the quantum
gate symbols such as:
The rules for quantum primitives are summarized in gure 8.
Here c
U
denotes any one of the quantum primitive symbols and U the cor-
responding unitary transformation, while stands for 0 or 1 in the case
14
|H; (H 0) |H; (H )
1

2
(|0 +|1)
|H; (H 1) |H; (H )
1

2
(|0 |1)
Figure 7: Operational model for H
|H; (c
U
) |H; (c
U
) U | (U)
Figure 8: Operational model for the quantum primitives of
i
of single-bit operators, or one of (0, 0), (0, 1), (1, 0) or (1, 1) in the case of
two-bit operators. For example
|(cnot (1, 0)) |(cnot ); (1, 1) .
4 Towards an equational theory
While the language
i
constructed in the previous section can be used to
describe quantum computations, reduction in
i
does not correspond to a
simple system for equational reasoning. This makes
i
unsuitable as a formal
proof system for quantum computation. We will discuss the problem in
this section and resolve it in the next with the introduction of the quantum
lambda calculus
q
.
In the classical lambda calculus, program evaluation through beta reduc-
tion can be regarded as a directed form of equational reasoning consistent
with the axiom
(x. t) v = t [v/x] ()
Indeed, the classical lambda calculus provides both a model of computation
and a formal system for reasoning about functions, a property we would like
to keep in the quantum case.
To understand the diculty, notice what happens when a function appli-
cation discards its argument (in other words, the argument does not appear
15
in the function body). For example
|((x. apple) banana) |((x. ) banana); apple
We see that in order to maintain reversibility, a record of the argument
banana is kept in the history. Restricting our attention to the computational
register, we see that its evolution is consistent with replacing the original
expression with an equal expression according to the axiom (). In other
words, in this example reduction is consistent with equational reasoning.
However, we run into problems when the discarded subterm is in a quan-
tum superposision with respect to the computational basis. For example,
consider the reduction of
|(x. 0) (H 0) |( (H )
1

2
_
|(x. 0) 0 +|(x. 0) 1
_
|( (H )
1

2
_
|(x. ) 0 +|(x. ) 1
_
|0
In the second step, a discarded subterm in a superposition is saved in the
history and the computational register becomes |0. However, if we were to
apply the axiom () to the contents of the computational register, we would
get the equation
1

2
_
|(x. 0) 0 +|(x. 0) 1
_
=

2 |0
which is invalid since the right hand side is not a legal normalized state.
As a second example, consider the following computation, where the inner
function discards its argument x:
|((y. ((x. y) y)) (H 0))

2
|( (H ))
_
|((y. ((x. y) y)) 0) +|((y. ((x. y) y)) 1)
_

2
|( (H )); ((y. (( . y) y)) )

_
|((x. 0) 0) +|((x. 1) 1)
_

2
|( (H )); ((y. (( . y) y)) )

_
|((x. ) 0); 0 +|((x. ) 1); 1
_
16
Now the computational register is entangled with the last expression in the
history. Ignoring the history, the computational register would be in a mixed
state with density matrix
_
1
2
0
0
1
2
_
However, an attempt to apply the equational axiom () to the contents of
the computational register would give
1

2
_
|((x. 0) 0) +|((x. 1) 1)
_
=
1

2
(|0 +|1)
which is clearly inconsistent.
5 A quantum lambda calculus
We will resolve the shortcomings of the language
i
by developing a quantum
lambda calculus
q
which has a consistent equational theory. This section
will be somewhat heavier on the formalities, and the reader who wishes to
see some concrete examples may wish to skip ahead to section 7 after reading
the introductory paragraphs.
The previous discussion suggests that the problems with equational rea-
soning in the presence of quantum operations can be avoided by preventing
functions from discarding arguments which may be in a superposition with
respect to the computational basis.
Let us call a subexpression denite with respect to the computational
basis if it is textually the same in all branches of the superposition. For
example, in the state
1

2
_
|(x. 0) 0 +|(x. 0) 1
_
the subexpression (x. 0) is denite, whereas the argument
1
2
(|0 +|1) is
non-denite. Denite subexpressions may be thought of as a classical re-
source. They can be observed without aecting the state of the computation.
On the other hand, non-denite subexpressions represent purely quantum re-
sources.
To avoid the problems pointed out in the previous section, we seek a
calculus that will keep track of whether an argument is denite or non-
denite, and which will make it impossible to write a function that discards
17
a non-denite resource. Calculi that are resource sensitive, known as linear
lambda calculi, have been studied intensively in recent years [26, 27, 28,
29]. So-called typed linear lambda calculi are very closely related to the
eld of linear logic [30, 31]. Linear logic is a resource sensitive logic where,
for example, certain assumptions may only be used once in the course of a
derivation.
For our purposes it will be sucient to study a simple untyped linear
calculus. The syntax is a fragment of the one introduced in [27], extended
with quantum operations as in gure 9.
t ::= terms:
x variable
(x. t) abstraction
(t t) application
c constant
!t nonlinear term
(!x. t) nonlinear abstraction
c ::= constants:
0 | 1 | H | S | R
3
| cnot | X | Y | Z | . . .
Figure 9: Syntax of the quantum calculus
q
Here terms of the form !t are called nonlinear. Nonlinear terms will be
guaranteed to be denite with respect to the computational basis, and may
be thought of physically as classical strings of symbols that may be discarded
and duplicated at will. On the other hand, linear terms may be non-denite,
possibly containing embedded qubits in superpositions with respect to the
computational basis. Abstractions of the form (!x. t) denote functions of
nonlinear arguments. In an abstraction of the form (x. t), the argument is
called linear.
A functional abstraction may use a nonlinear argument any number of
times in its body, or not at all. On the other hand, a linear argument must
appear exactly once in the function body (hence the name linear).
To enforce these rules, we require terms to be well-formed. This corre-
sponds to the constraint that linear arguments appear linearly in a function
18
body, and that all free variables appearing in a term !t refer to nonlinear
variables [28]. In the following examples, the terms in the left column are
well-formed, while those in the right column are ill-formed
2
(!x. 0) (x. 0)
(x. x) (x. !x)
(!x. (x x)) (x. (x x))
(y. (!x. y)) (y. (x. y))
(!y. !(!x. y)) (y. !(!x. y))
Well-formedness is a property that can be checked syntactically. For com-
pleteness, we formally state the rules for well-formedness [28], which the
reader satised with the above informal characterization may skip, in gure
10 .
These rules may be related to the typed linear calculi described in [28, 27]
by erasing the type annotations from the typing rules of the latter. Here
and denote contexts, which are sets containing linearity assumptions of
the form x and !x, where each variable x is distinct. If and are contexts
with no variables in common, then , denotes their union. For example,
the rule -E implicitly assumes that = . Rules may be read as
follows: For example, the promotion rule says that if t is a well-formed term
under the assumption that x
1
to x
n
are nonlinear, then !t is a well-formed
term under the same assumption. The condition = in (-E) ensures
that a linear variable can only appear once in the body of a formula. The
weakening and (-I) rules allow a function to discard a nonlinear argument,
whereas the contraction and (-E) rules allow us to duplicate a nonlinear
argument any number of times in the body of a function.
The well-formedness constraint prevents us from writing a function which
discards a linear argument. However, this is not sucient to prevent unsafe
computations without further specication of the substitution order. To see
this, consider the expression ((!x. 0) !(H 0)), which is well-formed. The
problem is that we are allowed to use ! to promote the expression (H 0) to a
nonlinear value, which can then be discarded. If we were allowed to reduce
2
Notice that while well-formedness guarantees that linear resources will be used ap-
propriately, it does not guarantee that terms are meaningful. For example the term
(y. (!z.0) y) is well-formed, but may or may not get stuck at run-time, according to
the operational model of gure 12, when applied to a linear or nonlinear argument respec-
tively. A typed calculus would be needed to specify which terms can be legally substituted
for y. For recent progress in this direction, see [16].
19
c
Const
x x
Id
!x
1
, . . . , !x
n
t
!x
1
, . . . , !x
n
!t
Pomotion
, x t
, !x t
Dereliction
, !x, !y t
, !z t [z/x, z/y]
Contraction
t
, !x t
Weakening
, x t
(x. t)
-I
, !x t
(!x. t)
-I
t
1
t
2
, (t
1
t
2
)
-E
Figure 10: Rules for well-formed terms in the quantum calculus
q
the subterm (H 0) rst, equational reasoning would give
|((!x. 0) !(H 0)) =
1

2
_
|((!x. 0) !0) +|((!x. 0) !1)
_
=

2 |0
which is an invalid equation since the last line is not a valid normalized state.
On the other hand, if we consider !(H 0) as an irreducible value, we may use
beta reduction immediately to obtain
|((!x. 0) !(H 0)) = |0
which is a valid result, since we are discarding the unevaluated expression
!(H 0), which is denite.
20
To prevent terms of the form !t from being evaluated, we follow Abramsky
[26] and extend our denition of values as in gure 11.
v ::= values:
x variable
c constant
(x. t) linear abstraction
(!x. t) nonlinear abstraction
!t !-suspension
Figure 11: Values in the quantum calculus
q
The computational model is described in gure 12
3
, where t is dened as in
(3).
t
1
h
1
; t

1
H; (t
1
t
2
) H; (h
1
); (t

1
t
2
)
(app
1
)
t
2
h
2
; t

2
H; (v
1
t
2
) H; ( h
2
); (v
1
t

2
)
(app
2
)
H; ((x. t) v) H; ((x. t
x
) ); t [v/x] ()
H; ((!x. t) !t

) H; ((!x. t
x
) ); t [t

/x] (!
1
) if x appears free in t
H; ((!x. t) !t

) H; ((!x. ) !t

); t (!
2
) if x not free in t
|H; (c
U
) |H; (c
U
) U | (U)
H; t H; ; t (Id) otherwise
Figure 12: Operational model for the quantum lambda calculus
q
According to these rules, quantum superpositions can only be created by
evaluating terms containing quantum primitives. The result of applying a
3
See [26, 32, 33] for related operational interpretations of linear lambda calculi. Our
evaluation model recomputes !-closures (see [32]).
21
quantum gate is a linear value, not preceded by a !. As we prove below,
there is no way of including such a linear value in a nonlinear subterm.
It follows that subterms that may be quantum non-denite will never be
discarded since, by (!
1
) and (!
2
), nonlinear functions can only be applied
to nonlinear terms.
Note that when a nonlinear function encounters a linear argument, it
simply gets stuck. More precisely, the rule (Id) applies.
The above reduction rules may create superpositions. However, such
superpositions are not arbitrary. Indeed, terms in a superposition will only
dier in positions containing the constants 0 and 1. Otherwise they will have
the same shape. We may formalize this by dening two terms to be congruent
if they coincide symbol by symbol except possibly in positions containing 0
or 1. It then follows that
Lemma 5.1. All terms in a superposition obtained via a reduction sequence
from a denite initial term are congruent.
Proof. The proof is by a simple induction on the length of the reduction
sequence, analyzing the reduction rules case by case.
Another case by case induction argument may be used to prove that
reduction preserves well-formedness. More precisely
Lemma 5.2. If t is well-formed and |H; t

i
c
i
|H

i
; t

i
, then all terms
t

i
appearing in the resulting superposition are well-formed.
4
Because terms appearing in a superposition have the same shape, it makes
sense to talk about specic subterms of the expression in the computational
register. We can therefore formulate the following lemma:
Lemma 5.3. Starting from a denite initial term, any !-suspension subterm
occurring during reduction is denite with respect to the computational basis.
Proof. This follows by induction on the length of the reduction sequence.
The initial term is denite by assumption. Assume that the lemma holds
after n steps. We have argued that all terms in a superposition obtained
from a denite initial term are congruent. They therefore have the same
4
Thanks to one of the referees for suggesting improvements in the exposition of this
section.
22
structure of subterms and the same reduction rule applies to them all. Since
we have argued that these terms are well-formed, there are then three ways
in which we may obtain a !-suspension subterm after n + 1 steps. First,
the suspension may not be part of the redex, in which case it is included
unmodied in the resulting expression. Second, it may be the result of beta
reduction of an application of the form
(x. ( x )) ( !t )
where !t is denite by the induction assumption. The result is ( ( !t ) ),
where !t has been copied without modication. Third, it may be the result
of beta reduction of an application of the form
(!x. !( x ) ) !t
where !t and !( x ) are denite by the induction assumption. This cre-
ates a suspension !( t ), which is denite because all its subterms are
denite. This completes the proof.
It is worth pointing out that we cannot create possibly non-denite sus-
pensions by reducing terms like
(x. !( x ) ) (H 0)
because x is linear, which implies that !( x ) is not a well-formed sub-
term.
Lemma 5.4. Given a denite initial term, the contents of the history track
remains denite throughout reduction.
Proof. We have argued that all terms in a superposition obtained from a
denite initial term are congruent. They therefore have the same structure of
subterms and the same reduction rule applies to them all. Since our reduction
rules allow only !-suspensions to be discarded (which saves a copy in the
history), and since !-suspensions are always denite by the previous lemma,
the result follows by induction on the length of the reduction sequence.
Since both the history and the shape of the term in the computational
register remain denite throughout reduction, we can state the following
conclusion
23
Corollary 5.5. Termination can be tested without disturbing the computa-
tion by observing the last term in the history. When this term becomes equal
to the placeholder , the result can be read o from the computational register.
Not only is termination a classical property, but so is the entire shape
of the term itself, i.e., term shapes can be implemented in classical memory,
and only their data slots need to point to qubits on a quantum device.
5
The fact that the history remains denite in
q
eliminates the specic
impediments to setting up an equational theory that were pointed out in the
previous section. Indeed, since the state of the computation is now always
guaranteed to be a direct product |H |c of the history |H and the com-
putational register |c, reduction can never lead to a computational register
|c that is in a mixed state. In addition, since |H remains denite, the
restriction of the reduction rules to the computational register will preserve
the normalization. We are therefore led to the following theorem:
t
1
t

1
(t
1
t
2
) (t

1
t
2
)
(app
1
)
t
2
t

2
(v
1
t
2
) (v
1
t

2
)
(app
2
)
(x. t) v t [v/x] ()
(!x. t) !t

t [t

/x] (!)
|c
U
U | (U)
Figure 13: Reduction rules for the quantum calculus
q
Theorem 5.6. In the quantum calculus
q
, the evolution of the computa-
tional register is governed by the reduction rules of gure 13.
Proof. This easily follows from a case-by-case analysis of the computational
rules of gure 12.
5
I would like to thank one of the referees for suggesting this improved formulation.
24
For example, consider the rule (!
2
) applied to a state of the form|H|c
where |c is a normalized superposition of the form

i
c
i
|(
i
((!x. t
i
) !t

)
i
)
in which, by lemma 5.1, all terms have the same structure and by lemma 5.3,
the subterm !t

does not depend on i. This then reduces to


|H

i
c
i
|( ((!x. ) !t

) ); (
i
t
i
[t

/x]
i
)
= |H; ( ((!x. ) !t

) )

i
c
i
|(
i
t
i
[t

/x]
i
)
with the computational register in the normalized state

i
c
i
|(
i
t
i
[t

/x]
i
),
consistent with applying the reduction rule (!x. t
i
) !t

t
i
[t

/x] to its con-


tents.
The big win is that we now have a simple set of reduction rules that can
be used to reason about the computation without having to keep track of
the history.
In order to dene an equational theory for this calculus, we will simply
dene a notion of equality that is compatible with the the reduction rules of
gure 13. Intuitively, reduction should be understood as a simple algebraic
operation of replacing subterms with equal subterms. However, we need to
take into account that reduction may not take place inside !-suspensions.
We therefore need to introduce algebraic rules governing just when we
can replace subterms in an expression with equal subterms [20, 21]. One way
to do that is to introduce the notion of a term context, which are expressions
with a hole [ ] in place of a subexpression:
C, C
i
::= [ ] | (t C) | (C t) | (x. C) | (!x. C) |

i
c
i
C
i
,
where the last term denotes a superposition of shape-congruent contexts. It
is important to note that there are no contexts of the form !( [ ] ). As
a result, subterms preceded by ! will be opaque in the sense that we will not
be able to perform substitutions under the ! sign.
25
Denition 5.7. The equational theory of
q
is the least equivalence relation
= containing the reduction relation () of gure 13 and which is closed
under substitution in term contexts [20, 21]. In other words
t
1
= t
2
C[t
1
] = C[t
2
]
(subst)
where C is an arbitrary term context and C[t] denotes the textual replace-
ment of the hole in C by the term t, extended by linearity to superpositions
of congruent terms and congruent contexts, i.e., for t =

i
c
i
t
i
, we dene
C[t] =

i
c
i
C[t
i
] and for C =

i
c
i
C
i
, we dene C[t] =

i
c
i
C
i
[t].
An alternative way of presenting the equational theory is by listing a set
of axioms and rules of inference as in gure 14. These rules should again be
t = t (re)
t
1
= t
2
t
2
= t
1
(sym)
t
1
= t
2
t
2
= t
3
t
1
= t
3
(trans)
t
1
= t
2
t
3
= t
4
(t
1
t
3
) = (t
2
t
4
)
(app)
t
1
= t
2
x. t
1
= x. t
2
(
1
)
t
1
= t
2
!x. t
1
= !x. t
2
(
2
)
(x. t) v = t [v/x] ()
(!x. t) !t

= t [t

/x] (!)
|(c
U
) = U | (U)
Figure 14: Equational proof system for the quantum calculus
q
understood as extending via linearity to congruent superpositions of terms.
In this formulation, the rules (app), (
1
) and (
2
) are together equivalent to
26
the term context substitution rule (subst) above. Again, there is no rule that
permits substitutions inside !-suspensions.
Theorem 5.8. In the quantum lambda calculus, the evolution of the compu-
tational register proceeds by replacing terms by equal terms according to the
equational theory of denition 5.7.
Proof. True by construction.
6 Recursion and a xed point operator
Recursive functions may be dened in the calculus
q
in a way analogous
to that described in section 2. We simply replace (t t) in equation (1) with
(t !t), where now t !f. ( (f !f) ).
Here we describe a related approach based on so-called xed point com-
binators. A xed point operator suitable for the linear lambda calculus is
given by the following adaptation of the classical Turing combinator
x ( (!u. !f. (f !((u !u) !f)))
!(!u. !f. (f !((u !u) !f))))
It is easy to check that under reduction
x !t t !(x !t)
where the !-suspension prevents further reduction of the term in brackets.
Recursive functions can be dened as follows: If
t !f. u
then it easily follows that
x !t u [(x !t)/f]
In other words, x !t copies itself into the body u of t under reduction, as
required for recursion.
27
7 Examples of algorithms
We are now ready to formulate some algorithms in the quantum lambda
calculus. First, we reproduce some classical constructions, now decorated
with the proper nonlinearity annotations.
First, we introduce list constructors that will enable us to build lists of
linear values (qubits or structures containing qubits)
() !x. !y. (x id)
cons h. t. !x. !y. ((y h) t)
with abbreviations h : t (cons h t) and (x
1
, . . . , x
n
) x
1
: x
2
: : x
n
: ()
as before. Since the arguments !x and !y above are nonlinear, we need to
redene our case abbreviation as follows:
case t
1
of (() t
2
, h : t t
3
)
now stands for
t
1
!(!z. t
2
) !(h. t. t
3
)
Deutschs algorithm [1, 5] can be very simply expressed as follows:
deutsch U
f
let (x, y) = U
f
((H 0), (H 1)) in
((H x), y)
Here the argument U
f
is assumed to be a function that takes (x, y) to
|1
|0
H
H
U
f
H
Figure 15: Deutschs algorithm
(x, y f(x)), where f is some (unknown) function of one bit. For example,
if f is the identity function, then we should take U
f
to be cnot . Indeed, the
reader may check that
|deutsch cnot |1
1
2
_
|0 |1
_
,
28
where the rst bit 1 = f(0) f(1) indicates that the function is balanced,
as required.
Let us write a simple expression that creates an EPR pair
epr cnot ((H 0), 0)
The quantum teleportation gate array with deferred measurement [34, 5] can
easily be translated into the following code: We create an EPR pair and
|0
|0
x
H
f
v f
v
H
X Z
v
v
Figure 16: Quantum teleportation
pass the rst EPR qubit, along with the unknown qubit x to be teleported,
to Alice. The outcome (x

, y

) of Alices computation then gets sent to Bob,


who has access to the second EPR qubit e
2
teleport x let (e
1
, e
2
) = epr in
let (x

, y

) = alice (x, e
1
) in
bob (x

, y

, e
2
)
Here
alice (x, e
1
) let (x

, y

) = cnot (x, e
1
) in ((H x

), y

)
and
bob (x

, y

, e
2
) let (y

, e

2
) = cX (y

, e
2
) in
let (x

, e

2
) = cZ (x

, e

2
) in
(x

, y

, e

2
)
The outcome of the computation consists of the list of three qubits (x

, y

, e

2
).
The teleported qubit is e

2
, but notice how linearity requires us to keep the
other two qubits in the answer. The reader may check that throughout
the computation, linear arguments are used exactly once. Implementing the
29
conditional operations cX and cZ in terms of the primitive constants is left
as an easy exercise.
Given recursion and lists, the map function, which applies a given function
f to each element of a list, may be dened as
map !f list case list of
_
() ()
h : t (f h) : (map !f t)
The arguments list, h and t may refer to qubits or data structures containing
qubits and are therefore chosen linear. The expression is well-formed because
list, h and t are each used exactly once.
It is now trivial to dene a program that computes a uniform superposi-
tion of a list of qubits by applying the Hadamard gate to each qubit in the
list:
H
n
list map !H list
For example, we may evaluate

H
n
(0, 0)
_

1
2
_
|(0, 0) +|(0, 1) + |(1, 0) +|(1, 1)
_
Note that the well-formedness conditions may be somewhat subtle, as the
following example illustrates. A naive attempt at dening an append function
that concatenates two linear lists
append x y case x of
_
() y
h : t h : (append t y)
fails to be well-formed. The problem can be seen by expanding the case
abbreviation
x !(z. y) !(h. t. (h : (append t y)))
Since y is a linear variable, we may not promote the subterms to nonlinear
values with the prepended !. An alternative denition that does work is
append x y
_
case x of
_
() (u. u)
h : t u. (h : (append t u))
_
y
Next we dene a reverse function
reverse list case list of
_
() ()
h : t append (reverse t) (h)
30
H R
2
R
3
R
n
v
v
v
H R
2
R
n1
v
v
H
R
n2
v


H
Figure 17: The quantum Fourier transform (without reversal)
The quantum Fourier transform [35, 36, 37] can now be dened as a direct
translation of the corresponding quantum circuit [5] as follows:
fourier list reverse fourier

list
where
fourier

list case list of


_
_
_
() ()
h : t let h

: t

= phases (H h) t !2 in
h

: (fourier

)
recursively applies the appropriate conditional phase operations to the rst
qubit in the list, using the helper function
phases target controls !n
case controls of
_

_
() (target)
control : t let (control

, target

)
= (cR !n) (control , target ) in
let target

: t

= phases target

t !(succ n) in
target

: control

: t

Here (cR !n) composes an appropriate combination of elementary gates to


implement a conditional phase operation with phase 2i/2
n
. Since this is
31
essentially a classical computation and depends on the particular set of prim-
itive constants chosen, we will not write it out here.
Note that we have assumed that the classical construction of the natural
numbers may be adapted to the quantum lambda calculus. That this is
possible for all classical constructions follows from the fact that there is an
embedding of the classical lambda calculus into the linear lambda calculus,
as shown in formula (4) of section 8.
8 Relating
q
to quantum Turing machines
In this section we will sketch a proof of the following theorem, leaving a more
rigorous analysis to future work:
Theorem 8.1. The computational model provided by the quantum lambda
calculus
q
is equivalent to the quantum Turing machine.
Proof. First, we argue that the quantum lambda calculus
q
may be e-
ciently simulated on a quantum Turing machine.
In
q
the current state of the computation consists of a superposition
of term sequences of the form H; t, which may be encoded as strings of
symbols on the tape of the quantum Turing machine. By lemma 5.1, term
sequences in dierent branches of the superposition are congruent, and the
same reduction rule will apply for all branches at each time step. The subset
of
q
not involving quantum operations consists of a set of reversible classical
rewritings, which can be unitarily and eciently implemented on a quantum
Turing machine by [2, 38, 39]. The fragment involving quantum operators
again involves simple classical rewritings followed by a unitary transformation
involving one or two symbols on the tape. Once again, the methods of
[2, 38, 39] may be used to construct a quantum Turing machine that can
execute these transformations. This completes the proof of the rst half of
the equivalence.
Next we argue that a quantum Turing machine can be eciently simu-
lated by the calculus
q
.
Yao shows in [4] that for any quantum Turing machine T, there is quan-
tum circuit C
n,t
that eciently simulates T on inputs of size n after t steps.
The circuit family C
n,t
may be eciently constructed via a classical compu-
tation. But
q
is universal for classical computation. This follows from the
32
fact that the classical call-by-value lambda calculus may be embedded in
q
via the following translation, adapted from [28]
(t
1
t
2
)

= ((!z. z) t

1
) t

2
x

= !x
(x. t)

= !(!x. t

)
(4)
So, given the specication of a quantum Turing machine and an input of
length n, a classical computation in
q
rst constructs a representation of
the appropriate quantum circuit family C
n,t
. It then follows the circuit di-
agram and applies the appropriate quantum operations one by one to the
input. Since
q
has primitive quantum operations available corresponding to
a universal set of quantum gates, this proves the second half of the equiva-
lence.
9 Related work
In a series of papers, Henry Baker [40, 41, 42] develops an untyped linear
language based on Lisp. His language is similar to the classical fragment of
the lambda calculus developed in the current article. It served as the initial
inspiration for the linear approach followed here.
Ideas stemming from linear logic have been used previously by Abramsky
in the study of classical reversible computation [43].
One of the earlier attempts at formulating a language for quantum com-
putation was Greg Bakers Qgol [44]. Its implementation (which remained
incomplete) used so-called uniqueness types (similar but not identical to our
linear variables) for quantum objects [45]. The language is not universal for
quantum computation.
The language QCL, developed by

Omer, is described in [46, 47]. QCL
is an imperative language with classical control structures combined with
special operations on quantum registers. It provides facilities for inverting
quantum functions and for scratch space management. No formal program
calculus is provided. A simulator is publicly available.
Another imperative language, based on C++, is the Q language developed
by Bettelli, Calarco and Serani [48]. As in the case of QCL, no formal
calculus is provided. A simulator is also available.
33
A more theoretical approach is taken by Selinger in his description of the
functional language QPL [49]. This language has both a graphical and a
textual representation. A formal semantics is provided.
The imperative language qGCL, developed by Sanders and Zuliani [50],
is based on Dijkstras guarded command language. It has a formal semantics
and proof system.
A previous attempt to construct a lambda calculus for quantum com-
putation is described by Maymin in [51]. However, his calculus appears to
be strictly stronger than the quantum Turing machine [52]. It seems to go
beyond quantum mechanics in that it does not appear to have a unitary
and reversible operational model, instead relying on a more general class of
transformations. It is an open question whether the calculus is physically
realizable.
A seminar by Wehr [53] suggests that linear logic may be useful in con-
structing a calculus for quantum computation within the mathematical frame-
work of Chu spaces. However, the author stops short of developing such a
calculus.
Abramsky and Coecke describe a realization of a model of multiplicative
linear logic via the quantum processes of entangling and de-entangling by
means of typed projectors. They briey discuss how these processes can be
represented as terms of an ane lambda calculus [54].
10 Conclusion
In this article we developed a lambda calculus
q
suitable for expressing and
reasoning about quantum algorithms. We discussed both its computational
model and its equational proof system. We argued that the resulting calculus
provides a computational model equivalent to the quantum Turing machine
and is therefore universal for quantum computation.
There are many possible directions for future work. The proof of Turing
equivalence should be eshed out. Formal issues relating to consistency and
semantics need to be addressed further. While our computational model
provides an operational semantics, the problem of providing a denotational
semantics is open. The formalism of [55] may be useful in this regard.
In this article, the introduction of a linear calculus was motivated by re-
quiring consistency of its operational model with equational reasoning. The
fact that linear arguments, denoting quantum resources, may not be dupli-
34
cated suggests a separate motivation for linearity, not addressed here, based
on the no-cloning theorem [56, 57].
While our calculus is untyped, it would be interesting to investigate typed
linear calculi with quantum primitives and, via the Curry-Howard correspon-
dence, the corresponding generalizations of linear logic [58, 59]. We might
mention that there have been prior attempts to relate linear logic to quantum
mechanics, starting with a suggestion by Girard [30, 60, 61].
On the practical side, the calculi described in this paper may be used as
a programming language for prototyping quantum algorithms. Indeed, the
algorithms exhibited in this article were transcribed into Scheme for testing.
The simulator, which was also written in Scheme, is available upon request
from the author.
It is our hope that the eld of quantum computation, like its classical
counterpart, may benet from the insights provided by the alternative com-
putational model provided by the quantum lambda calculus.
Note added
Since the rst version of this paper was written, some progress has been made
by the author in devising a typed version, with accompanying denotational
semantics, of a fragment of the quantum calculus described here [16].
Acknowledgments
I would like to thank Prof. Antal Jevicki and the Brown University Physics
department for their support. I would also like to thank the two anony-
mous referees for their brilliant, detailed and thoughtful comments leading
to various corrections and improvements in the exposition.
References
[1] P. Benio, The computer as a physical system: A microscopic quantum
mechanical Hamiltonian model of computers as represented by Turing
machines, J. Stat. Phys. 22 (5) (1980), 563-591.
35
[2] D. Deutsch, Quantum theory, the Church-Turing principle and the uni-
versal quantum computer, Proceedings of the Royal Society of London A
400 (1985), 97-117.
[3] D. Deutsch, Quantum Computational Networks, Proceedings of the Royal
Society of London A 439 (1989), 553-558.
[4] A. Yao, Quantum circuit complexity, in Proceedings of the 34th Annual
Symposium on the Foundations of Computer Science, IEEE Computer
Society Press, Los Alamitos, CA (1993) 352-361.
[5] M.A. Nielsen and I.L. Chuang, Quantum Computation and Quantum
Information, Cambridge University Press 2000.
[6] H.P. Barendregt, The lambda Calculus, North Holland, revised edition
(1984).
[7] J.C. Mitchell, Foundations of programming languages, MIT press 1996.
[8] B.C. Pierce, Types and programming languages, MIT press 2002.
[9] R.E. Davis, Truth, deduction and computation: logic and semantics for
computer science, Computer Science Press, New York 1989.
[10] C.A. Gunter, Semantics of programming languages: structures and tech-
niques, MIT press 1992.
[11] J. McCarthy, Recursive functions of symbolic expressions and their com-
putation by machine, part I, Communications of the ACM 3 (4) (1960),
184-195.
[12] D.P. Friedman, M. Wand, C.T. Haynes, Essentials of programming lan-
guages, MIT press 1992.
[13] L.C. Paulson, ML for the working programmer, Cambridge University
Press, 1996.
[14] P. Hudak, The Haskell school of expression, Cambridge University Press
2000.
[15] J. Backus, Can programming be liberated from the von Neumann style?
A functional style and its algebra of programs, Communications of the
ACM 21 (8), 1978.
36
[16] A. van Tonder, Quantum computation, categorical semantics and linear
logic, ArXiv.org e-print archive: arXiv:quant-ph/0312174 (2003).
[17] A. Church, An unsolvable problem in elementary number theory, Amer-
ican Journal of Mathematics 58 (1936) 354-363.
[18] A. Church, The calculi of lambda conversion, Princeton University Press
1941.
[19] A.M. Turing, On computable numbers, with an application to the
Entscheidungsproblem, Proc. London Math. Soc. (2) 42 (1936) 230-265;
Corrections in Proc. London Math. Soc. (2) 43 (1937) 544-546.
[20] G. Plotkin, Call-by-name, call-by-value and the -calculus, Theoretical
Computer Science 1 (1) (1976), 125159.
[21] M. Felleisen and R. Hieb, A revised report on the syntactic theories
of sequential control and state, Theoretical Computer Science 103 (2)
(1992) 235-271.
[22] O. Kiselyov, Many faces of the xed-point combinator, online article
http://okmij.org/ftp/Computation/xed-point-combinators.html, (Oct
1999).
[23] C.H. Bennett, Logical reversibility of computation, IBM J. Res. Develop.
17 (1973), 525532.
[24] A. Barenco, C.H., Bennett, R. Cleve, D.P. DiVincenzo, N. Margolus, P.
Schor, T. Sleator, J. Smolin and H. Weinfurter, Elementary gates for
quantum computation, Phys. Rev. A52 (1995), 3457-3467.
[25] P.O. Boykin, T. Mor, M. Pulver, V. Roychowdhury and F.
Vatan, On universal and fault-tolerant quantum computing,
arXiv:quant-ph/9906054 (1999).
[26] S. Abramsky, Computational interpretations of linear logic, Theoretical
Computer Science 111 (1-2) (1993) 3-57.
[27] P. Wadler, A syntax for linear logic, in Mathematical Foundations of
Programming Semantics: 9th International Conference, New Orleans,
LA, Proceedings 802 Springer-Verlag, New York (1993) 513-529.
37
[28] J. Maraist, M. Odersky, D. Turner and P. Wadler, Call-by-name, call-by-
value, call-by-need, and the linear lambda calculus, in 11th International
Conference on the Mathematical Foundations of Programming Seman-
tics, New Orleans, Louisiana, March-April 1995.
[29] R.A.G. Seely, Linear logic, *-autonomous categories, and cofree coalge-
bras, in Categories in Computer Science and Logic, June 1989, AMS
Contemporary Mathematics 92.
[30] J.-Y. Girard, Linear logic, Theoretical Computer Science 50 (1987) 1-
102.
[31] P. Wadler, A taste of linear logic, in Proceedings of the 18th International
Symposium on Mathematical Foundations of Computer Science, Gdansk,
Springer-Verlag, New York (1993).
[32] D.N. Turner and P. Wadler, Operational interpretations of linear logic,
Theoretical Computer Science 227 (1-2) (1999) 231-248.
[33] J. Chirimar, C.A. Gunter and J.G. Riecke, Reference counting as a com-
putational interpretation of linear logic, Journal of Functional Program-
ming 6 (2) (1996) 195-244.
[34] C.H. Bennett, G. Brassard, C. Crepeau, R. Jozsa, A. Peres, and W.
Wootters, Teleporting an unknown quantum state via dual classical and
EPR channels, Phys. Rev. Lett. 70 (1993) 1895-1899.
[35] D. Coppersmith, An approximate Fourier transform useful in quantum
factoring, IBM Research Report RC 19642 (1994).
[36] A. Ekert and R. Jozsa, Shors quantum algorithm for factorizing num-
bers, Rev. Mod. Phys. 68 (1996), 733-753.
[37] P.W Shor., Algorithms for quantum computation: discrete log and fac-
toring, in Proceedings of the 35th IEEE FOCS, (1994) 124134;
P.W. Shor, Polynomial-time algorithms for prime factorization and dis-
crete logarithms on a quantum computer, SIAM Journal on Computing
26 (5) (1997), 1484-1509.
[38] E. Bernstein and U. Vazirani, Quantum complexity theory, SIAM J.
Computing 26 (1997), 1411-1473.
38
[39] C.H. Bennett, E. Bernstein, G. Brassard, U. Vazirani, Strengths and
weaknesses of quantum computing, SIAM Journal on Computing 26 (5)
(1997) 1510-1523.
[40] H.G. Baker, Lively linear Lisp Look Ma, no garbage!, ACM Sigplan
Notices 27 (8) (1992), 89-98.
[41] H.G. Baker, A Linear Logic quicksort, ACM Sigplan Notices 29 (2)
(1994), 13-18.
[42] H.G. Baker, Use-once variables and linear objects storage manage-
ment, reection and multi-threading, ACM Sigplan Notices 30, 1 (1995),
45-52.
[43] S. Abramsky, A structural approach to reversible computation, Program-
ming Research Group Research Report RR-01-09, Oxford University
(2001).
[44] G.D. Baker, Qgol: A system for simulating quantum computations:
theory, implementation and insights, Honours thesis, Macquarie Univer-
sity (1996).
[45] E. Barendsen and S. Smetsers, Conventional and uniqueness typing in
graph rewrite systems, Computing Science Institute, University of Ni-
jmegen, Technical report CSI-R9328 (December 1993).
[46] B.

Omer, A procedural formalism for quantum computing, Master thesis,
Technical University Vienna (1998).
http://tph.tuwien.ac.atoemer/qcl.html
[47] B.

Omer, Classical concepts in quantum programming,
quant-ph/0211100 (2002).
[48] S. Bettelli, T. Calarco and L. Serani, Towards and architecture
for quantum programming, Eur. Phys. J. D 25 (2) (2003), 181-200.
arXiv.cs.PL/0103009 (2001).
[49] P. Selinger, Towards a quantum programming language, to appear in
Mathematical Structures in Computer Science (2003) 45 pages.
[50] J.W. Sanders and P. Zuliani, Quantum programming in Mathematics of
Program Construction, Springer LNCS, 1837:80-99, (2000).
39
[51] P. Maymin, Extending the lambda calculus to express randomized and
quantumized algorithms, quant-ph/9612052 (1996).
[52] P. Maymin, The lambda-q calculus can eciently simulate quantum com-
puters, quant-ph/9702057 (1997).
[53] M. Wehr, Quantum computing: A new paradigm and its type theory,
Talk held at Quantum Computing Seminar, Lehrstuhl Prof. Beth, Uni-
versitat Karlsruhe (1996).
[54] S. Abramsky and B. Coecke, Physical traces: Quantum vs. classical in-
formation processing, Electronic Notes in Theoretical Computer Science
69 (2003), arXiv:cs.CG/0207057 (2002).
[55] E. Kashe, Quantum domain theory - denitions and applications,
arXiv:quant-ph/0306077 (2003).
[56] D. Dieks, Communication by EPR devices, Phys. Lett. A 92 (1982),
271-272.
[57] W.K. Wootters and W.H. Zurek, A single quantum cannot be cloned,
Nature 299 (1982), 802-803.
[58] H.B. Curry and R. Feys, Combinatory Logic, Volume 1, North Holland,
1985. Second edition, 1968.
[59] W.A. Howard, The formulas-as-types notion of construction, in J.P.
Seldin and J.R. Hindley, editors, To H.B. Curry: Essays on Combi-
natory Logic, Lambda Calculus, and Formalism, Academic Press, New
York 1980, pp. 479-490. Reprint of 1969 article.
[60] V. Pratt, Linear logic for generalized quantum mechanics, in Proc. of
Workshop on Physics and Computation (PhysComp92), IEEE, Dallas
(1992), 166-180.
[61] S. Smets, What has Operational Quantum Logic to do with Linear
Logic?, presented at the Logic and Interaction Week 3, Marseilles,
France, February 2002.
40

You might also like