arXiv:1205.1742v1 [quant-ph] 8 May 2012 4 3 2 evdrnwditrs ntewk faibtcquan- adiabatic of [ wake tions [ the computation in tum interest renewed ceived [ tion n rsn new a gate family present logic and new universal a the on embedding report Hamiltonians also of We approach. our using theoretic Hamilto- gates group the one-output of two-input, all analysis embedding systematic nians a sub- perform state We ground their spaces. into Hamiltonians functions of Boolean constructions embedding various extend and unify to overlap. results fundamental work previous the in of used many techniques varies, and emphasis the While 1 tt usaeo pnssesi akcmol en- commonly task a [ is classical both systems in spin countered of subspace state oawd ait fN-opeedcso rbesand problems decision [ NP-complete problems of optimization variety NP-hard wide a to Whitfield D. J. Logic Spin State Ground draft epl otfntosit h rudsaesbpc fsi sys- spin of subspace state [ ground tems the into functions cost ops eea rvosrsls[ results previous several compass (b) (a) (c) etefrQatmTcnlge,Ntoa nvriyo Si of University National Technologies, Quantum for Centre unu nomto ehoois E aoaoisAmeri Laboratories NEC Technologies, Information Quantum nttt o cetfi necag,VaAaso1/,101 11/c, Alassio Via Interchange, Scientific for Institute eateto hsc,Clmi nvriy 3 .10hSt 120th W. 538 University, Columbia Physics, of Department nti etr euesmere fBoenfunctions Boolean of symmetries use we letter, this In h medn feeg adcpsit h ground the into landscapes energy of embedding The E-mail: E-mail: E-mail: 4 5 16 – , 6 9 – .Fnigasaei hssbpc sequivalent is subspace this in state a Finding ]. Abstract mna eosrtoso rudsaeebdig on in found optimization. quantum embeddings embeddin adiabatic state symme as state ground using of simplified ground demonstrations and The combined imental are formulas. gates gr how p Boolean illustrate the describe of preserve We tables which systems. embeddi operations truth spin the symmetry such examine and of we Hamiltonians subspace symmetries, state la and ground These theory the sp controllable group engineering. experimentally on and in based annealed science and of embedded fields be many in countered PACS PACS PACS , 18 11 [email protected] [email protected] [email protected] .Rcn ok aefcsdo embedding on focused have works Recent ]. – 15 84.30.Bv 03.65.Fd 75.10.Dg , 19 1 XOR , 4 – einn n piiigcs ucin n nrylandsc energy and functions cost optimizing and Designing – 2 , 25 , (a) 3 11 n ellratmt [ automata cellular and ] – aitna medn hc en- which embedding Hamiltonian icis(hoyof) (theory Circuits – ru hoy(unu mechanics) (quantum theory Group – pnHamiltonians Spin – 15 .Faccin M. , n t xeietlrealiza- experimental its and ] 1 – 3 n unu optimiza- quantum and ] 1 19 , 2 , , 7 20 – (b) 2 10 , 25 hc aere- have which ] .Bt four of Both ]. and 21 .D Biamonte D. J. , 26 NAND – 28 ]. p-1 each uhas such { ievle of eigenvalues with of btcqatmcmuigsc sltiepoenfold- protein lattice Hamiltoni- as [ of such ing adi- construction computing in studied the quantum recently abatic in problems embedding used other for be ans can gen- quite and is arguments eral symmetry of application the state, complex- increasing of are ity. circuits functions Boolean using larger useful demonstrated to be arguments of could symmetry Extensions our which constraints. freedom experimental considering of when degrees previ- ignored providing parameters ously free three have constructions cin ilsteeprmnal eeat[ relevant experimentally the yields actions [ learning 6Trn,Italy Torino, 26 0 gpr,BokS5 cec rv ,Snaoe117543 Singapore 2, Drive Science 3 S15, Block ngapore, iiigteHmloini q ( eq. in Hamiltonian the Limiting hogotti etr euedaoa Hamiltonians diagonal use we letter, this Throughout hl efcso medn icisit h ground the into circuits embedding on focus we While , N 1 H a needneWy rneo,N 84,USA 08540, NJ Princeton, Way, Independence 4 ca, } 24 e ok Y107 USA 10027, NY York, New , σ spins σ nHmloin.Uiga approach an Using Hamiltonians. in ih( with , = r.Orwr srlvn o exper- for relevant is work Our try. 2 , ohcasclotmzto swell as optimization classical both udsaesbpc noigthe encoding subspace state ound niae hc pnteoeao cso.Terms on. acts operator the spin which indicates , σ ≡ 29 (c) 4 rmtrzdfmle fdiagonal of families arameterized dcpsadcs ucin can functions cost and ndscapes X i so de icisaeue to used are circuits adder of gs 23 σ i ,aibtcqatmsmlto [ simulation quantum adiabatic ], go ola oi ae into gates logic Boolean of ng σ j ,o erhegn akns[ rankings engine search or ], c z r nesoda h esrproduct tensor the as understood are 1 i σ σ endby defined − i are + σ psi rbe en- problem a is apes ) X / ij ± nta of instead 2 ,w dniyBoenvariable, Boolean identify we 1, c ij σ σ i σ j = + | 0 X σ ijk ih tef h usrp of subscript The itself. 0 c | − | 1 ijk otosi inter- two-spin to ) σ 22 1 i σ ih ]. 16 j 1 σ 30 | – k ic the Since . 18 + ,machine ], tunable ] ... σ i ⊗ x (1) σ j ∈ . J. D. Whitfield et al.

Ising Hamiltonian which will be our primary focus. The idea of ground state spin logic is to embed Boolean functions, f : {0, 1}n → {0, 1}m, into the ground state subspace, L(Hf(x)), of spin Hamiltonian Hf(x)(σi, σj , ··· , σk) acting on the spins σi, σj ,..., σk. As an example, consider the universal NAND gate defined by NAND(x, y)=¯x ∨ y¯. The corresponding Hamiltonian, a) b) Hx¯∨y¯(σ1, σ2, σ3), should have the following ground state subspace

