Circuit complexity and functionality: a thermodynamic perspective

Claudio Chamon Boston University   Andrei E. Ruckenstein   Eduardo R. Mucciolo University of Central Florida   Ran Canetti

Circuit complexity, defined as the minimum circuit size required for implementing a particular Boolean computation, is a foundational concept in computer science. Determining circuit complexity is believed to be itself a hard problem [1]. Furthermore, placing general lower bounds on circuit complexity would allow distinguishing computational classes, such as P and NP, an unsolved problem [2]. Recently, in the context of black holes, circuit complexity has been promoted to a physical property, wherein the growth of complexity is reflected in the time evolution of the Einstein-Rosen bridge (“wormhole”) connecting the two sides of an AdS “eternal” black hole [3]. Here we explore another link between complexity and physics for circuits of given functionality. Taking advantage of the connection between circuit counting problems and the derivation of ensembles in statistical mechanics, we tie the entropy of circuits of a given functionality and fixed number of gates to circuit complexity. We use thermodynamic relations to connect the quantity analogous to the equilibrium temperature to the exponent describing the exponential growth of the number of distinct functionalities as a function of complexity. This connection is intimately related to the finite compressibility of typical circuits. Finally, we use the thermodynamic approach to formulate a framework for the obfuscation of programs of arbitrary length – an important problem in cryptography – as thermalization through recursive mixing of neighboring sections of a circuit, which can viewed as the mixing of two containers with “gases of gates”. This recursive process equilibrates the average complexity and leads to the saturation of the circuit entropy, while preserving functionality of the overall circuit. The thermodynamic arguments hinge on ergodicity in the space of circuits which we conjecture is limited to disconnected ergodic sectors due to fragmentation. The notion of fragmentation has important implications for the problem of circuit obfuscation as it implies that there are circuits with same size and functionality that cannot be connected via local moves. Furthermore, we argue that fragmentation is unavoidable unless the complexity classes NP and coNP coincide, a statement that implies the collapse of the polynomial hierarchy of complexity theory to its first level.

Introduction

During the past decade a novel connection between physics and computer science has emerged in the course of explorations of one of the most fundamental open problems in physics, namely, the development of a theory of quantum gravity that reconciles and unifies general relativity with quantum mechanics. In this context, a bold proposal was made and developed by Susskind and collaborators [3, 4, 5] whereby the formal computer science notion of complexity has acquired specific physical reality, as it is conjectured that the growth of computational complexity represents the growth of the Einstein-Rosen bridge (the “wormhole”) of an AdS “eternal” black hole. It is argued that this growth is linear in time and persists for a time scale that is exponential in the physical black hole entropy. One way to formalize this connection is to use heuristic models of black hole dynamics based on quantum circuits of 222-qubit gates [6], in which case one (i) defines “computational complexity” as the minimum number of elementary gates needed to implement a particular unitary operator; and (ii) introduces an intuitive notion of “circuit entropy”, determined from the logarithm of the number of possible circuits of a given complexity. Unlike the physical entropy, which saturates to a value linear in the number of qubits, n𝑛n, the circuit entropy, just as the circuit complexity, grows to its saturation value of O(4n)𝑂superscript4𝑛O(4^{n}). More precisely, Refs. [3, 4, 5] argue that computational complexity is connected with the entropy of an auxiliary ensemble of 2nsuperscript2𝑛2^{n} classical particles moving on a negatively curved two-dimensional surface of large genus. In analogy with the second law of thermodynamics in physical systems, this connection leads to the natural description of the growth tendency of computational complexity as “the second law of complexity” [5]. It is important to note that in deriving the linear growth of complexity with number of gates, Refs. [4, 5] ignore the role of “circuit collisions”, defined as different sequences of gates that lead to the same unitary, i.e., circuits of the same “functionality.”

By contrast, here we focus on the development of a thermodynamic approach that takes into account both complexity and functionality. Ultimately it is the specific computation implemented by a given circuit that is the central object of interested in most computational problems. Our framework is based on reversible computing, which can be implemented either as permutations P𝑃P acting on the space of 2nsuperscript2𝑛2^{n} strings of n𝑛n bits, or as unitary transformations U𝑈U acting on the dnsuperscript𝑑𝑛d^{n} dimensional Hilbert space of n𝑛n qudits with local Hilbert space dimension d𝑑d. Below, we focus on the permutations because the counting is discrete (and thus simpler), but the results carry over to unitaries with minor modifications. We will establish that there are exponentially many ways to express a given functionality – a permutation P𝑃P – in terms of reversible gates. Our framework of circuit thermodynamics allows us to connect the scaling of two seemingly unrelated counting problems: (a) how many 𝒩𝒩{\cal N}-gate circuits can one write for a given functionality, and (b) how many distinct functionalities are there for circuits with given complexity 𝒦𝒦{\cal K}. The connection between these quantities is tied to finite compressibility of typical circuits, e.g., those with gates drawn randomly from a given gate set. This finite compressibility highlights the importance of circuit collisions and also implies a linear growth of complexity with number of gates (up to its maximum value exponential in n𝑛n) with a slope that is less than unity. As an application of the framework, keeping track of functionality allows us to formulate a thermodynamic approach to the problem of circuit obfuscation, i.e., a form of program encryption that hides one among many circuit implementations of a given functionality.

Below we also introduce the notion of ergodicity in the space of circuits of equal size and functionality, which is implied by the assumption of the uniform covering of the space of circuits assumed in formulating our thermodynamic approach. The discussion of ergodicity requires defining a dynamics in the space of circuits which enables transforming two circuits into one another while preserving size and functionality. We define a set of dynamical rules that we refer to as “k𝑘k-local” dynamics according to which one replaces k𝑘k-gate subcircuits by equivalent subcircuits of equal size. This dynamical rule conserves both the functionality and size of the original circuit. We argue that, generically, such models lead to fragmentation of the space of circuits into disconnected sectors. Thus, ergodicity holds and the thermodynamic framework only applies within each sector. This conclusion raises interesting questions about circuit obfuscation that are connected with fundamental assumptions of complexity theory in computer science.

Results

Counting circuits, entropy inequalities, and the thermodynamics of circuit complexity: As noted above, there are multiple ways of writing the same permutation P𝑃P using reversible gates; the number of ways depends on the gate set G𝐺G used. We define the circuit entropy

𝒮(P,𝒩)=log2Ω(P,𝒩),𝒮𝑃𝒩subscript2Ω𝑃𝒩\displaystyle{\cal S}(P,{\cal N})=\log_{2}\Omega(P,{\cal N})\;,(1)

where Ω(P,𝒩)Ω𝑃𝒩\Omega(P,{\cal N}) is the number of circuits realizing permutation P𝑃P with exactly 𝒩𝒩{\cal N} gates. This definition immediately implies the sum-rule PΩ(P,𝒩)=|G|𝒩subscript𝑃Ω𝑃𝒩superscript𝐺𝒩\sum_{P}\;\Omega(P,{\cal N})=|G|^{\cal N}, where |G|𝐺|G| denotes the cardinality of the gate set used in the implementation of P𝑃P.

The above counting parallels that used in the formulation of the microcanonical ensemble in statistical mechanics. In this setting, both 𝒩𝒩{\cal N} and the circuit functionality, i.e., the permutation P𝑃P implemented by the circuit, are “conserved quantities”. Furthermore, we assume that all circuits implementing P𝑃P with 𝒩𝒩{\cal N} gates appear with equal weight in the counting, a condition equivalent to the equal probability of microstates in the microcanonical ensemble.

A number of inequalities follow from the definition of the circuit entropy in Eq. (1). The simplest one,

