liveBook · Manning

X gate

As explained in Quantum Programming in Depth

An X gate is a single-qubit bit-flip quantum gate that exchanges the computational-basis states zero and one.

The X gate is a single-qubit bit flip: it exchanges the computational-basis states |0⟩ and |1⟩. Applied to |0⟩, it produces |1⟩; applied to |1⟩, it produces |0⟩. section 5.1.1

A direct measurement makes the X gate operationally useful for distinguishing it from gates with different effects. Applying an unknown gate to |0⟩ yields |1⟩ for X and |0⟩ for Z, so computational-basis outcomes identify the candidate. section 5.1.1

Quantum experiments use the X gate in several related ways:

  • Flip a basis state directly before measurement. section 5.1.1
  • Normalize measurement conventions in Qiskit when circuit outcomes must encode which unitary was supplied. section 5.1.2
  • Form controlled-X operations, including CNOT, where the target flips only when the control is |1⟩. section 2.3.1

Distinguishing X from Z in Qiskit

Prepare one qubit in |0⟩, append the unknown single-qubit circuit, apply X if the circuit convention requires outcome normalization, and measure. Outcome 0 identifies Z; outcome 1 identifies X. The corresponding Qiskit workflow appends the supplied circuit, applies X, and measures one classical bit. section 5.1.1 section 5.1.2

Figure 5.2 To distinguish two unitaries in one experiment, we need to choose an initial state that can be converted to different orthogonal states by applying each of these two unitaries, possibly as part of a longer sequence of unitaries. We then run the experiment by preparing that initial state, applying that sequence of unitaries, and identifying which of the orthogonal states we got using measurements.
figure

Use the circuit-design figure to trace the general pattern: choose an input state, transform candidate outputs into orthogonal states, then identify the result by measurement. section 5.1.1

How Quantum Programming in Depth covers it

How deep it goes
Explains basis-state action and implements X within single- and two-qubit discrimination circuits, without developing its matrix representation.
Examples
Uses X-versus-Z, X-versus-H, and X-versus-minus-X discrimination experiments with measured circuit outcomes.
What it assumes
Assumes computational-basis states, unitary gates, measurement, and basic circuit construction while refreshing controlled-gate behavior.
What you can do after
Apply it via Qiskit or Q# and test discrimination circuits through measurement outcomes and passing automated tests.
How it connects
Connects X with Z, H, controlled gates, CNOT, computational-basis measurement, Qiskit, and Q#.

Also explained in

Compare how 2 books explain x gate →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quantum Programming in Depth. The section links point to the parts of the book it draws on.