L(Hx¯∨y¯) = span{|xi|yi|x¯ ∨ y¯i} (2) = span{|001i, |011i, |101i, |110i}

Using the σ matrices, such a Hamiltonian is given in [21] as, c) d) 1 1 Hx¯∨y¯(σ1, σ2, σ3)=2 + ( + σ1 + σ2 − σ1σ2) σ3 (3) Fig. 1: (Color online) Ground state embedding of the half adder XOR This construction uses a three-spin interaction which can circuit. a) The half adder is implemented with a gate and an AND gate. b) The XOR and AND gates have been substi- be replaced using the same number of spins and only two- tuted by the corresponding all-NAND circuits. c) The same spin interactions. This was done in [19, 20] by penalizing circuit has been rewritten without the redundant gates and and rewarding certain interactions such that the ground labeled wires. d) Here the circuit is mapped to a network of state subspace is not altered while the higher energy eigen- seven spins, each corresponding to the seven wires of the cir- states are. cuit. The thickness of each link is proportional to the two-spin Now we introduce the first result of our paper: a three- interaction strength, while the size of each node is proportional parameter family of Hamiltonians that generalizes the for- to the local field strength in the two-local reduction. The pa- mulas found in [19, 20, 25] and elsewhere. Using coeffi- rameters used for the NAND gate Hamiltonian given in eq. (12) c c c cients labeled as in eq. (1), the constraint that one eigen- are 1 = 2 = 12 = 1. subspace is four-fold degenerate and contains states |001i, |011i, |101i, and |110i leads to the following three equali- ties: consider positive semi-definite Hamiltonians, however the c3 = c1 + c2 (4) addition of multiples of the identity does not alter energy

c13 = c12 + c1 (5) differences within the landscape of the problem and we choose not to enforce this constraint. c23 = c12 + c2 (6) NAND After enforcing these constraints, the energies are As the gate is universal for the construction of logic circuits, the NP-complete problem CIRCUIT-SAT, Edegen = −c1 − c2 − c12 (7) where the question “Is there an input corresponding to the output of logical one?” is embedded using only positive E000 = 3(c1 + c2 + c12) (8) couplings and positive local fields. This leads to an alter- E = 3c − c − c (9) 010 1 2 12 native proof that finding the ground state of spin Hamil- E100 = 3c2 − c1 − c12 (10) tonians with anti-ferromagnetic couplings in a magnetic E111 = 3c12 − c1 − c2 (11) field is NP-hard [2].

