<?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 Yuvraj Thapa on Medium]]></title>
        <description><![CDATA[Stories by Yuvraj Thapa on Medium]]></description>
        <link>https://medium.com/@yuvi.yt.xx?source=rss-530f04efa43b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mxjXsjIessJJ9Sr7OdJEiQ.jpeg</url>
            <title>Stories by Yuvraj Thapa on Medium</title>
            <link>https://medium.com/@yuvi.yt.xx?source=rss-530f04efa43b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 21:51:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yuvi.yt.xx/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[Introduction to Cirq]]></title>
            <link>https://medium.com/@yuvi.yt.xx/introduction-to-cirq-68b2be118024?source=rss-530f04efa43b------2</link>
            <guid isPermaLink="false">https://medium.com/p/68b2be118024</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[cirq]]></category>
            <category><![CDATA[science]]></category>
            <dc:creator><![CDATA[Yuvraj Thapa]]></dc:creator>
            <pubDate>Mon, 20 Nov 2023 10:07:55 GMT</pubDate>
            <atom:updated>2023-11-20T10:07:55.257Z</atom:updated>
            <content:encoded><![CDATA[<p>Cirq is a Python-based software library designed for the creation, manipulation, and optimization of quantum circuits. It enables the execution of these circuits on both quantum computers and simulators. Cirq offers valuable abstractions tailored for addressing the challenges posed by contemporary noisy intermediate-scale quantum computers, emphasizing the importance of hardware-specific details to attain cutting-edge outcomes.</p><p>Cirq features a class named BlochSphere within the cirq_web package, designed to depict the Bloch sphere using Typescript and HTML. Quantum states can be input either as a numpy array or a Python list. Let us view the implementation of the same:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j1V_mbXoXmiL1XBq1wQSdA.png" /></figure><p>The code above draws the Bloch Sphere for the state |0⟩. The output, upon execution, is as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*5GpTTOoZ1SNhvnAU8DwmPg.png" /></figure><p>Similarly, we may plot the quantum state</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*OLWD-OHzdR5JAyxMcJbddQ.png" /></figure><p>by executing the code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pb7iuPd97klL74B57sopRA.png" /></figure><p>Our output, upon execution, is as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*J5ShFVCVqQ_z1Up3gKoSXA.png" /></figure><p>To try this out yourself, along with other exciting tasks in Cirq, click on the link in the references.</p><p>References: Dimitrijev M., Yakaryilmaz A., Morales C.Z., Bloch Sphere (<a href="https://colab.research.google.com/drive/1GH__Py5QvbKoJPrdeqP81hMADWu9QRMg?usp=sharing#scrollTo=SrRbVWpA9WrD">https://colab.research.google.com/drive/1GH__Py5QvbKoJPrdeqP81hMADWu9QRMg?usp=sharing#scrollTo=SrRbVWpA9WrD</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68b2be118024" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Day for Exercises]]></title>
            <link>https://medium.com/@yuvi.yt.xx/a-day-for-exercises-65d515e3c68a?source=rss-530f04efa43b------2</link>
            <guid isPermaLink="false">https://medium.com/p/65d515e3c68a</guid>
            <category><![CDATA[quantum-information]]></category>
            <category><![CDATA[science]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Yuvraj Thapa]]></dc:creator>
            <pubDate>Mon, 30 Oct 2023 18:07:35 GMT</pubDate>
            <atom:updated>2023-10-30T18:07:35.026Z</atom:updated>
            <content:encoded><![CDATA[<p>We devote today’s session to some exercises regarding the things we have discussed so far.</p><p>Ex 1: Consider the circuit below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*mQQhvll_58QqF9OjvLH8Hw.png" /></figure><p>If we execute it 1000 times, what is the expected value of observing zero?</p><p>Solution: Notice that the initial state of the qubit is |0⟩. By action of X-Gate, it gets converted to |1⟩. Now, two consecutive Hadamards get reduced to the Identity operator. So, we have the state same as before. We may hence conclude that the expected value of observing zero is 0.</p><p>Ex 2: Consider the circuit below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*9ifiyexznP5Ffp7t4b902w.png" /></figure><p>If the circuit is executed 1000 times, which one of the following outcomes is more likely?</p><p>{‘0’: 627, ‘1’: 373}</p><p>{‘0’: 328, ‘1’: 672}</p><p>{‘0’: 391, ‘1’: 609}</p><p>{‘0’: 703, ‘1’: 297}</p><p>{‘0’: 506, ‘1’: 494}</p><p>Solution: Notice that the initial state of the qubit is |0⟩. By action of X-Gate, it gets converted to |1⟩. Thereafter, for the first and third Hadamard gate, the Hadamard gate acts only if the state of the qubit is |0⟩; and for the second and the fourth Hadamard gate, the Hadamard gate acts only if the state of the qubit is |1⟩. Based on this, option <em>(a) </em>is the best fit.</p><p>Ex 3: We have two scenarios:</p><p>A) Set a qubit to |0⟩.<br>Apply reflection Ref(π/8) and then reflection Ref(π/4).</p><p>B) Set a qubit to |0⟩<br>Apply reflection Ref(π/4) and then reflection Ref(π/8).</p><p>Let |A⟩ and |B⟩ be the final states of Scenarios A and B, respectively.</p><p>What is the angle between |A⟩ and |B⟩?</p><p>Solution: Notice that in Case A, the final state of qubit becomes |+⟩, while in Case B, it becomes |-⟩. The angle between the states may be computed graphically, or by considering the dot product. We get the answer as π/2.</p><p>Exercise 4:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*ywpYe5wFwOBcCFQ6EdWDYQ.png" /></figure><p>Solution: We have - H|0⟩ = |+⟩ ; X|+⟩ = |+⟩ ; Z|+⟩ = |-⟩ ; H|-⟩ = |1⟩</p><p>Hence, (U1, U2, U3, U4) = (H, X, Z, H).</p><p>With this, we conclude the Quantum 30 challenge! We studied, we solved exercises, we did everything we could to make ourselves maximally entangled with this world of quantum!</p><p>Looking forward to such challenges in the future. Until then, it’s a goodbye.</p><p>Yours,</p><p>Yuvraj Thapa</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65d515e3c68a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quantum State Tomography]]></title>
            <link>https://medium.com/@yuvi.yt.xx/quantum-state-tomography-980675ae20fe?source=rss-530f04efa43b------2</link>
            <guid isPermaLink="false">https://medium.com/p/980675ae20fe</guid>
            <category><![CDATA[quantum-information]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[science]]></category>
            <dc:creator><![CDATA[Yuvraj Thapa]]></dc:creator>
            <pubDate>Sun, 29 Oct 2023 17:24:44 GMT</pubDate>
            <atom:updated>2023-10-29T17:24:44.952Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*d_kW4maVxlQ9QZW82F7ONA.png" /><figcaption>Source: <a href="https://qiskit.org/ecosystem/experiments/manuals/verification/state_tomography.html">https://qiskit.org/ecosystem/experiments/manuals/verification/state_tomography.html</a></figcaption></figure><p>Today’s discussion will be a relatively short one and is meant as an introduction to Quantum State Tomography. Ought to its introductory nature, we shall discuss a simplified version of the same.</p><p>Quantum State Tomography is the step of reconstructing the qubit state by making measurements on a group of identical qubits. The origin of these states can be any apparatus or system responsible for generating quantum states, whether it consistently produces pure quantum states or, alternatively, creates mixed states with varying degrees of purity.</p><p>It is similar to estimating the bias of a coin by looking at the statistical data of coin-toss. However, only making measurements may not be ample to construct a good guess.</p><p>Suppose we have a 1000 copies of the identical qubits which are in the same quantum state lying in the first or second quadrant of the unit circle. This quantum state is represented by an angle \theta which lies in the range [0,\pi). Our task is to guess this angle. Remark that the measurement outcomes of the quantum states with angles pi/3 and 2pi/3 are same, even though they are different quantum states! Therefore, getting a 1000 qubits and merely measuring them doesn’t guarantee the correct answer.</p><p>We discuss on ‘Global Phase.’ Consider a scenario where we have a qubit, and its state is either |0⟩ or −|0⟩. Is it possible to apply a sequence of one-qubit gates in such a way that we obtain different measurement outcomes All one-qubit gates are represented by 2×2 matrices, and their combined application is represented by a single matrix, denoted as A. By exploiting the principle of linearity, if A|0⟩ results in |u⟩, then A(−|0⟩) leads to −|u⟩. Consequently, when we perform a measurement, the probabilities of observing the state |0⟩ and the state |1⟩ are identical for |u⟩ and −|u⟩. Hence, it is impossible to distinguish between them. While the mathematical expressions |0⟩ and −|0⟩ are distinct, they are considered equivalent from a physical perspective. The minus sign in front of −|0⟩ is referred to as a global phase.</p><p>In a broader context, a global phase can be a complex number with a magnitude of 1.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=980675ae20fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The BB84 QKD Protocol]]></title>
            <link>https://medium.com/@yuvi.yt.xx/the-bb84-qkd-protocol-152241d1f0c7?source=rss-530f04efa43b------2</link>
            <guid isPermaLink="false">https://medium.com/p/152241d1f0c7</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[science]]></category>
            <category><![CDATA[quantum-cryptography]]></category>
            <dc:creator><![CDATA[Yuvraj Thapa]]></dc:creator>
            <pubDate>Fri, 27 Oct 2023 07:56:29 GMT</pubDate>
            <atom:updated>2023-10-27T07:56:29.525Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 27- Quantum 30 challenge</h3><p>Our agenda for today is to discuss the working of the BB84 protocol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*75cQYoPA6oJjTpJYaB_HJQ.png" /><figcaption>QKD by QWorld/ Aeysha Khalique</figcaption></figure><p>The BB84 protocol is needed for the transfer of the private key in order to establish a communication channel. Say Alice and Bob want to communicate and Alice wants to send a message to Bob. She starts with two <em>n-</em>bit strings <em>a </em>and <em>b. </em>Next, she encodes these two strings as the tensor product of <em>n</em> qubits. We have</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*5fxtwEu-Eqz3VKj2VfqJvg.png" /></figure><p>where <em>a_i</em> and <em>b_i</em> are the <em>i-</em>th bits of <em>a </em>and <em>b </em>respectively. Notice that <em>a_i, b_i </em>are from the set {0, 1}. Hence, we have</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yx49CpUQX29Q-5f4sKxfsw.png" /></figure><p>Note that <em>b_i </em>decides whether <em>a_i </em>is encoded in the computational (standard) basis or the Hadamard basis. As can be seen in the diagram on top, the qubits are now, not necessarily, mutually orthogonal.</p><p>Alice sends $\ket{\psi}$ to Bob. After Bob receives the string of qubits, he makes measurement by choosing a basis for each bit; and hence now both Alice and Bob possess their own set of states. Since only Alice knows <em>b</em>, it is virtually impossible for Bob or Eve to distinguish the states of the qubits. By no cloning theorem, we know that once Bob has received the qubits, Eve can’t be in possession of a copy of the qubits which were sent by Alice to Bob; unless Eve has made her own measurements which in turn risk disturbing a particular qubit by 1/2 if she guesses the wrong measurement basis.</p><p>For measurement purpose, Bob generates a string <em>b’</em> of the same length as <em>b. </em>He then uses this to measure the qubits he received from Alice. Let the string generated in the process by given by <em>a’</em>. Bob now makes a public announcement that he has received the string sent by Alice.</p><p>Bob now communicates with Alice over a public channel (anyone can see the communication in this channel), to determine which <em>b_i </em>and <em>b’_i</em> are equal and which are not. Both Alice and Bob discard the bits in <em>a </em>and <em>a’ </em>where <em>b </em>and <em>b’</em> don’t match.</p><p>For the remaining bits where both Alice and Bob measured in the same basis, Alice randomly chooses half the bits and discloses her choices over the public channel. Both Alice and Bob announce these bits publicly and run a check to see whether more than a certain number of them agree.If the check is successful, Alice and Bob proceed to generate shared secret keys through information reconciliation and privacy amplification methods. If the check fails, they abandon the current process and begin again.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=152241d1f0c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quantum Characteristics leading to the BB84 QKD Protocol]]></title>
            <link>https://medium.com/@yuvi.yt.xx/quantum-characteristics-leading-to-the-bb84-qkd-protocol-a5570497e8d8?source=rss-530f04efa43b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5570497e8d8</guid>
            <category><![CDATA[quantum-information]]></category>
            <category><![CDATA[quantum-cryptography]]></category>
            <category><![CDATA[science]]></category>
            <category><![CDATA[quantum-mechanics]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Yuvraj Thapa]]></dc:creator>
            <pubDate>Thu, 26 Oct 2023 11:10:30 GMT</pubDate>
            <atom:updated>2023-10-26T11:10:30.639Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 26- Quantum 30 Challenge</h3><p>Recall that in the previous discussion, we gave an intuitive introduction to classical cryptography. In today’s discussion we shall formalize it to much extent and look at the quantum characteristics leading to the BB84 protocol.</p><p>Recall that asymmetric cryptography involves the use of a pair of keys: a public key and a private key. The public key is used for the purpose of encryption, and is universally known. Meanwhile, the private key comes in use during decryption and is made known only to the sender and the receiver. As discussed earlier, asymmetric cryptography makes use of hard mathematical problems like Integer Factorisation, Discrete Logarithm, Elliptic Curve Discrete Logarithm, etc. for its purpose. These are also categorized as ‘One-Way Functions’ implying that the computation in the backward direction is hard for these functions, assuming that the input is sufficiently large.</p><p>It has been mathematically proved that an asymmetric encryption scheme is secure iff K is as long as M, K is random, K is used only once and K is completely secret.</p><p>Here Quantum Key Distribution comes into the picture! QKD protocols are meant to distribute K through an open channel whilst keeping it secret. Note that QKD helps in establishing the secret key and all communications, thereafter, are executed classically.</p><p>Let us discuss the Quantum One Time Pad. Before we do, we make sure of some nomenclature. The set {|0⟩, |1⟩} is called the Standard Basis set, and the set {|+⟩, |-⟩} is called the Hadamard Basis set.</p><p>Let the message be of length ‘<em>n’</em>, and be denoted by |M⟩. The pre-shared key is ‘k’ is constructed from the set {0, 1} , wherein for every i in range [1,n], we select at random two integers a_i and b_i from the set {0, 1}. The encrypted text is then given by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*mCdG8AswgQP-C19oU66fVg.png" /></figure><p>Notice that a_i = 0 implies that the X gate won’t be applied on the qubit of index i. Similarly b_i = 0 implies that the Z gate won’t be applied on the qubit of index i. The decryption takes place in the same manner. Hence we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FJbUpbEvu4YWpAQUNUs9Ag.png" /></figure><p>You might be wondering that this is all similar to a Classical One Time Pad. Indeed it is, and it may be noted that the Quantum One Time Pad doesn’t hold any advantage over the classical one. However, modifying the same by adding a few Quantum Characteristics may lead to something efficient.</p><p>The quantum characteristics of measurement and no-cloning gave rise to the first ever quantum cryptography protocol- the BB84 QKD protocol, in 1984.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5570497e8d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Intuitive Introduction to Cryptography]]></title>
            <link>https://medium.com/@yuvi.yt.xx/an-intuitive-introduction-to-cryptography-a6e5aee7e8f3?source=rss-530f04efa43b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6e5aee7e8f3</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[science]]></category>
            <category><![CDATA[quantum-information]]></category>
            <category><![CDATA[cryptography]]></category>
            <dc:creator><![CDATA[Yuvraj Thapa]]></dc:creator>
            <pubDate>Wed, 25 Oct 2023 17:12:18 GMT</pubDate>
            <atom:updated>2023-10-25T17:12:18.227Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 25- Quantum 30 Challenge</h3><p>In these last few days of the Cohort 3 of the Quantum 30 Challenge, we plan to discuss about Quantum State Tomography and an application of Quantum Physics in the field of computer science- Quantum Key Distribution. For today, we shall discuss Classical Cryptography to justify the need for Quantum Key Distribution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YTbODnF_0ekggKgJDW9rzA.png" /><figcaption><a href="https://www.darkreading.com/edge-articles/quantum-key-distribution-for-a-post-quantum-world">https://www.darkreading.com/edge-articles/quantum-key-distribution-for-a-post-quantum-world</a></figcaption></figure><p>Cryptography is an extensive subject of study and research in the field of computer science, which aims at providing confidentiality and integrity to the data being transmitted.</p><p>Suppose Alice wants to send a message to Bob. She writes a letter and goes to the post office to send it to Bob. While on her way, she gets anxious about her privacy and wants to ensure that the postman shouldn’t be able to open and read the letter, even if he tries his best to do so. She even thinks of destroying the letter and travelling to Bob herself to give him the message; but considering the fact that Bob and Alice have to communicate on a regular basis, travelling every time to deliver a message might end up being a tedious job for her. Ultimately, all she can rely on is the postal service and all she can do on her end is to ensure a secure channel that can’t be broken by adversaries.</p><p>On her way to the post office, she stops her car at the locksmith’s and buys a lockbox and mails the box to Bob. The lockbox she bought has two identical keys that come with it. She makes a one-time effort to drive to Bob’s house and hand one of the keys over to him. In this way, only Bob and Alice shall be able to open the box and their communication channel is hence secure from any possible middle man that may come in contact with their letter. The middle man can see the lockbox, but can’t open it and hence can’t read or change whatever is inside. This works well for both Alice and Bob, provided they live close enough so that one of the parties can visit the other at least once if needed. But what if they live seven seas apart?</p><p>If so, the initial initiative needs to be taken by one of the parties wherein one of them buys a padlock (a special type of lock wherein it needs a key to be unlocked but doesn’t need a key to be locked). Say Bob buys a padlock. He sends the padlock in the unlocked state to Alice, and keeps the key with himself. Alice then buys a lockbox with two identical keys. She puts one of the keys inside the lockbox, but locks it with Bob’s padlock. She then sends the lockbox to Bob who unlocks it using the key he has. On opening the lock box, he is now in possession of one of the two identical keys for the lock box. The lockbox may now serve as a secure communication channel as before.</p><p>The former case above describes the working of symmetric key cryptography while the latter describes that of public key cryptography. Symmetric key cryptographic primitives rely on a single shared secret key for the passing of messages, while the public key cryptographic primitives have a secret key and a public key- the public key to encrypt the message while the secret key to decipher the ciphertext. Public key cryptographic primitives are hence asymmetric. It is fascinating that every time we click on a link, the above story plays out- our browser plays the part of Alice while the server we are connecting to plays that of Bob. It is worth noting that in practice, public key cryptography is used to establish the secret symmetric key between the two parties to communicate further via a channel secured by symmetric key encryption.</p><p>To secure a system via public key cryptography, it has been a conventional practice to use hard mathematical problems like factorization and discrete logarithm to encrypt the plaintext. However, quantum algorithms like that of Shor’s have rendered them useless by solving them in record time with the use of Quantum computers. Quantum Key Distribution is hence an active area of research since public key cryptography can no longer be used for the job.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6e5aee7e8f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reflection Operators]]></title>
            <link>https://medium.com/@yuvi.yt.xx/reflection-operators-db413fd1beaf?source=rss-530f04efa43b------2</link>
            <guid isPermaLink="false">https://medium.com/p/db413fd1beaf</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[science]]></category>
            <category><![CDATA[quantum-physics]]></category>
            <dc:creator><![CDATA[Yuvraj Thapa]]></dc:creator>
            <pubDate>Tue, 24 Oct 2023 17:22:34 GMT</pubDate>
            <atom:updated>2023-10-24T17:22:34.270Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Day 24- Quantum 30 Challenge</strong></p><p>We shall discuss about a new class of operators called the reflection operators. What exactly is a reflection? The first image that strikes the mind is that of a pond, isn’t it? Maybe something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdxZ1oW3faG3a2yarTYJiA.png" /></figure><p>Well in mathematical terms, a reflection is a map from a <em>n</em>- dimensional Euclidean Space to itself. The special thing about this map is that it is an <em>isometry</em> with a hyperplane as a set of fixed points. Let us understand what all these terms mean:</p><p>An isometry is a distance preserving map from one metric space to another.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*taug441WIwPCz1HYAf6TxQ.png" /></figure><p>As for a hyperplane, given a <em>n- </em>dimensional vector space V, a hyperplane is a (<em>n-1) </em>dimensional subspace of V. In more intuitive sense, a hyperplane for a <em>2D- space </em>is a line, for a <em>3D-</em> <em>space </em>is a plane, and so on.</p><p>Since we have mentioned Reflection Operators out of no-where in the middle of a Quantum Information course, the question that arises in our mind is that are our Quantum gates also a type of Reflection operator? Is Hadamard operator a reflection? If so, what is its line of reflection?</p><p>It may be checked that the Hadamard operator is indeed a reflection operator with the line of reflection as y = tan(pi/8)x.</p><p>Furthermore, we have the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PMz6osEl8nafgeALkd7cDg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db413fd1beaf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rotation Operator]]></title>
            <link>https://medium.com/@yuvi.yt.xx/rotation-operator-12eb05e011c8?source=rss-530f04efa43b------2</link>
            <guid isPermaLink="false">https://medium.com/p/12eb05e011c8</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[science]]></category>
            <dc:creator><![CDATA[Yuvraj Thapa]]></dc:creator>
            <pubDate>Mon, 23 Oct 2023 17:34:45 GMT</pubDate>
            <atom:updated>2023-10-23T17:34:45.704Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 23- Quantum 30 Challenge</h3><p>Today, on the Day 23 of the Quantum 30 Challenge, we shall discuss in detail the <em>Rotation Operator.</em></p><p>Suppose we start in state |0⟩ and on application of a rotation operator, say <em>R, </em>we obtain the state |+⟩. Suppose we apply this same operator again. What then? What if we don’t stop and keep applying this operator repeatedly. The quantum states that we get are as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*SQpsEAMxWEgpF_D9mHVDtg.png" /><figcaption><a href="https://colab.research.google.com/drive/1Vv7YDNeHDmpDJRG-cH_IM4tAotGGvCBb?usp=sharing#scrollTo=pHf1GhCtAfSC">QB24_Q44_Rotations.ipynb — Colaboratory (google.com)</a></figcaption></figure><p>In matrix form, this particular operator is given by</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*ZxipZ0nwXDE4AhMNNv1HJA.png" /></figure><p>Let us look at the implementation of the Rotation operator. Consider we start in state |0⟩ and apply the R(pi/4) operator thrice. Then we have</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*tyioWa1O1l9AZsyh5Gyysw.png" /></figure><p>Wonder how we may read the quantum state of a circuit. The backend “statevector-simulator” of Qiskit may be used for that purpose. It’s function is to read the state of the circuit at that point of time. It is a classical operator and if any measurement operator is defined, it implements this measurement operator and continues by following one of the possible outcomes. The current state of a circuit may be read as follows:</p><pre>job = execute(quantum_circuit,Aer.get_backend(&#39;statevector_simulator&#39;),optimization_level=0)<br>current_quantum_state = job.result().get_statevector(quantum_circuit,precision).data</pre><p>Note that precision is optional. The “current_quantum_state” above is the list of amplitudes which are complex numbers. If we want to print the real part of the amplitude of the first state, then we may execute the following line of code:</p><pre>print(current_quantum_state[0].real)</pre><p>Let us implement what we did above, using “ry-gate” and “statevector_simulator”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*p_bn9_GI3iPKsoDxM4_nRw.png" /></figure><p>Consider rotation with degree θ in the counter-clockwise direction. The matrix form of the rotation operator is given by</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*gG5M0HM4Ra-gTPwEY667Ow.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12eb05e011c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Operations on the Unit Circle]]></title>
            <link>https://medium.com/@yuvi.yt.xx/operations-on-the-unit-circle-de604be48f71?source=rss-530f04efa43b------2</link>
            <guid isPermaLink="false">https://medium.com/p/de604be48f71</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[quantum-physics]]></category>
            <category><![CDATA[science]]></category>
            <dc:creator><![CDATA[Yuvraj Thapa]]></dc:creator>
            <pubDate>Sun, 22 Oct 2023 18:17:53 GMT</pubDate>
            <atom:updated>2023-10-22T18:17:53.228Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 22- Quantum 30 Challenge</h3><p>Suppose we start in the quantum state |0⟩. Let M be the quantum operator that transforms |0⟩ to |+⟩. If we apply M once more, what will be the next state? How can we look at it geometrically, and is there a way to parameterize each possible M? What if we start with the state |1⟩ and K be the quantum operator that transforms |1⟩ to |-⟩. What happens when we apply K once again, and is there a way of parameterizing all such K’s. We shall try answering these questions today.</p><p>Let us first look at a plot on unit circle that comprises of |0⟩, |1⟩, |+⟩ and |-⟩.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*qSmCqJeNudz8q7n-0LrdDA.png" /></figure><p>We shall not make any comments on the image at present, rather shall just keep it in our minds.</p><p>Suppose a qubit is set to state |0⟩ in the beginning. Any real valued quantum state, as we all know by now, is a point on the unit circle and will hence be of the form (a,b), where a and b are perpendicular distances of the point from the y-axis and the x-axis respectively. [e.g. consider the point (1,0). Then the point is at a distance of 1 units from the y- axis, while its distance from the x- axis is 0]. Let p be the angle of the line joining the point (a,b) and the origin, with the x- axis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6RTE7xLPeNuZPB4sQmYLCA.png" /></figure><p>We can hence set the qubit to state |v⟩ by using a rotation operator between |0⟩ and |1⟩ with angle p.</p><p>In Qiskit, the ry-gate can be used for the rotations on a unit circle. The default direction of the ry-gate is counterclockwise.</p><p>A technical remark: The ry-gate in Qiskit is defined for a <em>Bloch Sphere.</em> The states |0⟩ and |1⟩ are situated on the poles of the Bloch Sphere, and hence the angle between them is pi. However, on a unit circle, the angle between |0⟩ and |1⟩ is pi/2. Hence while using the ry-gate, we provide angle <em>2p </em>for a rotation of angle <em>p</em> on the unit circle.</p><p>Let p = 2pi/3. Then the ry-gate will be constructed for an angle of 4pi/3. Let us draw the circuit using Qiskit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*n8IAQmqQAHzht99gVfOvvA.png" /></figure><p>On rotation, the quantum state of the qubit is now in a superposition of states |0⟩ and |1⟩. On measurement after rotation, the superposition collapses into either of the two deterministic states. For our sake, we execute the circuit 1000 times and measure the number of times 0 and 1 are recorded. The output is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*J-ArF7v1dLqaTAlyZqI8dw.png" /></figure><p>We notice that upon collapsing from the superposition, the probability of 0 and 1 are roughly 1/4 and 3/4 respectively.</p><p>Since,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E-EtrQSOxquhE5pP13O-QA.png" /></figure><p>The parameterized quantum state is hence given by</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PU8KgkcgIdqauXgsqeK8EA.png" /></figure><p>Therefore, our Quantum state is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZaIMEdbJYisO-B0CQAHMAA.png" /></figure><p>Let us finally draw our Quantum state. Recall that the<em> draw_quantum_state(x, y, “t”) </em>takes three arguments:</p><ol><li>x: amplitude of being on the x- axis, i.e. in state 0.</li><li>y: amplitude of being on the y-axis, i.e. in state 1.</li><li>t: name of the vector</li></ol><p>Hence the quantum state can be drawn by executing the following code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ymLHEJ8th1Fc580SYzaW9g.png" /></figure><p>Doing so, we get:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*X0-vCvwipDx_O6pTfiW_sw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de604be48f71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Measurements]]></title>
            <link>https://medium.com/@yuvi.yt.xx/measurements-cfad7ee7228d?source=rss-530f04efa43b------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfad7ee7228d</guid>
            <category><![CDATA[quantum-mechanics]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[science]]></category>
            <dc:creator><![CDATA[Yuvraj Thapa]]></dc:creator>
            <pubDate>Fri, 20 Oct 2023 18:19:54 GMT</pubDate>
            <atom:updated>2023-10-20T18:19:54.200Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 20- Quantum 30 Challenge</h3><p>We shall start our discussion from where we left. We know that the probability of observing a state in a state is the square of its amplitude. If the amplitude is zero, then the state can’t be observed. After the measurement, the state collapses to the state observed. Hence, the system is no longer in the state of superposition. As a result, the information kept in a superposition is lost.</p><p>It’s about time now that we discuss the <em>‘second experiment’ </em>of the quantum coin flip. In this experiment, after the first Hadamard, we make a measurement. If the outcome is |0⟩, we apply the second Hadmard. The same may be simulated as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*kwJfSlTXHgnjV4ZrZTTA3A.png" /></figure><p>We get the image of our circuit as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N5C8F7IzLzpuFgogrsaO5g.png" /></figure><p>On executing the code a thousand times, we get the following outcome:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*WnMbjzRFVQAYvKyTBpmp1g.png" /></figure><p>What if we start in state |1⟩? Well let’s find out. We can alter our previous code- we apply an X- Gate so that the start state now is |1⟩. We then draw our circuit and find the number of times we land in 0 and 1 when the code is executed 1000 times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*mt79RJ7PhB_nWzTDAApmEg.png" /></figure><p>We notice that the results are identical!</p><p>Let us do a little exercise. We start in state |0⟩. We apply the Hadamard gate and make a measurement. If the measurement is 1, we stop; however if it’s 0, we repeat the process. Notice that the probability of getting a 0 is 1/2, hence it can happen that we just keep getting a 0 indefinitely. So for the purpose of our experiment, let us put a constraint that the cycle repeats itself a maximum of 3 times, i.e. even if we are able to get three 0’s in a row, the cycle would still stop.</p><p>The measured value at the end is noted. Note that if we get a 1 at some stage, then the measurement at that step itself becomes the final measurement since there is no future application of Hadamards on the qubit.</p><p>We first attempt to draw our circuit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*fRBdy4TdcAg2L7ASS0eZoQ.png" /></figure><p>Then we run our circuit a thousand times. On measuring the number of times we got a 0 and a 1, we get:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*6m-24hgsn8MvIMVJZD1dHg.png" /></figure><p>This indeed matches with our expectations! Our expectation has its basis in the following mathematics:</p><p>After the first flip, there is a 50–50 probability of 0 and 1. Hence 0 and 1 are expected 500 times each. If it lands on 1, we stop. However, if it lands on 0, we flip again. Ought to the 50–50 probability, 0 and 1 are expected 250 times each. If it lands on 1, we stop. However if it lands on 0, we flip for the final time. Again due to the 50–50 probability, we expect 0 and 1 to appear 125 times each. Even if the coin lands on 0, we don’t apply another Hadamard because that is what our protocol is.</p><p>Notice from above that we get 0 only 125 times, while the number of times we get a 1 is 500 + 250 + 125 = 875.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfad7ee7228d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>