Quantum Simulation Logic, Oracles, and the Quantum Advantage
\tcbsetsize=fbox,boxsep=3mm,colback=white,colframe=black \addbibresourceBib.bib
Query complexity is a common tool for comparing quantum and classical computation, and it has produced many examples of how quantum algorithms differ from classical ones. Here we investigate in detail the role that oracles play for the advantage of quantum algorithms. We do so by using a simulation framework, Quantum Simulation Logic (QSL), to construct oracles and algorithms that solve some problems with the same success probability and number of queries as the quantum algorithms. The framework can be simulated using only classical resources at a constant overhead as compared to the quantum resources used in quantum computation. Our results clarify the assumptions made and the conditions needed when using quantum oracles. Using the same assumptions on oracles within the simulation framework we show that for some specific algorithms, like the DeutschJozsa and Simon’s algorithms, there simply is no advantage in terms of query complexity. This does not detract from the fact that quantum query complexity provides examples of how a quantum computer can be expected to behave, which in turn has proved useful for finding new quantum algorithms outside of the oracle paradigm, where the most prominent example is Shor’s algorithm for integer factorization.
PACS number(s): 03.67.Ac, 03.67.Lx
Contents
 1 Preliminaries
 2 Quantum Simulation Logic
 3 The BernsteinVazirani Problem
 4 The DeutschJozsa Problem
 5 Oracles as a Comparison
 6 Grover’s Algorithm
 7 Simon’s Algorithm
 8 Shor’s Algorithm Factoring 15
 9 Conclusion
 A Constant and Balanced Functions for Three Bits of Input
 B Error Probability for Different Constructions of the Majority Function