𝒮(P1,𝒩1)+𝒮(P2,𝒩2)𝒮(P1P2,𝒩1+𝒩2),𝒮subscript𝑃1subscript𝒩1𝒮subscript𝑃2subscript𝒩2𝒮subscript𝑃1subscript𝑃2subscript𝒩1subscript𝒩2\displaystyle{\cal S}(P_{1},{\cal N}_{1})+{\cal S}(P_{2},{\cal N}_{2})\leq{\cal S}(P_{1}P_{2},{\cal N}_{1}+{\cal N}_{2})\;,(2)

expresses the fact that there may be more ways of implementing the product P1P2subscript𝑃1subscript𝑃2P_{1}P_{2} than simply sequentially implementing P1subscript𝑃1P_{1} and then P2subscript𝑃2P_{2}. Using this inequality, we can immediately derive a lower bound on the entropy 𝒮(P,𝒩)𝒮𝑃𝒩{\cal S}(P,{\cal N}) in terms of the circuit complexity 𝒦(P)𝒦𝑃{\cal K}(P) of the permutation P𝑃P:

𝒮(P,𝒦(P))+𝒮(11,𝒩𝒦(P))𝒮(P,𝒩),𝒮𝑃𝒦𝑃𝒮11𝒩𝒦𝑃𝒮𝑃𝒩\displaystyle{\cal S}(P,{\cal K}(P))+{\cal S}({1\!\!1},{\cal N}-{\cal K}(P))\leq{\cal S}(P,{\cal N})\;,(3)

where 1111{1\!\!1} denotes the identity permutation, which has zero complexity, i.e., it can be expressed without using any gate. The bound Eq. (3) connects the microcanonical ensemble entropy to the circuit complexity, and provide the foundation to what we refer to as the thermodynamics of circuit complexity. (In analogy to statistical physics, by introducing weights for different gates one could have also constructed a canonical ensemble for circuits.) The two terms on the left hand side represent two types of contributions to the circuit entropy: the first accounts for the number of different ways of writing P𝑃P within the minimum possible size 𝒦(P)𝒦𝑃{\cal K}(P), and is independent of 𝒩𝒩{\cal N}; the second term depends on the “free volume” 𝒩𝒦(P)𝒩𝒦𝑃{\cal N}-{\cal K}(P), with the complexity 𝒦(P)𝒦𝑃{\cal K}(P) acting as an “excluded volume”. The 𝒮(11,𝒩𝒦(P))𝒮11𝒩𝒦𝑃{\cal S}({1\!\!1},{\cal N}-{\cal K}(P)) contribution depends on P𝑃P only through its complexity. We posit that (i) up to subextensive corrections, 𝒮(P,𝒦(P))𝒮𝑃𝒦𝑃{\cal S}(P,{\cal K}(P)) depends on P𝑃P only through its complexity 𝒦(P)𝒦𝑃{\cal K}(P); and that (ii) the entropy 𝒮(P,𝒩)𝒮𝑃𝒩{\cal S}(P,{\cal N}) also only depends on 𝒩𝒩{\cal N} and the complexity 𝒦(P)𝒦𝑃{\cal K}(P), namely,

𝒮(P,𝒩)𝒮¯(𝒦(P),𝒩).𝒮𝑃𝒩¯𝒮𝒦𝑃𝒩\displaystyle{\cal S}(P,{\cal N})\approx\bar{\cal S}({\cal K}(P),{\cal N})\;.(4)

Note that, in parallel with the entropy inequality in Eq. (2), the circuit complexity satisfies the opposite inequality,

𝒦(P1)+𝒦(P2)𝒦(P1P2),𝒦subscript𝑃1𝒦subscript𝑃2𝒦subscript𝑃1subscript𝑃2\displaystyle{\cal K}(P_{1})+{\cal K}(P_{2})\geq{\cal K}(P_{1}P_{2})\;,(5)

which reflects the obvious fact that there may be shorter circuits implementing P1P2subscript𝑃1subscript𝑃2P_{1}P_{2} than the concatenation of P1subscript𝑃1P_{1} and P2subscript𝑃2P_{2}.

To exploit the implications of the above counting argument we introduce another entropy function σ(𝒦,𝒩)=log2ω(𝒦,𝒩)𝜎𝒦𝒩subscript2𝜔𝒦𝒩\sigma({\cal K},{\cal N})=\log_{2}\omega({\cal K},{\cal N}). By contrast to Ω(𝒦(P),𝒩)Ω𝒦𝑃𝒩\Omega({\cal K}(P),{\cal N}), which counts the number of 𝒩𝒩{\cal N}-gate circuits of fixed functionality with complexity 𝒦𝒦{\cal K}, ω(𝒦,𝒩)𝜔𝒦𝒩\omega({\cal K},{\cal N}) counts all 𝒩𝒩{\cal N}-gate circuits of fixed complexity, 𝒦𝒦{\cal K}:

ω(𝒦,𝒩)=Pδ𝒦,𝒦(P) 2𝒮(P,𝒩)Pδ𝒦,𝒦(P) 2𝒮¯(𝒦(P),𝒩)=ν(𝒦) 2𝒮¯(𝒦,𝒩),𝜔𝒦𝒩subscript𝑃subscript𝛿𝒦𝒦𝑃superscript2𝒮𝑃𝒩subscript𝑃subscript𝛿𝒦𝒦𝑃superscript2¯𝒮𝒦𝑃𝒩𝜈𝒦superscript2¯𝒮𝒦𝒩\displaystyle\omega({\cal K},{\cal N})=\sum_{P}\delta_{{\cal K},{\cal K}(P)}\;2^{{\cal S}(P,{\cal N})}\approx\sum_{P}\delta_{{\cal K},{\cal K}(P)}\;2^{\bar{\cal S}({\cal K}(P),{\cal N})}=\nu({\cal K})\;2^{\bar{\cal S}({\cal K},{\cal N})}\;,(6)

leading to

σ(𝒦,𝒩)𝜎𝒦𝒩\displaystyle\sigma({\cal K},{\cal N})log2ν(𝒦)+𝒮¯(𝒦,𝒩)absentsubscript2𝜈𝒦¯𝒮𝒦𝒩\displaystyle\approx\log_{2}\nu({\cal K})+\bar{\cal S}({\cal K},{\cal N})\(7a)
α𝒦+𝒮¯(𝒦,𝒩),absent𝛼𝒦¯𝒮𝒦𝒩\displaystyle\approx\alpha{\cal K}+\bar{\cal S}({\cal K},{\cal N})\ \;,(7b)

where ν(𝒦)=Pδ𝒦,𝒦(P)𝜈𝒦subscript𝑃subscript𝛿𝒦𝒦𝑃\nu({\cal K})=\sum_{P}\delta_{{\cal K},{\cal K}(P)} is a “density of states” that counts the number of possible functionalities (i.e., permutations) implemented by circuits of a fixed complexity, 𝒦𝒦{\cal K}. In writing Eq. (7b) we assumed the extensitivity of both sides of Eq. (7a) which implies that log2ν(𝒦)=α𝒦subscript2𝜈𝒦𝛼𝒦\log_{2}\nu({\cal K})=\alpha{\cal K}. The function ω(𝒦,𝒩)=2σ(𝒦,𝒩)𝜔𝒦𝒩superscript2𝜎𝒦𝒩\omega({\cal K},{\cal N})=2^{\sigma({\cal K},{\cal N})} defines, for circuits of 𝒩𝒩{\cal N} gates, the circuit complexity weight distribution, which peaks at the extremum of the function σ(𝒦,𝒩)𝜎𝒦𝒩\sigma({\cal K},{\cal N}):

