Skip to main content

Quantum Computing Basics: Qubits, Basis, and Probability


Quantum Computing Fundamentals

Understanding qubits, basis, Hadamard transform, and quantum probability

1. Qubit (quantum bit)

A qubit is a unit vector in a 2-dimensional complex Hilbert space:

\[ |\psi\rangle = \alpha |0\rangle + \beta |1\rangle \]

where

\[ \alpha, \beta \in \mathbb{C}, \quad |\alpha|^2 + |\beta|^2 = 1 \]

  • \(|0\rangle, |1\rangle\) are basis states
  • \(|\alpha|^2\) = probability of measuring 0
  • \(|\beta|^2\) = probability of measuring 1

2. Basis (measurement basis)

A basis is a set of orthonormal vectors used to describe or measure a qubit.

(a) Computational (Z) basis

\[ |0\rangle = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \quad |1\rangle = \begin{pmatrix} 0 \\ 1 \end{pmatrix} \]

Measurement probabilities:

\[ P(0) = |\langle 0|\psi\rangle|^2 = |\alpha|^2 \]

\[ P(1) = |\langle 1|\psi\rangle|^2 = |\beta|^2 \]

(b) Hadamard (X) basis

\[ |+\rangle = \frac{|0\rangle + |1\rangle}{\sqrt{2}}, \quad |-\rangle = \frac{|0\rangle - |1\rangle}{\sqrt{2}} \]

Same qubit, different description:

\[ |\psi\rangle = c_+ |+\rangle + c_- |-\rangle \]

3. Basis change (Hadamard transform)

The Hadamard gate:

\[ H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \]

Example:

\[ H|0\rangle = |+\rangle, \quad H|1\rangle = |-\rangle \]

4. Why basis matters (quantum communication)

  • Measuring in the wrong basis gives random outcomes
  • Non-commuting bases: \[ [Z, X] \neq 0 \]
  • Used in protocols like BB84 for eavesdropping detection
A qubit is a vector; a basis is the coordinate system you choose to measure it.

5. Why Hadamard are used?

  • Hadmard is used to keep the total probality value 1 because practically probabity cannot be greter than 1. If we do not apply Hadamard then probability of P(0) + P(1) could be 2 (max). Hadamard limts it to P(0) + P(1) = 1/2 + 1/2 = 1 (max)

6. Amplitude and Probability in Quantum Mechanics

In the above you observe the probabity of qbits are directly proportional to their amplitude. Surprised? You should know that the probabily of dection of a wave increases as the legth of wavelength increases. It is a natural phenomena

Amplitude becomes probability by squaring its size.

That rule is called the Born rule.

What is an amplitude? (In general)

  • a signed size (can be + or −)
  • or a length of an arrow

It is not a probability.

Why amplitude cannot be probability

Amplitudes can be:

  • negative
  • complex (in advanced cases)

Probabilities must:

  • be positive
  • be between 0 and 1

So we need a way to turn:

+ or − → always positive
      

The rule that does this

\[ \text{probability} = |\text{amplitude}|^2 \]

This is not chosen by us — experiments confirm it. This rule is the Born rule.

Simple number example

Amplitude for 0:

\[ a = \frac{1}{\sqrt{2}} \]

Probability:

\[ P(0) = \left(\frac{1}{\sqrt{2}}\right)^2 = \frac{1}{2} \]

Same for 1.

Why square and not something else?

  1. Removes minus signs \[ (-a)^2 = a^2 \]
  2. Makes probability always positive
  3. Preserves total probability: \[ a^2 + b^2 = 1 \]

No other simple rule does all three and matches experiments.

Everyday analogy

  • Wave height = amplitude
  • Energy ∝ (height)²

Double the wave height → 4× energy

Quantum probability behaves the same way.

Example: qubit

Suppose a qubit is:

\[ |\psi\rangle = \frac{|0\rangle + |1\rangle}{\sqrt{2}} \]

  • Amplitude for 0: \(\psi_0 = \frac{1}{\sqrt{2}}\)
  • Amplitude for 1: \(\psi_1 = \frac{1}{\sqrt{2}}\)

Probability of measuring 0:

\[ P(0) = |\psi_0|^2 = \left(\frac{1}{\sqrt{2}}\right)^2 = \frac{1}{2} \]

Probability of measuring 1:

\[ P(1) = |\psi_1|^2 = \left(\frac{1}{\sqrt{2}}\right)^2 = \frac{1}{2} \]

Further Reading

People are good at skipping over material they already know!

View Related Topics to







Contact Us

Name

Email *

Message *

Popular Posts

Theoretical BER vs SNR for binary ASK, FSK, and PSK with MATLAB Code + Simulator

📘 Overview & Theory 🧮 MATLAB Codes 📚 Further Reading Bit Error Rate (BER) Equations BER formulas for ASK, FSK, and PSK modulation schemes. ASK BER = 0.5 × erfc(0.5 × √SNR) FSK BER = 0.5 × erfc(√(SNR / 2)) PSK BER = 0.5 × erfc(√SNR) Theoretical BER vs SNR for Amplitude Shift Keying (ASK) The theoretical Bit Error Rate (BER) for binary ASK depends on how binary bits are mapped to signal amplitudes. For typical cases: If bits are mapped to 1 and -1, the BER is: BER = Q(√(2 × SNR)) If bits are mapped to 0 and 1, the BER becomes: BER = Q(√(SNR / 2)) Where: Q(x) is the Q-function: Q(x) = 0.5 × erfc(x / √2) SNR : Signal-to-Noise Ratio N₀ : Noise Power Spectral Density Understanding the Q-F...

Simulation of ASK, FSK, and PSK using MATLAB Simulink (with Online Simulator)

