{"id":39185,"date":"2020-05-12T09:09:56","date_gmt":"2020-05-12T16:09:56","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/premier-developer\/?p=39185"},"modified":"2020-04-23T09:17:44","modified_gmt":"2020-04-23T16:17:44","slug":"quantum-computing-for-software-developers-part-ii","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/quantum-computing-for-software-developers-part-ii\/","title":{"rendered":"Quantum Computing for Software Developers \u2013 Part II"},"content":{"rendered":"<p>App Dev Manager\u00a0<a href=\"https:\/\/www.linkedin.com\/in\/leonardwoody\/\" target=\"_blank\" rel=\"noopener noreferrer\">Leonard Woody<\/a> breaks down the fundamentals of quantum computing from the perspective of a software developer.<\/p>\n<hr \/>\n<p>Link to Part I &#8211; <a href=\"https:\/\/devblogs.microsoft.com\/premier-developer\/quantum-computing-for-software-developers-part-i\/\">https:\/\/devblogs.microsoft.com\/premier-developer\/quantum-computing-for-software-developers-part-i\/<\/a><\/p>\n<p>Continuing from Part 1, let\u2019s create a struct that represents the state of a qubit like below:<\/p>\n<p><img decoding=\"async\" width=\"2349\" height=\"1070\" class=\"wp-image-39186\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-63.png\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-63.png 2349w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-63-300x137.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-63-1024x466.png 1024w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-63-768x350.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-63-1536x700.png 1536w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-63-2048x933.png 2048w\" sizes=\"(max-width: 2349px) 100vw, 2349px\" \/><\/p>\n<p>Using this struct, we can create a class for a Qubit:<\/p>\n<p><img decoding=\"async\" width=\"2351\" height=\"1173\" class=\"wp-image-39187\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-64.png\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-64.png 2351w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-64-300x150.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-64-1024x511.png 1024w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-64-768x383.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-64-1536x766.png 1536w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-64-2048x1022.png 2048w\" sizes=\"(max-width: 2351px) 100vw, 2351px\" \/><\/p>\n<p>Now we can create a Measure method that is a little more rigorous:<\/p>\n<p><img decoding=\"async\" width=\"2125\" height=\"1126\" class=\"wp-image-39188\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-65.png\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-65.png 2125w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-65-300x159.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-65-1024x543.png 1024w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-65-768x407.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-65-1536x814.png 1536w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-65-2048x1085.png 2048w\" sizes=\"(max-width: 2125px) 100vw, 2125px\" \/><\/p>\n<p>Things start to get interesting when we have multiple Qubits. If they are entangled, we have to track all the possibilities in the system of Qubits could have from a measurement. We can represent this like below:<\/p>\n<p><img decoding=\"async\" width=\"1234\" height=\"1089\" class=\"wp-image-39189\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-66.png\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-66.png 1234w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-66-300x265.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-66-1024x904.png 1024w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-66-768x678.png 768w\" sizes=\"(max-width: 1234px) 100vw, 1234px\" \/><\/p>\n<p>This curious result leads us to a hint of the power of Quantum Computing. For each qubit added to a quantum system, we need to <strong>double<\/strong> the amount of bits to store the state. The table below shows how this quickly gets out of control.<\/p>\n<p><img decoding=\"async\" width=\"2436\" height=\"931\" class=\"wp-image-39190\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-67.png\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-67.png 2436w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-67-300x115.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-67-1024x391.png 1024w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-67-768x294.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-67-1536x587.png 1536w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-67-2048x783.png 2048w\" sizes=\"(max-width: 2436px) 100vw, 2436px\" \/><\/p>\n<p>Finally, quantum entanglement leads us to the following curious result:<\/p>\n<p><img decoding=\"async\" width=\"2146\" height=\"997\" class=\"wp-image-39191\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-68.png\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-68.png 2146w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-68-300x139.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-68-1024x476.png 1024w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-68-768x357.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-68-1536x714.png 1536w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/04\/word-image-68-2048x951.png 2048w\" sizes=\"(max-width: 2146px) 100vw, 2146px\" \/><\/p>\n<p>In other words, the results of measurement for a system of qubits is <strong>correlated<\/strong>. When we entangle a system of two qubits into a \u201cBell State\u201d, if you measure 1 on one qubit you will <strong>always<\/strong> measure a 1 on the other qubit. The reverse is also true, but you will <strong>never<\/strong> get different measurements.<\/p>\n<p>In these two parts of my blog entry, I have demonstrated what Superposition and Entanglement mean from a quantum computing perspective. In Part 3, I\u2019ll get into quantum operations! \ud83d\ude0a<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In these two parts of my blog entry, I have demonstrated what Superposition and Entanglement mean from a quantum computing perspective. In Part 3, I\u2019ll get into quantum operations!<\/p>\n","protected":false},"author":582,"featured_media":39192,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[5158],"tags":[5177,3],"class_list":["post-39185","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-quantum-computing","tag-quantum-computing","tag-team"],"acf":[],"blog_post_summary":"<p>In these two parts of my blog entry, I have demonstrated what Superposition and Entanglement mean from a quantum computing perspective. In Part 3, I\u2019ll get into quantum operations!<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/39185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=39185"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/39185\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/39192"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=39185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=39185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=39185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}