σ(𝒦,𝒩)𝒦|𝒩=0=α+𝒮¯(𝒦,𝒩)𝒦|𝒩.\displaystyle\frac{\partial{\sigma({\cal K},{\cal N})}}{\partial{\cal K}}{\biggr{\rvert}}_{{\cal N}}=0=\alpha+\frac{\partial\bar{\cal S}({\cal K},{\cal N})}{\partial{\cal K}}{\biggr{\rvert}}_{{\cal N}}\;.(8)

Since the entropy decreases with complexity, we write 𝒮¯(𝒦,𝒩)/𝒦|𝒩=β(κ)evaluated-at¯𝒮𝒦𝒩𝒦𝒩𝛽𝜅{\partial\bar{\cal S}({\cal K},{\cal N})}/{\partial{\cal K}}|_{{\cal N}}=-\beta(\kappa) where β(κ)𝛽𝜅\beta(\kappa) is a positive function of κ=𝒦/𝒩𝜅𝒦𝒩\kappa={\cal K}/{\cal N}. At the extremum κ=κ𝜅superscript𝜅\kappa=\kappa^{*}, α=β(κ)=β𝛼𝛽superscript𝜅𝛽\alpha=\beta(\kappa^{*})=\beta, and Eq. (7b) assumes the form,

σ(𝒦,𝒩)=β𝒦+𝒮¯(𝒦,𝒩).𝜎superscript𝒦𝒩𝛽superscript𝒦¯𝒮superscript𝒦𝒩\displaystyle\sigma({\cal K}^{*},{\cal N})=\beta\;{\cal K}^{*}+\bar{\cal S}({\cal K}^{*},{\cal N})\ \;.(9)

It is gratifying that Eq. (9) can be recast in a form familiar from the thermodynamics of physical systems: if we interpret 𝒦𝒦{\cal K} as the negative of the energy, =𝒦𝒦\mathcal{E}=-{\cal K} (or equivalently, ϵ=/𝒩=κitalic-ϵ𝒩𝜅\epsilon=\mathcal{E}/{\cal N}=-\kappa) and β=1/T𝛽1𝑇\beta=1/{T} as the inverse of the temperature T𝑇T, Eq. (9) can be rewritten in terms of the equilibrium free energy F(T,𝒩)𝐹𝑇𝒩F(T,{\cal N}),

Tσe(,𝒩)F(T,𝒩)=T𝒮¯e(,𝒩),,𝑇subscript𝜎𝑒𝒩𝐹𝑇𝒩𝑇subscript¯𝒮𝑒𝒩\displaystyle-{T}\;{\sigma_{e}}(\mathcal{E},{\cal N})\equiv F({T},{\cal N})=\mathcal{E}-{T}\;{{\bar{\cal S}}_{e}}(\mathcal{E},{\cal N})\;,\;,(10)

where subscripts e𝑒e represent the respective σ𝜎\sigma and 𝒮¯¯𝒮\bar{\cal S} functions evaluated at the corresponding negative energies. Within this correspondence, the smallest (large negative) energy state - corresponding to high complexity - would represent a low entropy crystal while the largest (zero) energy state - corresponding to low complexity - would represent a high entropy gas.

The direct analogy with statistical mechanics can be exploited further in the calculation of the probability distribution of complexities for 𝒩𝒩{\cal N}-gate circuits:

P𝒩(𝒦)=ω(𝒦,𝒩)𝒦=0𝒩ω(𝒦,𝒩),subscript𝑃𝒩𝒦𝜔𝒦𝒩superscriptsubscript𝒦0𝒩𝜔𝒦𝒩\displaystyle P_{{\cal N}}({\cal K})=\frac{\omega({\cal K},{\cal N})}{\sum_{{\cal K}=0}^{{\cal N}}\omega({\cal K},{\cal N})}\;,(11)

where the form of ω(𝒦,𝒩)𝜔𝒦𝒩\omega({\cal K},{\cal N}) can be obtained by expanding σ(𝒦,𝒩)=log2ω(𝒦,𝒩)=α𝒦+𝒮¯(𝒦,𝒩)𝜎𝒦𝒩subscript2𝜔𝒦𝒩𝛼𝒦¯𝒮𝒦𝒩\sigma({\cal K},{\cal N})=\log_{2}\omega({\cal K},{\cal N})=\alpha{\cal K}+\bar{\cal S}({\cal K},{\cal N}) in Eq. (7b) to second order in Δ𝒦=(𝒦𝒦)Δ𝒦𝒦superscript𝒦\Delta{\cal K}=({\cal K}-{\cal K}^{*}), the departure from the solution of the extremum condition, β(κ)=α𝛽superscript𝜅𝛼\beta(\kappa^{*})=\alpha:

log2ω(𝒦,𝒩)=𝒮¯(𝒦,𝒩)+α𝒦+12Δ𝒦22𝒮¯(𝒦,𝒩)𝒦2|𝒩,𝒦=𝒦+.\displaystyle\log_{2}\omega({\cal K},{\cal N})=\bar{\cal S}({\cal K}^{*},{\cal N})+\alpha{\cal K}^{*}+\frac{1}{2}\;{\Delta{\cal K}}^{2}\;\frac{\partial^{2}\bar{\cal S}({\cal K},{\cal N})}{\partial{\cal K}^{2}}{\biggr{\rvert}}_{{\cal N},{\cal K}={\cal K}^{*}}+\cdots\ \;.(12)

Using the extensivity of the entropy in 𝒦𝒦{\cal K} and 𝒩𝒩{\cal N} we can write 𝒮¯(𝒦,𝒩)=β𝒦βμ𝒩+¯𝒮superscript𝒦𝒩𝛽superscript𝒦𝛽𝜇𝒩\bar{\cal S}({\cal K}^{*},{\cal N})=-\beta{\cal K}^{*}-\beta\mu{\cal N}+\cdots, where we have borrowed the statistical mechanics notation involving the equilibrium “chemical potential” μ𝜇\mu. At the extremum, this leads to the simplification of the first two terms in Eq. (12) to 𝒮¯(𝒦,𝒩)+α𝒦=βμ𝒩¯𝒮superscript𝒦𝒩𝛼superscript𝒦𝛽𝜇𝒩\bar{\cal S}({\cal K}^{*},{\cal N})+\alpha{\cal K}^{*}=-\beta\mu{\cal N} from which it then follows that:

ω(𝒦,𝒩)𝜔𝒦𝒩\displaystyle\omega({\cal K},{\cal N})=212𝒩T2c𝒩Δ𝒦2 2βμ𝒩.absentsuperscript212𝒩superscript𝑇2subscript𝑐𝒩Δsuperscript𝒦2superscript2𝛽𝜇𝒩\displaystyle=2^{-\frac{1}{2{\cal N}T^{2}c_{{\cal N}}}{\Delta{\cal K}}^{2}}\;2^{-\beta\mu{\cal N}}\;.(13)