For c1, c2, and c12 greater than zero, the degenerate space Let us turn to an illustration that shows how to use is always the ground state. In closed form the three- the Hamiltonian in eq. (12) to construct more complex parameter family of Hamiltonians encoding NAND in the functions. Naively, it may seem a separate spin must be ground state is included for each wire originating from a FANOUT oper- ation [19–21]. However, this is not the case; instead the Hx¯∨y¯(σ1, σ2, σ3) = (c1σ1 + c2σ2)(1 + σ3) (12) same spin may be used for the input to as many gates as desired. As an example, in fig. 1, an all-NAND half adder +(c1 + c2)σ3 + c12 X σiσj i 0. The freedom to select these parame- an application of our symmetry considerations. ters could be desirable as it reduces the constraints placed on an experimental realization. An important consideration for this model is the in- The ground state energy of the NAND Hamiltonian, is put and output of the circuit. To extract data from this −(c1 + c2 + c12) instead of zero. Some authors choose to system, single spin projective measurements can be used.

p-2 Ground State Spin Logic

Inputs are set using an additional Hamiltonian F1, F2, R12 Hx∨y Hx¯∨y¯ 12 R inputs 1 H F H H = (1 + (−1)1−xk σ ) (13) zero 3 one F1 F2 F1 in 2 X k k Hx¯∨y R12 Hx∨y¯ a) 2 F which forces the k-th bit to take the value xk ∈{0, 1}. 1 F3 F3 F3 F

There are certain symmetries of Boolean functions from 12 F1F2F3 R which we can infer properties of the class of Hamiltonians Hx∧y¯ R12 Hx¯∧y that have the embedded in the ground F 1 F F F state subspace. 2 1 2 F2

To limit the scope of our initial discussions, we will re- Hx∧y Hx¯∧y¯ 12 H H R strict our attention to Hamiltonians containing only two- y¯ y spin interactions and to the set of the 16 two-input, one- F3 c) output gates. R R 12 12 F1F2, F2F3, F1F3, R12 Each of the two-input, one-output gates is defined by F1 its : F1 xy z Hx¯ Hx H H 0 0 b x⊕y F2 x==y 1 F3 0 1 b2 F F2 3 1 0 b3 1 1 b4 b) d) with bi ∈ {0, 1}. There are 16 choices for the vector b = [b ,b ,b ,b ]. The corresponding Hamiltonian, Hb, must 1 2 3 4 Fig. 2: (Color online) The action of D4 × Z2 on the 16 Hamil- have ground state subspace tonians corresponding to truth tables of two-input, one out- put functions. The Hamiltonians can be converted to any L(Hb)= {|00b1i, |01b2i, |10b3i, |11b4i} (14) other Hamiltonian in the same orbit by applying the spin-flip F R Thus, there are 16 relevant ground state subspaces, each (negate) i or input-swap (permute) 12 operations. The sym- metry operations that leave the ground state subspaces of each corresponding to one of the truth tables. Hamiltonian invariant (the stabilizer subgroup) is written on The symmetry operations on truth tables must treat the the perimeter of each rectangular region. Orbits a), b), c), d) output bit differently in order to remain in the space of are explained separately in the text. Each of these orbits re- the 16 truth tables. Thus, we consider (i) bit flips of any quires an additional spin for a Hamiltonian embedding using of the spins and (ii) swaps of the two inputs giving the only two-spin interactions: orbit a) requires a single spin, b) following symmetries: {e, F1, F2, F3, R12}. Here e is the two spins, c) three spins, and orbit d) requires four spins. identity operation, Fi is the spin-flip operation (negate), and R12 is the spin-swap operator (permute). The action of the latter two operations on spins is defined via These classes are depicted in fig. 2a, 2b, 2c, 2d, respec- Fi ◦ σj = (1 − 2δij)σj (15) tively. These classes correspond to different NPN (negate- permute-negate) classes [31, 32]. Interestingly, each orbit Rij ◦ σk = σj δki + σiδkj + σk(1 − δki − δkj ) (16) requires a different number of spins to implement when The group G can be presented as considering only two-spin interactions. We examine each in turn. G = hR12, F1, F3i (17) First, consider the constant functions with bi = c and where h·i indicates a set of generators. Defining relations c ∈{0, 1}. Since these functions do not depend on x nor y, 2 2 2 of the group are R12 = F1 = F3 = e, R12F1 = F2R12, there is no need to couple either to the third spin. Hence, F1F3 = F3F1 and R12F3 = F3R12. From these relations, the Hamiltonian in eq. (13) can be used. According to the or alternatively from the cycle graph, the group is of order group action depicted in fig. 2a, given the Hamiltonian for 16 and is isomorphic to D4×Z2, where D4 is the symmetry Hzero corresponding to bi = 0, the action of F3 transforms group of the square and Z2 is the cyclic group of order 2. Hzero to Hone. The action of G on the set of 16 truth tables is depicted Second, for each of the functions, b = x, b = y, b =x ¯ in fig. 2. Four orbits are found under action of the group: i i i and bi =y ¯, the output bit only depends on one of the two {0, 1}, inputs. The other input is extraneous, so the gate only requires two spins to implement. The truth tables can be {x, y, x,¯ y¯}, embedded using variations of the COPY gate previously {x ∨ y, x¯ ∨ y, x ∨ y,¯ ··· , x¯ ∧ y¯} introduced in [19–21]. The general k-COPY gate forces k {x ⊕ y, x == y}. bits to take the same value and the corresponding diagonal

