{"id":42309,"date":"2025-11-01T10:50:26","date_gmt":"2025-11-01T05:20:26","guid":{"rendered":"https:\/\/tocxten.com\/?page_id=42309"},"modified":"2025-11-01T21:10:30","modified_gmt":"2025-11-01T15:40:30","slug":"single-qubit-gates-x-y-z-hadamard-phase-shift","status":"publish","type":"page","link":"https:\/\/tocxten.com\/index.php\/single-qubit-gates-x-y-z-hadamard-phase-shift\/","title":{"rendered":"Single-Qubit Gates (X, Y, Z, Hadamard, Phase Shift)"},"content":{"rendered":"\n<h2 class=\"wp-block-heading has-pale-ocean-gradient-background has-background\" style=\"font-size:30px\">1. Introduction<\/h2>\n\n\n\n<p>In quantum computing, <strong>quantum gates<\/strong> are the fundamental building blocks used to manipulate quantum bits or <strong>qubits<\/strong>. Just as classical logic gates (like AND, OR, NOT) operate on bits, quantum gates operate on qubits to change their state. However, unlike classical gates, quantum gates are <strong>reversible<\/strong> and operate on <strong>superpositions<\/strong> of states, enabling powerful computations that classical computers cannot efficiently perform.<\/p>\n\n\n\n<p>A <strong>single-qubit gate<\/strong> acts on one qubit at a time. These gates can:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Rotate<\/strong> the qubit\u2019s state on the <strong>Bloch Sphere<\/strong>.<\/li>\n\n\n\n<li><strong>Flip<\/strong> the qubit between its basis states |0\u27e9 and |1\u27e9.<\/li>\n\n\n\n<li><strong>Change the phase<\/strong> of the qubit\u2019s state.<\/li>\n\n\n\n<li><strong>Create or destroy superposition states<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p>Each single-qubit gate can be represented by a <strong>2\u00d72 unitary matrix<\/strong>. A unitary matrix U satisfies the condition: U\u2020U=I<\/p>\n\n\n\n<p>where U\u2020U^\\daggerU\u2020 is the conjugate transpose of UUU, and III is the identity matrix. This ensures that quantum operations preserve probability (the total probability always remains 1).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Why Single-Qubit Gates Are Important<\/strong><\/h3>\n\n\n\n<p>Single-qubit gates form the foundation for all quantum operations. By combining them with <strong>multi-qubit gates<\/strong> such as the <strong>CNOT gate<\/strong>, we can build any complex quantum algorithm. Thus, mastering single-qubit gates is the first step toward understanding quantum computation and quantum circuit design.<\/p>\n\n\n\n<p>In this chapter, we will explore the <strong>mathematical representation<\/strong>, <strong>purpose<\/strong>, and <strong>Qiskit implementations<\/strong> of the key single-qubit gates:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Pauli-X Gate<\/li>\n\n\n\n<li>Pauli-Y Gate<\/li>\n\n\n\n<li>Pauli-Z Gate<\/li>\n\n\n\n<li>Hadamard Gate<\/li>\n\n\n\n<li>Phase Shift Gate<\/li>\n<\/ul>\n\n\n\n<p>We will also examine their <strong>effects on basic and superposed states<\/strong>, visualize results on the <strong>Bloch Sphere<\/strong>, and finally perform a <strong>comparative analysis<\/strong> to understand their relationships<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-pale-ocean-gradient-background has-background\"><strong>2. Mathematical Representation of Qubit Gates<\/strong><\/h2>\n\n\n\n<p>To understand how single-qubit gates work, it\u2019s important to first understand the <strong>mathematical representation<\/strong> of qubits and how gates act upon them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.1 Qubit Representation<\/strong><\/h3>\n\n\n\n<p>A <strong>qubit<\/strong> is the quantum equivalent of a classical bit. While a classical bit can only exist in one of two states (0 or 1), a qubit can exist in a <strong>superposition<\/strong> of both:<\/p>\n\n\n\n<p>\u2223\u03c8\u27e9=\u03b1\u22230\u27e9+\u03b2\u22231\u27e9<\/p>\n\n\n\n<p>where<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u03b1 and \u03b2 are <strong>complex probability amplitudes<\/strong>,<\/li>\n\n\n\n<li>\u2223\u03b1\u2223^2 and \u2223\u03b2\u2223^2 represent the <strong>probabilities<\/strong> of measuring the qubit in states |0\u27e9 and |1\u27e9 respectively, and they must satisfy the <strong>normalization condition<\/strong>: \u2223\u03b1\u2223^2 + \u2223\u03b2\u2223^2 = 1 <\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.2 Matrix Form of Basis States<\/strong><\/h3>\n\n\n\n<p>We can express the basis states as <strong>column vectors<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"248\" height=\"76\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-6.png\" alt=\"\" class=\"wp-image-42330\"\/><\/figure>\n\n\n\n<p>Thus, any qubit \u2223\u03c8\u27e9 can be written as:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"119\" height=\"70\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-7.png\" alt=\"\" class=\"wp-image-42331\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.3 Quantum Gate as a Matrix<\/strong><\/h3>\n\n\n\n<p>A <strong>quantum gate<\/strong> acts on qubits via <strong>matrix multiplication<\/strong>.<br>If U is the matrix representing a quantum gate, then:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"127\" height=\"45\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-8.png\" alt=\"\" class=\"wp-image-42333\"\/><\/figure>\n\n\n\n<p>Here, \u2223\u03c8\u2032\u27e9|\\psi&#8217;\\rangle\u2223\u03c8\u2032\u27e9 is the <strong>new quantum state<\/strong> after applying the gate.<\/p>\n\n\n\n<p>Since UUU must be <strong>unitary<\/strong>, it guarantees <strong>reversibility<\/strong> and <strong>probability conservation<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.4 Example<\/strong><\/h3>\n\n\n\n<p>Let\u2019s take a simple example \u2014 the <strong>Pauli-X gate<\/strong>, also called the <strong>quantum NOT gate<\/strong>.<br>It is represented as:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"90\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-9.png\" alt=\"\" class=\"wp-image-42336\"\/><\/figure>\n\n\n\n<p>When it acts on \u22230\u27e9|0\\rangle\u22230\u27e9:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"348\" height=\"87\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-10.png\" alt=\"\" class=\"wp-image-42338\" srcset=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-10.png 348w, https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-10-300x75.png 300w\" sizes=\"auto, (max-width: 348px) 100vw, 348px\" \/><\/figure>\n\n\n\n<p>and vice versa:<\/p>\n\n\n\n<p>X\u22231\u27e9=\u22230\u27e9<\/p>\n\n\n\n<p>This shows that the Pauli-X gate <strong>flips<\/strong> the qubit, similar to a classical NOT operation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.5 Bloch Sphere Interpretation<\/strong><\/h3>\n\n\n\n<p>Every single-qubit state can also be represented as a point on the <strong>Bloch Sphere<\/strong>, where:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"376\" height=\"68\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-11.png\" alt=\"\" class=\"wp-image-42342\" srcset=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-11.png 376w, https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-11-300x54.png 300w\" sizes=\"auto, (max-width: 376px) 100vw, 376px\" \/><\/figure>\n\n\n\n<p>Here,<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u03b8 and \u03d5 are spherical coordinates that define the qubit\u2019s position on the sphere.<\/li>\n\n\n\n<li>Quantum gates correspond to <strong>rotations<\/strong> on this sphere.<\/li>\n<\/ul>\n\n\n\n<p>Thus, each single-qubit gate can be interpreted as a <strong>rotation operator<\/strong> acting on the Bloch Sphere.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.6 Unitarity, Hermitian Property, and Reversibility<\/strong><\/h3>\n\n\n\n<p>In quantum mechanics, every operation that evolves a quantum state must <strong>preserve total probability<\/strong>. This requirement is mathematically guaranteed if the operator (gate) is <strong>unitary<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Unitarity<\/strong><\/h4>\n\n\n\n<p>A matrix U is <strong>unitary<\/strong> if:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"176\" height=\"50\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-12.png\" alt=\"\" class=\"wp-image-42344\"\/><\/figure>\n\n\n\n<p>where<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>U\u2020 is the <strong>conjugate transpose<\/strong> (Hermitian adjoint) of U,<\/li>\n\n\n\n<li>III is the <strong>identity matrix<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p>This ensures that the transformation does <strong>not change the overall length (magnitude)<\/strong> of the quantum state vector.<br>Hence, the <strong>probabilities remain normalized<\/strong> \u2014 total probability = 1.<\/p>\n\n\n\n<p>Because a unitary matrix has an inverse equal to its conjugate transpose<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"110\" height=\"38\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-13.png\" alt=\"\" class=\"wp-image-42346\"\/><\/figure>\n\n\n\n<p>it follows that every quantum operation is <strong>reversible<\/strong>.<br>This is a major distinction from <strong>classical logic gates<\/strong> (e.g., AND, OR), which are generally <strong>irreversible<\/strong> because they lose information.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Hermitian Property<\/strong><\/h4>\n\n\n\n<p>A matrix H is <strong>Hermitian<\/strong> if:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"96\" height=\"33\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-14.png\" alt=\"\" class=\"wp-image-42347\"\/><\/figure>\n\n\n\n<p>Hermitian matrices play a special role in quantum mechanics:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>They represent <strong>observable quantities<\/strong> (like energy, spin, momentum).<\/li>\n\n\n\n<li>When a gate\u2019s matrix is both <strong>unitary and Hermitian<\/strong>, it implies:<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"170\" height=\"38\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-15.png\" alt=\"\" class=\"wp-image-42348\"\/><\/figure>\n\n\n\n<p>meaning that <strong>applying the same gate twice restores the original state<\/strong>.<\/p>\n\n\n\n<p>For example:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"195\" height=\"41\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-16.png\" alt=\"\" class=\"wp-image-42349\"\/><\/figure>\n\n\n\n<p>This shows that applying Pauli gates twice is equivalent to doing nothing \u2014 they are <strong>self-inverse<\/strong> and therefore <strong>Hermitian as well as unitary<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-pale-ocean-gradient-background has-background\"><strong>3. List of All Single-Qubit Gates and Their Purpose<\/strong><\/h2>\n\n\n\n<p>Single-qubit gates form the foundation of quantum computation. They manipulate a single qubit\u2019s state by rotating or phase-shifting it on the <strong>Bloch Sphere<\/strong>. Each gate corresponds to a specific <strong>unitary matrix<\/strong> that defines how the qubit state transforms.<\/p>\n\n\n\n<p>Below is an overview of the most important <strong>single-qubit gates<\/strong> used in quantum computing:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"546\" height=\"651\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-17.png\" alt=\"\" class=\"wp-image-42354\" srcset=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-17.png 546w, https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-17-252x300.png 252w\" sizes=\"auto, (max-width: 546px) 100vw, 546px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.1 Observations<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>All these gates are <strong>unitary<\/strong>, ensuring reversibility.<\/li>\n\n\n\n<li>Pauli-X, Y, Z gates represent <strong>180\u00b0 rotations<\/strong> around the respective axes of the Bloch sphere.<\/li>\n\n\n\n<li>Hadamard and Phase gates are essential for creating <strong>superpositions<\/strong> and <strong>phase shifts<\/strong>, key ingredients in quantum interference.<\/li>\n\n\n\n<li>Rotation gates generalize Pauli gates by allowing <strong>continuous transformations<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.2 Classification<\/strong><\/h3>\n\n\n\n<p>Single-qubit gates can be broadly classified into:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Pauli Gates (X, Y, Z)<\/strong> \u2014 Basic rotation operators<\/li>\n\n\n\n<li><strong>Superposition Gate (H)<\/strong> \u2014 Creates quantum superposition<\/li>\n\n\n\n<li><strong>Phase Gates (S, T, Rz)<\/strong> \u2014 Control and modify phase relationships<\/li>\n<\/ul>\n\n\n\n<p>These gates, when combined with at least one <strong>two-qubit entangling gate<\/strong> (like CNOT), are <strong>universal<\/strong> \u2014 meaning they can build <strong>any possible quantum operation<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-pale-ocean-gradient-background has-background\"><strong>4. Pauli-X Gate<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.1 Definition<\/strong><\/h3>\n\n\n\n<p>The <strong>Pauli-X gate<\/strong>, also known as the <strong>Quantum NOT Gate<\/strong>, performs a <strong>bit-flip<\/strong> operation on a qubit.<br>It flips the state |0\u27e9 to |1\u27e9 and |1\u27e9 to |0\u27e9 \u2014 analogous to the classical NOT gate in digital logic.<\/p>\n\n\n\n<p>Mathematically, the Pauli-X gate is one of the <strong>Pauli matrices<\/strong> and represents a <strong>rotation of \u03c0 radians (180\u00b0) about the X-axis<\/strong> of the Bloch sphere.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"67\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-18.png\" alt=\"\" class=\"wp-image-42358\"\/><\/figure>\n\n\n\n<p style=\"font-size:18px\"><strong>4.2 Matrix Representation and Properties<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"936\" height=\"328\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-19.png\" alt=\"\" class=\"wp-image-42360\" srcset=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-19.png 936w, https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-19-300x105.png 300w, https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-19-768x269.png 768w, https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-19-760x266.png 760w\" sizes=\"auto, (max-width: 936px) 100vw, 936px\" \/><\/figure>\n\n\n\n<p>Thus, applying the X gate twice brings the qubit back to its original state. <\/p>\n\n\n\n<p><strong>X(X\u2223\u03c8\u27e9)=\u2223\u03c8\u27e9<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.3 Effect on Basis States<\/strong><\/h3>\n\n\n\n<p>Let\u2019s apply the X gate on the two computational basis states:  <\/p>\n\n\n\n<p> <strong>X\u22230\u27e9=\u22231\u27e9, X\u22231\u27e9=\u22230\u27e9 <\/strong><\/p>\n\n\n\n<p>That is, it <strong>flips<\/strong> the basis states \u2014 a quantum version of NOT operation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.4 Effect on Superposition States<\/strong><\/h3>\n\n\n\n<p>For a general qubit: \u2223\u03c8\u27e9=\u03b1\u22230\u27e9+\u03b2\u22231\u27e9 <\/p>\n\n\n\n<p>the Pauli-X gate gives: <\/p>\n\n\n\n<p><strong>X\u2223\u03c8\u27e9=\u03b1X\u22230\u27e9+\u03b2X\u22231\u27e9=\u03b1\u22231\u27e9+\u03b2\u22230\u27e9     <\/strong><\/p>\n\n\n\n<p>Hence, it <strong>swaps the amplitudes<\/strong> of |0\u27e9 and |1\u27e9.<\/p>\n\n\n\n<p>If we apply it to a Hadamard-created superposition:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"189\" height=\"73\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-20.png\" alt=\"\" class=\"wp-image-42368\"\/><\/figure>\n\n\n\n<p>then<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"142\" height=\"51\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-21.png\" alt=\"\" class=\"wp-image-42370\"\/><\/figure>\n\n\n\n<p>So, |+\u27e9 is an <strong>eigenstate of X<\/strong> with eigenvalue +1.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.5 Qiskit Example: Pauli-X Gate<\/strong><\/h3>\n\n\n\n<p>Below is a complete example in <strong>Qiskit<\/strong> that shows the effect of the <strong>Pauli-X gate<\/strong> on |0\u27e9 and on a superposed qubit.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Import necessary modules\nfrom qiskit import QuantumCircuit\nfrom qiskit.visualization import plot_histogram\nfrom qiskit_aer import AerSimulator\nfrom qiskit.visualization import plot_bloch_multivector\n\n# Create a Quantum Circuit with one qubit and one classical bit\nqc = QuantumCircuit(1, 1)\n\n# Apply X gate\nqc.x(0)\n\n# Measure the qubit\nqc.measure(0, 0)\n\n# Display the circuit\nqc.draw('mpl')\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"248\" height=\"147\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-23.png\" alt=\"\" class=\"wp-image-42375\"\/><\/figure>\n\n\n\n<p><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The circuit starts with the qubit in state |0\u27e9.<\/li>\n\n\n\n<li>The <strong>X gate<\/strong> flips it to |1\u27e9.<\/li>\n\n\n\n<li>Measurement confirms the result is always <strong>1<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Now let\u2019s see the effect on a superposed qubit created using a Hadamard gate:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import matplotlib\nimport sys\nprint(\"matplotlib backend:\", matplotlib.get_backend())\nprint(\"python executable:\", sys.executable)\n\n# If you're in a notebook, this will import display() for later use\nfrom IPython.display import display<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># Run this in a notebook cell\n%matplotlib inline\n\n# Then (same as before)\nfrom qiskit import QuantumCircuit, transpile\nfrom qiskit_aer import AerSimulator\nfrom qiskit.visualization import plot_bloch_multivector\nimport matplotlib.pyplot as plt\n\nqc2 = QuantumCircuit(1)\nqc2.h(0); qc2.x(0)\nqc2.save_statevector()\n\nsim = AerSimulator()\ntqc = transpile(qc2, sim)\nresult = sim.run(tqc).result()\nstatevector = result.get_statevector()\n\nfig = plot_bloch_multivector(statevector)   # returns a matplotlib.figure.Figure\ndisplay(fig)                                # explicit display in notebooks\n# plt.show()  # not necessary when using display(fig)<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"389\" height=\"406\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-24.png\" alt=\"\" class=\"wp-image-42379\" srcset=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-24.png 389w, https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-24-287x300.png 287w\" sizes=\"auto, (max-width: 389px) 100vw, 389px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <strong>Hadamard gate<\/strong> creates a superposition (|0\u27e9 + |1\u27e9)\/\u221a2.<\/li>\n\n\n\n<li>The <strong>X gate<\/strong> swaps amplitudes, but since both are equal, the state remains unchanged on the Bloch sphere along the <strong>X-axis<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading has-pale-ocean-gradient-background has-background\"><strong>5. Pauli-Y Gate<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.1 Definition<\/strong><\/h3>\n\n\n\n<p>The <strong>Pauli-Y gate<\/strong> is one of the three fundamental <strong>Pauli matrices<\/strong> used in quantum computing.<br>It represents a <strong>\u03c0 (180\u00b0) rotation about the Y-axis<\/strong> on the Bloch sphere.<\/p>\n\n\n\n<p>While the <strong>Pauli-X<\/strong> gate flips the qubit between |0\u27e9 and |1\u27e9 (bit flip), the <strong>Pauli-Y<\/strong> gate performs a bit flip <strong>combined with a phase shift<\/strong>.<\/p>\n\n\n\n<p>Mathematically, it introduces a <strong>complex phase factor (i)<\/strong> that distinguishes it from the X gate.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.2 Matrix Representation<\/strong><\/h3>\n\n\n\n<p>The <strong>Pauli-Y gate<\/strong> is represented by the following <strong>2\u00d72 unitary and Hermitian ma<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"159\" height=\"80\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-25.png\" alt=\"\" class=\"wp-image-42382\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Property<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><strong>Unitary<\/strong><\/td><td>( Y^\u2020 Y = I )<\/td><\/tr><tr><td><strong>Hermitian<\/strong><\/td><td>( Y = Y^\u2020 )<\/td><\/tr><tr><td><strong>Self-Inverse<\/strong><\/td><td>( Y^2 = I )<\/td><\/tr><tr><td><strong>Rotation<\/strong><\/td><td>Rotation of \u03c0 around <strong>Y-axis<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.3 Effect on Basis States<\/strong><\/h3>\n\n\n\n<p>Let\u2019s apply Y to the computational basis states:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"385\" height=\"145\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-26.png\" alt=\"\" class=\"wp-image-42383\" srcset=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-26.png 385w, https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-26-300x113.png 300w\" sizes=\"auto, (max-width: 385px) 100vw, 385px\" \/><\/figure>\n\n\n\n<p>Hence,<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>|0\u27e9 \u2192 <strong>i|1\u27e9<\/strong><\/li>\n\n\n\n<li>|1\u27e9 \u2192 <strong>\u2013i|0\u27e9<\/strong><\/li>\n<\/ul>\n\n\n\n<p>So it performs a <strong>bit flip with a phase factor of \u00b1i<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.4 Effect on Superposition States<\/strong><\/h3>\n\n\n\n<p>For a general qubit: \u2223\u03c8\u27e9=\u03b1\u22230\u27e9+\u03b2\u22231\u27e9   <\/p>\n\n\n\n<p>The Pauli-Y operation gives: Y\u2223\u03c8\u27e9=\u03b1(i\u22231\u27e9)+\u03b2(\u2212i\u22230\u27e9)=\u2212i(\u03b2\u22230\u27e9\u2212\u03b1\u22231\u27e9)  <\/p>\n\n\n\n<p>This shows that the Y gate not only flips the amplitudes but also <strong>introduces a phase rotation<\/strong> of \u00b1i, representing a 180\u00b0 rotation about the Y-axis on the Bloch sphere.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.5 Qiskit Example: Pauli-Y Gate<\/strong><\/h3>\n\n\n\n<p>Below is a complete example you can run directly in <strong>Jupyter Notebook<\/strong> (with inline visualization):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Ensure inline plotting for Jupyter Notebook\n%matplotlib inline\n\n# Import required libraries\nfrom qiskit import QuantumCircuit, transpile\nfrom qiskit_aer import AerSimulator\nfrom qiskit.visualization import plot_bloch_multivector, plot_histogram\nimport matplotlib.pyplot as plt\n\n# Create Quantum Circuit\nqc = QuantumCircuit(1, 1)\n\n# Apply Y gate to |0>\nqc.y(0)\n\n# Display the circuit\nqc.draw('mpl')<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"153\" height=\"120\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-27.png\" alt=\"\" class=\"wp-image-42389\"\/><\/figure>\n\n\n\n<p>\ud83e\udde0 <strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The circuit starts with the qubit in state |0\u27e9.<\/li>\n\n\n\n<li>Applying the <strong>Y gate<\/strong> rotates the qubit 180\u00b0 about the Y-axis.<\/li>\n\n\n\n<li>The resulting state is <strong>i|1\u27e9<\/strong>, equivalent to |1\u27e9 up to a global phase.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.6 Visualization of Pauli-Y on Superposed State<\/strong><\/h3>\n\n\n\n<p>Now let\u2019s visualize the effect of Y on a <strong>superposition<\/strong> created by the <strong>Hadamard<\/strong> gate.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Create a new circuit for visualization\nqc2 = QuantumCircuit(1)\nqc2.h(0)  # Create superposition (|0> + |1>)\/\u221a2\nqc2.y(0)  # Apply Pauli-Y gate\nqc2.save_statevector()  # Save the quantum state\n\n# Simulate\nsim = AerSimulator()\ntqc2 = transpile(qc2, sim)\nresult = sim.run(tqc2).result()\n\n# Get the statevector\nstatevector = result.get_statevector()\n\n# Plot Bloch vector\nfig = plot_bloch_multivector(statevector)\ndisplay(fig)  # Ensures inline output in Jupyter\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"389\" height=\"406\" src=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-28.png\" alt=\"\" class=\"wp-image-42392\" srcset=\"https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-28.png 389w, https:\/\/tocxten.com\/wp-content\/uploads\/2025\/11\/image-28-287x300.png 287w\" sizes=\"auto, (max-width: 389px) 100vw, 389px\" \/><\/figure>\n\n\n\n<p>\u2705 <strong>Expected Result:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The qubit rotates <strong>around the Y-axis<\/strong> by 180\u00b0, moving the state from +X to \u2013X direction on the Bloch sphere.<\/li>\n\n\n\n<li>You\u2019ll see the point shift to the <strong>opposite side<\/strong> of the sphere along the X-axis.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction In quantum computing, quantum gates are the fundamental building blocks used to manipulate quantum bits or qubits. Just as classical logic gates (like AND, OR, NOT) operate on&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-42309","page","type-page","status-publish","hentry"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/tocxten.com\/index.php\/wp-json\/wp\/v2\/pages\/42309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tocxten.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/tocxten.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/tocxten.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tocxten.com\/index.php\/wp-json\/wp\/v2\/comments?post=42309"}],"version-history":[{"count":33,"href":"https:\/\/tocxten.com\/index.php\/wp-json\/wp\/v2\/pages\/42309\/revisions"}],"predecessor-version":[{"id":42396,"href":"https:\/\/tocxten.com\/index.php\/wp-json\/wp\/v2\/pages\/42309\/revisions\/42396"}],"wp:attachment":[{"href":"https:\/\/tocxten.com\/index.php\/wp-json\/wp\/v2\/media?parent=42309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}