Thus, the probability distribution in Eq. (11) is a Gaussian peaked at 𝒦¯=𝒦=κ𝒩¯𝒦superscript𝒦superscript𝜅𝒩{\bar{\cal K}}={\cal K}^{*}=\kappa^{*}{\cal N} linear in 𝒩𝒩{\cal N} with a width (root mean square deviation) Δrms𝒩T2c𝒩proportional-tosubscriptΔrms𝒩superscript𝑇2subscript𝑐𝒩\Delta_{\rm rms}\propto\sqrt{{\cal N}T^{2}c_{{\cal N}}}, where c𝒩=𝒦/T|𝒦,𝒩subscript𝑐𝒩evaluated-at𝒦𝑇superscript𝒦𝒩c_{{\cal N}}=-{\partial{\cal K}}/{\partial T}{|}_{{\cal K}^{*},{\cal N}} is a positive intensive quantity analogous to the specific heat in thermodynamics, which, in physical systems measures the increase in energy induced by an increase in temperature and controls energy fluctuations around the thermal equilibrium state at temperature T𝑇T. In our case, note the negative sign in the definition of c𝒩subscript𝑐𝒩c_{{\cal N}}: this accounts for the fact that increasing temperature (i.e., increasing entropy) implies a decrease in complexity. Moreover, Eq. (13) and the sum rule PΩ(P,𝒩)=𝒦=0𝒩ω(𝒦,𝒩)=|G|𝒩subscript𝑃Ω𝑃𝒩superscriptsubscript𝒦0𝒩𝜔𝒦𝒩superscript𝐺𝒩\sum_{P}\;\Omega(P,{\cal N})=\sum_{{\cal K}=0}^{{\cal N}}\omega({\cal K},{\cal N})=|G|^{\cal N} determines the leading behavior of the chemical potential, μ=Tlog2|G|𝜇𝑇subscript2𝐺\mu=-T\log_{2}|G|.

It is important to stress that we expect that generic solutions of the extremum condition α=β(κ)𝛼𝛽superscript𝜅\alpha=\beta(\kappa^{*}) for κsuperscript𝜅\kappa^{*}, which depend on the gate set through the value of α𝛼\alpha, are neither 0 nor 1 but lie in between, 0<κ<10superscript𝜅10<\kappa^{*}<1. This expectation underscore two important conclusions of our paper, which we conjecture will survive more rigorous treatments: (a) generic circuits display a finite circuit compressibility with a compression factor η=(1𝒦/𝒩)𝜂1superscript𝒦𝒩\eta=(1-{\cal K}^{*}/{\cal N}), with 0<η<10𝜂10<\eta<1; and (b) the average complexity grows linearly with the depth of the circuit. We stress that these results hinge on an important and non-trivial feature that emerges from the thermodynamic arguments at the root of Eq. (8) and the resulting condition α=β(κ)𝛼𝛽𝜅\alpha=\beta(\kappa), namely the balance between two competing effects: the exponential increase in the density of states ν(𝒦)2α𝒦𝜈𝒦superscript2𝛼𝒦\nu({\cal K})\approx 2^{\alpha{\cal K}} and the decrease in the entropy 𝒮¯(𝒦,𝒩)¯𝒮𝒦𝒩\bar{\cal S}({\cal K},{\cal N}) with increasing 𝒦𝒦{\cal K}. We also note that, while our extensivity assumption for log2ν(𝒦)subscript2𝜈𝒦\log_{2}\nu({\cal K}) and the linear increase of the average complexity with circuit depth should hold up to a maximum complexity exponential in n𝑛n, 𝒦maxn 2nsimilar-tosubscript𝒦max𝑛superscript2𝑛\mathcal{{\cal K}}_{\rm max}\sim n\;2^{n}, our focus is on polynomial (in n𝑛n) size circuits with 𝒩>>nmuch-greater-than𝒩𝑛{\cal N}>>n.

To further motivate the notion that generic circuits display a finite compressibility with a compression factor 0<η<10𝜂10<\eta<1, we consider the following scenario leading to a lower bound on η𝜂\eta. Consider a random circuit of 3-bit Toffoli gates and imagine “pushing” a gate through the circuit until the gate encounters either (i) a gate with which it does not commute, in which case we stop; or (ii) its inverse, in which case the pair (the gate and its inverse) annihilate, decreasing the size of the circuit by two gates (see Fig. 1). For a Toffoli gate, the probability that it does commute with a gate on its path is of the order 1𝒪(1/n)1𝒪1𝑛1-{\cal O}(1/n), or equivalently, a gate can be “pushed” through 𝒪(n)𝒪𝑛{\cal O}(n) gates before either stopping as in case (i) or annihilating as in case (ii). The overall probability of annihilation is 𝒪(1/n2)𝒪1superscript𝑛2{\cal O}(1/n^{2}), accounting for the probability 𝒪(1/n3)𝒪1superscript𝑛3{\cal O}(1/n^{3}) that the inverse is met in any of the 𝒪(n)𝒪𝑛{\cal O}(n) attempts before stopping. Hence, this process leads to a compression of the circuit by a factor (12ξ/n2)12𝜉superscript𝑛2(1-2\xi/n^{2}) of its original size, where ξ𝜉\xi is a constant of 𝒪(1)𝒪1{\cal O}(1). This implies that circuits with greater than 𝒪(n2)𝒪superscript𝑛2{\cal O}(n^{2}) universal (Toffoli) gates are compressible with η=2ξ/n2𝜂2𝜉superscript𝑛2\eta=2\xi/n^{2}, setting a lower bound for compressibility of random circuits of universal gates. Indeed, since the probability of annihilation of linear gates - NOTs and CNOTs - scales more favorably as 1/n1𝑛1/n and 1/n21superscript𝑛21/n^{2} respectively, circuits comprised of gates from the universal set of Toffolis, CNOTs, and NOTs are more compressible with a compression factor η𝜂\eta above the Toffoli bound. [It is worth mentioning that since any linear circuit can be implemented with 𝒪(n2)𝒪superscript𝑛2{\cal O}(n^{2}) gates, purely linear circuits are highly compressible, with η(1n2/𝒩)similar-to𝜂1superscript𝑛2𝒩\eta\sim(1-n^{2}/{\cal N}).]

Refer to caption
Figure 1: An example of “pushing” a Toffoli gate g𝑔g past gates h1,h2,,hpsubscript1subscript2subscript𝑝h_{1},h_{2},\dots,h_{p} so as to annihilate g𝑔g with its inverse g~~𝑔\tilde{g} (identical to g𝑔g for a Toffoli gate), thereby reducing the circuit size by two gates. Typically, in a random circuit over n𝑛n bitlines, a Toffoli gate can travel past 𝒪(n)𝒪𝑛{\cal O}(n) gates with which it commutes before encountering either a gate with which it does not commute or, with probability 𝒪(1/n3)𝒪1superscript𝑛3{\cal O}(1/n^{3}), its inverse. The process depicted leads to a compression of the circuit size by a factor (12ξ/n2)12𝜉superscript𝑛2(1-2\xi/n^{2}), where ξ𝜉\xi is a constant of 𝒪(1)𝒪1{\cal O}(1).

Finally, we note that a compression factor 0<η<10𝜂10<\eta<1 also implies that circuit collisions - i.e., multiple circuits implementing the same permutation - are non-negligible. The importance of collisions can also be argued from a lower bound for 𝒮(P,𝒩)𝒮𝑃𝒩{\cal S}(P,{\cal N}),

[𝒩𝒦(P)]log2|G|1/2𝒮(P,𝒩),delimited-[]𝒩𝒦𝑃subscript2superscript𝐺12𝒮𝑃𝒩\displaystyle\left[{\cal N}-{\cal K}(P)\right]\;\log_{2}|G|^{1/2}\leq{\cal S}(P,{\cal N})\;,(14)