p-3 J. D. Whitfield et al. operator 1 z = f(x, y) Hf(x,y)(σ1, σ2, σ3, σ4) Hk-COPY = − σiσj (18) 2 X Constant functions i6 j = z =0 Hzero = (1 − σ3) acting on k-spins possesses a ground state subspace Copy-type functions z = x Hx = (1 − σ1σ3) ⊗k ⊗k AND, OR,..., NAND, NOR functions L(Hk-COPY) = span{|0i , |1i }. (19) Hx¯∨y¯ = (c1σ1 + c2σ2)(1 + σ3) z =x ¯ ∨ y¯ 3 If we are concerned with constructing a Hamiltonian us- +(c1 + c2)σ3 + c12 Pi

Hx⊕y(σ1, σ2, σ3)= −σ1σ2σ3 (20) with the same ground state subspace. Note that this Hamiltonian is not of the same form of eq. (21) like those The inability to create this operator acting on three given in [19, 20]. spins with two-spin interactions can be demonstrated alge- To extend the XOR Hamiltonians previously listed to braically or graphically using Karnaugh maps [19,25]. For a parameterized family of Hamiltonians, we rearrange XOR, the stabilizer subgroup is generated by FiFj and eq. (21) with R = [1, −1, −2, 2] as R12, see fig. 2d. When considering the ancilla spin, σ4, Hx⊕y = −(σ1 + σ2)(1 − σ4) (23) there is an additional F4 symmetry that leaves the truth table unchanged. −2σ4 + (σ1σ2 + σ1σ4 + σ2σ4) Beginning with the swap-symmetric operators Mz = −σ3 + σ1σ3 + σ2σ3 +2σ3σ4 Pi σi and Mzz = Pi

p-4 Ground State Spin Logic

