<?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 Felix Xu on Medium]]></title>
        <description><![CDATA[Stories by Felix Xu on Medium]]></description>
        <link>https://medium.com/@felixxu328?source=rss-14dc41184b65------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uwtlyHitbQMerdNdyH6pIQ.jpeg</url>
            <title>Stories by Felix Xu on Medium</title>
            <link>https://medium.com/@felixxu328?source=rss-14dc41184b65------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 19:20:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@felixxu328/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[Geometrical Understanding of Quantum Computing]]></title>
            <link>https://medium.com/@felixxu328/geometrical-understanding-of-quantum-computing-772bb0c0a0ce?source=rss-14dc41184b65------2</link>
            <guid isPermaLink="false">https://medium.com/p/772bb0c0a0ce</guid>
            <category><![CDATA[quantum-mechanics]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[quantum]]></category>
            <category><![CDATA[qiskit]]></category>
            <category><![CDATA[quantum-physics]]></category>
            <dc:creator><![CDATA[Felix Xu]]></dc:creator>
            <pubDate>Wed, 08 Nov 2023 10:12:29 GMT</pubDate>
            <atom:updated>2023-11-08T10:12:29.717Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Numerous resources introduce quantum computing. Almost all of them go through Physics and Math in very detail. In this article, I am going to share my personal understanding of Quantum Computing, which is from the geometrical aspect. I aim to help beginners to build intuition in this area.</p><p>In this article, I’m going to use quantum gate symbols and the Bloch sphere generated by Qiskit.</p><h3>Qubit: a 3D sphere</h3><p>Let’s begin with qubits. You may have heard of this name and think they are a kind of particle that has an arrow pointing at everywhere in the space. That’s usually the Physics behind it. But here, I would ask you to forget the Physics and consider a qubit as a Bloch sphere, as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8M5wAnEfn9rpTETO3oVEVw.png" /></figure><p>A Bloch sphere is a visualization consisting of all possible quantum states that a qubit can have. Some states are more important, like the blue ones. The vector pointing upward represents “0” and downward represents “1”. They are so important that is called the z-basis since all other vectors can be represented by those two vectors. To characterize the vectors further, we also have x-basis (red vectors) and y-basis (green vectors).</p><p>With qubits in our hands, we can now begin to build quantum circuits. In general, a quantum circuit mainly has three parts: initialization, operation (conducted by quantum gates), and measurement. We will discuss the initialization and measurement first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2b2odCtT44t5GaJN1H1ZtA.png" /></figure><h3>Initialization</h3><p>We don’t want quantum computations to start from a random state that we may not even know. Therefore, we need initialization to bring all qubits to the same quantum state. Usually, we use the one shown below, where all vectors point upward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mmhrwke6q8_xFi8sNo8cUQ.png" /></figure><h3>Measurement</h3><p>After executing a quantum circuit, we need to extract the information from it. So we do a measurement, whose system is the black box below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6mtD_RIYOnKpToaQErKROA.png" /></figure><p>Although a quantum state is represented as a vector in 3-dimensional space, we mainly focus on the z-axis, where we read “0” or “1”. When the vector is on the z-axis, it is easy to anticipate the result. Like the two spheres below, from left to right, the measurement should give “0” and “1” respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uXL1-KRHtVTQi00TrWnKFQ.png" /></figure><p>When the vector is not aligned with the z-basis, there is a probability to measure “0” or “1”. I’m not going to calculate this probability here, but to give some basic idea. When the vector is exactly in the middle, like the two vectors below, the probability should be fifty-fifty. Notice that the middle is not one vector, but a series of vectors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dRR3UM8qqpCTyRTIkknIyA.png" /></figure><p>If the vector is higher than the middle and closer to “0”, there should be more probability to measure “0” than “1”. On the contrary, the vector lower than the middle has a higher probability of measuring “1”. This probability depends on where the vector exactly points, which we may not know. However, each measurement only gives one result and we definitely cannot read the probability from it. What we usually do is to measurement for multiple times and plot a histogram, from which we can approximate the probability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XsXWyjt_ZzIxfJFibp_goA.png" /></figure><h3>Single Qubit Gates</h3><h4>NOT gate (𝑋 gate)</h4><p>Now let’s move on to the gates. In classical computer science, we have a NOT gate. When we input “0” into it, we get “1”, and vice versa. In quantum computing, we also have a NOT gate. This gate lets the vector rotate along the x-axis for 180 degrees. This rotation explains why the NOT gate is alternatively known as the 𝑋 gate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YdqZdIxlevt1vfIbMZsemg.png" /></figure><p>The effect of this gate is still not very clear. Let’s take an example. If the vector is pointing upward, it will point downward after applying the NOT gate. The measurement result will change from “0” to “1”. That seems like the effect of a proper NOT gate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IqLd0dmKj1D9CVr-vD-qSQ.png" /></figure><p>The effect is not limited to this situation. More examples are listed below. I recommend you to think by yourself. The answer will be put at the end of this article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oxVYrCqRpqXDio7GagVonQ.png" /></figure><h4><strong>𝑌 gate &amp; 𝑍 gate</strong></h4><p>Now you may wonder if are there also 𝑌 gate and 𝑍 gate. Yes, there are. That two gates also let the vector rotate for 180 degrees, along the y-axis and z-axis, respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pHrEK9_SBSBYHuiIxgYLgQ.png" /></figure><h4><strong>Hadamard gate (𝐻 gate)</strong></h4><p>Another very important gate is the Hadamard gate. This gate lets the vector rotate for 180 degrees along a diagonal axis in the xz-plane, which is denoted as (1, 0, 1).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WBx0fUgff2Cx8gyzaRUdvA.png" /></figure><p>Now you may wonder why we need such a “wired” gate. Let’s recall that the vector is just in the middle (the pink one above), the probability of measuring “0” or “1” is fifty-fifty. In quantum computing, this randomness can be used to do many amazing works. The Hadamard gate can generate this state from the initial state (the green one above) very fast. This is one of the essential uses of the Hadamard gate.</p><h4>Phase gate (𝑃 gate)</h4><p>There are also rotational gates with other angles. Like the phase gate, which lets the vector rotate along the z-axis for a user-defined angle φ.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HMeeGz8OU-3zdcdGOlTHVQ.png" /></figure><h4><strong>𝑆 gate (√𝑍 gate) &amp; 𝑆^† gate (</strong>√𝑍<strong>^† gate)</strong></h4><p>Both S and S^† gates are special cases of the phase gate, with ϕ set to 90 degrees and -90 degrees, respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4V0M2nXbwKSejit2howonw.png" /></figure><h4><strong>𝑇 gate &amp; 𝑇^† gate</strong></h4><p>The 𝑇 gate and 𝑇^† gate are similar, with an angle of 45 degrees.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d57QohHXnQBBvbix67-nZQ.png" /></figure><p><strong>Identity gate (𝐼 gate)</strong></p><p>The output of the identity gate is identical to itself. That means it does nothing to the vector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Esfzq011ci598UTayL_4gg.png" /></figure><h4><strong>Controlled-not gate (CNOT, cx)</strong></h4><p>You may notice that the gate we talked about above is all on a single qubit. In classical computer science, there are the AND gate and OR gate, which allow two bits to collaborate and give a collective result. In quantum computing, there is a similar one. It is the controlled-not gate and its symbol is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*198ZUEIbTOeC_u1Z2XVsYA.png" /></figure><p>When using the CNOT gate, the control qubit and target qubit need to be assigned. When the control qubit is at “0”, the CNOT gate applies an 𝐼 gate to the target gate. When the control qubit is at “1”, a NOT gate is applied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*huXSXNPh94xXVeFdrnHpWg.png" /></figure><p>For example, within the situations shown below, the gates applied on the target qubits depend on the control qubits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-XTdz69Ok8CrNJ0TOXPjFg.png" /></figure><p>Things are clear when the control qubit is at “0” or “1”. What if the control qubit has a vector in between, like the situation shown below?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7putEDiUzl9Fdo_mm454pA.png" /></figure><p>We can think about it from the measurement results. As we discussed before, the control qubit has a fifty-fifty probability of measuring “0” or “1”. When the measurement gives “0”, nothing happens and the target qubit remains “0”. If the measurement gives “1”, a NOT gate is applied and the target qubit has “1”. Therefore, the target qubit also has a fifty-fifty probability of measuring “0” or “1”.</p><p>But is it really that simple? Here’s another question: Is it possible to measure “01” on two qubits?</p><p>The answer is no. You may find that whatever the measurement of the control qubit is, the same result will be found on the target one. Even if those two qubits are measured separately, we can still know the result of one qubit from the other one. In this situation, we say those two qubits are entangled.</p><p>Notice that I no longer use the Bloch sphere to represent the qubits in entanglement, because things are becoming more complicated</p><h3><strong>Appendix</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qdvbAuC1fCu5BO77GcwObQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=772bb0c0a0ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>