Explicit Boolean tensor networks #
A Boolean tensor network as an algorithm reads it (DescribedNetwork T) is the number of edges,
numbered 0, 1, …, and a list of vertices, each given by its ordered list of ports, the numbers
of the edges at the vertex, and a descriptor t : T of its tensor. For an evaluator
eval : T → List Bool → R, the entry of the vertex when port i carries the bit bs[i] is
eval t bs, and the contraction (DescribedNetwork.contraction) sums, over all assignments of
bits to the edges, the product of the entries at the bits on the ports.
An explicit network (ExplicitTensorNetwork R) has tables as descriptors: the value of the
tensor of a vertex when port i carries the bit bs[i] is the entry of its table at position
BitString.lsbValue bs, the number whose binary digit i is bs[i]
(BitString.testBit_lsbValue).
So a vertex with k ports has a table of 2 ^ k entries. The contraction of an explicit network
(ExplicitTensorNetwork.contraction) sums, over all assignments of bits to the edges, the product
of the table entries at the bits on the ports, which is the contraction of the described network
with table lookup as the evaluator (DescribedNetwork.contraction_entry). It needs no
well-formedness: a port naming no edge reads false, and a position past the end of a table has
entry zero.
Its size measures are the number of edges, the number of vertices, the maximum number of ports of
a vertex (ExplicitTensorNetwork.maxDegree) and the total length of the tables
(ExplicitTensorNetwork.tableLength). A described network is rows-first bipartite with r
rows (DescribedNetwork.IsRowsFirstBipartite) when every port names an edge and every edge is a
port of exactly one of its first r vertices and of exactly one of the others.
Writing a network out (TensorNetwork.toExplicit). Given numberings of the vertices and the
edges of a Boolean tensor network on finite types, list the edges at each vertex in increasing
order and tabulate its tensor on them. The contraction is unchanged
(TensorNetwork.contraction_toExplicit). The ports of a vertex are its incident edges, so the
degree bound carries over (TensorNetwork.maxDegree_toExplicit_le), and a numbering that puts
one end of every edge below r and the other at or above it gives a rows-first bipartite network
(TensorNetwork.isRowsFirstBipartite_toExplicit).
Main definitions #
Cslib.Circuits.Frontier.DescribedNetwork: a Boolean tensor network given by the ports and the descriptors of its vertices.Cslib.Circuits.Frontier.DescribedNetwork.contraction: its contraction, for an evaluator of the descriptors.Cslib.Circuits.Frontier.DescribedNetwork.IsRowsFirstBipartite: the bipartition with the firstrvertices as rows.Cslib.Circuits.Frontier.ExplicitTensorNetwork: an explicit Boolean tensor network, with tables as descriptors.Cslib.Circuits.Frontier.ExplicitTensorNetwork.entry,Cslib.Circuits.Frontier.ExplicitTensorNetwork.portBits: table lookup and the bits on a list of ports.Cslib.Circuits.Frontier.ExplicitTensorNetwork.contraction: the contraction.Cslib.Circuits.Frontier.ExplicitTensorNetwork.maxDegree,Cslib.Circuits.Frontier.ExplicitTensorNetwork.tableLength: size measures.Cslib.Circuits.Frontier.TensorNetwork.explicitPorts,Cslib.Circuits.Frontier.TensorNetwork.explicitTable,Cslib.Circuits.Frontier.TensorNetwork.toExplicit: writing a Boolean tensor network out.
Main results #
Cslib.Circuits.Frontier.DescribedNetwork.map_contraction: the contraction commutes with maps of semirings.Cslib.Circuits.Frontier.DescribedNetwork.contraction_entry: explicit networks are described networks with table lookup as the evaluator.Cslib.Circuits.Frontier.ExplicitTensorNetwork.maxDegree_le_iff: the degree bound.Cslib.Circuits.Frontier.TensorNetwork.entry_explicitTable: a written-out table evaluates the tensor.Cslib.Circuits.Frontier.TensorNetwork.contraction_toExplicit: writing a network out preserves its contraction.Cslib.Circuits.Frontier.TensorNetwork.length_explicitPorts: a vertex has one port per incident edge.Cslib.Circuits.Frontier.TensorNetwork.maxDegree_toExplicit_le,Cslib.Circuits.Frontier.TensorNetwork.isRowsFirstBipartite_toExplicit,Cslib.Circuits.Frontier.TensorNetwork.length_table_toExplicit: degree, bipartition and table lengths of a written-out network.
References #
- OpenAI, The Exponential Time Hypothesis is False, Appendix D.1 (p. 53).
A Boolean tensor network with described tensors: the number of edges, numbered from zero,
and a list of vertices. A vertex is given by its ordered list of ports, the numbers of its
edges, and a descriptor t : T of its tensor.
The contraction: the sum over all assignments of bits to the edges of the product of the entries of the vertices at the bits on their ports, for entries in a commutative semiring.
The contraction commutes with maps of semirings.
Rows-first bipartite: the first r vertices are the rows and the others the columns,
every port names an edge, and every edge is a port of the rows exactly once and of the columns
exactly once. So every edge joins a row to a column.
Instances For
An explicit Boolean tensor network over R: a network whose descriptors are tables. The
entry of the table of a vertex at position BitString.lsbValue bs is the value of its tensor
when port i carries the bit bs[i].
The contraction of an explicit network: the sum over all assignments of bits to the edges of the product, over the vertices, of the table entries at the bits on their ports.
The maximum degree: the largest number of ports of a vertex, or zero without vertices.
The total length of the tables.
Explicit networks: with table lookup as the evaluator, the contraction of a described network is that of the explicit network.
Writing a tensor network out #
The ports of a vertex when the edges are numbered by ee: the numbers of the edges at the
vertex, in increasing order.
An edge is a port of v exactly when it is incident to v.
The table of a vertex: its tensor at each list of bits on its ports, by position.
A written-out table evaluates the tensor. At the bits that an assignment puts on the ports
of v, the table of v has the value of the tensor at that assignment.
An edge is a port of a vertex at most once.
The ports of a vertex are its incident edges: their number is its degree.
The number of times the edge numbered j is a port of v: once if it is incident to v, and
never otherwise.
A table lists the values of the tensor at all 2 ^ (number of ports) lists of bits on the
ports.
Every entry of a written-out table is a value of the tensor.
A Boolean tensor network on finite types written out as an explicit network, numbering the
vertices by ev and the edges by ee: vertex i is ev.symm i, with its ports in increasing
order and its table.
The vertices of the written-out network are the ports and tables of the vertices.
The degree bound carries over: a vertex of the written-out network has as many ports as the vertex has incident edges.
Every table of the written-out network has an entry for every list of bits on its ports.
Every table entry of the written-out network is a value of a tensor.
Rows first. If every edge joins a vertex numbered below r to one numbered at least r,
the written-out network is bipartite with the first r vertices as rows.
Writing a network out preserves its contraction.