sessed by the resulting Hamiltonian. However, the symme- try group composed of the gate-local symmetries preserves the full ground state subspace including the values of the ancilla bits. The symmetries of the Boolean function be- fore being decomposed into logic gates will arise as global symmetries that cannot be obtained from the gate-local symmetries of the individual gates. For instance, if σa corresponds to an ancilla spin, then inverting this bit in each circuit component leaves the ground state subspace invariant. That is, H and (Fa, Fa, ··· , Fa) ◦ H embed the Fig. 3: (Color online) The half adder spin Hamiltonian that same Boolean function. arises from the four spin decomposition of the XOR Hamilto- nian which simplifies the construction from fig. 1d. Dashed As a further illustration of the distinction between links represent negative interactions and checkerboard shad- global -local symmetries, consider the full adder ing indicates a negative local field. The size of the nodes corresponding to a Boolean function which adds binary and the thickness of the edges are proportional to the fields summands A, B, and carry-in bit Cin. The permutation and interaction strength (on spins A and B there is no local of the input bits and the carry-in bit is a symmetry of the field). The parameters used for the AND gate and XOR gate full adder Boolean function. However, such a permuta- c c c are 1 = 2 = 12 = 1. tion is not a gate-local symmetry of the sub-Hamiltonians used in the circuit embedding, see the appendix for de- couplings between spins can be used to embed problems tails. This is because the values of the ancilla spin within into the target Hamiltonian of the evolution. Since both of the ground state subspace is not preserved under this per- these experimental systems are limited to two-spin inter- mutation. Thus, the local symmetries do not determine actions, our decomposition for XOR provides an effective all possible symmetries when some bits are considered as three-spin interaction which is experimentally realizable. ancillas. As a final example of ground state spin logic, fig. 4 shows In table 1, we summarize our results for Hamiltonian embeddings of two-input, one-output Boolean functions. the spin Hamiltonian of the ripple carry adder for four-bit While we have restricted attention to diagonal Hamilto- binary numbers. The figure shows the network for both NAND nians, future work could consider transformations where an implementation with only gates in fig. 4a and an XOR AND OR the ground state is preserved but the Hamiltonian obtains implementation with , , and gates in fig. 4b. off-diagonal elements. The second construction allows a decrease in the number Now we return to the half adder example from fig. 1. of ancilla spins and provides 51 free parameters. Addi- With our constructions, we can directly implement it using tionally, as shown in the appendix, the symmetry group of the second implementation has at least 231 elements. the XOR and AND gates, Another salient feature is that the average degree of the NAND HHA = Hx⊕y(σA, σB , σa, σS)+ Hx∧y(σA, σB , σC ). (25) spins changes from 3.85 in the all- case to 4.22 in the second implementation. Explicitly listing the free param- Here σA and σB correspond to the inputs to be summed, eters and the symmetries that preserve the ground state σa corresponds to the XOR ancilla bit, and σS and σC subspace is an illustration of how our approach gives ex- correspond to the sum and carry bits. As depicted in fig. 3, perimentalists and theorists systematic methods to find the new spin Hamiltonian uses two less ancilla spins than additional degrees of freedom. our earlier construction and now has six free parameters. An important step towards large scale experimental re- Additional degrees of freedom arise from the D4 stabilizer alizations of the techniques presented in this paper will be subgroup of the XOR Hamiltonian and the Z2 stabilizer the adiabatic implementation and characterization of the subgroup of the AND Hamiltonian. elementary logic gates. In the case of XOR, this Hamilto- The symmetry group of HHA can be inferred from the nian will allow one to realize an effective three-spin inter- symmetries of the component Hamiltonians using a di- action by using only two-spin interactions and introducing rect product structure. For a general circuit Hamilto- an ancilla spin. Such an interesting example is in line with nian composed of gate Hamiltonians acting on subsets of current experimental capabilities [16–18]. spins, H = P Hi, the stabilizer subgroup is the direct product of the stabilizers for each of the Hamiltonians in ∗∗∗ the sum. The direct product group action is defined as (g1,g2, ··· gN ) ◦ H = P gi ◦ Hi. If g is in the intersection The authors would like to thank V. Bergholm and Z. of all stabilizer groups (the diagonal subgroup), then g ◦H Zimboras for helpful discussions and M. Allegra and J. will have the same ground state subspace as H. Roland for carefully reading the manuscript. JDW ac- Additional symmetries arise after partitioning the bits knowledges support from NSF (No. 1017244) and thanks into output and ancilla bits. We can expect the symme- the Visitor Program at the Max-Planck Institute for the tries of the Boolean function being embedded to be pos- Physics of Complex Systems, Dresden where parts of this

p-5 J. D. Whitfield et al.

a) b)

