{"id":2516,"date":"2020-01-19T03:08:48","date_gmt":"2020-01-19T03:08:48","guid":{"rendered":"http:\/\/www.myamplelife.com\/wp\/?p=2516"},"modified":"2021-10-28T17:10:22","modified_gmt":"2021-10-28T17:10:22","slug":"integer-solutions-and-ising-model","status":"publish","type":"post","link":"https:\/\/www.myamplelife.com\/wp\/2020\/01\/integer-solutions-and-ising-model\/","title":{"rendered":"\u015ar\u012bdhara Br\u0101hma\u1e47a: Integer Solutions and Ising Model"},"content":{"rendered":"\r\n<p>This is the third installment of my commentary on <em>Quantum Integer Programming<\/em> (QuIP) that brings together &#8211; an union (\u0938\u092e\u094d\u0939\u093f\u0924,<em> Samhita<\/em>) &#8211; Quantum Mechanics and Integer Programming.<\/p>\r\n\r\n\r\n\r\n<p>The two earlier posts are:<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-red-color\" style=\"text-align: center;\"><a href=\"http:\/\/www.myamplelife.com\/wp\/2020\/01\/sridhara-brahma\u1e47a-\u0936\u094d\u0930\u0940\u0927\u0930-\u092c\u094d\u0930\u093e\u0939\u094d\u092e\u0923\/\">Numbers and Magnets<\/a><\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-red-color\" style=\"text-align: center;\"><a href=\"http:\/\/www.myamplelife.com\/wp\/2020\/01\/imaginary-numbers-and-electron-spin\/\">Imaginary Numbers and Electron Spin<\/a><\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p>Integer Solutions<\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<p>In ancient India, several problems seeking <em>integer<\/em> solutions were posed &#8220;simply for pleasure&#8221;. The first general solutions of first degree indeterminate equations are by <em>Brahmagupta<\/em> (625 AD).<\/p>\r\n\r\n\r\n\r\n<p>For centuries, this type of recreational mathematics, like approximations for <em>pi<\/em>, occupied the priestly class enjoying their leisurely life.<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-green-cyan-color\" style=\"text-align: center;\">I suppose, in the 21st Century, we would call them <em>University Professors<\/em>. &#x1f60f;<\/p>\r\n\r\n\r\n\r\n<p>Bhaskara II (as there was a Bhaskara I in 650 AD who is credited with having pioneered the decimal system, the use of circle to represent zero, provided a remarkable rational approximation for <em>pi<\/em> and so on) provided some wonderful results in his <strong><em>L\u012bl\u0101vat\u012b<\/em><\/strong>, which is Book 1 of\u00a0<strong><em>Siddh\u0101nta \u015airomani<\/em><\/strong>\u00a0(\u0938\u093f\u0926\u094d\u0927\u093e\u0902\u0924 \u0936\u093f\u0930\u094b\u092e\u0923\u0940),&#8221;Crown of treatises&#8221;, around 1150 AD, especially for quadratic equations.<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-green-cyan-color\" style=\"text-align: center;\"><strong><em>Siddh\u0101nta\u00a0<\/em><\/strong>means an established way, a settled issue, a canonical text-book, a tenet. Treatise.<\/p>\r\n\r\n\r\n\r\n<p>The earliest one of these that have been found is the <strong><em>Surya Siddhanta (300-400 AD).\u00a0<\/em><\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-green-cyan-color\" style=\"text-align: center;\">Among other things, it introduced trigonometric functions of angles, such as\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Jy%C4%81,_koti-jy%C4%81_and_utkrama-jy%C4%81\"><em>jy\u0101<\/em><\/a>-ardha.<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-green-cyan-color\" style=\"text-align: center;\">This was transliterated by Arabic mathematicians and astronomers as\u00a0<em>jiba,\u00a0<\/em>which was <em>mistranslated<\/em> by the Europeans (into Latin) as <em>sinus<\/em>. &#x1f937;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-green-cyan-color\" style=\"text-align: center;\">This is why today we use the phrase <em>sine <\/em>to represent (the acute angle in the context of a right triangle) the ratio of the length of opposite side to the hypotenuse!<\/p>\r\n\r\n\r\n\r\n<p>As is now properly understood (Dirk Struik, <em>A Concise History of Mathematics<\/em>, 1948):<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p>It is therefore, strictly speaking, incorrect to call linear indeterminate equations Diophantine equations. Where Diophantus still accepted fractional solutions, the Hindus were satisfied only with integer solutions. They also advanced beyond Diophantus in admitting negative roots\u2026..<\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<p>Indeed, the Arabic translations of these <em>Siddhantas<\/em> were the basis of learning for future generations of scholars, including <em>Omar Khayyam<\/em> (see my post <em><a href=\"http:\/\/www.myamplelife.com\/wp\/2019\/05\/in-praise-of-poetry\/\">In Praise of Poetry\u2026and James Bond<\/a><\/em>).<\/p>\r\n\r\n\r\n\r\n<p>As I mentioned in my earlier post, the Italians took the solution of higher order equations to a whole new level and conceived <em>imaginary numbers<\/em>. This study of roots of algebraic equations was further vastly elevated by <em>Evariste Galois<\/em> (1811-1832).<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-red-color\">Let us take a different route.<\/p>\r\n\r\n\r\n\r\n<p>An entirely different way to find feasible integer solutions for linear indeterminate equations is as follows:<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-green-cyan-color\" style=\"text-align: center;\">Convert integers to binary representation.<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-green-cyan-color\" style=\"text-align: center;\">Write the equations in the form ax-b=0.<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-green-cyan-color\" style=\"text-align: center;\">Minimize the sum of squares of the equations.<\/p>\r\n\r\n\r\n\r\n<p>Because <em>x(i) squared<\/em> is <em>x(i)<\/em>, we will have an expression that is the sum of terms, each of the form <em>A(i)x(i)<\/em> and <em>B(i,j)x(i)x(j)<\/em> where <em>A(i)<\/em> and <em>B(i,j)<\/em> are integers if <em>a<\/em> and <em>b<\/em> are.<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-green-cyan-color\" style=\"text-align: center;\">If we minimize the expression and obtain a zero objective function value, we have a feasible solution.<\/p>\r\n\r\n\r\n\r\n<p>This is called <em>Quadratic Unconstrained Binary Optimization<\/em> (QUBO).<\/p>\r\n\r\n\r\n\r\n<p>This approach is not limited to first order equations, and can be applied to any set of polynomials. This takes us into algebraic geometry.<\/p>\r\n\r\n\r\n\r\n<p>However, we will <strong>not<\/strong> solve such a QUBO <em>algebraically<\/em>, nor by <em>geometric construction<\/em>, like our mathematical ancestors from Egypt, Greece, India, Iran, Iraq, Italy, England, Germany and France might have attempted to do so.<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-red-color\" style=\"text-align: center;\">Instead, we will manipulate spins on a quantum computer. &#x1f633;<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p>Ising Model<\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<p>Consider a graph <em>G = (V,E)<\/em> whose vertices <em>V<\/em> have electrons that have spin (<em>sigma(i)<\/em> on vertex<em> i<\/em>), which when measured can take on a value of either -1 or +1.<\/p>\r\n\r\n\r\n\r\n<p>This graph of electrons is in a transverse field that has strength <em>H(i) <\/em>on vertex<em> i<\/em>, and the edges between the vertices have coupling strengths (between vertex <em>i<\/em> and<em> j<\/em>, it is <em>J(i,j)<\/em>); the values of <em>H<\/em> and <em>J<\/em> can be positive, zero or negative.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>The <em>Ising model<\/em> (in Physics) is a mathematical abstraction to study interacting spins among adjacent electrons (arranged on a lattice, or a graph) at the microscopic (sub-atomic) level.<\/p>\r\n\r\n\r\n\r\n<p>Under certain conditions, when all the electron spins point in the same direction, as that is the lowest energy level (which is Nature\u2019s equilibrium), <em>magnetism<\/em> emerges as a macroscopic phenomenon that we can observe in our physical world at human scale.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>The energy of the Ising model is of the form:<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/wikimedia.org\/api\/rest_v1\/media\/math\/render\/svg\/8c92b9ff7af38ba46817d8dc7a1639b1cd6b7f16\" alt=\"{\\displaystyle H(\\sigma )=-\\sum _{\\langle i~j\\rangle }J_{ij}\\sigma _{i}\\sigma _{j}-\\mu \\sum _{j}h_{j}\\sigma _{j}}\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-green-cyan-color\" style=\"text-align: center;\">It is not hard to see that there is a one-one mapping between solutions that give a zero objective function value to a QUBO and the minimum energy levels of a corresponding Ising model.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>Indeed, if <em>x(i)<\/em> is a 0-1 variable in an integer constraint, and <em>sigma (i)<\/em> is a spin (that can take on a value of -1 or +1), then <em>sigma(i) = 2x(i)-1<\/em>.<\/p>\r\n\r\n\r\n\r\n<p>A simple illustration of this is at the top of this post where <em>H(i)=0<\/em> for <em>i=1,2,3<\/em> and <em>J(1,2)=1<\/em> and <em>J(1,3)=-1<\/em>. (Set <em>mu<\/em> to 1).<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-red-color\" style=\"text-align: center;\">How to solve the Ising model?<\/p>\r\n\r\n\r\n\r\n<p>We use a <em>physical device<\/em> that has spins on a graph.\u00a0This is a physical quantum computer.<\/p>\r\n\r\n\r\n\r\n<p>We first <em>prepare<\/em> the spins on each of the electrons to be in a superposition state (\u201cHadamard transformation\u201d) such that they have 50-50 chance of being -1 or +1.<\/p>\r\n\r\n\r\n\r\n<p>For the toy problem of 3 variables above, if we measure the spins <em>right now<\/em>, then we will get any one of the eight solutions with equal probability, and so with probability 6\/8, any such measured solution will be <em>wrong<\/em> for our problem.<\/p>\r\n\r\n\r\n\r\n<p>However: Every one of the measured solutions is correct for a problem where all <em>H(i)<\/em> and <em>J(i,j)<\/em> are zero. (Trivially.)<\/p>\r\n\r\n\r\n\r\n<p>Thus, this \u201cequal superposition\u201d state needs to be <em>manipulated<\/em> before measuring, for the result to be correct for our values of <em>H(i)<\/em> and <em>J(i,j)<\/em>.<\/p>\r\n\r\n\r\n\r\n<p>Unlike a Gate (Circuit) model where a quantum algorithm specifies how to manipulate the spin state using a quantum gate, we follow a different approach (that has been shown to be computationally equivalent).<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-red-color\" style=\"text-align: center;\">We slowly change the field that this device is immersed in.<\/p>\r\n\r\n\r\n\r\n<p>That is, we slowly start changing <em>H(i)<\/em> and <em>J(i,j)<\/em>\u00a0\u00a0from zero values to their true values.<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-green-cyan-color\" style=\"text-align: center;\">In our toy example, <em>H(i)<\/em> are zero throughout, so there is no change. But J(1,2) and J(1,3) need to slowly become +1 and -1 respectively from 0.<\/p>\r\n\r\n\r\n\r\n<p>There is a fundamental result in quantum mechanics (from 1928, von Neumann and Wigner) called the <em>adiabatic theorem<\/em>. It says that:<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-red-color\" style=\"text-align: center;\">if you slowly change the Hamiltonian (field), then the ground state (previous optimal solution) will remain in the ground state for the newer field. That is, the spins will change their (pre-measured complex values of amplitudes) accordingly.<\/p>\r\n\r\n\r\n\r\n<p>So, if we gently change the field, making sure that that spins remain in their ground state throughout, then, when we are done reaching our problem values of <em>H(i)<\/em> and <em>J(i,j)<\/em>, we can measure the spins.<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-red-color\" style=\"text-align: center;\">They will have 50-50 chance of being in one or the other of the two correct solutions (with very high probability)!<\/p>\r\n\r\n\r\n\r\n<p>This is called <em>Adiabatic Quantum Computing<\/em>.<\/p>\r\n\r\n\r\n\r\n<p>Repeatedly doing the above will give us a sampling of all the feasible solutions.<\/p>\r\n\r\n\r\n\r\n<p>Note that if we convert the <em>sigma(i)<\/em> values to <em>x(i)<\/em> values and find that QUBO objective value is <em>not<\/em> zero, it means we have infeasibility.<\/p>\r\n\r\n\r\n\r\n<p class=\"has-text-color has-vivid-red-color\" style=\"text-align: center;\">QuIP: Finding integer feasible solutions by physically manipulating spins in line with the adiabatic theorem of quantum mechanics.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>In plain English, finding integer feasible solutions physically, exploiting adiabatic theorem of quantum mechanics.<\/p>\n","protected":false},"author":1,"featured_media":2533,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[410,413,412,411,394,415,414,418,842,416,417],"_links":{"self":[{"href":"https:\/\/www.myamplelife.com\/wp\/wp-json\/wp\/v2\/posts\/2516"}],"collection":[{"href":"https:\/\/www.myamplelife.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.myamplelife.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.myamplelife.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.myamplelife.com\/wp\/wp-json\/wp\/v2\/comments?post=2516"}],"version-history":[{"count":41,"href":"https:\/\/www.myamplelife.com\/wp\/wp-json\/wp\/v2\/posts\/2516\/revisions"}],"predecessor-version":[{"id":6656,"href":"https:\/\/www.myamplelife.com\/wp\/wp-json\/wp\/v2\/posts\/2516\/revisions\/6656"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.myamplelife.com\/wp\/wp-json\/wp\/v2\/media\/2533"}],"wp:attachment":[{"href":"https:\/\/www.myamplelife.com\/wp\/wp-json\/wp\/v2\/media?parent=2516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myamplelife.com\/wp\/wp-json\/wp\/v2\/categories?post=2516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myamplelife.com\/wp\/wp-json\/wp\/v2\/tags?post=2516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}