which highlights the fact that there are exponentially many circuits that realize any P𝑃P. This result can be derived from a bound on 𝒮(11,𝒩𝒦(P))𝒮11𝒩𝒦𝑃{\cal S}({1\!\!1},{\cal N}-{\cal K}(P)), which enters Eq. (3). In particular, we proceed by placing bounds on the entropy of identities, 𝒮(11,𝒩)𝒮11𝒩{\cal S}({1\!\!1},{\cal N}). By expressing 𝒩=a 2𝒩subscriptsubscript𝑎superscript2{\cal N}=\sum_{\ell}a_{\ell}\;2^{\ell}, where a=0,1subscript𝑎01a_{\ell}=0,1 are the binary coefficients in the expansion of 𝒩𝒩{\cal N} in base 2 (we shall assume that 𝒩𝒩{\cal N} is even), and then using Eq. (2) multiple times, it follows that 𝒮(11,𝒩)a𝒮(11,2)a 21𝒮(11,2)=𝒩2𝒮(11,2)=𝒩2log2|G|𝒮11𝒩subscriptsubscript𝑎𝒮11superscript2subscriptsubscript𝑎superscript21𝒮112𝒩2𝒮112𝒩2subscript2𝐺{\cal S}({1\!\!1},{\cal N})\geq\sum_{\ell}a_{\ell}\;{\cal S}({1\!\!1},2^{\ell})\geq\sum_{\ell}a_{\ell}\;2^{\ell-1}{\cal S}({1\!\!1},2)=\frac{{\cal N}}{2}{\cal S}({1\!\!1},2)=\frac{{\cal N}}{2}\log_{2}|G|, where we used that a two-gate identity can be written as the product of any gate g𝑔g and its inverse g1superscript𝑔1g^{-1}. This bound on the entropy of identities, together with Eq. (3), lead to Eq. (14).

Thermodynamic mixing of circuits: The thermodynamic approach presented above relies on the microcanonical assumption, namely that all 𝒩𝒩{\cal N}-gate circuits of a given functionality P𝑃P appear with equal weight in the count Ω(P,𝒩)Ω𝑃𝒩\Omega(P,{\cal N}). This assumption hinges on “ergodicity” in the space of circuits of a given functionality, a concept which implies a “microscopic” dynamical process and “equilibration” of collections of gates in a circuit, analogous to the thermalization induced by microscopic collisions of atoms or molecules in a gas. We shall return to the complex and interesting question of microscopic dynamics below. Here we concentrate on a coarse-grained model for thermodynamic mixing on a “macroscopic” scale by dividing the circuit into smaller pieces, and assuming that thermalization occurs on a “mesoscopic” scale. In particular, the equilibration of an arbitrary (polynomial size) circuit is established by connecting a string of short m𝑚m-gate segments/subcircuits. These “mesoscopic” subcircuits are assumed to be large enough to obey the laws of circuit thermodynamics introduced above but small enough so that an appropriate set of “microscopic” dynamical rules leads to rapid equilibration in a time τeqsubscript𝜏𝑒𝑞\tau_{eq}.

More precisely, consider the situation depicted in Fig. 2, in which two m𝑚m-gate subcircuits of functionality P1subscript𝑃1P_{1} and P2subscript𝑃2P_{2}, respectively, are allowed to exchange gates and functionality via some dynamical rules. Thermalization at the mesoscopic scale implies that, after a time scale τeqsubscript𝜏𝑒𝑞\tau_{eq}, (a) the counting of individual subcircuits (Fig. 2a) satisfy the microcanonical assumption, and (b) the concatenated circuit with 2m2𝑚2m gates and functionality P1P2subscript𝑃1subscript𝑃2P_{1}P_{2} satisfies the thermodynamic inequalities Eqs. (2) and (5).

Refer to caption
Figure 2: The elementary C-gate represents the equilibration between two circuits of equal sizes 𝒩1=𝒩2=msubscript𝒩1subscript𝒩2𝑚{\cal N}_{1}={\cal N}_{2}=m. The two individual m𝑚m-gate circuits, depicted in (a), have functionalities P1subscript𝑃1P_{1} and P2subscript𝑃2P_{2}, respectively. In (b) they are brought into contact and exchange gates and functionality, realizing a combined functionality P1P2subscript𝑃1subscript𝑃2P_{1}P_{2}, while preserving the total number of gates 𝒩1+𝒩2=2msubscript𝒩1subscript𝒩22𝑚{\cal N}_{1}+{\cal N}_{2}=2m. In (c), following equilibration (symbolized by the red double-arrow in (b)) the 2m2𝑚2m-gate circuit is split in the middle such that each of the partitions contains m𝑚m gates and represents, respectively, functionalities P1subscriptsuperscript𝑃1P^{\prime}_{1} and P2subscriptsuperscript𝑃2P^{\prime}_{2}, with P1P2=P1P2subscriptsuperscript𝑃1subscriptsuperscript𝑃2subscript𝑃1subscript𝑃2P^{\prime}_{1}\,P^{\prime}_{2}=P_{1}\,P_{2}.

Given the mesoscopic thermalization assumption, we are now in position to define a coarse-grained model for thermodynamic mixing that takes as input a circuit C𝐶C that is split into M𝑀M subcircuits, each comprising of m=𝒩/M𝑚𝒩𝑀m={\cal N}/M gates: C=c1c2cM𝐶subscript𝑐1subscript𝑐2subscript𝑐𝑀C=c_{1}c_{2}...c_{M}. A subcircuit cisubscript𝑐𝑖c_{i} (i=1,,M𝑖1𝑀i=1,\dots,M) can be thought of as a degree of freedom in a d𝑑d-dimensional space with d=|G|m𝑑superscript𝐺𝑚d=|G|^{m} states, i.e., a dit; and thus a circuit can be viewed as a string of M𝑀M such dits. The coarse-grained mixing of the full circuit C𝐶C is implemented as a circuit acting on dit-strings, i.e., a “circuit acting on circuits” - hereafter referred to as a C-circuit - built out of gates acting on dits, i.e., “gates acting on circuits” - referred to as C-gates. Fig. 3 depicts a brickwall C-circuit of C-gates acting on a pair of neighboring dits ci1(τ)subscript𝑐𝑖1𝜏c_{i-1}(\tau) and ci(τ)subscript𝑐𝑖𝜏c_{i}(\tau) in layer τ𝜏\tau and evolving them into ci1(τ+1)subscript𝑐𝑖1𝜏1c_{i-1}(\tau+1) and ci(τ+1)subscript𝑐𝑖𝜏1c_{i}(\tau+1) after one “time” step, i.e., into layer τ+1𝜏1\tau+1 of the C-circuit. The brickwall C-circuit is a scrambler of circuits, much as usual brickwall circuits of dit- or qudit-gates are scramblers of states of dits or qudits (see for example Ref. [7] and references therein).

Refer to caption
Figure 3: A brickwall C-circuit that progressively expands the “mesoscopic” (local) equilibrium established between pairs of m𝑚m-gate subcircuits (depicted by the gray boxes) into a thermodynamically mixed equilibrium state for the full circuit, while preserving the functionality of the original concatenation of gates. Neighboring m𝑚m-gate subcircuits are brought into local thermal equilibrium via the exchange (depicted by the two-headed red arrows) of gates and functionality (while preserving both the number of gates and the combined functionality of the subcircuits). A subcircuit is paired with either its neighbor to the left or to the right, alternating in each time step (following the pattern of blue arrows).