Fig. 4: (Color online) Ripple carry adder. The figure shows the network of spins corresponding to a ripple carry adder with four bits. The ripple carry adder is composed by one half adder and three full adders; in yellow it shows the input spins from 4 i 4 i the four bits binary numbers A = Ai2 and B = Bi2 ; while the sum spins, Si are drawn in purple. Carry bits are Pi=1 Pi=1 labeled as Ci. The direction of the sum is from left to right. Fig. a) shows a ripple carry constructed with only NAND gates and parameters c1 = c2 = c12 = 1, while b) shows the same adders built with XOR, AND and OR gates. work were completed. [20] Gu M. and Perales A., Encoding universal computa- tion in the ground states of Ising lattices arXiv:1204.1084 (2012). REFERENCES [21] Crosson I. J., Bacon D. and Brown K. R., Phys. Rev. E, 82 (2010) 031106. [1] Hartmann A. K. and Weigt M., Phase Transitions [22] Garnerone S., Zanardi P. and Lidar D. A., Adi- in Combinatorial Optimization Problems: Basics, Algo- abatic quantum algorithm for search engine ranking rithms and Statistical Mechanics (Wiley-VCH) 2005. arXiv:1109.6546 (2011). 15 [2] Barahona F., J. Phys. A: Math. Gen., (1982) 3241. [23] Pudenz K. L. and Lidar D. A., Quantum adiabatic ma- [3] Kirkpatrick S., Gelatt C. D. and Vecchi M. P., Sci- chine learning arXiv:1109.0325 (2011). 220 ence, (1983) 671. [24] Perdomo A., Truncik C., Tubert-Brohman I., Rose [4] Ohzeki M. and Nishimori H., J. Comp. Theor. G. and Aspuru-Guzik A., Phys. Rev. A, 78 (2008) 8 Nanoscience, (2011) 963. 012320. 80 [5] Das A. and Chakrabarti B. K., Rev. Mod. Phys., [25] Rosenbaum D. and Perkowski M., Multiple-Valued (2008) 1061. Logic, IEEE International Symposium on, 0 (2010) 270. [6] Das A. and Chakrabarti B. K., (Editors) Quantum an- [26] Lent C. S., Tougaw P. D. and Porod W., Quantum nealing and related optimization methods (Springer) 2005. cellular automata: The physics of computing with arrays [7] Altshuler B., Krovi H. and Roland J., Adiabatic of quantum dot molecules in proc. of Physics and Compu- quantum optimization fails for random instances of NP- tation, 1994. PhysComp ’94, Proceedings., Workshop on complete problems arXiv:0908.2782 (2009). 1994 pp. 5 –13. 107 [8] Altshuler B., Krovi H. and Roland J., PNAS, [27] Gu M., Weedbrook C., Perales A. and Nielsen (2010) 12446. M. A., Physica D, 238 (2009) 835. 11 [9] Choi V., Quant. Info. and Comm., (2011) 0638. [28] Burgarth D., Giovannetti V., Hogben L., Sev- 106 [10] Dickson N. and Amin M. H. S., Phys. Rev. Lett., erini S. and Young M., Logic circuits from zero forcing (2011) 050502. arXiv:1106.4403 (2011). [11] Apolloni B., Caravalho N. and Falco D. D., Quan- [29] Perdomo A., Dickson N., Drew-Brook M., Rose tum stochastic optimization: Stochastic Processes and G. and Aspuru-Guzik A., Finding low-energy confor- 33 their Applications, (1989) 233. mations of lattice protein models by quantum annealing [12] Amara P., Hsu D. and Straub J. E., J. Phys. Chem., arXiv:1204.5485 (2012). 97 (1993) 6715. [30] Biamonte J. D., Bergholm V., Whitfield J. D., [13] Finnila A. B., Gomez M. A., Sebenik C., Stenson C. Fitzsimons J. and Aspuru-Guzik A., AIP Advances, 219 and Doll J. D., Chem. Phys. Lett., (1994) 343. 1 (2011) 022126. 58 [14] Kadowaki T. and Nishimori H., Phys. Rev. E, (1998) [31] Correia V. P. and Reis A. I., Classifying n-input 5355. Boolean functions in proc. of VII Workshop Iberchip 2001 [15] Farhi E., Goldstone J., Lapan J., Lundgren A. and p. 58. 292 Preda D., Science, (2001) 472. [32] Chang C.-H. and Falkowski B. J., Elec. Lett., (1999) 484 [16] Britton J. W. et al., Nature, (2012) 489. 798. 473 [17] Johnson M. W. et al., Nature, (2011) 194. [33] Hayes J. P., Introduction to Digital Logic Design 1st 82 [18] Harris R. et al., Phys. Rev. B, (2010) 024511. Edition (Addison-Wesley Longman Publishing Co., Inc., [19] Biamonte J. D., Phys. Rev. A, 77 (2008) 052331.

p-6 Ground State Spin Logic

Boston, MA, USA) 1993. the symmetry group {e, R12}, giving a symmetry group for [34] Barrat A., Barthelemy´ M. and Vespignani A., Dy- the whole Hamiltonian of at least 25 elements. The Hamil- namical Processes on Complex Networks (Cambridge Uni- tonian uses nine ancilla spins to build the truth table of versity Press) 2008. the full adder, resulting in nine new symmetries, labelled [35] Wegener I., The complexity of Boolean functions (John in the main text as {Fa : a labels an ancilla spin}. The Wiley & Sons, Inc., New York, NY, USA) 1987. action of the latter changes the ground state subspace but the resulting system still describes the original problem. Appendix. – Hamiltonians embedding full adders. We provide the characterization of the full adder [33] necessary to con- struct the ripple carry adder shown in the main text. This affords us an opportunity to explore the network proper- ties of the adders circuit family with well known construc- tions and optimized solutions [34, 35].

