{"id":4099,"date":"2024-09-21T14:43:16","date_gmt":"2024-09-21T14:43:16","guid":{"rendered":"https:\/\/workhouse.sweetdishy.com\/?p=4099"},"modified":"2024-09-21T14:43:16","modified_gmt":"2024-09-21T14:43:16","slug":"extension-to-multiple-solutions","status":"publish","type":"post","link":"https:\/\/workhouse.sweetdishy.com\/index.php\/2024\/09\/21\/extension-to-multiple-solutions\/","title":{"rendered":"Extension to multiple solutions"},"content":{"rendered":"\n<p>A simple extension to this algorithm works when the search criterion has<\/p>\n\n\n\n<p>multiple solutions. The oracle then gives an answer \u201cyes\u201d whenever any one<\/p>\n\n\n\n<p>of the M possible solutions is input. The Hilbert space then has a \u201csolution<\/p>\n\n\n\n<p>subspace\u201d M, spanned by M solution states. Let us denote by |\u03b2i the uniform<\/p>\n\n\n\n<p>superposition of all these vectors, and by |\u03b1i, its orthogonal complement.<\/p>\n\n\n\n<p>|\u03b2i =<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>\u221a<\/p>\n\n\n\n<p>M<\/p>\n\n\n\n<p>X<\/p>\n\n\n\n<p>x\u2208M<\/p>\n\n\n\n<p>|xi, (8.81)<\/p>\n\n\n\n<p>|\u03b1i =<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>\u221a<\/p>\n\n\n\n<p>N \u2212 M<\/p>\n\n\n\n<p>X<\/p>\n\n\n\n<p>x \/\u2208M<\/p>\n\n\n\n<p>|xi. (8.82)<\/p>\n\n\n\n<p>In this situation, the input state is<\/p>\n\n\n\n<p>|\u03c8i =<\/p>\n\n\n\n<p>r<\/p>\n\n\n\n<p>M<\/p>\n\n\n\n<p>N<\/p>\n\n\n\n<p>|\u03b2i +<\/p>\n\n\n\n<p>r<\/p>\n\n\n\n<p>N \u2212 M<\/p>\n\n\n\n<p>N<\/p>\n\n\n\n<p>|\u03b1i. (8.83)<\/p>\n\n\n\n<p>The angle \u03b8 is now given by<\/p>\n\n\n\n<p>sin \u03b8 = h\u03c8|\u03b2i =<\/p>\n\n\n\n<p>r<\/p>\n\n\n\n<p>M<\/p>\n\n\n\n<p>N<\/p>\n\n\n\n<p>. (8.84)<\/p>\n\n\n\n<p>The operator<\/p>\n\n\n\n<p>\u02c6<\/p>\n\n\n\n<p>O tags all of the M solutions with a \u2018\u2212\u2019 sign, and the Grover<\/p>\n\n\n\n<p>iterate is de\ufb01ned the same way as before. After p iterations we get the state<\/p>\n\n\n\n<p>\u02c6<\/p>\n\n\n\n<p>G<\/p>\n\n\n\n<p>p<\/p>\n\n\n\n<p>|\u03c8i = cos[(2p + 1)\u03b8]|\u03b1i + sin[(2p + 1)\u03b8]|\u03b2i, (8.85)<\/p>\n\n\n\n<p>and the number of iterations required is nearly<\/p>\n\n\n\n<p>p \u2248<\/p>\n\n\n\n<p>\u03c0<\/p>\n\n\n\n<p>4<\/p>\n\n\n\n<p>r<\/p>\n\n\n\n<p>N<\/p>\n\n\n\n<p>M<\/p>\n\n\n\n<p>. (8.86)<\/p>\n\n\n\n<p>You should check for yourself that this works out.<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"https:\/\/learning.oreilly.com\/api\/v2\/epubs\/urn:orm:book:9781482238129\/files\/bgc5.png\" width=\"671\" height=\"659\"><\/p>\n\n\n\n<p>172 Introduction to Quantum Physics and Information Processing<\/p>\n\n\n\n<p>8.6.2 Quantum counting<\/p>\n\n\n\n<p>A fallout of the multiple search algorithm is the counting algorithm. Be-<\/p>\n\n\n\n<p>fore we know how many times to iterate, we need to know how many solutions<\/p>\n\n\n\n<p>M there are to the search criterion. Can we deduce a quantum algorithm for<\/p>\n\n\n\n<p>\ufb01nding M given U<\/p>\n\n\n\n<p>f<\/p>\n\n\n\n<p>k<\/p>\n\n\n\n<p>? The solution found by Brassard et al. [15], is a com-<\/p>\n\n\n\n<p>bination of Grover\u2019s search and Shor\u2019s phase estimation algorithms. The key<\/p>\n\n\n\n<p>point here is to note that the number of solutions is related to the eigenvalues<\/p>\n\n\n\n<p>of the operator<\/p>\n\n\n\n<p>\u02c6<\/p>\n\n\n\n<p>G, which can also be expressed in the |\u03b1i-|\u03b2i basis as the 2-d<\/p>\n\n\n\n<p>matrix<\/p>\n\n\n\n<p>\u02c6<\/p>\n\n\n\n<p>G =<\/p>\n\n\n\n<p>cos \u03d5 \u2212sin \u03d5<\/p>\n\n\n\n<p>sin \u03d5 cos \u03d5<\/p>\n\n\n\n<p>!<\/p>\n\n\n\n<p>where sin \u03d5 = 2<\/p>\n\n\n\n<p>p<\/p>\n\n\n\n<p>M(N \u2212 M)<\/p>\n\n\n\n<p>N<\/p>\n\n\n\n<p>. (8.87)<\/p>\n\n\n\n<p>The eigenvalues of this matrix are e<\/p>\n\n\n\n<p>\u00b1i\u03d5<\/p>\n\n\n\n<p>. We can therefore use the phase estima-<\/p>\n\n\n\n<p>tion algorithm to deduce \u03d5. We need to feed the algorithm with an eigenstate<\/p>\n\n\n\n<p>of<\/p>\n\n\n\n<p>\u02c6<\/p>\n\n\n\n<p>G. Now you can see for yourself that |\u03c8i is a linear superposition of the two<\/p>\n\n\n\n<p>eigenstates of<\/p>\n\n\n\n<p>\u02c6<\/p>\n\n\n\n<p>G, so the circuit of Figure 8.18 will work to t bits of accuracy.<\/p>\n\n\n\n<p>|0i<\/p>\n\n\n\n<p>H<\/p>\n\n\n\n<p>. . .<\/p>\n\n\n\n<p>\u2022<\/p>\n\n\n\n<p>QF T<\/p>\n\n\n\n<p>\u22121<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>t qubits |0i<\/p>\n\n\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\n\n\n\n<p>\uf8f4<\/p>\n\n\n\n<p>\uf8f4<\/p>\n\n\n\n<p>\uf8f4<\/p>\n\n\n\n<p>\uf8f4<\/p>\n\n\n\n<p>\uf8f4<\/p>\n\n\n\n<p>\uf8f2<\/p>\n\n\n\n<p>\uf8f4<\/p>\n\n\n\n<p>\uf8f4<\/p>\n\n\n\n<p>\uf8f4<\/p>\n\n\n\n<p>\uf8f4<\/p>\n\n\n\n<p>\uf8f4<\/p>\n\n\n\n<p>\uf8f3<\/p>\n\n\n\n<p>FIGURE 8.18: Circuit for quantum counting<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A simple extension to this algorithm works when the search criterion has multiple solutions. The oracle then gives an answer \u201cyes\u201d whenever any one of the M possible solutions is input. The Hilbert space then has a \u201csolution subspace\u201d M, spanned by M solution states. Let us denote by |\u03b2i the uniform superposition of all [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4042,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[497],"tags":[],"class_list":["post-4099","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-quantum-algorithms"],"jetpack_featured_media_url":"https:\/\/workhouse.sweetdishy.com\/wp-content\/uploads\/2024\/09\/algorithm-1.png","_links":{"self":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts\/4099","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/comments?post=4099"}],"version-history":[{"count":1,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts\/4099\/revisions"}],"predecessor-version":[{"id":4100,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts\/4099\/revisions\/4100"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/media\/4042"}],"wp:attachment":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/media?parent=4099"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/categories?post=4099"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/tags?post=4099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}