📘 Overview 🧮 How to use MATLAB Simulink 🧮 Simulation of ASK using MATLAB Simulink 🧮 Simulation of FSK using MATLAB Simulink 🧮 Simulation of PSK using MATLAB Simulink 🧮 Simulator for ASK, FSK, and PSK 🧮 Digital Signal Processing Simulator 📚 Further Reading ASK, FSK & PSK HomePage MATLAB Simulation Simulation of Amplitude Shift Keying (ASK) using MATLAB Simulink In Simulink, we pick different components/elements from MATLAB Simulink Library. Then we connect the components and perform a particular operation. Result A sine wave source, a pulse generator, a product block, a mux, and a scope are shown in the diagram above. The pulse generator generates the '1' and '0' bit sequences. Sine wave sources produce a specific amplitude and frequency. The scope displays the modulated signal as well as the original bit sequence created by the pulse generator. Mux i...

BER vs SNR for M-ary QAM, M-ary PSK, QPSK, BPSK, ...(MATLAB Code + Simulator)

Bit Error Rate (BER) & SNR Guide Analyze communication system performance with our interactive simulators and MATLAB tools. 📘 Theory 🧮 Simulators 💻 MATLAB Code 📚 Resources BER Definition SNR Formula BER Calculator MATLAB Comparison 📂 Explore M-ary QAM, PSK, and QPSK Topics ▼ 🧮 Constellation Simulator: M-ary QAM 🧮 Constellation Simulator: M-ary PSK 🧮 BER calculation for ASK, FSK, and PSK 🧮 Approaches to BER vs SNR What is Bit Error Rate (BER)? The BER indicates how many corrupted bits are received compared to the total number of bits sent. It is the primary figure of merit for a...

Power Spectral Density Calculation Using FFT in MATLAB

📘 📘 Overview 🧮 🧮 Steps to calculate 💻 🧮 MATLAB Codes 📚 📚 Further Reading Power spectral density (PSD) tells us how the power of a signal is distributed across different frequency components, whereas Fourier Magnitude gives you the amplitude (or strength) of each frequency component in the signal. Steps to calculate the PSD of a signal Firstly, calculate the fast Fourier transform (FFT) of a signal. Then, calculate the Fourier magnitude (absolute value) of the signal. Square the Fourier magnitude to get the power spectrum. To calculate the Power Spectral Density (PSD), divide the squared magnitude by the product of the sampling frequency (fs) and the total number of samples (N). Formula: PSD = |FFT|^2 / (fs * N) Sampling frequency (fs): The rate at which the continuous-time signal is sampled (in Hz). ...

Online Simulator for ASK, FSK, and PSK

Try our new Digital Signal Processing Simulator!   •   Interactive ASK, FSK, and BPSK tools updated for 2025. Start Now Interactive Modulation Simulators Visualize binary modulation techniques (ASK, FSK, BPSK) in real-time with adjustable carrier and sampling parameters. 📡 ASK Simulator 📶 FSK Simulator 🎚️ BPSK Simulator 📚 More Topics ASK Modulator FSK Modulator BPSK Modulator More Topics Simulator for Binary ASK Modulation Digital Message Bits Carrier Freq (Hz) Sampling Rate (...

MATLAB Codes for Various types of beamforming | Beam Steering, Digital...

📘 How Beamforming Improves SNR 🧮 MATLAB Code 📚 Further Reading 📂 Other Topics on Beamforming in MATLAB ... MIMO / Massive MIMO Beamforming Techniques Beamforming Techniques MATLAB Codes for Beamforming... How Beamforming Improves SNR The mathematical [↗] and theoretical aspects of beamforming [↗] have already been covered. We'll talk about coding in MATLAB in this tutorial so that you may generate results for different beamforming approaches. Let's go right to the content of the article. In analog beamforming, certain codebooks are employed on the TX and RX sides to select the best beam pairs. Because of their beamforming gains, communication created through the strongest beams from both the TX and RX side enhances spectrum efficiency. Additionally, beamforming gain directly impacts SNR improvement. [Read more about Beamforming and How it improves SNR] Wireless...

Constellation Diagrams of ASK, PSK, and FSK (with MATLAB Code + Simulator)

Constellation Diagrams: ASK, FSK, and PSK Comprehensive guide to signal space representation, including interactive simulators and MATLAB implementations. 📘 Overview 🧮 Simulator ⚖️ Theory 📚 Resources Definitions Constellation Tool Key Points MATLAB Code 📂 Other Topics: M-ary PSK & QAM Diagrams ▼ 🧮 Simulator for M-ary PSK Constellation 🧮 Simulator for M-ary QAM Constellation BASK (Binary ASK) Modulation Transmits one of two signals: 0 or -√Eb, where Eb​ is the energy per bit. These signals represent binary 0 and 1. BFSK (Binary FSK) Modulation Transmits on...

Linear Predictive Coding (LPC) in Speech Processing

Linear Predictive Coding (LPC) in Speech Signal Processing What is LPC? Linear Predictive Coding (LPC) is a method that represents a speech signal using a small number of parameters. It models the speech signal as the output of a linear filter excited by a source (voice or noise). LPC is widely used in speech compression, speech synthesis, coding, and recognition. 1. Core Idea of LPC LPC assumes that the current speech sample can be approximated by a linear combination of past samples: x[n] ≈ a₁ x[n−1] + a₂ x[n−2] + ... + aₚ x[n−p] The coefficients a₁, a₂, ..., aₚ are chosen to minimize the prediction error . 2. Why This Works for Speech The human vocal tract behaves like an all-pole acoustic filter . Thus speech can be approximated by the model: x[n] = − Σ (aâ‚– x[n−k]) + G e[n] Where: aâ‚– = LPC coefficients (vocal tract shape) e[n]...