One of the main problems in quantum information theory is to understand the resources needed for quantum computation. Here, a resource is a property used to enable the computational speedup, usually described as something consumed by the computation, but it could also be a static resource: a property present in one computational model but absent in another. Some properties that have been proposed as resources for quantum computation are interference [Feynman1982], entanglement [Einstein1935], nonlocality [Bell1964], contextuality [Kochen1967, Kleinmann2011, Howard2014], and even coherence [Baumgratz2014, Hillery2016]. It could also be that different algorithms makes use of different resources, or different combinations of resources, which further motivates resource studies in the context of specific algorithms.
From our perspective contextuality is clearly a top contender. If contextuality is the intrinsic property that gives quantum computers their advantage one would expect to find evidence of this even in simple algorithms. Our first attempt to study this started with the DeutschJozsa algorithm [Deutsch1985, Deutsch1992], that determines whether a given function is constant or balanced. This was the first proposed quantum algorithm that showed an exponential speedup compared to the bestknown classical algorithm, although this speedup only holds when requiring the solution to be deterministic. There are existing results on resources for this algorithm, for example, \textciteCollins1998 shows that for one and two qubits there is one implementation where entanglement is not needed. While this does not rule out implementations where entanglement is present, it does show that entanglement is not strictly needed for the algorithm to work. The question remains if contextuality is needed. Notable is that for one and twoqubit input, the oracles can be implemented with a stabilizer circuit, and while stabilizer circuits can be efficiently simulated [Gottesman1998], they can also produce phenomena like nonlocal and, in particular, contextual correlations. A similar framework, closely related to the stabilizer subtheory, is Spekkens’ model [Spekkens2007] which contains similar transformations, but does not produce nonlocal and contextual correlations. Spekkens’ model gives the same behavior as the stabilizer subtheory of quantum mechanics for one and twoqubit input functions.
Our question at this point was simply: what needs to be added to Spekkens’ model to enable threequbit inputs (or larger). To our surprise, what was needed was to add a new gate to Spekkens’ model \parenciteJohansson2017, without allowing for nonlocal correlations and without making it contextual. This addition enables all balanced functions on an arbitrarily large input, not only a subset thereof. In our paper, we show that for each problem instance there exists a realization in this new extended model, so that all balanced and constant functions at any size of the input can be reproduced. In addition, we show that the standard DeutschJozsa quantum algorithm, using the gates of the model, solves the problem with a single query.
Since nonlocal and contextual correlations are manifestly absent from the framework, the possibility of stating and solving each problem instance within the model, rules out these properties from being enabling properties. As before, this does not rule out implementations where entanglement or contextuality is present, but shows that they are not strictly needed.
Further, the model can be efficiently simulated on a classical probabilistic Turing machine, i.e., the algorithm is efficiently simulatable in a classical probabilistic Turing machine — with constant overhead — meaning that there is no speedup when comparing to the algorithm run on a quantum Turing machine.
Having established this framework, we turned to a second algorithm, Simon’s algorithm [Simon1994, Simon1997] that finds the generator of a hidden ordertwo subgroup. This algorithm is usually portrayed as the posterchild for quantum exponential speedup, and is regarded as stronger evidence since the speedup remains even if the solution is accepted with a bounded errorprobability. Also here our framework reproduces the behavior of Simon’s quantum algorithm [Johansson2017]. Thus, contextuality is not needed, and the algorithm is efficiently simulatable in a classical probabilistic Turing machine.
Both algorithms assume access to the function through a blackbox oracle, meaning that the solver only has access to the function’s input and output, not the internal structure of the oracle.
The framework used in [Johansson2017] is limited and puts hard structural constraints on the setup. In this paper, we extend the framework, allowing for a less strict setup resulting in an approximation that gives predictions closer to those of quantum theory. This builds further on the main idea of [Johansson2017] that the resources needed is the ability to choose to store, process, and retrieve information from an additional informationcarrying degreeoffreedom of the physical system.
We begin with some preliminaries (Section 1) and a thorough introduction to our framework (Section 2). We then start with a simple oracle problem called the BernsteinVazirani problem (Section 3), for which our model completely reproduces the results of the quantum algorithm. We also show that our approach works even when DeutschJozsa is considered both as a promise problem and as a decision problem (see Section 4). For Grover Search there is a speedup, but not as much as in the quantum case (Section 6), and also for Simon’s problem our model completely reproduces the results of the quantum algorithm (Section 7).
A more pressing question that these results point to, is whether the oracle model really can produce conclusive evidence for a separation between quantum and classical computation. We tend to believe it cannot, and definitely not for DeutschJozsa and Simon’s problems, see the discussion in Section 5. However, quantum algorithms that produce bounds for quantum query complexity do provide us with examples of how a quantum computer could be expected to behave, and inspire us to invent new approaches to nonrelativized computational problems. Shor’s algorithm[Shor1994, Shor1999] is one such example.
We do point out that there is no principal reason prohibiting our model (or a similar one) to have an effect outside of the oracle paradigm, and that our model is best compared with a construction suffering from systematic errors. In this spirit, we compare our framework with a current stateoftheart implementation of Shor’s algorithm (Section 8).
1 Preliminaries
In this section we go through some relevant theory helpful to understand the content of this paper, namely the concepts of Turing machines and oracles, and also a brief introduction to quantum computation.
1.1 Turing Machines
The concepts of Probabilistic Turing Machines (PTMs) and Quantum Turing Machines (QTMs) are essential here. While it is possible to use the formal notion of a Turing Machine that manipulates classical or quantum symbols on a strip of tape according to a table of rules, the comparison is made simpler by using the presentation of \textciteBernstein1993,Bernstein1997.
In their physicslike view of a PTM, they describe its time evolution as a sequence of probability distributions. At each time step, the distribution describes the likelihood of the machine’s configuration, and the probability assigned to any specific configuration is a real number in , to within a precision of for some integer . With a machine able to do coinflips, these numbers are reachable with a deterministic algorithm in time polynomial in . The probability distribution over all configurations at time is represented by a vector . The transition function taking the machine into the next configuration can be thought of as a stochastic matrix whose rows and columns index configurations, entries are probabilities, and the columns sum to one.
Bernstein1997 point out that stochastic matrices obtained from probabilistic TM are finitely specified and map each configuration by making only local changes to it, but even so, the support of the probability distribution can be exponential in the running time of the machine. Observing the PTM (or part of it) at a time step will yield a configuration (or partial configuration) sampled from the probability distribution, and the distribution is updated conditioned on the value observed, i.e., sampling shrinks the support of the distribution to only cover the observed configuration. This update does not change the future behavior of the machine, because the involved probabilities are additive. It is therefore only necessary to keep track of which configuration the machine is in, at each time step. So, even though the distribution may have a support that grows exponentially with running time, it is only necessary to keep track of a constant amount of information to trace the behavior of the machine as time progresses.
A similar physicslike view of a QTM assigns complex numbers called amplitudes, instead of probabilities, to the possible configurations. The resulting vector of complex amplitudes describes the QTM’s quantum state at each time step, as a linear combination of configurations known as a superposition, and the probability of observing a specific configuration is given by the absolute square of its amplitude [Born1954]. Further, observation of a measurement outcome enforces the state of the machine to be updated to be consistent with the outcome according to Lüders rule [Luders2006]. The quantum time evolution needs to keep track of the amplitude and phase of all the configurations because the involved quantities are not only added to each other; the components may cancel each other because of the phase. This phenomenon is known as interference, and is needed to reproduce the quantum behavior. Observation would restrict the configuration so that the interference is prohibited and therefore, in a QTM, observation may disturb its state and its later behavior. The result is that the possible exponential growth of the superposition support needs to be retained to reproduce the complete quantum behavior. In other words, it may be necessary to keep track of an exponentially increasing amount of information to trace the behavior of the machine as time progresses.
More details and the correspondence with the formal Turing Machine model can be found in \textciteBernstein1993,Bernstein1997. In what follows the time evolution will be divided into chunks known as gates as we will be using the circuit model of quantum computation. This has been shown to be polynomially equivalent to the QTM model by \textciteYao1993.
1.2 Oracle Turing Machines and oracle notions
A brief deviation into the standard definition of an oracle TM is needed, before we translate it into the physicslike description. A formal definition can be found in \textcite[73]Arora2009a, but here we will adopt the more suitable description of [Bennett1997]. An oracle TM has a special query tape and two distinguished internal states: a prequery state and a postquery state. A query is executed whenever the machine enters the prequery state, and causes the oracle to evaluate the query string present on the query tape (if no query is present the oracle performs a noop). The query string should be written in the form , i.e., the input to the oracle concatenated with a target bit , commonly initialized to 0, onto which the oracle’s answer is added modulo two. (Except for the query tape and change of internal state from pre to postquery state, other parts of the oracle TM do not change during the query.) The target bit is strictly speaking not needed for a classical oracle TM, since the answer could be overwritten onto the space used for the query string, but it can be added without loss of generality. More importantly, the target bit enables reversion of the oracle, sometimes known as “uncomputation” [Bennett1973], since the input equals and the target bit is already equal to , calling the oracle again will reset the target bit to . Extending this to several target bits is simple and can be done at a linear cost corresponding to one evaluation per target bit, most presentations condense this to a single evaluation per target bitstring.
Informally [Bennett1997] an oracle is a device that lets the machine evaluate some function at unit cost. Effectively, using an oracle the question becomes: if we could compute this function efficiently, what else could we then compute? With this in mind, oracles can be thought of as a tool used to calculate a lower bound on the resource requirement.
Reformulating this in the already mentioned physicslike description, we describe the evaluation of the oracle as a change in a single timestep, so that the evaluation has unit cost. We will later implement this physicslike description in terms of quantum or classical reversible gates that specify the map in each timestep. In this circuit model, an oracle constitutes a part of the circuit that counts as one single gate when analyzing its resource requirements. Normally, a circuit implementation of a function uses a query register from which the input is read, and an answer register where the result is added, bitwise modulo two (see Figure 1). The query register remains unchanged by the gate; this enables reversibility of the circuit implementation even for nonbijective functions, similar to the oracle TM model above. A simple extension of the argument of \textciteYao1993 can be used to show that this model is polynomially equivalent with the oracle TM model, taking into account that each output bit needs to be handled by a separate oracle in the formal model.
In oracle query complexity the relevant quantity is the number of calls an algorithm makes to the oracle. Each call is counted as one operation, or one unit of time, and this is the measure that will be used throughout this paper. As mentioned above, most of the problems that we will consider are decision and promise problems. The solver of a promise problem is guaranteed that the function is one of a few possible types, and the problem is to determine which it is.
It is conventional in computational complexity to consider the oracle as a black box. Sometimes however, and especially in the related field of cryptography, a wider definition is used to better capture the problem. In the context of analyzing the security of a cryptographic algorithm, an attack model or security model needs to be specified, stating assumptions on the power, knowledge, and access to the system available to an adversary. \textciteChow2002 explains that in the blackbox model the adversary is restricted to observe input and output from the cryptographic algorithm, in contrast to the whitebox model where he or she is assumed to have complete access to both the specific software implementation, and to the running environment of the algorithm. A graybox model is a mixture between these two extremes, and applicable whenever the adversary has access to some internal details of the algorithm, but not all.
As an example, consider that we know (are promised) the mapping of a cryptographic function and the problem is to determine an input parameter (a key) based on the output of the function. If access is given to the function in the form of a blackbox, then the problem is usually intractable. However, if the function runs on some hardware, then a more realistic model is that we can monitor its power consumption. This additional information may open up for a sidechannel attack known as power analysis; information about the key leaks out through the power consumption, and retrieving the key becomes tractable (see e.g., [Fransson2015]). Side channels naturally appear when the protocol is implemented in a physical system. This is an example of a graybox model since it only requires having an incomplete description of the machinery, we only need to have knowledge about the side effect resulting from the physical implementation, and not the full description as in the whitebox model.
Another example where these notions fit well is computational modeling and system identification [Bosch1994, 43], where the goal is instead to model or identify a process. In the whitebox setting, we have complete knowledge about the process, and a model can be built from first principles. In the blackbox setting we have no prior knowledge about the underlying process, and to our help is only the statistics generated by the inputoutput process. A graybox model corresponds to something in between, when we have partial knowledge about the process.
In the circuit model the different black and nonblackbox models will translate into the following

