<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pavan Rohit on Medium]]></title>
        <description><![CDATA[Stories by Pavan Rohit on Medium]]></description>
        <link>https://medium.com/@pavanrohit?source=rss-345a55b31a09------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*2AKIgI3Xdaxaf8H3.</url>
            <title>Stories by Pavan Rohit on Medium</title>
            <link>https://medium.com/@pavanrohit?source=rss-345a55b31a09------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 09:04:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pavanrohit/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[One day through time]]></title>
            <link>https://medium.com/@pavanrohit/one-day-through-time-804fc132f51e?source=rss-345a55b31a09------2</link>
            <guid isPermaLink="false">https://medium.com/p/804fc132f51e</guid>
            <category><![CDATA[short-story]]></category>
            <dc:creator><![CDATA[Pavan Rohit]]></dc:creator>
            <pubDate>Tue, 09 Jun 2026 17:07:59 GMT</pubDate>
            <atom:updated>2026-06-10T01:29:49.341Z</atom:updated>
            <content:encoded><![CDATA[<p>I landed in what seemed like a small village. But, my intuition already started screaming danger. Yet, I was unable to figure out how to escape. The roads seem battered, looks like this part of the country hadn’t seen development in a while. But then, there were times when Bangalore roads seemed worse. So, what do I know. But, why are the roads so unsanitary? And, the stranger thing was this village seemed to have lot more wilderness around. There were geese running around, there were sparrows, and there was the smell of petrichor. Truth be told, I felt lot closer to nature and strangely peaceful.</p><p>I walked along, to see if I can share my plight with a sympathetic stranger. And, I saw a man running. He seemed quite a bit peculiar, with a well chiseled body. This man has seen his share of danger, that much was obvious. But, he had a long hair and decorated it with flowers. And, then there was the matter of the ornaments. He wore a lot of them, stone, copper and silver ones. I had seen guys wearing chains, but never this variety of them and never so many of them. There was this strange duality of masculine and feminine that kept throwing me off. The man was staring back at me too, with a mix of fear and aggression. Is he intending to fight?</p><p>‘Who are you?’ he asked, in a language that should’ve been banned from usage anywhere except the stage.</p><p>‘Ravi’, I mumbled.</p><p>‘Where are you from? You look different’, he enquired.</p><p>‘I am from Bangalore’, I confessed.</p><p>‘Are you a spy from Vengi?’</p><p>‘A spy from where?’ I asked alarmingly. He grabbed me by the collar and took me along. The landscape kept getting weirder by every passing minute. Suddenly, there was a blood curdling cry, from what seemed like a graveyard. There was a man who looked like nightwalker that entered my time capsule. Painted in white, probably from Vibuthi, he was wearing a garland of bones. His black clothes were smeared in blood. And, he was sitting on a dead body of someone, who couldn’t have been more than 20 years old. And, in front was an image, equally frightening. And, there were people who were mourning the dead. I closed my eyes, out of pure fright. But, the ordeal seems to be nearing the climax as we entered a huge rampart surrounded by what looks like a river. There are a massive number of soldiers standing guard on these walls. As soon as we entered, there was a deafening roar of several elephants. There were people carrying swords, spears. There is an unmistakable scent of sandalwood mixed with stench. And, there was a higher than usual concentration of robed fellows, probably monks. As my friend dragged me along the street, people kept watching me curiously. But, I could sense an unmistakable gloom in the air. I asked the guy, “What’s the matter? Why does everyone look sad?” He just shot an angry look.</p><p>Realizing his predicament, I tried to keep my trap shut for the rest of the time. But, the scenes around made me drop my jaws. There are huge Rangolis in front of every house. Are the women in the house so jobless, that they got time to put these designs every day? The houses themselves were quite modest, built with bricks. They were painted white and red, mostly, and wore a weathered look. Soon, we entered a palace. I was ushered into the chambers of the king.</p><p>“We found the enemy Maharaja”, said my guy without looking up. The first sight of king shattered all my misconceptions. Oh Tollywood, how have you betrayed me. Truth be told, he was a handsome man, with greyed hair. He didn’t wear any cloth on his upper body. But, the amount of jewellery he wore would look obscene even in a jewellery ad. It had all varieties, some chains had temple lions on them, some had flowers and fruits. Some had stones. And then, he wore bracelets, rings and what not. He had a long hair tied into a knot, adorned with flowers. He had huge ear rings which hung till his shoulders. He was covered in a thick paste of sandalwood and camphor, that is usually seen in marriages. He had a dazzling sword by his hand. But, one of the fingers in his left hand was missing. Did he lose one in the battle? Maybe!</p><p>“We are hearing that you carry some poison with you.”</p><p>“No Maharaja! I don’t have any poison”</p><p>The guard immediately seized my bag and emptied it on the floor. A bit embarrassing that I carried so many chips and chocolates, but nothing poisonous. But, everyone in the room were terrified. I realized their horror. Immediately, I told them, I am from 21st century and this is favourite snack for people in the future. Looking at their puzzled faces, I realized they hadn’t understood what I said</p><p>“I am from future, Maharaja. If you permit, I can eat this in front of you, to gain your trust”</p><p>“How do I not know, you already didn’t take the antidote?”</p><p>“You can feed it to any animal Raja, if nothing happens to it, you can trust me”</p><p>The raja seemed convinced and asked me to try. I just took a fistful of chips and put it in mouth. Then he asked the soldier to try. The soldier tried it and started frantically asking for water. Everyone looked in alert and were ready to kill at the slightest sound. After a couple of glasses of water, “This is a miracle Raja. I never had something as tasty as this in my life”</p><p>Then, everyone took turns eating it. After relishing little of what is left with me, they probably started to trust me. Then, the room fell silent for what felt like an eternity. Then, the king said, “Let’s meet in private”</p><p>I breathed a huge sigh of relief. After all, I might actually not die before I am even born. I hope so. Some of the king’s men helped me wash myself. The process itself seemed so rooted to the ground, and oddly refreshing. Then, I was taken into the private chambers of the king. There was an elaborate meal waiting for me. It reminded me of the dinner I had at Mandi, with a small table with food on golden plate. But, the cushions are no where to be seen. There is just a plain mat. For a king that powerful, his dining space is more spare than mine. The food though, was an experience of its own. I can’t taste any hint of chilli anywhere. It felt more like what I used to eat when I am sick, a bit bland to my taste. But, it was definitely, a lot more nuanced. No flavour was overpowering by itself, but I could sense ghee, vegetables and every ingredient that is part of the meal. The king asked me a bit about the time and place I am from. He was thoroughly amused by the anecdotes I shared with him. Whether he believed I was truthful or not, I don’t know. But, at least, he held me at least on par with his jester. I decided to find out though.</p><p>“Raja, why did you believe when I said, I am from future. No one else in your court seems to have believed me and were shocked when you said so”</p><p>“I still don’t believe you, but the circumstances forced me to take a chance on you. You see, there’s this evil epidemic that is inflicted on our country. People are getting killed like flies. On the advice of raja purohit, I sacrificed my finger to the Goddess. But, the fate didn’t change. And, you materialised. Maybe, the Goddess herself sent you to help me? You said, the medicine and technology of your time is far advanced in your age. Tell me, why are people dying of this mysterious illness. They usually vomit and do motions and then die.”</p><p>“I am no doctor Raja, but based on what you are saying, it could be due to water pollution. I can suggest couple of things. First, fix the sanitation. No peeing or excreta near water. And, as soon as the job is finished, clean the hands thoroughly with hot water before touching anything. Similarly, if you intend to use water for any purpose, in preparation of food, that needs to be boiled. And, mix water with salt and jaggery powder and keep drinking. If you follow this religiously for couple of months, the issue might subside.”</p><p>The King listened intently. Then he called his minister and asked him to spread this info among public. I was given an accommodation near king’s quarters. Next month went by in a blur. As the rainy season subsided, so did the epidemic. The king gifted me an enormous gold necklace for my help. As I was admiring its beauty, I heard a loud thud. As the sound grew louder, I realised its time to start for office</p><p>PS: setup is the narrator went to Manyakheta during the reign of Amoghavarsha of Rashtrakutas</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=804fc132f51e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quantum speedup]]></title>
            <link>https://medium.com/@pavanrohit/quantum-speedup-c7720d0ac4bb?source=rss-345a55b31a09------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7720d0ac4bb</guid>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Pavan Rohit]]></dc:creator>
            <pubDate>Sun, 26 May 2024 11:03:35 GMT</pubDate>
            <atom:updated>2024-06-02T15:43:46.316Z</atom:updated>
            <content:encoded><![CDATA[<p>Fast forward 30 years. All the mobile screens flashed at once. That’s the notification of the most important achievement of the century. Arguably, of course. Scientists managed to develop a quantum computer which can solve problems faster than a classical computer. So, what does it mean for the humanity. Is the banking system broken? Have we solved P = NP problem? Have we discovered panacea to cure all illnesses? Before we answer the above questions, let’s try to figure out how quantum algorithms achieve speedup over classical algorithms using one of the first quantum algorithms ever developed, Deutsch algorithm.</p><p><strong>Problem Statement</strong></p><p>There is a function defined on x which is N bit number(let’s assume N=10). It outputs a single bit output.</p><blockquote>f(x) ∈ {0, 1} ∀ x ∈ {0–1023}</blockquote><p>It’s assured to us that either the function gives a constant output or a balanced output. In case of constant output, f(x) is either 0 or 1 for all values of x. If the function is balanced, f(x) takes value 0 for 512 values and 1 for 512 values at random. The problem is to figure out whether the function is constant of balanced.</p><p><strong>Classical computer vs Quantum computer</strong></p><p>Let’s assume the function is constant, a classical computer takes at least 513 operations to figure out that it is constant. However, a quantum computer takes one operation to figure out if it is balanced or constant function. Let’s figure out how in the following sections</p><p><strong>Quantum Algorithm</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7y1i_d2q_BikIA_sAoIliw.png" /><figcaption><strong>fig:1</strong> source:<a href="https://en.wikipedia.org/wiki/Deutsch%E2%80%93Jozsa_algorithm#/media/File:Deutsch-Jozsa-algorithm-quantum-circuit.png">https://en.wikipedia.org/wiki/Deutsch%E2%80%93Jozsa_algorithm#/media/File:Deutsch-Jozsa-algorithm-quantum-circuit.png</a></figcaption></figure><p>In this algorithm, we make use of the above circuit. The circuit contains an oracle which takes |x&gt;|y&gt; as input and gives |x&gt;|y ⊕ f(x)&gt; as output in zero time.</p><blockquote>y ⊕ f(x) = (y + f(x)) % 2</blockquote><p>The first step in the algorithm is applying 𝐻⊗𝑛 on x and H on y. As we know a hadamard transform creates a superposition of states. For example,</p><blockquote>H(|0&gt;) = 1/√2(|0&gt; + |1&gt;);</blockquote><p>The above equation can be interpreted as the state gives |0&gt; upon measurement 50% of times and |1&gt; another 50% of times.</p><p>Let’s see what happens if we apply Hadamard transform on a two Qubit system</p><blockquote>H(|0&gt;|0&gt;) = H(|0&gt;)⊗H(|0&gt;)</blockquote><blockquote>H(|0&gt;|0&gt;) = 1/2{(|0&gt; + |1&gt;)(|0&gt; + |1&gt;)}</blockquote><blockquote>H(|0&gt;|0&gt;) = 1/2{|00&gt; + |01&gt; + |10&gt; + |11&gt;}</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUW_k24oaV_GVVva7GoZVQ.png" /><figcaption><strong>fig 2</strong></figcaption></figure><p>Extending the logic to n Qubits</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eCfvipBu_jdV_pQmHZZJQA.png" /><figcaption><strong>fig 3</strong></figcaption></figure><p>So, in the above circuit,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KVpzsLHifOs92u8vGeTYyw.png" /><figcaption><strong>fig:4</strong></figcaption></figure><p>Now, let’s try to compute <strong>𝛙</strong>₂ for a single Qubit system. Expanding the product term and substituting f(|0&gt;) in place of |0&gt; and f(|1&gt;) in place of |1&gt; in the |y&gt; term, we get the following</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*IRX2cchk0F6lXbu5gT_ggQ.png" /><figcaption><strong>fig:5</strong></figcaption></figure><p>Writing the above in terms of summation over x, we get</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*zYrApr8AkMSnW_-jsT_n-Q.png" /><figcaption><strong>fig:6</strong></figcaption></figure><p>Now, to the final step. Let’s apply H on x and check what happens. If f(0) = f(1) = c, then</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*TYm0mvuQGQ5NrcUL7GzyRQ.png" /><figcaption><strong>fig:7</strong></figcaption></figure><p>Applying H on first term gives us |0&gt;. However if f(0) is not equal to f(1), then the same equation looks as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*zBg0QZ18i-ykbuwCTe3KSg.png" /><figcaption><strong>fig:8</strong></figcaption></figure><p>In the above equation the interesting thing to note is that the coefficients of |0&gt; and |1&gt; should be opposite in sign</p><p>Applying H on first term gives us |1&gt;. So, all we need to do to figure out if the function is balanced or constant is to just apply H on x and measure it. If it yields 0, function is constant, else, it is balanced. So, what made this possible?</p><p><strong>Superposition: </strong>We placed input x in superposition of all the values in the domain and computed the function value for all the values of x in a single operation. There’s no known equivalent for this in classical computer</p><p><strong>Entanglement</strong>: The phase difference between x and y at <strong>𝛙</strong>₃ depended upon the value of function at x i.e f(x). If f(x) is constant for all values of x, then the phase difference between x and y is constant for all values of x. However, when f(x) is balanced, the phase difference between x and y increased by π for some values of x and remained same for other values of x. This behaviour resulted in a macroscopic difference in measurement leading to success of this algorithm</p><p>Let’s try using this algorithm for n Qubit input. To apply H on x, Let’s assume x as x₀ x₁ x₂….xₙ. If x₀ is 0, H(x₀) becomes |0&gt; + |1&gt;. If x₀ is 1, H(x₀) becomes |0&gt; — |1&gt;. So, we can write as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*Hxa4w2PQD2vQAXTmqzKX-g.png" /><figcaption><strong>fig:9</strong></figcaption></figure><p>If we want to write this more concisely, we can write it as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*ZOY-woPPKbLkI4hXbIP8eg.png" /><figcaption><strong>fig:10</strong></figcaption></figure><p>Expanding this for all bits of x, we get</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*8RJXmiG4tAX5upkVGMth9g.png" /><figcaption><strong>fig:11</strong></figcaption></figure><p>Let’s try to make all the summations over z into summations over several bits</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NZY5SxLKnGDNo_4m4eKaVQ.png" /><figcaption><strong>fig:12</strong></figcaption></figure><p><strong>𝛙</strong>₁ is given by following from above</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*s-thhAg4aeOE-Mzl1l6n6w.png" /><figcaption><strong>fig:13</strong></figcaption></figure><p>Now to get <strong>𝛙</strong>₂, we substitute the equation we derived for H(x) in fig:12 in place of |x&gt; to get the following</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f6NK1zLJlB-Ql02JFrxF2Q.png" /><figcaption><strong>fig:14</strong></figcaption></figure><p>If f(x) is constant for all values of x, it goes out of equation and for value of z=0, you get</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wc30we4FAwQR-ru-UxzQCQ.png" /><figcaption><strong>fig:15</strong></figcaption></figure><p>As we can see, the first term has 1/sqrt(2) as the normalisation factor of |0&gt; — |1&gt;. So, x is 0 with probability 1 if f(x) is constant function</p><p>If f(x) is a balanced function, the same computation becomes as follows, if we split summation over z as two parts, one containing z= 0 and other containing summation over z from 1 to N</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*4auVx9ZmhTmghSgy2_HEtA.png" /><figcaption><strong>fig:16</strong></figcaption></figure><p>Bringing out the constant terms outside summation in the first term of above equation, we get</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*YQqh0sdKR1rMhmEHlnvUxQ.png" /><figcaption><strong>fig:17</strong></figcaption></figure><p>As f(x) is balanced, the first term(summation over x=0 to x=N where z is 0) is 0</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*En6gaVLkTYl4R3zzI41qVQ.png" /><figcaption><strong>fig:18</strong></figcaption></figure><p>As you can see, the first term cancels out as f(x) is balanced. So, if we measure x after applying H again, we get any value other than 0. That’s how the algorithm can be used to distinguish between constant and balanced functions in a single operation</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7720d0ac4bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quantum Fourier Transform]]></title>
            <link>https://medium.com/@pavanrohit/quantum-fourier-transform-2f7bc0ff51a8?source=rss-345a55b31a09------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f7bc0ff51a8</guid>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Pavan Rohit]]></dc:creator>
            <pubDate>Sun, 01 Oct 2023 10:49:13 GMT</pubDate>
            <atom:updated>2023-11-12T06:11:32.757Z</atom:updated>
            <content:encoded><![CDATA[<p>There are numerous resource online which explain Quantum FFT and I don’t think I can explain it better than any of them. The motivation behind this post is to explain myself the intuition behind the FFT, and try to come back later when I struggle with the basic concept again</p><p>As an electrical engineer, FFT is taught to us in the following way. Imagine a periodic series of period N. Let’s represent it as S</p><blockquote>s = {x[0], x[1], x[2], …….., x[N-1]}</blockquote><p>In the above equation, x[0] represents the sampled value of the signal at time instant 0, x[1] represents the sampled value of signal at time instant 1 and so on. If we want to write it as a sum of periodic functions, we can choose to represent it as a linear combination of exponentials as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*bVvzFvXmirAtXrfNmVdLZQ.png" /><figcaption>Equation 1</figcaption></figure><p>If 2𝝅/N is ω, the base periodic sequence is a function of ω. The term in flower braces is f(jω). To get the coefficients y[j], we need to apply FFT. We do that by doing as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*KYqNKVAjyjv7D_t4NxhSXA.png" /><figcaption>Equation 2</figcaption></figure><p>We can think of the above as finding the correlation between the periodic exponential function and the periodic function, both sampled in time.</p><p>In Quantum computing, as per definition, basis state |a[j]&gt;can be transformed into its Fourier space |b[k]&gt; as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*5ME97ndrUbXOEkbj_LK81A.png" /><figcaption>Equation 3</figcaption></figure><p>Let’s say there’s a wavefunction Ψ which is expressed in original space as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*R_b6c_vCVFp0hCAuLRycxA.png" /><figcaption>Equation 4</figcaption></figure><p>In the Fourier space, let’s say it is expressed as following</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*IhzeLPx3Hv-dUG_BX-hYxw.png" /><figcaption>Equation 5</figcaption></figure><p>By using the expansion for vectors as given by equation 3, Ψ can be written as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*vsJk4-g6GwMem4_wtnlYCA.png" /><figcaption>Equation 6</figcaption></figure><p>To get the value of βⱼ which is the component of |b[j]&gt;, we separate out |b[j]&gt; in the above equation and that gives us</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*4-LSM60KBYHUkVGeXMf46w.png" /><figcaption>Equation 7</figcaption></figure><p>As you can see, this looks similar to the equation 2. Initially, equation 3 which is the Fourier transformation from one basis space to another looked a bit unfamiliar, it filters down to the familiar expansion in equation 7 after a bit of math</p><p>Now, Let’s move on to computing the Fourier transform of n qubit state with the general representation of |j₁j₂..jₙ&gt; where each jₖ can take two values, 0 and 1(since qubit is a superposition of |0&gt; and |1&gt;). Since each of the jₖ can take two possible values, we can consider the general representation to be a binary number with its value within 0 to 2ⁿ</p><p>To transform a wave function in this space to Fourier space, we use equation 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*sAomTk3rO0dTMH2_mSKF2w.png" /><figcaption>Equation 8</figcaption></figure><p>k can be written as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*Gf0xciT5wrJ1AeXbw4lqFg.png" /><figcaption>Equation 9</figcaption></figure><p>dividing it by 2^n, we get</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*h5aWoQh_Q4HBi-dt6QGqYw.png" /><figcaption>Equation 10</figcaption></figure><p>Exponential in equation 8 can now be simplified as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*2PBUIkCte5TqKFFwXjLW1A.png" /><figcaption>Equation 11</figcaption></figure><p>By iterating each kₜ over 0 and 1, we get all values of k from 0 to 2^n-1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*B9zevPzECVFqkw1JeLRhcg.png" /><figcaption>Equation 12</figcaption></figure><p>By moving summation of kₜ over 0 and 1 inside product, we get</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*X0ZJltNX5u7_Ik6B3o9AqQ.png" /><figcaption>Equation 13</figcaption></figure><p>This is the form of quantum FFT we use to build quantum circuits using standard Rₖ operators</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f7bc0ff51a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hooli Ocean]]></title>
            <link>https://medium.com/@pavanrohit/hooli-ocean-b68a3318a655?source=rss-345a55b31a09------2</link>
            <guid isPermaLink="false">https://medium.com/p/b68a3318a655</guid>
            <category><![CDATA[storytelling]]></category>
            <dc:creator><![CDATA[Pavan Rohit]]></dc:creator>
            <pubDate>Wed, 15 Mar 2023 02:07:38 GMT</pubDate>
            <atom:updated>2023-03-15T02:11:32.133Z</atom:updated>
            <content:encoded><![CDATA[<p>There’s tremendous buzz in the campus. All the notice boards turned colourful. The participants outside the auditorium are looking nervous. “Hooli Shakers,” the speakers reverberated across the hall. Two guys climbed the dias and started their pitch. The judges, who till then were half asleep, suddenly sat up. The next one hour saw an intense excitement in the Auditorium. There was excitement everywhere. “Hooli Shakers” won the competition unanimously and received a grant of a million dollars</p><p>In the next week’s keynote address, Gavin started, “A lot of companies have failed in the past due to lack of imagination. If Nokia had imagined smart phones, they’d still be the market leaders today. If Kodak had imagined digital cameras, ‘Kodak moment’ would still be a thing. We at Hooli solved this problem”. There was a stunned silence in the room. Gavin continued, “We are releasing a CAAS product today. CAAS stands for Creativity As A Service. We call it ‘Hooli Ocean’. A ocean is made up of billions of drops. A Hooli Ocean is made up of millions of brains. We implant chip in the brains of the most creative people and connect it to the internet.’ There was a collective gasp in the audience. “We’ve rigorous criteria to select the Hooli drops which make up the ocean. Be assured, we will only choose the most creative persons to take part in this through a meticulous selection process and reward them handsomely.”</p><p>Just as he ended, an Ad started playing in the screen. A bearded man was struggling to finish the portrait. A woman comes on to the screen and says, “Leo, I’ve never seen you struggle with a portrait before. What’s happening?” Leo says, “I’ve a painter’s block. I can’t figure out how to continue.” “Worry not”, says the woman with a glee, “Hooli Ocean can help you continue”. She goes to the app, takes the picture of the portrait and uploads it. Within a minute, the app sends Monalisa. The ad ends with a caption, “Even creators are human”</p><p>The internet broke to this news. Several commentators called it the greatest invention after internet itself. Husk tweeted, “This is a revolutionary idea. I am proud to be the first Hooli drop #iamahoolidrop.” Within few hours, the hashtag was trended by the who’s who in the world. A certain reputed college in India tweeted, “We’re proud to announce that the number of our college Hooli Drops is the highest in the world beating Harvard and Cambridge #iamahoolidrop #proudindians.” The idea became a terrific success earning Hooli billions in revenue.</p><p>A year later, Hooli announced the most profitable year in its history. Its stock jumped up by 400% percent. Completely unrelated to this, scientists are trying to discover the cause for sudden increase in the migraines. They’re suspecting climate change and exhorting the world to take necessary steps to combat it. Hooli announced a charity trust to combat climate change and donated 100 million dollars to it, cementing its reputation as a progressive company</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b68a3318a655" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rotations in Bloch sphere]]></title>
            <link>https://medium.com/@pavanrohit/quantum-rotational-operators-169239aa652f?source=rss-345a55b31a09------2</link>
            <guid isPermaLink="false">https://medium.com/p/169239aa652f</guid>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Pavan Rohit]]></dc:creator>
            <pubDate>Sat, 14 Jan 2023 16:10:14 GMT</pubDate>
            <atom:updated>2023-10-01T07:45:43.706Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post, I will try to explain about the rotational operators. They are extremely significant in quantum computation. Why are they so significant? Well, any Qubit can be represented as a point on Bloch sphere. We can transform any Qubit to a target Qubit using just three rotations. Any arbitrary single qubit unitary operator can be written as</p><blockquote>U = exp(i<em>θ</em>)Rz(α<em>)Ry(</em>β)Rz(γ)</blockquote><p>How to understand this intuitively? Let’s start that exercise by ignoring the global phase factor exp(i<em>θ</em>). So, our U becomes the following</p><blockquote>U = Rz(α<em>)Ry(</em>β)Rz(γ)</blockquote><p>If we apply this unitary operator on a Qubit, it will first get rotated by γ about Z axis, followed by a rotation of β about Y axis and then a rotation of α about Z axis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vgupUZ0WY8spE0owPbpvuA.png" /></figure><p>The above image is a cross section of Bloch sphere(It is convenient to think of bloch sphere as earth and grey lines as latitudes. However rotation about Y axis can’t be thought as traversing longitudes as all of them pass through poles). Rotation about Z axis is equivalent to traversing grey line. Rotation about Y axis is equivalent to traversing the black line. So, applying U is equivalent to traversing grey line followed by black line followed by grey line. From the Qubit represented by blue circle, we can always imagine a path to any other point on the sphere just traversing grey, black and grey line.</p><p>Isn’t two rotations enough for any Qubit to get transformed to any Qubit on circle? No. The Qubit represented by yellow circle is a counter example. We can’t traverse grey line from that as it lies on pole of bloch sphere. So, we have to traverse black line to travel vertically along the sphere. To reach any point not on circle joining poles, we need a rotation about Z axis again. That is why we need three rotations.</p><p>Let us now discuss more about the rotation operators Rx(<em>θ), Ry(θ), Rz(θ) </em>and their derivations. These are expressed in terms of Pauli Matrices given by</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*ckd_S58HytLcDRKeKqZlvg.png" /></figure><p>Rotation about X axis is given by the following formula</p><blockquote><em>Rx(θ) = cos(θ/2)I — i sin(θ/2)X</em></blockquote><p>Rotation about Y axis is given by the following formula</p><blockquote><em>Ry(θ) = cos(θ/2)I — i sin(θ/2)Y</em></blockquote><p>Rotation about Z axis is given by the following formula</p><blockquote><em>Rz(θ) = cos(θ/2)I — i sin(θ/2)Z</em></blockquote><p>It took me an embarassingly long time to derive these equations. Derivations are done in the following sections</p><p><strong>Derivation of Rx(θ)</strong></p><p>Let’s assume our initial state was making an angle of θ with Z axis and we intend to rotate it by θ’ about X axis as shown in the figure</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*HrfUDdLb38PViDcMgewUDw.png" /></figure><p>Initial vector as shown in blue is</p><blockquote>i = cos(θ/2) |0&gt; + i sin(θ/2) |1&gt;</blockquote><p>After rotation, the rotated vector as shown in green is</p><blockquote>f = cos(θ/2+θ’/2)|0&gt; + i (sin(θ/2 + θ’/2)</blockquote><p>Expanding</p><blockquote>f = cos(θ/2)cos(θ’/2)|0&gt; — sin(θ/2)sin(θ’/2)|0&gt;</blockquote><blockquote>+ i sin(θ/2)cos(θ’/2) |1&gt; + i sin(θ’/2) cos(θ/2) |1&gt;</blockquote><p>taking common terms</p><blockquote>f = cos(θ’/2) * (cos(θ/2) |0&gt; + i sin(θ/2))</blockquote><blockquote>— sin(θ’/2) * (sin(θ/2) |0&gt; -i cos(θ/2) |1&gt;)</blockquote><p>term in first brackets is initial vector i and term in second brackets is i times Rx of state vector i</p><p>Hence</p><blockquote>Rx = cos(θ/2) I — i sin(θ/2) X</blockquote><p><strong>Derivation of Ry(θ)</strong></p><p>Use the same approach as the one used for Rx(θ) but set the initial vector <em>i</em> to be a point on XZ plane. Let it be cos(θ/2) |0&gt; + sin(θ/2) |1&gt;</p><p>If we rotate the vector by θ’ about Y axis, the final vector would be</p><blockquote>f = cos(θ/2 + θ’/2) |0&gt; + sin(θ/2 + θ’/2)|1&gt;</blockquote><p>Expanding <em>f</em>, we get</p><blockquote>f = cos(θ/2)cos(θ’/2) |0&gt; — sin(θ/2)sin(θ’/2)|0&gt; +</blockquote><blockquote>sin(θ/2)cos(θ’/2) |1&gt; + cos(θ/2)sin(θ’/2) |1&gt;</blockquote><p>Taking cos(θ’/2) and sin(θ’/2) common, we get</p><blockquote>f = cos(θ’/2)(cos(θ/2) |0&gt; + sin(θ/2)|1&gt;) -sin(θ’/2)(sin(θ/2)|0&gt; — cos(θ/2)|1&gt;)</blockquote><p>This can be written as</p><p><em>f = [cos(θ’/2)I -sin(θ’/2)(iY)]*i</em></p><p><strong>Derivation of Rz(θ)</strong></p><p>Let’s assume our initial state was making an angle of θ with Z axis, ϕ with Y axis and we intend to rotate it by ϕ’ about Z axis as shown in the figure</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*1SSE3CmAAGftg_y7t-5dNg.png" /></figure><p>Initial state vector <em>i</em> can be represented as</p><blockquote>i = cos(θ/2) |0&gt; + (e^iϕ) * sin(θ/2) |1&gt;</blockquote><p>Final state vector <em>f</em> after rotating ϕ’ degrees about z axis can be represented as</p><blockquote>i = cos(θ/2) |0&gt; + (e^i(ϕ+ϕ’)) * sin(θ/2) |1&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nE-vcObnp47hx9x_w5wlDw.png" /></figure><p>Solving for a, b, c, d, we get</p><blockquote>a = 1, b = 0, c= 0, d = exp(iϕ’)</blockquote><p>We can write that as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*8Kj7EnhYCG-vh6f50ORshA.png" /></figure><p>If we ignore the global phase factor outside the matrix, the operator can be written as</p><blockquote><em>Rz(θ) = cos(θ/2)I — i sin(θ/2)Z</em></blockquote><p>We shall discuss how to build controlled Qubit operators using rotation operators in the next post</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=169239aa652f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The tale of Ra]]></title>
            <link>https://medium.com/@pavanrohit/the-tale-of-ra-9151eeab1e55?source=rss-345a55b31a09------2</link>
            <guid isPermaLink="false">https://medium.com/p/9151eeab1e55</guid>
            <category><![CDATA[storytelling]]></category>
            <dc:creator><![CDATA[Pavan Rohit]]></dc:creator>
            <pubDate>Sat, 26 Nov 2022 06:46:29 GMT</pubDate>
            <atom:updated>2022-11-26T06:46:29.138Z</atom:updated>
            <content:encoded><![CDATA[<h3>The tale of Raghava</h3><p>Raghav has been on road whole day. He is on a personal mission. Ever since Vaidehi left him, he had been yearning for a girl, to share his emotions and to continue his lineage. Today, he’s going to meet the king of Ujjain. He recollected the advice Sumana gave him. “Raja! This is a done deal. Ujjain’s princess has no suitors. The kingdom is in shambles and the king is a big time gambler. He can’t find anyone else for her. Don’t ramble too much about Vaidehi. That can put anyone off.” “I don’t talk about her so much,” Raghava protested. “I never speak about her for more than an hour at a stretch,” he said to the bewildered Sumana. Anyway, with a lot of huff and puff, he reached Ujjain.</p><p>The King Harsha welcomed him warmly. Even he knows that Raghava is his golden ticket. He had been preparing for this occasion. He arranged for a grand feast, one that’s never heard of before. Anything that walks, runs or crawls is on table. There’s a separate section for flying creatures. The clown and the jester regaled them with stories, often leaving the guests in fits of cough as the food pipe and wind pipe competed for air time. In all these events, the queen and princess are looking visibly distraught.</p><p>The dinner finished and all the guests retired for the day. Harsha and Raghav sat down together. Raghava said, “It’s no secret to you as to why I came here. I am looking to marry again and I think your daughter will be a good wife to me and a great queen to our kingdom.” A visibly excited Harsha called his wife and daughter to the chamber. The princess was the first to speak.</p><p>“Dad! I have something to say. I am in love with someone and I married him yesterday.”</p><p>“What!” Harsha couldn’t believe what he was hearing. “I knew you wanted me to marry me off to Raghav. And, given a chance, I will be sent off to his kingdom. So, I didn’t want to take that chance. I married Chemil.”</p><p>“You married the court jester!” Harsha said incredulously. “At least better than a married man. He makes me laugh,” said the princess and left merrily.</p><p>A disappointed Raghav left the chambers. He started back to the kingdom. After travelling for about two days, he was completely tired. He stopped near a hut which seemed familiar to him. He knocked the door. A old woman opened the door. It’s Sabari! Raghav was delighted to see a familiar face in woods. After the pleasantries have been exchanged, Sabari called her daughter and asked her to lay down the dinner. As three of them sat for dinner, Raghav came straight to the point. “I am looking for a wife. I’ve seen brides all over the world but no one matched the beauty and grace of your daughter. If you permit, I will make her the queen of my kingdom and heart,” Raghav said, clearly pleased with his articulation. Sabari had a sudden glint in her eye. She said, “Raghav! I am so honored that you made this proposal. It’s clearly our good karma which got us this opportunity. However, like all that glitters is not gold, my daughter isn’t the best match for you and certainly, not someone worthy to be your queen. I’ve a better idea.”</p><p>“Oh Wow! What’s your idea?”</p><p>“I’ve been thinking about this for quite sometime. My husband died long back and in this age, I need someone to help me. My eye sight has become a bit worse. Nothing your doctors can’t cure though. I am wise with all the years of experience. I think we should get married.” A shocked Raghav left the food and ran out of the hut. He ran as fast as he can and went as far away as he could. He stopped by a stream. He gulped the water and rested near the tree. He kept thinking about the incidents of the last couple of days. He was feeling exasperated at his inability to find a girl for himself. He remembered the story of a virtuous king who turned a rock into a girl by touching it with his feet. Immediately an idea struck him. He dashed across the rocks into woods, into the oblivion</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9151eeab1e55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A trip to earth]]></title>
            <link>https://medium.com/@pavanrohit/a-trip-to-earth-33b94e8190e1?source=rss-345a55b31a09------2</link>
            <guid isPermaLink="false">https://medium.com/p/33b94e8190e1</guid>
            <category><![CDATA[storytelling]]></category>
            <dc:creator><![CDATA[Pavan Rohit]]></dc:creator>
            <pubDate>Thu, 29 Sep 2022 16:25:12 GMT</pubDate>
            <atom:updated>2022-09-29T16:25:12.702Z</atom:updated>
            <content:encoded><![CDATA[<p>Nykaa is watching her favourite influencer Ariana go live. She had been excited about it all week. Her feed was filled with Ariana’s pictures and songs. Suddenly, house alarms blared. The speakers in her room announced, “Nykaa! Mr. Keres heart just stopped. The quick response team has been informed and they’re on the way. Estimated time of arrival is ten minutes.” Nykaa called her mom immediately. “Yes Nykaa. I know”, Arya responded. “But you know how it’s with me. It is quarter ending time and I can’t afford to waste a minute. I suggest you go to the hospital with your dad. Besides, you can watch the recorded video later.” Nykaa sighed, “Mom, this isn’t fair. You know how eager I was to watch Ariana today. You’re using the power differential in our relationship to get undue advantage.” Arya shouted, “Nykaa! Watch your language. Don’t you forget that I made your breakfast today. If you continue behaving this way, I’ll have to ground you.” Nykaa realised that her outburst isn’t going to work today. She decided to take a conciliatory approach and pleaded, “I’m sorry mom. I’m just stressed that I’ll miss out today’s show.” After few moments, Arya responded thoughtfully, “Don’t worry Nykaa. Neither of us needs to go. Let the quick response team do their job. Enjoy your show.” And, the phone beeped.</p><p>Ten minutes passed. The door bell rang. The quick response team sprung into action. The body was quickly shifted to the ambulance. Arya told them the situation and they were empathetic to her and assured her not to worry. As soon as they reached hospital, he was moved into ICU. The heart stopped ten minutes ago. So, all the body parts were deprived of oxygen for the ten minutes. That meant, all the cells are now dead. The operator entered the social security number of Keres. The computer flashed his details and the machine started whirring. It’s a 3d printer and it started printing the organs based on the DNA that was associated with Keres. First the heart, lungs, kidneys and spleen. A couple of robots came forward and started the surgery. They cut open the body of patient and started replacing part by part. Finally, blood was pumped in and brain was inserted. The entire process took about half one hour. Then, Keres was moved into memory regeneration room.</p><p>Here, the operator retrieved his memory from the database. His most recent memory was from two days ago. The state mandated everyone to upload their memory once every two days. After crushing the agmar rebellion, the state learned that it’s easy to control the citizens if it knows what they’re thinking. There was a widespread opposition to the idea. However, the state prevailed. It argued that the policy is necessary to save citizens when there’s a brain death. It also promised them free treatment in such cases. The civil society celebrated victory for getting these concessions. However, there have been data breaches to the central database. Such data breaches have been very costly to the governments in power as they lost their majority</p><p>Keres went through the memory regeneration process and was promptly discharged. He went to the patient waiting room and looked for Arya or Nykaa. He was told that none of them accompanied him to the hospital. He thanked them for saving their life and took the bus back home. But, he kept thinking about how he was left alone in the hospital like a homeless person. Was it all worth it? He spent years trying to build comfortable life for his family. But, there’s no one beside him, except death.</p><p>He came back home. They had the customary family dinner at home. Arya asked, “How did the hospital treat you?” He responded with a dry, “fine.” The table became silent again. After about a week, Keres called for a house meeting. Everyone sat at the table, rather impatiently. He started, “I don’t feel loved. I feel horrible” Arya retorted, “Not this again Keres. How much more love do you need? Didn’t we take a vacation last year? Why the constant need for love?” They went back and forth for a while. Finally, Arya spoke up, “let’s go to the doctor that we saw last year” She made an appointment with him for the next day.</p><p>The doctor is a warm friendly guy. He had a bright smile and his bespectacled eyes reflected the wisdom the old age naturally brings. He said, “There’s a new therapy we recommend for patients with this condition. It’s a cocktail of chemicals like dopamine, oxytocin etc which can make anyone feel love. It’s especially popular among our young customers. Why don’t you try it?” Keres beamed at the suggestion. He took the appointment for the next Friday and spent the week in anticipation.</p><p>The day arrived. He was taken into a room filled with colourful lights. It looked more like a discotheque than a operation theatre. The lady greeted him with a warm smile and asked, “Your first time?” He nodded. She said, “Nothing to worry. It’s just an injection.” After a couple of minutes, she gave him a dose of the injection and he passed out. The next day he woke up, a bit confused. He was feeling even more depressed. It was supposed to make him feel better, isn’t it? Now, Arya is concerned. They visited the doctor again. He started slowly, as if he’s about to break a dreadful news. “I think, your recent operation has affected your brain in an irreversible way. Our chemicals don’t seem to work on you” Arya asked, “What’s the solution, doctor?” Doctor said, “We recommend two regimes for such patients. One is, your family should take couple of months off and spend time with each other.” Arya asked, “What’s the second option?” For all such patients, we recommend a trip to Earth. We found that spending an year on earth can rejuvenate such people. There are some people especially specialised to deal with these cases.” Arya smiled. “It’s decided then. Keres, I’ll book your tickets”</p><p>Keres boarded the starship which takes him to earth. As the pictures of trees and mountains flashed across the screen, his mood lifted. He started whistling, after a long time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33b94e8190e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bloch Sphere]]></title>
            <link>https://medium.com/@pavanrohit/bloch-sphere-e878ac939765?source=rss-345a55b31a09------2</link>
            <guid isPermaLink="false">https://medium.com/p/e878ac939765</guid>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Pavan Rohit]]></dc:creator>
            <pubDate>Thu, 29 Sep 2022 16:16:21 GMT</pubDate>
            <atom:updated>2022-09-29T16:16:21.759Z</atom:updated>
            <content:encoded><![CDATA[<p>Most of the lectures in Quantum computing start with a description of Bloch sphere. It’s possible to skim over it in a rush to finish the lecture. I did that too and even though I made progress, it felt as though I am cramming a lot of information. It’s only after understanding Bloch sphere, I felt like I understood the basic concepts</p><p>So, What’s a Bloch sphere? In simple words, it’s a way to visualise Qubits. As explained before, a Qubit when measured takes one of the two possible values(Conventionally represented as |0&gt; and |1&gt;) So, Mathematically, a Qubit can be represented as</p><blockquote><strong>ψ = a |0&gt; + b |1&gt;</strong></blockquote><p>In the above equation, we have two variables. So, we can represent <strong>ψ </strong>as<strong> </strong>a two dimensional surface in a three dimensional space. The surface we choose to represent Qubit is surface of a sphere with radius one and it’s called Bloch Sphere.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8VFa61-9OQ0hXIdLDbQWOQ.png" /></figure><p>Source: <a href="https://en.wikipedia.org/wiki/Bloch_sphere#/media/File:Bloch_sphere.svg">Wikipedia</a></p><p>In the picture, the point where the positive Z-axis meets sphere is |0&gt; and the point where negative Z-axis meets sphere is |1&gt;. |0&gt; and |1&gt; are orthogonal vectors(inner product of |0&gt; and |1&gt; is 0).</p><p><strong>Conventionally, orthogonal vectors are represented by perpendicular axes. Why’re we representing |0&gt; and |1&gt; on the same axis?</strong></p><p>I found the answer to be quite surprising. Some implementations of quantum computers use fermions to create Qubits(A fermion is a particle with spins which are odd multiples of 1/2. Electrons are an example of fermions). In such systems, in presence of interacting field in +Z direction, the particles either deflect towards positive Z axis or negative Z axis. The ones which deflect towards positive Z axis are in state |0&gt; and the rest in state |1&gt;. Similarly, any geometrically opposite points on the surface of sphere are orthogonal to each other.</p><p><strong>Given a point on the Bloch sphere, how do we calculate the probabilities of the particle in each state when measured?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*m47mw3ppygqeauGQY9qNiw.png" /></figure><p>As you can see in the above picture, the point representing Qubit makes an angle of θ with Z axis. To know the probabilities of |0&gt; and |1&gt; present in the Qubit, we draw a plane parallel to XY(represented by red line). In the figure, the plane intersects the Z axis at point X. The distance of X from the north pole of sphere(our |0&gt;) is</p><blockquote>1 — cos(θ) =&gt; 2sin²(θ/2)</blockquote><p>Similarly, the distance from south pole which is our |1&gt; is</p><blockquote>1 + cos(θ) =&gt; 2 cos²(θ/2)</blockquote><p>The probabilities of |0&gt; in Qubit is half the distance from the other pole. So, in the above example, the probability of |0&gt; is distance from South Pole(state |1&gt;) which is cos²(θ/2). The probability of |1&gt; is sin²(θ/2)</p><p>It is easy to see that any point which lies on equator of Bloch sphere has |0&gt; and |1&gt; in equal proportion.</p><blockquote>|+&gt; = 1/sqrt(2) * (|0&gt; + |1&gt;)</blockquote><p>The point where positive X-axis meets sphere is called |+&gt;</p><blockquote>|-&gt; = 1/sqrt(2) * (|0&gt; — |1&gt;)</blockquote><p>The point where positive Y-axis meets sphere is called |i&gt;</p><blockquote>|+i&gt; = 1/sqrt(2) * (|0&gt; + i |1&gt;)</blockquote><p>and the point where negative Y-axis meets sphere is called |-i&gt;</p><blockquote>|-i&gt; = 1/sqrt(2) * (|0&gt; — i|1&gt;)</blockquote><p>An interesting point to note here is that to compute the probability that an electron in state |0&gt; deflects towards positive X-axis when we apply excitation field along positive X-axis is same as finding the probability of |+&gt; state when the electron is in state |0&gt;. We use the same procedure described above but instead axis being Z axis, it would be X-axis. Instead of intersecting plane being parallel to XY plane, it will be parallel to YZ plane. It is easy to see that electron beam in |0&gt; state deflects equally in |+&gt; and |-&gt; directions. If we use this visualisation, Stern-Gerlach experiment becomes more intuitive to understand</p><p><strong>Isn’t a circle enough to visualise a Qubit? Why did we bring in a spherical surface?</strong></p><p>Any Qubit can be represented as</p><blockquote><strong>ψ = cos(</strong>θ/2) |0&gt; + e^(iΦ) sin(θ/2) |1&gt;</blockquote><p>the Φ component in the equation denotes the phase difference between |0&gt; and |1&gt;. For example, |+i&gt; state is 90⁰ ahead of |+&gt; state. It’s this phase difference which plays important role in some of the quantum algorithms</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e878ac939765" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Qubit]]></title>
            <link>https://medium.com/@pavanrohit/qubit-aeb6a2e2da76?source=rss-345a55b31a09------2</link>
            <guid isPermaLink="false">https://medium.com/p/aeb6a2e2da76</guid>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Pavan Rohit]]></dc:creator>
            <pubDate>Sun, 25 Sep 2022 09:04:41 GMT</pubDate>
            <atom:updated>2022-09-25T09:07:27.701Z</atom:updated>
            <content:encoded><![CDATA[<p>There’s a famous scene in The Big Bang Theory where Penny asks Sheldon if she should pursue relationship with Leonard. Sheldon explains Penny about the Schrodinger’s cat. It was a thought experiment proposed by Schrodinger to explain superposition in Quantum mechanics. So, what’s Schrodinger’s cat? Imagine a sealed box containing a cat and vile of poison. As long as the box is sealed, we don’t know if the cat is dead because the vile broke or alive. But, if we open the box, the vile of poison could break due to our action and kill the cat. It might not break and the cat could be still alive. So, as long as the box remains closed, the cat can be thought as being both dead and alive at the same time. This peculiar concept is called superposition. It is a key concept we need to know to understand about Qubits.</p><p>Wait, what’re qubits? Just as how classical computer works using bits, a quantum computer works using Qubits. Qubits are units of information which when measured can give one of the two states. For example, in the Schrodinger’s cat thought experiment, cat being alive is one state and it being dead is another. Let’s denote these states as |0&gt; and |1&gt;(This is Dirac’s notation to represent quantum states). Just as in the experiment, a Qubit can stay in superposition of both the states. What do I mean when I say it can stay as a superposition of two states? Imagine someone created a million copies of the same Qubit. If you measure the value of all the Qubits, some of them can become |0&gt;, others |1&gt;. The state of this Qubit can be represented by</p><blockquote><em>S = a |0&gt; + b |1&gt;</em></blockquote><p>Quantum mechanics states that the probability that measurement yield |0&gt; is given by square of a and the probability of |1&gt; is b squared. Since the measurement yields either |0&gt; or |1&gt; and probabilities should add up to 1,</p><blockquote><em>a² + b² = 1.</em></blockquote><p>Also, it is impossible to predict before hand if the measurement yields a |0&gt; or |1&gt; if neither of a nor b is 0. In the above equation, a and b are both complex numbers. So, a Qubit can technically be in infinite possible states even if the measurement always yields a |0&gt; or |1&gt;</p><p>Why should a and b be complex? Why not real numbers? The state of any entity(electron/photon/muon etc) is given by a wave function. We can imagine wave function as a function of position and time. What it means is that, the probability of finding an entity at a position depends upon the time when it is observed and position where we’re observing. In the young’s double slit experiment conducted with electrons(photons), these entities behaved as if they’re waves. Any wave is characterised by two properties, amplitude and phase. That’s the reason why a complex number is better suited to represent the coefficients of wave function rather than a real number as it represents two properties(real component and imaginary component). Alternatively, you can use two real numbers for each state(one cosine component and one sine component). We are choosing the former.</p><p>These Qubits are visualised using a Bloch sphere. What’s Bloch sphere and how to understand it will be discussed in the next post</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aeb6a2e2da76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quantum Aha Moment]]></title>
            <link>https://medium.com/@pavanrohit/quantum-aha-moment-a36a911c04c2?source=rss-345a55b31a09------2</link>
            <guid isPermaLink="false">https://medium.com/p/a36a911c04c2</guid>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Pavan Rohit]]></dc:creator>
            <pubDate>Sun, 25 Sep 2022 09:02:41 GMT</pubDate>
            <atom:updated>2022-09-25T09:02:41.441Z</atom:updated>
            <content:encoded><![CDATA[<p>Last year my friend forwarded an article which talked about advances made in 3nm technology. I remember studying that when process node reaches 3nm, each transistor could contain just 2–3 atoms and quantum effects become more prominent. As someone carrying a huge mortgage, this news worried me. What happens after 3nm? Will my job remain secure? So, I started thinking what other fields I could venture in. I thought, I am currently working on processors, so I should switch to a job of making quantum processors. How different can it be? Well, they are as different as a wormhole and an earthworm.</p><p>An year since, I now realized that my field might not really end and I shouldn’t have worried. Also, quantum processors and in extension quantum physics are really cool. I will describe an aha moment which made me fall in love with the subject. I came across a line which said, functions are points in an infinite dimensional space. Usually, if I don’t understand a line, I just skip to the next line and try to get the gist of what the author is saying. That day, I made a resolution that I will try to understand every word and every line. So, I stopped. What does this mean?</p><p>So, let us take an example. Let us imagine a class of 40 students. We can now define a function which takes the name of kid as an input and gives the weight of the kid as an output. The normal way to visualize this is, you plot kids names on X-axis and their weights on Y-axis. If we do that, we get 40 points in a 2 dimensional plane. Imagine a 40 dimensional plane where each axis represents a kid. Let’s say first kid’s name is Rohit and his weight is 40KG. Then, x-coordinate is 40. Second kid name is Rahul and his weight is 35. Then y-coordinate is 35 and so on. So, the entire function now becomes a point in this 40 dimensional plane. If we extend this concept to real functions, each function becomes a point(vector) in an infinite dimensional space and each point in that space represents one function. This was such an aha moment for me. It’s a beautiful way of looking at things. If this space of functions satisfies some special properties, it becomes a Hilbert space in which quantum mechanics operates(if you add two functions, the resultant function should be in the same space, if you multiply the function by scalar, it should belong to the space, additive identity should be part of the space, existence of norm. Fourier series is a well known example of Hilbert space. Why should it satisfy these properties? If these properties are not defined, we can never apply linear operations like addition on these functions and never logically prove anything).</p><p>Okay, what did we achieve by doing this? Well, now let’s take a function sin(x). It is a point in this space. If you differentiate sin(x), it becomes cos(x) which is another point in the same space. We know that we can transform any point(vector) to any other point(vector) in the space by multiplying it with a matrix. And boom! These matrices are called operators. If you multiply a function with a matrix, you get it’s first differential. If you multiply it with same matrix n times, you get it’s nth differential. Differentiation becomes an operator, integration becomes an operator and so on. Instead of dealing with functions, suddenly, we landed in Linear Algebra.</p><p>Once a transformation becomes a matrix, it makes a lot of cool results possible. For example, quantum mechanics states that every entity can be represented by wavefunction which is some kind of oracle which contains all the information about the particle(entity). Now, if we want to find a measurable corresponding to this particle(momentum, position, energy etc), we find corresponding operator, find its eigen vectors and write the wavefunction as a linear combination of these eigen vectors. Corresponding eigen values become the allowed values for that measurable and the square of coefficients of these eigen vectors become the probabilities of the measurable being that eigen value.</p><p>I tried explaining the same thing in a different post on blog is much more shabby way. Please take a look if interested. Hopefully, I will explain more interesting concepts in more lucid way in future!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a36a911c04c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>