The action of an individual C-gate, which takes place on a time scale longer than τeqsubscript𝜏𝑒𝑞\tau_{eq}, is based on the mesoscopic equilibration assumption, and is implemented in three steps that parallel those depicted in Fig. 2, as follows: (a) take ci1(τ)subscript𝑐𝑖1𝜏c_{i-1}(\tau) and ci(τ)subscript𝑐𝑖𝜏c_{i}(\tau), with functionalities P(ci1(τ))𝑃subscript𝑐𝑖1𝜏P(c_{i-1}(\tau)) and P(ci(τ))𝑃subscript𝑐𝑖𝜏P(c_{i}(\tau)); (b) draw a circuit cauxsubscript𝑐auxc_{\rm aux} uniformly out of the Ω(P,2m)Ω𝑃2𝑚\Omega(P,2m) 2m2𝑚2m-gate circuits with functionality P=P(ci1(τ))P(ci(τ))𝑃𝑃subscript𝑐𝑖1𝜏𝑃subscript𝑐𝑖𝜏P=P(c_{i-1}(\tau))\,P(c_{i}(\tau)); and (c) split the 2m2𝑚2m-gate circuit cauxsubscript𝑐auxc_{\rm aux} into two m𝑚m-gate circuits ci1(τ+1)subscript𝑐𝑖1𝜏1c_{i-1}(\tau+1) and ci(τ+1)subscript𝑐𝑖𝜏1c_{i}(\tau+1). We note that the action of a C-gate on the two dits ci1subscript𝑐𝑖1c_{i-1} and cisubscript𝑐𝑖c_{i} preserves functionality of the product of the two associated sub-circuits, a “conservation law” that maintains the functionality of the overall circuit. (We also note that the stochastic process defined above could be replaced by the action of a C-circuit built from deterministic C-gates with given substitution truth tables chosen randomly.)

As alluded to above, the action of the brickwall C-circuit progressively expands the “local” equilibrium within each of the m𝑚m-gate subcircuits into an thermodynamically mixed equilibrium state for a full circuit C𝐶C of any size 𝒩𝒩{\cal N}. The equilibration process induced via the C-circuit is analogous to the equilibration of connected thermodynamic systems (e.g., containers of gas molecules) that were initially isolated from one another. More specifically, this thermodynamic mixing of circuits reflects three properties of the explicit C-circuit implementation: (i) the circuit entropy after the application of each C-gate never decreases, but increases or remains the same; (ii) through subsequent layers of the scrambling process, functionalities of individual subcircuits change but the functionality of the overall concatenated circuit is preserved; and, most importantly, (iii) the thermalization in the space of dits defining the action of a stochastic C-gate and the layer-by-layer evolution of the circuit leads to the branching into a multitude of paths, which implies that memory of the initial circuit is lost, i.e., the scrambling process is irreversible.

Given the one-dimensional brickwall arrangement of gates acting on M𝑀M dits, such as the C-circuit in Fig. 3, the number of layers required for scrambling the initial dit-string (in our case the initial circuit C𝐶C) should scale as Mγsuperscript𝑀𝛾M^{\gamma}. In random circuits acting on dits without conservation laws γ=1𝛾1\gamma=1 [6, 8, 9, 7] while in the presence of locally conserved quantities we expect γ2𝛾2\gamma\geq 2 [10, 11, 12]. For the case of scrambling by C-circuits, a C-gate acting on two subcircuits of functionalities P1subscript𝑃1P_{1} and P2subscript𝑃2P_{2}, respectively, may change P1subscript𝑃1P_{1} and P2subscript𝑃2P_{2} but preserves P1P2subscript𝑃1subscript𝑃2P_{1}P_{2}. This more complicated “non-linear” conservation law has not yet been analyzed in detail but we expect that both the saturation of the entropy to its maximum attainable value and the state of uniform average complexity, 𝒦i¯=𝒦(P)/M¯subscript𝒦𝑖𝒦𝑃𝑀\bar{{\cal K}_{i}}={\cal K}(P)/M, for each of the M𝑀M subcircuits of a C-circuit C𝐶C are reached within a time polynomial in M𝑀M.

An application to Circuit Obfuscation: The C-circuit-based thermodynamic mixing of circuits presented above provides a conceptual framework for circuit obfuscation. Circuit obfuscation can be viewed as a gedanken experiment: take two 𝒩𝒩{\cal N}-gate circuits, C1subscript𝐶1C_{1} and C2subscript𝐶2C_{2}, with the same functionality P𝑃P, and apply to each of them a functionality preserving scrambling procedure that runs in polynomial time. As defined in Ref. [13], Indistinguishability Obfuscation (IO) holds if at the end of the process an adversary with polynomial resources cannot distinguish whether a given obfuscated circuit originated from C1subscript𝐶1C_{1} or C2subscript𝐶2C_{2}. Indeed, as we have seen from the discussions above, a sufficiently large C-circuit is a good circuit obfuscator since the scrambling process removes all information about initial circuits and thus an adversary with polynomial resources would not be able to distinguish which scrambled circuit originated from which initial circuit.

We note that the general line of reasoning presented so far makes certain assumptions, some of which will be challenged below. In particular, the notion of fragmentation of the space of circuits of a given size and functionality into disconnected sectors, which we introduce shortly, will restrict the thermodynamic framework to individual sectors. As discussed below, fragmentation of circuit space has conceptual implications for the problem of circuit obfuscation.

Microscopic dynamics of circuits: All thermodynamics-based arguments presented thus far rely on the assumption of ergodicity, namely that some microscopic dynamical rules that connect circuits of same size and functionality lead to a uniform covering of the space of all such circuits. Moreover, we assumed that equilibration across the space of circuits is achieved in polynomial time, i.e., that, given the dynamical rules, connecting any two circuits can be achieved with a number of steps that scales polynomially in the number of gates, 𝒩𝒩{\cal N}. This assumption raises a number of interesting and up to now unexplored questions.

To begin with, by contrast to motion of molecules in a gas in the course of collisions, which is governed by physical laws, there is no unique or natural dynamics for moving/colliding gates in a circuit in ways that preserve functionality. A naive notion of gate collisions, analogous to collisions of gas particles, must take into account the non-commutative algebra of gates in a universal set. If one defines a collision as an interchange of gates g1subscript𝑔1g_{1} and g2subscript𝑔2g_{2} acting on shared bitlines, then preserving functionality before and after the collision implies, generically, a substitution g1g2g2Dg1subscript𝑔1subscript𝑔2subscript𝑔2𝐷subscript𝑔1g_{1}\,g_{2}\leftrightarrow g_{2}\,D\,g_{1}, where D𝐷D is a “debris” gate needed so that algebraically g1g2=g2Dg1subscript𝑔1subscript𝑔2subscript𝑔2𝐷subscript𝑔1g_{1}\,g_{2}=g_{2}\,D\,g_{1}. An example of such a collision is illustrated in Fig. 4a for two Toffoli gates. A macroscopic number of such debris-generating collisions would inevitably lead to an irreversible increase in the size of the circuit, violating the constraint of a fixed number of gates.

Refer to caption
Figure 4: (a) An example of a collision (the interchange) g1g2g2Dg1subscript𝑔1subscript𝑔2subscript𝑔2𝐷subscript𝑔1g_{1}\,g_{2}\leftrightarrow g_{2}\,D\,g_{1}, where the debris gate D𝐷D is needed to preserve the functionality of the initial two-gate segment of the circuit. (b) An example of a substitution of a segment with k=3𝑘3k=3 gates, g1g2g3g1g2g3subscript𝑔1subscript𝑔2subscript𝑔3subscriptsuperscript𝑔1subscriptsuperscript𝑔2subscriptsuperscript𝑔3g_{1}\,g_{2}\,g_{3}\leftrightarrow g^{\prime}_{1}\,g^{\prime}_{2}\,g^{\prime}_{3}. The same arrangements in (b) can be used as examples of two functionally equivalent circuits with 𝒩=3𝒩3{\cal N}=3 that cannot be connected via a k=2𝑘2k=2 substitution rule.