Fig. 6: (Color online) Full adder spin network for the circuit in fig. 5a. This construction reduces the number of ancilla a) Full adder circuit b) Full adder circuit with NANDs

spins from nine in the case in fig. 5d to five. In this case, the

✵ ☎

✳ ❝ ❡✞✝ ✳

❞❡❣ ✳ interactions are not all of the same sign.

❤ ✟ ✝ ❡✝ ♣❛✝❤ ❝ ❡✞✝ ✳

✵ ✄ ✳

The number of ancilla spins can decrease using the stan- ✵ ✳✂ dard XOR, AND and OR gates of fig. 5a. Fig. 6 shows the

spin network associated to this circuit. This Hamiltonian

✵ ✁

✳ presents at least 29 symmetries arising from the single-gate ✵ ✳ symmetries. To enhance comprehension of the spin Hamiltonians,

✵ we compute some well known complex networks mea-

❆ ❇ ❈ ✻ ✼ ❙ ❈ ✐♥

♦✉ sures [34]. The node centrality of the resulting network, in ❜✆✝ c) Full adder network d) Centrality of nodes fig. 5d, suggests that the input and outputs spins are the least central both for local (degree centrality) and global Fig. 5: (Color online) a) Full adder circuit. b) Transcription centrality measures (shortest path centrality). Here the with only NAND gates. c) The spin network representing the degree centrality Dk of node k is defined as: all-NAND circuit of the full adder. The input spins A, B and C dk the lower carry-in spin are depicted in yellow while the out- Dk = , (26) put spins of sum (S) and carry-out (Cout) are colored in purple. N − 1 The green nodes represent ancilla spins. d) Degree centrality and shortest path centrality of network nodes. Notice that the where dk is the degree of node k and N is the number input and output spins (denoted A = 0, B = 1, Cin = 2 and of nodes of the network. The shortest path centrality is S = 12, C = 13 respectively) are the least central while the defined as: out SP most central nodes are the ancilla spins five, six and seven. SP = ikj , (27) k X SP i,j ij In order to sum arbitrarily large binary numbers, the half adder circuit needs to implement the bit carrying op- where SPij represents the number of shortest path be- eration. The full adder circuit introduces this operation tween nodes i and j and SPikj is the number of those with a third input bit, accounting for the lower level carry paths passing through node k. Nodes with higher cen- trality can be thought as the network bottleneck between bit Cin. Fig. 5 shows the network associated to this cir- input and output spins. cuit, where the inputs bits A, B and Cin are in yellow and the output bits S and Cout are in purple. The network Additional calculations for the ripple carry adder. The corresponds to a circuit with only NAND gates. The two- sum of two binary n-bit numbers x and y, can be carried spin interactions and the local fields are then all positive out by concatenating n full adder circuits yielding the rip- valued. From eq. (12), we have three free parameters for ple carry adder. This circuit implements a cascade: the each NAND gate, giving 3 · 5 = 15 free parameters. Each carry-out bit of each full adder will be used as the carry-in NAND Hamiltonian is also symmetric under the action of bit for the next one. The first full adder has logical zero

p-7 J. D. Whitfield et al. as the carry-in bit. Alternatively, it can be completely re- As mentioned in the main text, this degree of freedom placed by the half adder circuit. Fig. 4 of the main text, could be desirable as it reduces the constraints placed on shows the network associated to a four bit ripple carry an experimental realization. adder used to sum two four-bit binary numbers. In fig. 4a We can identify NAND as a point on the orbit of the Hamiltonian is built from NAND gates, providing all the NPN class by considering three indicator variables, non-negative local fields and interactions and resulting in x,y,z ∈{0, 1}. We write 46 spins and 86 links. The starting circuit contains 38 x y z NANDs, each of them are associated to a Hamiltonian, see H = ((−1) c1σ1 + c2(−1) σ2)(1 + (−1) σ3) z x+y eq. (12), which depends on three free parameters. Thus, +(−1) (c1 + c2)σ3 + c12((−1) σ1σ2 the Hamiltonian of the whole circuit has 3 · 38 = 114 free x+z y+z +(−1) σ1σ3 + (−1) σ2σ3) parameters. As in fig. 2, the stabilizer subgroup of the NAND gate contains only two elements: The Hamiltonian for NAND is recovered by setting x = y = z = 0. The rest of the orbit is picked out by NAND stab( )= hR12i≃ Z2 (28) assigning other values to x,y,z. The ground state energy as a function of x,y,z is given as and generates a group of symmetries for the full Hamil- tonian of at least 238 elements. Fig. 4b shows the same circuit built using seven XOR, seven AND and three OR x+y x+z y+z Egs = c12((−1) − (−1) − (−1) ) gates. This implementation yields a network with only 32 −(c + c )(−1)z + bits and 65 links. The gate Hamiltonians have three free 1 2 z x y parameters each for a total of 3 · 17 = 51 free parameters. +(1 − (−1) )((−1) c1 + (−1) c2) In this case, the stabilizer subgroup of both OR and AND A meaningful experimental demonstration showing the is also generated by R12, while for the XOR gate we have: capabilities to realize every gate in the orbit could be