The whitebox model assumes that we know everything that we can know about implementation of the oracle. That is, we know the specific circuit that performs the function, and even how the computing machinery is built and operates.

The blackbox model assumes that we know nothing about the implementation of the oracles. We can only access inputs to and outputs from the circuit.

A graybox is some specified mixture of black and white, for instance, it could be that we have more knowledge about how the function is implemented, but not complete knowledge.
1.3 Quantum Computation
A QTM computer is a machine that operates on quantum bits, or qubits, rather than bits. Qubits are the elementary information carriers in quantum theory. They are twolevel systems that can be parameterized by two complex numbers and through the expression
(1) 
where and are the two orthogonal eigenstates to the PauliZ operator,
(2) 
These states are usually referred to as the computational basis states.
We will use two kinds of operations on these qubits, reversible transformations and measurements. Transformations relate to the classical bit operations and are described by unitary operators
(3) 
where () is the Hermitian conjugate, and the identity operator. These operators are also referred to as quantum gates. Measurements are used to retrieve information from these systems, and of particular use are projective measurements. In such a measurement the state is projected onto an eigenstate of an observable (a Hermitian operator), and the information retrieved by an observer from such a measurement is the eigenvalue corresponding to that eigenstate. The probability of obtaining a specific outcome from a specific observable depends on the state before measurement, and is given by the Born rule [Born1954]. The probability is given by the absolute square of the component (amplitude) in the direction of the eigenstate related to the outcome. As an example, the probability of finding the qubit represented by expression (1) in state , from measuring the observable, is . Furthermore, the state of the physical system is changed in a projective measurement to the eigenstate in question (or a vector in the eigenspace, in the degenerate case). The state is projected onto the eigenspace, hence the term projective measurement. The requirement that the probabilities of the different outcomes sums to one translates into normalization of the state so that .
There exists a third operation: preparation, that can be thought of as measurement on an unknown state followed by a unitary transformation that depends on the measurement outcome, such that the output eigenstate is rotated to the desired state. For a more thorough explanation of the primitives (and their generalizations that we do not treat here), see \textciteNielsen2010.
An important concept in quantum information theory is that of mutually unbiased bases. Take two sets of states and , both being bases for the quantum system. These two bases are said to be mutually unbiased if any pair of two states formed between the sets satisfy the condition
(4) 
where is the dimension of the system. Importantly, the lefthand side is constant, independent of bases and states, so that information retrieved from a projective measurement along one basis is completely unrelated to the information retrieved from a projective measurement in the other basis. [Bengtsson2007]
As an example, the bases spanned by the eigenstates of the Pauli operators and are 2dimensional and mutually unbiased.
(5) 
A transition between the computational basis and the phase basis, spanned by the eigenstates of , can be performed by the Hadamard gate by
(6) 
It also transform the Pauli operators according to
(7) 
Composition of systems of several qubits uses the tensor product, for example
(8) 
where the subscripts and indicates that the states describe two subsystems, but these are often dropped from the notation. The dimension of the tensor product vector space is the product of the constituent spaces, and therefore, computations involving qubits will have states described by a dimensional Hilbert space. States that can be written on the form (8) are called product states. The tensor product creates a Hilbert space (here, finitedimensional complex vector space) of all linear combinations of the possible separable states. Some of these linear combinations cannot be written as a product state as in Equation 8, and these are called entangled states.
The most wellknown twoqubit gate is the quantum CNOT gate. A CNOT is a controlledX operation; it applies to the target qubit conditioned on the control qubit. The graphical presentation is a dot on the control qubit, connected with a control line to the target gate, here an . For some examples of gate arrangements, see Figure 2. With as control and as target it has the effect
(9) 
where “” is the exclusiveOR, or addition modulo 2 so that
(10) 
This is the effect as seen from the computational basis. From the point of view of the phase basis, transforming the operator via Hadamard transforms, we obtain a different map (see Figure 2A), and it is easy to verify that, for example
(11) 
in total
(12) 
that is,
(13) 
This effect in the phase basis is sometimes called phase kickback [Cleve1998].
A controlled phase flip (Controlled or ) and a qubit swap (SWAP), that corresponds to classically swapping the qubits [Beckman1996], can also be constructed directly from the CNOT (see Figure 2A). The and SWAP behaviors correspond to small modifications of Equations 12 and 10.
Toffoli and Fredkin gates are controlled versions of the CNOT and SWAP, respectively. A Toffoli gives the map
(14) 
while a Fredkin gives
(15) 
A Toffoli gate with controlling qubits is called an Toffoli. Also, inverted (white) controls enables the gate if the control system is in state , and can be implemented by applying an before and after the control.
Since functions in quantum computation are constructed from unitary transformations, any function implemented needs to be reversible. The standard approach is to use the circuit model wherein the computation is described by a reversible circuit, and then replace the classical reversible gates by their quantum equivalents. Then, the circuit constitutes a unitary operation with the same mapping of the computational basis states as the classical analogue of a reversible circuit operating on bits. In contrast to the classical reversible function, there may be additional information to retrieve from the output of the query register. There is at least one additional information carrying degreeoffreedom that we can choose to retrieve information from, instead of retrieving the result of the computation. Of course, in classical reversible logic, we cannot expect to retrieve any additional information about the computation from the query register after such a transformation, see Figure 3.
A quantum oracle is an oracle assumed to be a specific unitary transformation acting on qubits (or other quantum systems) rather than on classical bits. (For a formal definition in the QTM model, see \textciteBennett1997.) Such an oracle is a unitary transformation, so it is necessarily a reversible map from qubits to qubits. A quantum oracle is usually described by a classical reversible logical function encoded into the computational basis of a unitary operator. Having access to such an oracle a quantum computer can exploit the ability to sample from some distributions related to the function, rather than just having access to the function itself. This will be further discussed in Section 5.
2 Quantum Simulation Logic
In what follows we will use Quantum Simulation Logic (QSL), which extends an earlier model for simulation of quantum mechanical systems known as Spekkens’ toy model [Spekkens2007]. That model views the quantum state as a state of the observer’s knowledge, an epistemic state, represented as probability distributions over a set of ontic states, and the ontic state is hidden away from the observer. The word hidden is key here, because the model restricts the knowledge an observer can have about the ontic state of the system; the knowledge balance principle states that the amount of knowledge an observer has about the system is at most equally large as the amount of knowledge an observer lacks about the system. This implies that there is a restriction to the allowed probability distributions that are used to describe states in the model.
Spekkens’ model associates the ontic states of a qubit system with the four points of the corresponding phase space. QSL indexes these four points using two bits of information, so that the ontic state is represented through two classical bits, details will follow below. Since the main part of the paper is about computation, the words ontic and epistemic will not be used below, but those acquainted with Spekkens’ model may find it useful to remember that the basic bit values in the QSL model are associated with Spekkens’ ontic states, and a probabilistic combination of different bitvalues correspond to Spekkens’ epistemic states, or indeed, correspond directly to quantum states of the simulated quantum system.
In this section we will see several examples of how QSL is similar to quantum theory. Some, but not all, of these examples can be stated directly in Spekkens’ toy model, and a few are even present in Ref. [Spekkens2007]. We include these to show how easy it is to follow the time evolution of a QSL system, protocol, or algorithm, as compared to the standard representation of Spekkens’ model, and to illustrate and get a feeling of how the QSL framework works. One should be aware that QSL extends beyond Spekkens’ toy model (through the Toffoli as described below), so some properties of Spekkens’ model do not hold in QSL, but QSL can in turn reproduce phenomena not reproducible in Spekkens’ model.
2.1 Elementary Systems
Each elementary QSL system is constructed from two classical information carriers that each can carry one bit of information. Yet, preparation and measurement only allow for storage of one bit of information or retrieval of one bit of information, while the other is destroyed through randomization, just as in Spekkens’ model. This gives the following description.
2.1.1 States
The state of an elementary system is represented by a tuple
(16) 
where and represent the bit values of the two classical carriers.
Preparing an elementary system to have a definite value in the bit corresponds to preparing a quantum system in the computational basis state , an eigenstate of the observable. For this reason, will be referred to as the computational bit. Since the elementary system only can carry one bit of information, the second bit is in this case necessarily described by an equally weighted random variable . In other words, to simulate the eigenstates of the observable we have
(17) 
Similarly, preparing an elementary system to have a definite value of the bit corresponds to preparing a quantum system in a phase basis state,
(18) 
These give us a simulation of eigenstates of the observable. For this reason, will be referred to as the phase bit. Also here, the other bit, in this case the computational bit, must be random.
Note that the state is associated with and the eigenvalue of the observable, and similarly, the state is associated with and the eigenvalue of the observable. In what follows, the observable will be used interchangeably with the projection , differing only in eigenvalues while retaining eigenvectors.
This brings us to the first analogy with quantum theory, namely the uncertainty principle. An observer cannot simultaneously make a value assignment to the complementary observables and , and having perfect knowledge about one implies having none about the other. This is true in both QSL and in quantum theory.
The information can also be stored in the correlation between the computational bit and phase bit. They are then either correlated or anticorrelated, and this simulates the eigenstates of the observable.
(19) 
Also here, each value of the bit XOR is associated with the eigenspaces of the observable.
These six are all the pure qubit states that we can simulate with a single elementary QSLsystem. In addition, we can represent the maximally mixed state that encodes that we have no knowledge at all about the system. The natural way to do that is to have both the computational and phase bit represented by two independent random variables.
(20) 
These seven QSL states are equivalent to Spekkens’ epistemic states [Spekkens2007]: the six pure states, and the maximally mixed state.
An elementary QSL system has a sample space of four discrete points, corresponding to the four ontic states in Spekkens’ model (the description with the four boxes appears in [Spekkens2007]),
(21) 
and with as the least significant bit (LSB) they have the canonical labeling
(22) 
Perhaps the most used method of calculating the similarity between two quantum states and is the absolute square of their inner product, . This is called the statistical overlap or transition probability [Uhlmann1976], and take on values between 0 and 1. If the states are parallel, then , and if they are orthogonal .
In QSL this quantity is the standard statistical overlap, or the complement of the Kolmogorov distance
(23) 
where and are distributions describing the states. States with disjoint support are perfectly distinguishable in the same way as orthogonal states are perfectly distinguishable, while states with overlapping support are not.
Another popular measure of similarity is the fidelity, which in QSL is given as the square root of the statistical overlap,
(24) 
The quantum fidelity between two mixed states and is given for general states by
(25) 
where Tr denotes the trace of the operator. If is pure this simplifies to , and if both states are pure to (see \parenciteJozsa1994). For an elementary system the fidelity between QSL states is completely equivalent with that between quantum states. As an example, the fidelity between and is , between and is , and between and any other state is (including the maximally mixed).
Note that the fidelity measure in QSL is not the Bhattacharyya coefficient
(26) 
that is usually taken as the classical analogue to quantum fidelity [Fuchs1999].
The quantum states of a qubit have a geometrical representation called the Bloch sphere. It is a unit ball where all pairs of antipodal points on the surface correspond to orthogonal pure states, and inside the surface resides the mixed states.
The QSL states in relation to the Bloch sphere is shown on Figure 4. Their positions are motivated by the relations of Equations 17, 19 and 18 to mutually unbiased pairs of orthogonal quantum states. The states in each pair have disjoint support, and each state has a statistical overlap with any state in any other pair; they form mutually unbiased partitions of the state space.
2.1.2 Transformations
Unitary transformations are reversible maps on quantum states. It is therefore natural to simulate these with operations from classical reversible logic on the bits composing a QSL state.
In identifying which transformations that correspond to which quantum gates, we start with the transformation. This operation inverts the states of the computational basis and leaves the phase basis unchanged.
(27) 
Therefore the corresponding QSL gate flips the computational bit and leaves the phase bit unchanged (see Figure 5),
(28) 
or as the permutation in the cyclic notation.
In the same way, the gate inverts the phase basis and leaves the computational basis unchanged.
(29) 
Hence, the QSL Zgate flips the phase bit instead of the computational bit
(30) 
or .
In QSL the states that correspond to eigenstates of can be singled out as those that preserve the parity between the computational and phase bit, . The only way a transformation will preserve that while also inverting the computational and phase basis, is to flip both bits.
(31) 
This corresponds to the permutation . Figure 5 shows a graphical representation of these transformations. Blue line segments represent the computational bit and red represents the phase bit.
As in quantum theory these transformations uphold the identities
(32) 
but composition of these gates also shows a difference between QSL and quantum theory. The identity
(33) 
is not upheld, but instead
(34) 
Another useful transformation is the Hadamard gate. This quantum gate obeys
(35) 
while also being an involution, . In QSL the mapping that simulates this is the one that swaps the computational and phase bit.
(36) 
This permutation, which in cyclic notation is given by , is identified as the analogue of the Hadamard gate in [Pusey2012], and indeed,
(37) 
Note that the analogy is not complete, because in quantum theory we have
(38) 
while in QSL
(39) 
The last single qubit gate that we describe is the gate. This is the square root of the Zgate,
(40) 
which has an order of four. By defining it as
(41) 
which is equivalent with the permutation , and with
(42) 
we see that Equation 40 and the quantum identities
(43) 
are obeyed since
(44) 
but again, while we expect
(45) 
QSL instead gives
(46) 
Figure 6 shows a graphical representation of the simulation of the Hadamard, , and gates.
All of these transformations are generated by and (, , , ), which also generate the group of transformations that Spekkens allows for in his model, the symmetric group on four symbols [Judson2016, 68]. This is because gives the 4cycle and gives the 2cycle of adjacent elements in that 4cycle.
Another way to view this [Spekkens2007] is through the Bloch representation. Figure 7 shows the effect of , , , and , on the six QSL states.
We can see that the and transformations have the expected effect, considering that in the Bloch sphere representation they can be viewed as rotations around the and directions respectively (see Figure 7A and Figure 7B). However, the expected effect of the Hadamard gate is to also flip the states along , but this is not the case in QSL (see Figure 7C). Finally, the quantum gate correspond to a plane rotation of the Bloch sphere, while the QSL simulation also flips the states along (see Figure 7C).
Spekkens recognizes this and shows that some transformations, like those we relate to and gates, correspond to antiunitary maps in the Bloch sphere representation. \textciteSkotiniotis2008 connected the subgroup of 12 even permutations to unitary maps, while the odd permutations correspond to antiunitary maps.
It is surprising that these faulty identities, or systematic errors, exist at the level of simulating qubits, but that the simulation can reproduce many phenomena even when the system size grows. There will be many examples of this in the rest of this paper.
2.1.3 No Universal Spin1/2 Inverter
A universal state inverter is a transformation that takes an arbitrary state and produces an orthogonal state . Such a device is not allowed by quantum theory [Rungta2001]. For a pure qubit state the operation inverting the spin is given by a composition of , , and complex conjugation [Wootters1998]. Here represents the complex conjugated state. In the Bloch sphere representation the spin flip operation is such that
(47) 
where is the Bloch vector and is the Pauli vector. In general
(48) 
where flips the sign of the component in the Bloch vector, flips the sign of the component, and conjugation flips the sign of the component. This is an antiunitary map and cannot be implemented with the dynamics of a quantum system.
In QSL, because of the existence of transformations that correspond to antiunitary maps in the Bloch sphere representation, one may be tempted to think that a universal spin1/2 inverter could be possible. This is not the case, because a device that takes an arbitrary QSL state and produces the disjoint state must obey the following three conditions.