A more fruitful direction is to define a dynamics in the space of circuits based on gate-substitution rules that exchange a string of gates with an alternate string with same size and functionality. One can view an 𝒩𝒩{\cal N}-gate circuit as a quasi-1D system, or a chain of 𝒩𝒩{\cal N} sites, in which a gate gisubscript𝑔𝑖g_{i} (a non-Abelian group element) is placed at each site i𝑖i. Global functionality is determined by P=g1g2g𝒩𝑃subscript𝑔1subscript𝑔2subscript𝑔𝒩P=g_{1}\;g_{2}\cdots g_{\cal N}, and a local microscopic dynamics must preserve this overall functionality. The functionality-preserving local dynamical model we have in mind involves the following substitution of a string of k𝑘k consecutive gates:

(gi,gi+1,,gi+k)subscriptsuperscript𝑔absent𝑖subscriptsuperscript𝑔absent𝑖1subscriptsuperscript𝑔absent𝑖𝑘\displaystyle\left(g^{\,}_{i},g^{\,}_{i+1},\dots,g^{\,}_{i+k}\right)(gi,gi+1,,gi+k)absentsubscriptsuperscript𝑔𝑖subscriptsuperscript𝑔𝑖1subscriptsuperscript𝑔𝑖𝑘\displaystyle\longleftrightarrow\left(g^{\prime}_{i},g^{\prime}_{i+1},\dots,g^{\prime}_{i+k}\right)(15a)
gigi+1gi+ksubscript𝑔𝑖subscript𝑔𝑖1subscript𝑔𝑖𝑘\displaystyle g_{i}\,g_{i+1}\,\dots\,g_{i+k}=gigi+1gi+k.absentsubscriptsuperscript𝑔𝑖subscriptsuperscript𝑔𝑖1subscriptsuperscript𝑔𝑖𝑘\displaystyle\;\;=\;\;g^{\prime}_{i}\,g^{\prime}_{i+1}\,\dots\,g^{\prime}_{i+k}\;.(15b)

An example of a k=3𝑘3k=3 circuit identity involving Toffoli and CNOT gates is shown in Fig. 4b. Substitution rules for fixed (and small) k𝑘k can be built from a catalog of strings of k𝑘k gates that multiply to the same permutation. Transition probabilities among the k𝑘k-length strings, in the case the catalog is exhaustive, can be chosen to be

T(gi,,gi+k),(gi,,gi+k)=1Ω(gigi+k,k)δgigi+k,gigi+k.subscript𝑇subscriptsuperscript𝑔absent𝑖subscriptsuperscript𝑔absent𝑖𝑘subscriptsuperscript𝑔𝑖subscriptsuperscript𝑔𝑖𝑘1Ωsubscript𝑔𝑖subscript𝑔𝑖𝑘𝑘subscript𝛿subscript𝑔𝑖subscript𝑔𝑖𝑘subscriptsuperscript𝑔𝑖subscriptsuperscript𝑔𝑖𝑘\displaystyle T_{\left(g^{\,}_{i},\dots,g^{\,}_{i+k}\right),\left(g^{\prime}_{i},\dots,g^{\prime}_{i+k}\right)}=\frac{1}{\Omega(g_{i}\,\dots\,g_{i+k},k)}\;\delta_{g_{i}\,\dots\,g_{i+k},g^{\prime}_{i}\,\dots\,g^{\prime}_{i+k}}\;.(16)

We note that the stochastic C-gate used above can be implemented via such a transition matrix element with k=2m𝑘2𝑚k=2m. Alternatively, one can dilute the connectivity associated with the T𝑇T-matrix so that not all pairs of k𝑘k-strings satisfying Eqs. (15) are connected via a matrix element. We note that since the number of circuits with k𝑘k gates is |G|ksuperscript𝐺𝑘|G|^{k}, enumerating the equivalence rules for large k𝑘k becomes prohibitive.

While to our knowledge this type of dynamical model has not been discussed in the literature and a detailed study of the model is outside the scope of this paper, we can already point to a set of fundamental issues that have important implications for the discussion of circuit thermodynamics. In particular, our intuition suggests that the space of circuits with functionality P=g1g2g𝒩𝑃subscript𝑔1subscript𝑔2subscript𝑔𝒩P=g_{1}\;g_{2}\cdots g_{\cal N} evolving via k𝑘k-range rules will generically fragment into a number of disconnected sectors. A simple example that supports the notion of fragmentation is to consider a functionality-preserving dynamics that only connects 2-strings if and only if two neighboring gates gisubscript𝑔𝑖g_{i} and gi+1subscript𝑔𝑖1g_{i+1} commute, in which case we exchange (gi,gi+1)(gi+1,gi)subscript𝑔𝑖subscript𝑔𝑖1subscript𝑔𝑖1subscript𝑔𝑖(g_{i},g_{i+1})\leftrightarrow(g_{i+1},g_{i}) with probability 1/2. This dynamics allows a gate to move left and right through the list of gates in the circuit by passing other gates with which it commutes, but not past those gates with which it does not commute. This dynamics preserves the number of gates of each type in the circuit and thus does not allow one to connect the two equivalent circuits in Fig. 4b. A less restricted dynamics with k=2𝑘2k=2 in this same example would still not allow the two sequences of three gates in Fig. 4b to be connected.

Fragmentation implies that a particular dynamics is ergodic only within individual sectors, and thus all the thermodynamic results would apply, but only within each disconnected sector. Implicit in this statement is that, within a given sector, ergodicity is reached within a number of steps defining the particular dynamics that is polynomial in 𝒩𝒩{\cal N}. In this case, the finite compressibility of generic circuits is an example of a property that survives in the fragmented system, where the compression factor should be determined by some weighted average over fragments.

The above intuition concerning fragmentation and polynomial thermalization is further supported by arguments from the theory of computational complexity. According to these arguments, connecting any two circuits of the same functionality and size via a polynomial number of local functionality preserving dynamical moves would imply the equality NP = coNP of two complexity classes, namely NP - decision problems for which polynomial time solutions are not known but for which a YES solution can be checked in polynomial time; and coNP - decision problems for which polynomial time solutions are not known but for which a NO solution can be checked in polynomial time. Even though it is widely believed that NP \neq coNP, rigorously justifying this belief (or its negation) is an open problem in computer science. In order to understand the above claim consider the Circuit Equivalence problem, the problem of deciding whether two (polynomial-sized) circuits are equivalent. Circuit Equivalence is known to be a problem in coNP, since a NO solution can be easily checked by comparing the outputs of the two circuits on a given input. At the same time, if any two circuits could be connected by a polynomial number of dynamical moves, even if difficult to find, this set of moves can be used to verify a YES solution of the Circuit Equivalence problem in polynomial time, placing Circuit Equivalence also in NP. Similarly, a parallel set of arguments can be used to argue that Circuit Inequivalence, i.e., the problem of deciding that two (polynomial-sized) circuits are inequivalent, which is a problem in NP, is also in class coNP since the connectivity of any two circuits via a polynomial number of moves could be used to verify the NO solution of Circuit Inequivalence (i.e., equivalence) in polynomial time. Moreover, it is also well known that Circuit Equivalence and Circuit Inequivalence are among the hardest problems in their respective coNP and NP classes, i.e., they are in classes coNP-complete and NP-complete, respectively. “Completeness” indicates that any problem in coNP or NP can be reduced, respectively, to Circuit Equivalence or Circuit Inequivalence in polynomial time. Given that a polynomial number of dynamical moves placed Circuit Equivalence in NP and Circuit Inequivalence in coNP the conclusions of the above line of argumentation are that: (i) all problems in coNP are in NP (coNP \subset NP); (ii) all problems in NP are in coNP (NP \subset coNP); and thus that (iii) NP = coNP. As already alluded to above, this conclusion contradicts widely accepted beliefs in computational complexity and implies that, in our context, fragmentation is unavoidable, regardless of whether the polynomial sequence of moves connecting pairs of circuits is easy or hard to find.

