
2
opted such programming languages as Python so that the
user can organise and approximate its (quantum) com-
putation yet such language extensions are an aid to the
(classical computing) user transitioning to the quantum
computing paradigm. The computing model founded on
the (quantum) circuit, as proposed by [9] dominates those
simulator resources presently available.
A circuit comprises of one or more qubits as input,
which are transformed through the use of single- or
multi-qubit operators collectively referred to as quan-
tum logic gates; the output qubits are specified or ‘mea-
sured’ (see section 2, below) only once all transforma-
tions are completed. The (quantum) circuit model there-
fore is the method of computation consistent with the
circuit as algorithm: as a method, the quantum circuit
model ‘builds up’ output through the aggregated trans-
formations of input qubits. It is not the case, how-
ever, that the circuit model is the sole option for ex-
ecuting a quantum computation: an alternative model
in measurement-based quantum computing (henceforth,
MQBC) proceeds through single-qubit operations ap-
plied in a certain order and basis to an agglomeration
of qubits formed through quantum entanglement, known
as a ‘cluster state’ [10]. In contrast to the circuit model,
MBQC can be thought of as ‘emerging’ the desired out-
put from a cluster state [11]. The cluster state requires
no additional input qubits to establish a (quantum) state
[12]. Revisiting its purpose as an algorithm, the circuit
is a complicated fit for the MBQC model: a circuit can
be adapted to MBQC but only after deconstructing each
multi-qubit gate to its single-qubit equivalent then se-
curing the output through measurement. In brief, the
circuit as syntax is inefficient for encoding an algorithm
under the MBQC model.
In light of the inefficiency of adapting the circuit to the
MBQC model the question becomes, what is an efficient
algorithm representation for the MBQC model? Under
the circuit model, individual qubits are the resource from
which a computation is built up by means of single- or
multi-qubit transformations of individual qubits. In con-
trast, MBQC proceeds through single-qubit operations
that transform/consume a cluster state resource. This
cluster state is therefore pivotal to the question of effi-
ciency in encoding an algorithm for the MBQC model. It
turns out that a subgroup of the quantum state, known
as a graph state has a syntax, in the form of graphs, that
can model a cluster state. A graph, as an expression of
graph state, can efficiently implement a prescribed set of
transformations of a cluster state. In effect, the graph
as an algorithm is to MBQC what the circuit is to the
circuit model.
We submit Q2Graph (https://github.com/QSI-
BAQS/Q2Graph), a software package for the design
and testing of a graph as an algorithm for MQBC.
Q2Graph is a standalone executable and draws upon
(simple) graphs as proxies of cluster states to fulfil its
requirements as a design tool. Q2Graph differs from
other well-known graph visualisation/design packages
(e.g. [13–18]) by its primary purpose namely, the design
and modelling of a graph as an algorithm for an MBQC
system[19]. More specifically, the modelling functionality
of Q2Graph includes the ability to reproduce the effect
of single-qubit operations upon the structure of a graph.
The remainder of this article will serve as a detailed
introduction to version 0.1 of Q2Graph. Section II is
a review of MBQC, graphs and graph states, which,
together, form the theoretical underpinnings of the
graph as a unit of instructions for MBQC. With the
previous section for context, Section III is a review of
the design principles that inform Q2Graph, to stimulate
potential use cases for the application. In particular,
the algorithm-specific graph is introduced as a model to
bridge between classical- and NISQ-computing facilities.
Section IV is a review of Q2Graph functions with an
emphasis upon how a user might use the package to
model a quantum algorithm. The article concludes with
Section V, including some comments on next steps for
development of Q2Graph version 0.2.
II. MEASUREMENT-BASED QUANTUM
COMPUTING, GRAPHS AND GRAPH STATES
Measurement-based quantum computation emerges a
computation from a resource of entangled qubits (‘clus-
ter state’) by transforming single qubits, in a certain or-
der and basis. In preparing the cluster state (denoted
as |ΦiC), each of its qubits, except those designated as
input, are initialised at state |+i. Following on from
initialising the component qubits is the process of creat-
ing quantum entanglement, which is necessary to creating
|ΦiC. As implied by its title, |ΦiCis a composite or mul-
tipartite system of n-interacting qubits. Ordinarily the
state space of a composite physical system (say, |Ψi) is
obtained as the tensor product of its component qubits,
thus,
|Ψi≡|ψ1i⊗|ψ2i ⊗ ... ⊗ |ψni.(3)
In contrast, applying a controlled-Z (‘CZ’) gate between
qubits |iiCand |jiCtransforms to the state space |ijiC
not |iiC|jiC[20, 21] as would be consistent with (3).
This ‘entangled’ state space of |ijiCis inseparable, there
is no observable point of difference in state between its
component qubits. By definition then,
|ΦiC6=|iiC⊗ |jiC⊗... ⊗ |niC.(4)
Multipartite states like |ΦiCare efficiently described
by the stabiliser formalism (see [1, 22–24]). A stabiliser
state is an eigenvector of an operator, Uwith eigenvalue
+1 (i.e. U|ψi=|ψi). In every instance of a multipar-
tite state, Uwill include operators of the Pauli group,
PN:={±I,±iI,±X,±iX,±Y,±iY,±Z,±iZ}N. More
will be made of both stabiliser states and Pbelow, in
the context of graphs and graph states.
So much for defining the state space of |ΦiC. Com-
putation in MBQC now proceeds through measurement,