Map the eigenstates of to each other. This is done by flipping the phase bit while doing nothing to the computational bit.

Map the eigenstates of to each other. This is done by flipping the computational bit while doing nothing to the phase bit.

Map the eigenstates of to each other. This requires changing the parity between the computational and phase bit.
The third condition cannot be obeyed without violating the other two.
2.1.4 Measurement
A measurement in QSL consists of information retrieval followed by a state update to ensure that only one bit of information can be known about an elementary system. This is completely equivalent to Spekkens’ model, and simulates measurement disturbance, or the update of a quantum state after a measurement (sometimes called collapse). The specifics are as follows.
A projective measurement of in QSL returns the computational bit and randomizes the phase bit, while measuring the observable instead reads the phase bit and randomizes the computational bit. Remember that the phasebit value 0 is associated with a positive relative phase between the computational states, and the phasebit value 1 is associated with a negative relative phase. Finally, measuring returns the parity of the computational and phase bit and then randomizes both the computational and phase bits while preserving parity, that is, if measuring yields , then the system is updated randomly to either or , and if , the system is updated randomly to either or .
This ensures repeatability of measurements, i.e., if a projective measurement is repeated, the second measurement will yield the same outcome as the first. It also ensures measurement disturbance, prohibiting that the bit values not measured can be predicted after the measurement. The connection with mutual unbiasedness is clear. Information retrieved from one of these measurements is unrelated to the information retrieved from the other. That is, we can retrieve either the computational bit, the phase bit, or the parity between them, never two of them, or indeed three.
2.1.5 Preparation
To prepare a system that simulates or , we create a system with the computational bit or respectively, and the phase bit is chosen randomly. In the same way we can prepare QSL states simulating and by distributing and according to the respective distribution.
Preparation by measurement can also be performed, by taking a maximally mixed state (the state of no knowledge, with both computational and the phase bit randomized), measuring some observable to obtain information on the state, and then transforming the now known state into the desired state.
2.1.6 Noncommutativity of Measurements
In quantum theory the order of measurements performed is of importance to their outcomes. Consider for instance that we have prepared a quantum state and then we measure the observables and . If is measured first it will produce the outcome 0 with certainty, and then will randomly yield the outcome 0 (for ) or 1 (for ) with equal probability. If the order of the measurements is reversed, both measurements of and will instead produce independent random outcomes.
In QSL the outcomes are, for this particular protocol, in complete compliance with quantum theory. To simulate the above procedure we start by preparing the QSL state
(49) 
Measuring will return the computational bit which will always be , and randomize the already random phase bit, so that the state changes from to . Measurement of will then return the new random value of the phase bit and randomize the computational bit. If we instead start by measuring the outcome will be the random value while the computational bit is randomized so that the state changes from to . A subsequent measurement of will retrieve .
2.1.7 Qkd — Bb84
Having built up the model for simulating single qubit systems, let us now consider a cryptographic protocol that only requires a single qubit system. In 1984, \textciteBennett1984 presented a protocol for distributing a cryptographic key, with the property that an eavesdropper can in principle be detected, and then the compromised key can be discarded.
The protocol is shown in Figure 8 and proceeds as follows. In one round of the protocol Alice wants to send a random bit to Bob. Alice encodes this bit in a one of two bases, {,} or {,}. The bitvalue is encoded in either or , and into or . Alice chooses the encoding randomly, and Bob chooses to perform a measurement in one of these two bases, also randomly. If Bob chooses the same encoding as Alice, then he receives the bit , otherwise he retrieves or with equal probability.
This procedure is now repeated a number of times, and after a sufficiently long sequence they stop and share the encoding they used. Both Alice and Bob can now deduce in which rounds of the protocol their encoding were different, and discard data from these rounds. This process is known as sifting. The remaining data of Alice is now equal to that of Bob (in the ideal case); they each have a copy of the same random bitstring.
If someone (usually denoted Eve) is trying to eavesdrop during this process, the measurement disturbance will introduce noise in the key. Eve is assumed to have no knowledge about the random encoding used by Alice, so Eve’s best strategy is to guess the encoding at random. If Eve’s guess is correct, the quantum state is unaffected by her measurement, but if Eve’s guess is wrong, she only gets random data and her measurement device outputs a state in the wrong basis. For example, if Alice sends the state , and Eve picks the phase basis , then Eve’s measurement outcome is random, and her measurement will update the quantum state into
(50) 
When Bob then measures in the computational basis there is a 50% chance of creating a biterror in the key.
An eavesdropper can now be detected if Alice and Bob sacrifice part of the key and compare it between themselves. If the error rate is too high (nonzero in the ideal case), the whole key should be discarded because Eve has been eavesdropping. If the error rate is sufficiently low (zero in the ideal case), they can be confident that no one have listened in on their communication. In a real system with noise and lost qubits this is more complicated, and there are also ways to handle limited eavesdropping, but here we will restrict ourselves to the ideal case.
The simulation of the protocol in QSL can be exemplified as follows. If Alice chooses the computational basis state, her bit is encoded into the QSL state
(51) 
If she instead chooses the phase basis, her bit is encoded in the QSL state
(52) 
If Bob chooses to measure in the same basis as Alice has used for encoding, he will retrieve the bit , otherwise he will retrieve the random value , which will then be discarded in the sifting step.
If Eve is eavesdropping, there is a 50% chance that she chooses a different encoding than Alice, in which case she retrieves the random value , and through the measurement disturbance mechanism, she also randomizes the bitvalue . In this case Bob will receive a random bit value (independent of ), irrespective of in which encoding he measures. This reproduces the quantum behavior of BB84. In other words, the BB84 protocol including the described attack, known as the interceptresend attack, can be faithfully simulated in QSL.
It is important to note that the security fails if there exists a measurement that retrieves information without disturbing the system. In QSL we have included a restriction on the allowed measurements in order to simulate measurement disturbance. In an actual implementation of QSL, using physical bits, this restriction could be ignored by an adversary, and a measurement that does not disturb the system be performed. In quantum theory there is no such measurement [Busch2009], but if an actual implementation of BB84 does not use an ideal qubit there may be such a measurement. A wellknown example is when failing to make a singlephoton source so that in each round, the information is encoded onto several photons. In this case, an eavesdropper could split off two of the many photons, and measure separately on them, in the two possible encodings. This would reveal the information present in one of the encodings (Eve will learn which is correct in the sifting phase), while not disturbing the remaining photons at all, so that no noise is present in the generated key. This attack, known as the photonnumbersplitting attack, would be equivalent to an adversary ignoring the restriction of QSL.
2.2 Pairs of Elementary Systems
In this section we are at most considering pairs of qubits, i.e., dimensional systems.
QSLsystems compose under the Cartesian product, and for two elementary systems we write
(53) 
the latter notation for brevity, which we could equivalently write
(54) 
so that and can take the values . This gives a pair of QSLsystems a sample space of discrete points.
States that cannot be described as convex combinations of other states corresponds to pure states, and the maximally mixed state is still represented by a uniform distribution over all 16 points.
2.2.1 Transformations
For pairs of elementary systems we also have gates corresponding to twoqubit gates. The relations in Figure 2 motivates the following construction of a QSL analogue of the quantum CNOT, and one can verify that this construction is equivalent with the construction in [Spekkens2007].
(55) 
see Figure 9A for a graphical representation.
ControlledZ () and SWAP follow directly from the identities
(56) 
(57) 
(see Figure 9B,C). This implies the QSL maps
(58) 
and
(59) 
2.2.2 Entanglement
The QSL analogue to product states are states where the information about one subsystem is independent of the information about the other subsystem. In contrast, in entangled states the information is stored in the correlations between the pair of QSLsystems.
In quantum theory, a measure of the amount of entanglement in a bipartite system is the entropy of entanglement. This is obtained by calculating the von Neumann entropy of the reduced density operator , where is the state of the composite system , and is the partial trace taken over the subspace related to system . As an example, consider the Bell state with density operator
(60) 
The reduced density operator for system is the maximally mixed state,
(61) 
This makes the entropy of entanglement equal to 1, and means that even though we have a pure bipartite state (of entropy 0) we obtain a maximally mixed state (of entropy 1) for the subsystem . The entropy of entanglement is symmetric in its arguments, so the uncertainty about the state of subsystem equals that of subsystem , . So we have maximal information about the whole system but no information about the individual parts. Thus, in a sense all information is stored in the correlations of the pair. States with this property are called maximally entangled. The Bell states
(62) 
are maximally entangled states. These can be generated from the following recipe (see Figure 10).