Clearly, fragmentation and the accompanying broken ergodicity significantly alters the discussion of circuit obfuscation. For a system with multiple sectors, the relevant question becomes: given two circuits C1subscript𝐶1C_{1} and C2subscript𝐶2C_{2}, can one decide in polynomial time whether they belong to the same ergodic (thermalized) sector or not? Physical intuition based on the scrambling of information, irreversibility, and chaos in closed systems with large number of degrees of freedom leads to a natural conjecture that, for non-trivial dynamical rules, this is a hard (NP) decision problem. If this is the case, then the thermodynamic framework does in fact provide a path to Indistinguishability Obfuscation of any two circuits, C1subscript𝐶1C_{1} and C2subscript𝐶2C_{2}. Otherwise the thermodynamic framework could only establish IO for circuits in the same sector.

Discussion and future directions

This paper presents a thermodynamic framework for describing course-grained properties of large 𝒩𝒩{\cal N}-gate reversible classical circuits with 𝒩nmuch-greater-than𝒩𝑛{\cal N}\gg n (with 𝒩𝒩{\cal N} polynomial in n𝑛n, the number of bitlines of the circuit) and a given functionality, defined by the permutation P𝑃P implemented by the circuit. Our construction of circuit thermodynamics is based on three assumptions that underpin the logical consistency of the approach: (i) the functionality P𝑃P only appears through the circuit complexity 𝒦(P)𝒦𝑃{\cal K}(P), i.e., the minimum number of gates required for the implementation of the permutation P𝑃P; (ii) the entropy defined by counting of the number of possible 𝒩𝒩{\cal N}-gate circuits implementing P𝑃P is extensive in 𝒩𝒩{\cal N} and 𝒦(P)𝒦𝑃{\cal K}(P); and (iii) ergodicity in the space of circuits, which as a result of fragmentation can only occur in disconnected sectors, requires a “time” (i.e., number of dynamical moves) that is polynomial in 𝒩𝒩{\cal N}, the size of the circuit.

The fragmentation of the space of circuits suggests a number of questions we expect to address through more detailed analytical and computational studies: (i) is there is a critical value kcsubscript𝑘𝑐k_{c} such that if kck𝒩subscript𝑘𝑐𝑘𝒩k_{c}\leq k\leq{\cal N} the space of circuits of size 𝒩𝒩{\cal N} and functionality P𝑃P becomes fully connected, and how does this value scales with the number of bitlines n𝑛n? (ii) If the space is fragmented, how does the number of fragments scale with k𝑘k and 𝒩𝒩{\cal N} and (possibly) the complexity of P𝑃P? (iii) can one make more precise statements about the hardness of deciding whether any two circuits belong to the same or different sectors? We note that even though we raise these questions in the context of the permutation group S2nsubscript𝑆superscript2𝑛S_{2^{n}}, the thermodynamic framework and the issues it raises can be generalized to other groups.

In summary, the thermodynamic perspective to complexity and functionality of circuits provides a framework that may stimulate new ways of thinking and new problems at the interface between physics and computer science. In particular, the issue of fragmentation, which is a topic of much current interest to the physics communities working on classical and quantum dynamics [14, 15, 16, 17, 18], may raise new questions for the computer science community, which to our knowledge have not been explored. Conversely, the question of the scaling of information scrambling rates with system size for systems with “multiplicative” rather than additive conservation laws (as is the case with the functionality of circuits) may intrigue and inspire physicists interested in classical and quantum dynamics.

Acknowledgments

We are grateful to Alexsey Khudorozhkov and Guilherme Delfino for insightful discussions. This work was supported in part by DOE Grant DE-FG02-06ER46316 (C.C.) and a Grant from the Mass Tech Collaborative Innovation Institute (A.E.R.). R.C., C.C., and A.E.R. also acknowledge the Quantum Convergence Focused Research Program, funded by the Rafik B. Hariri Institute at Boston University.

References

  • [1] Valentine Kabanets and Jin-Yi Cai. Circuit minimization problem. In Proceedings of the Thirty-Second Annual ACM Symposium on Theory of Computing, STOC ’00, page 73–79, New York, NY, USA, 2000. Association for Computing Machinery.
  • [2] Alexander A Razborov and Steven Rudich. Natural proofs. Journal of Computer and System Sciences, 55(1):24–35, 1997.
  • [3] Leonard Susskind. Three lectures on complexity and black holes, 2018.
  • [4] Adam R. Brown, Leonard Susskind, and Ying Zhao. Quantum complexity and negative curvature. Phys. Rev. D, 95:045010, Feb 2017.
  • [5] Adam R. Brown and Leonard Susskind. Second law of quantum complexity. Phys. Rev. D, 97:086015, Apr 2018.
  • [6] Patrick Hayden and John Preskill. Black holes as mirrors: quantum information in random subsystems. Journal of High Energy Physics, 2007(09):120, sep 2007.
  • [7] Aram W. Harrow and Saeed Mehraban. Approximate unitary t-designs by short random quantum circuits using nearest-neighbor and long-range gates. Communications in Mathematical Physics, 401(2):1531–1626, May 2023.
  • [8] Winton Brown and Omar Fawzi. Scrambling speed of random quantum circuits, 2013.
  • [9] Winton Brown and Omar Fawzi. Decoupling with random quantum circuits. Communications in Mathematical Physics, 340(3):867–900, September 2015.
  • [10] Tibor Rakovszky, Frank Pollmann, and C. W. von Keyserlingk. Diffusive hydrodynamics of out-of-time-ordered correlators with charge conservation. Phys. Rev. X, 8:031058, Sep 2018.
  • [11] Vedika Khemani, Ashvin Vishwanath, and David A. Huse. Operator spreading and the emergence of dissipative hydrodynamics under unitary evolution with conservation laws. Phys. Rev. X, 8:031057, Sep 2018.
  • [12] Sumner N. Hearth, Michael O. Flynn, Anushya Chandran, and Chris R. Laumann. Unitary k-designs from random number-conserving quantum circuits, 2023.
  • [13] Boaz Barak, Oded Goldreich, Rusell Impagliazzo, Steven Rudich, Amit Sahai, Salil Vadhan, and Ke Yang. On the (im)possibility of obfuscating programs. In Joe Kilian, editor, Advances in Cryptology — CRYPTO 2001, pages 1–18, Berlin, Heidelberg, 2001. Springer Berlin Heidelberg.
  • [14] F. Ritort and P. Sollich. Glassy dynamics of kinetically constrained models. Advances in Physics, 52(4):219–342, June 2003.
  • [15] Sanjay Moudgalya, B Andrei Bernevig, and Nicolas Regnault. Quantum many-body scars and hilbert space fragmentation: a review of exact results. Reports on Progress in Physics, 85(8):086501, July 2022.
  • [16] Vedika Khemani, Michael Hermele, and Rahul Nandkishore. Localization from hilbert space shattering: From theory to physical realizations. Phys. Rev. B, 101:174204, May 2020.
  • [17] Sanjay Moudgalya and Olexei I. Motrunich. Hilbert space fragmentation and commutant algebras. Phys. Rev. X, 12:011050, Mar 2022.
  • [18] Zhi-Cheng Yang, Fangli Liu, Alexey V. Gorshkov, and Thomas Iadecola. Hilbert-space fragmentation from strict confinement. Phys. Rev. Lett., 124:207602, May 2020.