The acceptance gap of a circuit as a tensor contraction #
The acceptance gap of a list of gate codes (Cslib.Quantum.acceptGap) is the contraction of an
explicit Boolean tensor network (Cslib.Quantum.PathNetwork.network) built from the circuit and a
mirror copy of it (Cslib.Quantum.PathNetwork.contraction_network). More generally, for a list S
of measured qubits, the network computes the projected gap Cslib.Quantum.onesGap S of the event
that every qubit of S reads 1; acceptance is the case S = [0]. This is the form in which the
contraction algorithm of [OAI26k], Theorem D.1, simulates quantum circuits exactly.
Occurrences. The qubits of a gate code are its target and then its controls
(Cslib.Quantum.PathNetwork.qubits). Listing them gate by gate numbers the occurrences
0, …, N - 1 of qubits in gates (Cslib.Quantum.PathNetwork.occurrences); gate i owns the
occurrences from base gs i on. The last occurrence of qubit j before position p
(Cslib.Quantum.PathNetwork.lastOcc) is where the value of j entering position p was written.
The network. It has two copies, c = 0 and c = 1, of the circuit. In copy c, occurrence
u has the segment c N + u, with an out edge 2 (c N + u) and a link edge
2 (c N + u) + 1, so there are 4 N edges.
- Gate vertices (rows). In each copy, gate
ihas a vertex with the out edges of its occurrences and, for each of its qubits written by an earlier gate, the link edge of that earlier occurrence. A qubit not written before is read from the input register instead (Cslib.Quantum.PathNetwork.inPort). The tensor (Cslib.Quantum.PathNetwork.gateEntry) is, for the Hadamard gate,negwhen the input and output bits of the target are both one and1otherwise; for a classical gate it is the indicator that the outputs are the gate applied to the inputs. - Glue vertices (rows). The link edges of the last occurrence of each qubit in the two copies meet at a glue vertex with the equality tensor, or, for a measured qubit, the tensor that requires both bits to be one. A scalar vertex without ports requires the input bit of every measured qubit that no gate touches to be one.
- Segment vertices (columns). Each segment joins its out and link edges with the equality tensor.
So every edge joins a row to a column, every vertex has at most six ports, and untouched qubits
cost nothing. The gate tables are bounded tables for the degree bound six
(Cslib.Circuits.Frontier.ExplicitTensorNetwork.boundedTable). With neg = -1, an assignment of
nonzero weight is a pair of paths of the path sum
(Cslib.Quantum.pathRun) ending in the same register with every measured qubit equal to one, and
its weight is the product of their signs, so the contraction is onesGap S
(Cslib.Quantum.PathNetwork.contraction_network). The network is defined for any value neg of
the Hadamard sign, so that over ℕ it can carry 2 ^ P - 1, which is -1 modulo 2 ^ P
(Cslib.Quantum.PathNetwork.contraction_network_mod).
Main definitions #
Cslib.Quantum.PathNetwork.qubits,Cslib.Quantum.PathNetwork.occurrences,Cslib.Quantum.PathNetwork.base,Cslib.Quantum.PathNetwork.lastOcc: occurrences of qubits.Cslib.Quantum.PathNetwork.gateEntry: the tensor of a gate.Cslib.Quantum.PathNetwork.inPort,Cslib.Quantum.PathNetwork.gatePorts,Cslib.Quantum.PathNetwork.inBit,Cslib.Quantum.PathNetwork.gateVertex,Cslib.Quantum.PathNetwork.acceptTable,Cslib.Quantum.PathNetwork.glueVertex,Cslib.Quantum.PathNetwork.scalarVertex: the vertices.Cslib.Quantum.PathNetwork.network: the network of a circuit, with its number of rows.
Main results #
Cslib.Quantum.PathNetwork.lastOcc_succ,Cslib.Quantum.PathNetwork.lastOcc_eq_some,Cslib.Quantum.PathNetwork.lastOcc_eq_none: last occurrences.Cslib.Quantum.PathNetwork.contraction_network: with the Hadamard sign-1, the contraction is the projected gap.Cslib.Quantum.PathNetwork.network_mapTables,Cslib.Quantum.PathNetwork.contraction_network_mod: overℕ, with the Hadamard sign2 ^ P - 1, the contraction modulo2 ^ Pis the projected gap oncePexceeds the number of Hadamard gates.Cslib.Quantum.PathNetwork.numEdges_network,Cslib.Quantum.PathNetwork.length_vertices_network,Cslib.Quantum.PathNetwork.maxDegree_network_le,Cslib.Quantum.PathNetwork.length_table_network,Cslib.Quantum.PathNetwork.length_occurrences_le:4 Nedges forN ≤ 3 Loccurrences of theLgates, degree at most six and full tables.Cslib.Quantum.PathNetwork.exists_base_le_lt,Cslib.Quantum.PathNetwork.sum_readers,Cslib.Quantum.PathNetwork.isRowsFirstBipartite_network: every occurrence lies in one gate and every link edge is read by one gate or its glue vertex, so the network is rows-first bipartite when the qubits of every gate are distinct.
References #
- OpenAI, The Exponential Time Hypothesis is False, Theorem D.1 (p. 53).
Occurrences #
The qubits of a gate code: its target, then its controls.
Tensors and vertices #
The tensor of the gate code g at the bits ins entering and outs leaving its qubits. For
the Hadamard gate it is neg when the target enters and leaves as one, and 1 otherwise; for a
classical gate it is 1 when the outputs are the gate applied to the inputs, and 0 otherwise.
The glue vertex of occurrence w, for the list S of measured qubits: when w is the last
occurrence of its qubit, it joins the link edges of w in the two copies, requiring equal bits,
and both bits one for a qubit of S.
The network of a circuit with the measured qubits S, the input register X and the
Hadamard sign neg, with its number of rows: the gate vertices of the two copies, the glue
vertices and the scalar vertex, then the segment vertices.
Runs along the occurrences #
Last occurrences #
Occurrences of gates #
Registers along the occurrences #
Entries of the vertices #
The final registers #
The contraction #
A well-formed gate code has at most three qubits.
The contraction of the network is the projected gap. With -1 as the Hadamard sign, over
any commutative ring, the contraction of the network of well-formed gate codes with the measured
qubits S on the input register X is onesGap S gs X; for S = [0] it is the acceptance gap
Cslib.Quantum.acceptGap.
Residues of the contraction over ℕ #
Mapping the tables maps the Hadamard sign.
The residue of the contraction over ℕ is the projected gap. With 2 ^ P - 1, which is
-1 modulo 2 ^ P, as the Hadamard sign, and P larger than the number of Hadamard gates, the
contraction of the network of well-formed gate codes with the measured qubits S on the input
register X, reduced modulo 2 ^ P, is the projected gap.
Sizes #
Every gate has at least one and at most three occurrences.
The bipartition #
The reader of a link edge. Let u be an occurrence of the qubit q. If u is the last
occurrence of q, no gate reads q from u; otherwise exactly one gate does, the gate of the
next occurrence of q.
A gate whose qubits are distinct has distinct ports: the out edges are distinct and even, and the input ports are distinct and odd, since distinct qubits have distinct last occurrences.
The network is rows-first bipartite with the gate, glue and scalar vertices as rows, when the qubits of every gate are distinct.