Prepare a pair of qubits in the state , where is 00 for , 01 for , 10 for , and 11 for .

Apply a Hadamard gate to the first qubit.

Apply a CNOT with the first qubit as control and the second as target.
We can use this recipe also in QSL to produce the states simulating the Bell states in Equation 62. As an example, the state simulating is
(63) 
For the whole state there are 2 bits of uncertainty, and is therefore a state of maximal knowledge since it is composed by two elementary subsystems. Viewing one of the individual subsystems, and ignoring the other, there is also two bits of uncertainty and therefore, viewed individually, they are maximally mixed.
The four QSL states related to Bell states are
(64) 
where and are independent randomly generated bits. These states are equivalent with those used by Spekkens, but represented differently. Spekkens represents the state of a pair of elementary systems by their joint probability distribution. As an example,
(65) 
shows the joint probability distribution corresponding to . The marginal probability distributions for each elementary system are uniform, corresponding to a maximally mixed states; in their marginal distributions there is no information about the state.
2.2.3 Remote Steering
Suppose that Alice and Bob each possess one qubit of a pair in the state
(66) 
This is sometimes expressed as Alice and Bob sharing an entangled state. If Bob measures his qubit in the computational basis , then he obtains the outcome for and with equal probability. If he obtains , the state updates according to
(67) 
and if he gets it updates according to
(68) 
In both cases he knows the state of Alice’s qubit, but if Bob instead chooses to measure in the phase basis, he will still get outcomes for at random and with equal probability. If the outcome is or the state updates to
(69) 
respectively. In either case Bob will learn the state of Alice’s system, but he also notes that it will be different if he chose to measure in the computational or phase basis. This phenomenon, that Bob apparently can influence Alice’s state by the choice of his measurement basis, is known as remote steering.
In QSL this is simulated as follows. Alice and Bob each get one elementary system from a pair initiated in the state
(70) 
If Bob measures , he learns the value of , and thus also the value of the computational bit in Alice’s system. If was 1 (there is a probability of that being the case) the state updates to
(71) 
and accordingly if the outcome is 0, here is a new i.i.d random bit generated by the measurement. Note that this also terminates the last bit of correlation between the two systems so that there is no correlation between them after the measurement. If Bob instead measures , he learns the value of , and thus the value of the phase bit in Alice’s system. If the outcome is 1 the state updates to
(72) 
and accordingly if the outcome is 0. In QSL, and in Spekkens’ model, the measurement choice of Bob is not influencing Alice’s system — the measurement choice is influencing Bob’s knowledge about Alice’s system.
2.2.4 Anticorrelation in Spinmeasurements of the Singlet
Another closely related example that instead does not work in Spekkens’ model or QSL is complete anticorrelation within the singlet. If a single system spin measurement is preformed in any direction, , on both qubits in the singlet state
(73) 
they will always output opposite values. The state simulating the singlet is
(74) 
where the overline denotes the Boolean complement. We can see that measuring and on both systems will return
(75) 
respectively. The first two measurements and will produce opposite outcomes, but the last, , will produce equal outcomes (see the last line of expression (75)). Thus, even though we are restricted to only three measurements, QSL does not reproduce this phenomenon.
There are three more examples like this; one for each Bell state, with different relations between the correlations that can be seen from measurements of , and on both qubits. In QSL and Spekkens’ however, measurement of will always show opposite correlations as those in quantum theory, just as in the above example (see further [Spekkens2007]).
2.2.5 Nocloning
Nocloning is the nogo theorem stating that there is no unitary transformation that takes an arbitrary state and an auxiliary qubit , and returns both systems in the state [Wootters1982]
(76) 
A unitary transformation preserves the inner product, so if we take two quantum states and and apply a hypothetical cloner,
(77) 
Requiring the inner product to be preserved we have
(78) 
Since this implies that the norm of these two scalars is equal,
(79) 
which only happens if the states are parallel or orthogonal. Therefore, there is no single unitary that performs the task for an arbitrary state.
In QSL we have two elementary systems in pure states , and an auxiliary system in a pure state . The transformation that clones these states is
(80) 
For this to be reversible, the number of elements in the joint support of and needs to be preserved by the transformation, because if the support grows or shrinks it is not a bijection. Before the transformation, the number of elements in the joint support is
(81) 
where we have used that the support of a pure state has 2 elements, i.e., . The number of elements in the joint support after the transformation is
(82) 
This gives us the condition (compare with Equation 79)
(83) 
but this is only fulfilled when and are disjoint (orthogonal) or completely overlap (parallel). Therefore, in a setup with two QSL systems, there is no single QSL transformation that performs the task for an arbitrary state.
2.2.6 Interference
Examples of interference does not require a bipartite system, but it makes for a good example of how it is used in quantum information processing.
Consider the protocol in Figure 11. Prepare a two qubit system in the state , and apply a Hadamard gate to each of them
(84) 
Then a unitary operation that encodes a reversible function in the computational basis is applied.
(85) 
Even though the unitary encoding the function is used only once, information about more than a single function values (in this case two) appears in the state. This phenomenon is sometimes called quantum parallelism. The state in expression (85) also equates to
(86) 
and after the final Hadamard it becomes
(87) 
Measuring the observable , that is, testing whether the first qubit is still in the initial state , will test positive with probability
(88) 
So, if amplitudes will interfere destructively, and the test will be positive with probability zero. If they interfere constructively, and the test will be positive with unit probability. This is known as Deutsch algorithm [Deutsch1985], and considered by many the starting point of quantum algorithm research.
There are four functions over 1 bit: and . The canonical way of constructing those with reversible logic follows. The first two, and , are constructed by doing nothing at all respectively applying a gate to the output. For the last two, and , an additional CNOT is applied between the input and output. The quantum unitary would then be realized in four ways, as the identity, an gate on the second qubit only, a CNOT, or a CNOT followed by an gate on the second qubit.
In QSL, the protocol proceeds as follows. Prepare two systems simulating , and apply to each system
(89) 
The effect of the above discussed construction of in QSL will map the function from the first to the second system over the computational bits. It will also add the phase of the second system into the first system if the CNOT is present (that is, if ). This simulates the phenomenon sometimes called phase kickback [Cleve1998]. For the other two functions (when ) there will be no phase kickback. So, not knowing which function that is implemented, the natural way of describing the effect of the phase kickback is to use the parity of the function. This gives the map
(90) 
Applying the function to the result of the map in expression (89) we get
(91) 
and then applying the last transformation gives
(92) 
A simulation of measuring the observable is to test whether the computational bit of the first system is zero or not. From the state in expression (92) this translates to testing
(93) 
which is true only when and are equal, and false when they are not, just as in quantum theory.
Figure 12 shows the explicit instance of protocol in QSL when .
This is a faithful simulation of a protocol showing interference and quantum parallelism. Even in QSL there is an apparent effect of information from both function values being added to the result, while only one query is made (see the QSL map in Equation 90 ). Now, whether a quantum computer access all function values with only one query, or whether the equations only describe the structure of additional information that can be retrieved, is an unsettled philosophical debate. For QSL the latter is certainly the case, but we should also stress that QSL is not quantum theory. Yet, since one process faithfully simulates the other, these processes are operationally equivalent, and in that spirit a machinery running this particular QSL recipe should not be distinguished from one running the quantum recipe.
We need to stress that in QSL we do not calculate the parity of the function by accessing the function twice, and then have the oracle signal that information. The expression using the parity of the function just turns out to be a good description for the additional information available when we do not know which of the four functions that was applied. With the constructions of and , the phase bit of the first system is flipped, but not for the constructions for and , i.e., the output depends on the choice of function made in the construction.
To further clarify, with “operationally equivalent” we mean that processes, or theories are equivalent when only judged by their input/output behavior. So, a machine running Deutsch algorithm in QSL is operationally equivalent to the corresponding process on a quantum machine, but comparing QSL as a theory against quantum theory is not. In fact, we have already seen examples that QSL is operationally different, for instance in the correlations seen in the outcomes from Pauli measurement over Bell states. However, our main goal here is not to fuel the philosophical debate, nor to perfectly simulate the whole of quantum theory, but only to simulate it accurate enough to solve the computational problem.
2.2.7 Measurements
For one elementary system we have defined three measurements that we relate to the Pauli observables. We also have six observables for the orthogonal projections onto their eigenstates, as exemplified in the previous section, and we can ask whether the computational bit is or not (corresponding to the observable ), rather than asking if it is or (Corresponding to the observable ). When measuring a single elementary system there is no distinction between asking if it is or not, or or , but for higher dimensional systems there is a distinction. For instance, say that the dimension is four and that we measure the observable , with the outcome that the system is not in , we cannot infer whether it is , , or . In QSL a measurement of corresponds to asking the system if all the computational bits are zero or not. A measurement that distinguishes between , , , or corresponds to asking the system whether the computational bits encode , , , or respectively.
For systems composed of two elementary systems, we have seen that single system measurements act locally. In the Pauli group of observables there are also joint measurements of the kind , and in QSL these are simulated as follows.
A measurement of the observable returns the correlation between the computational bits of both systems, , and redistributes according to the outcome. That is, if the computational bits of both systems will be random but completely correlated after the measurement, and if they will be random but anticorrelated. A measurement represented by does the same, but for the phase bits. The procedure is similar for , for the computational bit of the first system and with the phase bit of the second, and so on.
These joint measurements retrieve 1 bit of information even though the whole system is composed of two elementary systems, and we should therefore be able to retrieve two bits, implying that the joint measurements are nonmaximally informative measurements. In quantum theory this relates to when an observable has degenerate eigenvalues. For instance, the observable quantity can take on two different values, and knowing this value gives us 1 bit of information.
A Bell state measurement is a measurement that distinguish the four Bell states. This is a maximally informative measurement since it takes the maximally mixed state into a pure state (one of the Bell states). In QSL, an analogue to this measurement returns the correlation between the two computational bits and between the two phase bits. An example of this will be given in Section 2.2.8.
This is not to be confused with measurements whose outcome violate Bell inequalities — measurements included in a Bell test. For instance the CHSH inequality has a classical bound of 2, and quantum theory can violate this to a maximal value of , called the Tsirelson bound. An experiment that maximally violates the inequality can be constructed from measuring the observables
(94) 
on one qubit, and
(95) 
on the other, starting with a system in the singlet state. For a complete description see \textcite[111]Nielsen2010. In Hilbert space the observables in expression (95) has eigenbases that are offset with from the eigenbases of those in expression (94). In QSL we do not have measurements with this relationship between each other.
So, in QSL we have maximally entangled states, but cannot violate Bell inequalities. Obtaining a violation from QSL, which is a local realist model, would contradict Bell’s theorem [Bell1964].
Another phenomenon that QSL cannot reproduce is the contextual correlations in the PeresMermin square, which is an explicit example of the KochenSpekker theorem [Kochen1967]. This was shown by \textcitePusey2012, not in the QSL representation, but with his stabilizer representation of Spekkens’ model. However, \textciteKleinmann2011 initiated work on extending Spekkens’ model to reproduce the contextual correlations that can be seen from Pauli group measurements. Their work was later concluded by \textciteHarrysson2016. It is also interesting to note that correlations seen from measurement sequences in the PeresMermin square have an efficient simulation according to the GottesmanKnill theorem [Gottesman1998, Aaronson2004].
2.2.8 Superdense Coding
Superdense coding is the name of a protocol that in a sense allows one party, Alice, to convey two bits of information to the other party, Bob, by only interacting with one qubit. It is however a two qubit protocol as shown by Figure 13.
First create the state , give one of the two qubits to Alice and the other qubit to Bob. Depending on which of the four messages that Alice wants to send to Bob, she applies , , , or to her qubit, creating
(96) 
She then sends her qubit to Bob. A Bell state measurement will allow Bob to perfectly distinguish the state of the pair and deduce Alice’s message.
In QSL the state simulating is , and when Alice applies or the result is
(97) 
respectively. As previously stated, a Bell state measurement returns the XOR (the correlation) between the two computational bits and the two phase bits. This measurement on the above states will yield , , , or , respectively. Thus, we also have superdense coding in QSL.
The reason that Alice can convey a 2 bit message to Bob by sending him one elementary QSL system, is that each QSL system contains 2 bits. It is true that Bob cannot access both bit values, since he is restricted to only retrieving 1 bit of information from each system. He can retrieve both bits of the message only because there is a second system, initially highly correlated with the first, and where the correlations are manipulated by Alice.
2.3 Higher Number of Elementary Systems
Going to higher number of elementary systems, QSL departs from Spekkens’ toy model to become a less restrictive theory. Systems still compose under the Cartesian product, and the following notation is used
(98) 
Sometimes we will use a separation between different registers with the notation , where , , and will be integers modulo a poweroftwo.
2.3.1 Teleportation
Before we introduce the new transformations, let us take one more example with more than two qubits.
Teleportation is the name of a protocol where, given some preshared entanglement, Bob can recreate a qubit state made available to Alice, from information from Alice on the result of a Bellstate measurement performed by her.
The protocol is shown in Figure 14, and proceeds as follows. Alice and Bob share a qubit pair in the Bell state created by the H and a CNOT gates at the left of Figure 14,
(99) 
Alice then correlates the state , that she wants to teleport to Bob, with her part of the pair. This is done using a Bell state measurement built from the next CNOT and H gates.
(100) 
After the Hadamard, the state can be written as
(101) 
Alice measures her two qubits and sends the result to Bob. We see from expression (101) that if the least significant bit that Bob receives is set, then he needs to apply to his qubit, and if the most significant is set apply an . Doing so, he retrieves the state .
The same protocol (Figure 14) with QSL gives
(102) 
By the two measurements Alice now retrieves the values of and , and sends them to Bob. If the first bit is set he performs an , i.e., adds to the computational bit modulo 2. If the latter is set he performs a , i.e., adds to the phase bit, also modulo 2. The state he ends up with is
(103) 
which is the state Alice was provided with. Thus, Alice and Bob cooperate to “teleport” the state of Alice’s input system to Bob. Just as in the quantum protocol, Alice does not at any point retrieve any information on the state provided to her. That is, Alice and Bob cooperate to update the state of Bob’s system to correspond to the state of Alice’s input system, independent of what the state of that input system is, just as in the quantum protocol.
In classical communication this is not described as teleportation, but rather as encryption and decryption through the OneTimePad, where the random numbers and act as secret shared key between Alice and Bob. Therefore, in QSL (or Spekkens’ toy model), the teleportation protocol is equivalent to (two uses of) the OneTimePad.
We should note that quantum teleportation goes beyond this, since we are restricted to simulate a finite subset of quantum states being teleported, rather than the continuum of states in quantum theory.
2.3.2 Transformations
Here we introduce a transformation unavailable in Spekkens’ model, and as we will see it take us out to a less restricted model. The QSL Toffoli construction is shown in Figure 16A., and produces the mapping
(104) 
It is constructed in this way to uphold quantum gate identities like those in Figure 15A. and Figure 15B. If the input of one of the two control qubits is initiated in , the effect is that of a CNOT over two other systems. Also, if the target qubit is initiated in , the effect is that of a over the two control qubits.