stab(XOR)= hF1F2, F1F3, R12i≃ D4 (29) performed by realizing each of the eight Hamiltonians x,y,z ∈{0, 1}. Apart from characterizing the degenerate with eight elements. Thus, total symmetry group of the ground space of each of the eight gates, the experiments Hamiltonian contains at least 210 · 87 =231 elements. can also be modified slightly to correspond to instances Fig. 7 shows the centrality of each spin of the net- of adiabatic search algorithm as follows. The output of works in fig. 4. We note that, in the second implemen- each gate can be set to either logical-zero or logical-one, tation of the ripple carry adder, the resulting network is see eq. (13). Successful adiabatic annealing would then slightly more connected. The average degree centrality return the associated inputs to the circuit. (hDii =0.131) in this case is higher than in the implemen- tation with only NANDs (hDii = 0.083). The variance is also higher in the second example, var(Di)=0.041, than in the first, var(Di)=0.021. In both implementations, the most important spins as identified by the global measure of shortest path centrality are the spins on the backbone of the circuit. In particular, the carry bits, Ci, have high centrality as they connect subnetworks which would oth- erwise be disconnected.

General formulas for orbit of NAND under D4 × Z2. From the main text, the Hamiltonian for NAND is

H = (c1σ1 + c2σ2)(1 + σ3) + (c1 + c2)σ3 + c12Mzz

This can be written as

H = c12(σ1σ2 + σ1σ3 + σ2σ3) (30)

+σ3(c1(1 + σ2(1 + σ3)))

+σ3(c2(1 + σ2(1 + σ3)))

The energy shift to ensure that the ground state is also the null space is c1 + c2 + c12.

We see that the symmetry in variables σ1 and σ2 breaks for c1 6= c2, yet the ground state subspace remains invariant.

p-8

Ground State Spin Logic

✵ ✳

❞❡ ❣ ✳ ❝❡ ♥ ✳

❡ ❝❡ ♥ ✳

❤✞ ✝ ✝ ♣❛✝ ❤ ✝

✵ ✳

✵ ✳

✵ ✳

✵ ✳

✵ ✳

❆ ❇ ✁ ❙ ❈ ❆ ❇ ✁ ✂ ✆ ✼ ❙ ❈ ❆ ❇ ✁ ✄ ✁ ✆ ✁ ✾ ❙ ❈ ❆ ❇ ✂ ✼ ✂ ✾ ❙ ❈

✶ ✶ ✶ ✶ ✷ ✷ ✷ ✷ ✸ ✸ ✸ ✸ ✹ ✹ ✹ ♦✉ ❜✐✝

a) Ripple carry network with only NAND gates

✵ ✳

❞❡ ❣ ✳ ❝❡ ♥ ✳

❡ ❝❡ ♥ ✳

❤✞ ✝ ✝ ♣❛✝ ❤ ✝

✵ ✳

✵ ✳

✵ ✳

✵ ✳

✵ ✳

✵ ✵

❆ ❇ ❙ ❈ ❆ ❇ ✽ ❙ ❈ ❆ ❇ ✼ ✁ ❙ ❈ ❆ ❇ ✁ ✆ ✁ ✾ ❙ ❈

✶ ✶ ✶ ✶ ✷ ✷ ✷ ✷ ✸ ✸ ✸ ✸ ✹ ✹ ✹ ♦✉ ❜✐✝ b) Ripple carry network using standard gates

Fig. 7: (Color online) Centrality measures for the ripple carry adders of fig. 4. Graphs a) and b) correspond to networks in fig. 4a and 4b respectively. In the first implementation, the number of spins used is 46 with an average degree centrality of 0.083, while in the latter the same problem is embedded with a lower number of spins, 32, but with a higher average degree centrality of 0.131.

p-9