Bits, Qubits, and Phase
UF Herbert Wertheim College of Engineering, University of Florida UF Herbert Wertheim College of Engineering, University of Florida Quantum Theory
Project
Bits, Qubits, Phase  /  for engineers
A working model for electrical and computer engineers

A qubit is a phasor you are allowed to rotate but not to read.

Everything strange about quantum computing and quantum sensing follows from that one sentence. This page builds it up from things you already use. Complex amplitudes. Phase. Interference. Truth tables. Every figure below is live, so drag it and change it.

THE OBJECTA normalized pair of complex amplitudes. Two real degrees of freedom. A point on a sphere.
THE OPERATIONA rotation of that sphere. Reversible by construction, which is why AND has no direct quantum twin.
THE PAYOFFPhase you cannot read directly, but can convert into a measurable outcome by interference.
drag to rotate
01

The bit, and the cost of forgetting

Start where the audience already lives. A classical gate throws information away, and that is the hinge the whole quantum story turns on.

A bit is a switch. A classical gate is a lookup table on switches. Nothing here is mysterious, but one property of these tables is easy to miss because it is so familiar.

Most classical gates destroy information. An AND gate takes two bits in and returns one bit out. If the output is 0 you cannot say which of three inputs produced it. The gate is a one way street. Run the table below and watch the count of inputs that collapse onto each output.

Bench 01  Truth tables and information loss
Landauer's principle. Erasing one bit of information must dump at least kT ln2 of heat, about 2.9 zJ or 18 meV at 300 K. Real CMOS burns roughly a million times that per operation, so this is not yet an engineering constraint. It is a clue. It says that irreversibility is a physical act, not a bookkeeping convenience.

Hold onto the reversible entries in that list. NOT and CNOT lose nothing. You can run them backwards and recover the input exactly. Every quantum gate has that property, and not by choice. It is forced by the physics.

02

A qubit is a normalized phasor pair

You already carry the right mental object. It is the Jones vector of a polarized wave, and the sphere it lives on is the Poincaré sphere under a different name.

Take a plane wave travelling toward you. Its electric field has two orthogonal components, horizontal and vertical. Each carries an amplitude and a phase, so each is a complex number. Stack them and you get two complex numbers describing one wave.

That is a qubit. Rename the horizontal component α and call it the amplitude on |0⟩. Rename the vertical component β and call it the amplitude on |1⟩.

|ψ⟩ = α|0⟩ + β|1⟩   with   |α|2 + |β|2 = 1

Two complex numbers is four real numbers. Two constraints remove two of them. Normalization fixes the total power to one. Global phase is unobservable, exactly as the choice of time origin for a phasor is unobservable. Four minus two is two, and two real parameters is the surface of a sphere.

|ψ⟩ = cos(θ/2) |0⟩  +  eiφ sin(θ/2) |1⟩

Latitude sets the odds. Longitude sets the phase. The polar angle θ controls how the probability splits between 0 and 1. The azimuth φ is the relative phase between the two amplitudes. Measurement is blind to φ, and yet φ is where every quantum advantage comes from. Move both sliders and watch the polarization ellipse on the right respond.

Bench 02  One qubit, three equivalent pictures
Bloch sphere  ·  drag to rotate
The same state as polarization
Where you have seen this before. Optics calls this the Poincaré sphere and uses it for polarization. The mathematics is identical. Only the labels on the poles change. If you have ever traced a signal around a Poincaré sphere, you have already done quantum state tomography without being told.
The same thing in matrix form

Write the state as a column vector and the measurement as a projector. The probability of reading 0 is the squared overlap with the |0⟩ axis.

P(0) = |⟨0|ψ⟩|2 = |α|2 = cos2(θ/2)   and   P(1) = sin2(θ/2)

The Bloch vector is the expectation of the three Pauli operators. It is the Stokes vector of the polarization picture, component for component.

r = ( ⟨X⟩, ⟨Y⟩, ⟨Z⟩ ) = ( sinθ cosφ,  sinθ sinφ,  cosθ )

A pure state has |r| = 1 and sits on the surface. Anything inside the ball is a statistical mixture, which is what noise does to a qubit. Section 06 puts that to work.

03

Gates are rotations

Every single qubit gate is a rigid rotation of that sphere. Pick an axis, pick an angle, and you have named the gate.

A gate has to preserve total probability, so it has to preserve the length of the state vector. A length preserving linear map on a sphere is a rotation. That is the whole classification.

X is a half turn about the x axis, which swaps the poles, so it is the quantum NOT. Z is a half turn about the vertical axis. It leaves both poles alone and leaves every measurement probability untouched, which makes it look like it does nothing. It flips the sign of β. Section 04 shows how much that matters.

H, the Hadamard, is a half turn about the tilted axis halfway between x and z. It carries a pole to the equator. It is the gate that creates superposition, and it is the exact analogue of a 50:50 coupler.

Build a sequence below. The dashed line shows the rotation axis of the gate as it runs.

Bench 03  Gate sandbox
drag to rotate the view
Try this. Apply H, then measure. You get a fair coin. Now apply H, then Z, then H, and measure. You get 1 every single time. The Z in the middle never changed a probability. It changed a phase, and the second H converted that phase into a certainty.
The matrices, and why a rotation is a unitary

A rotation by angle γ about the unit axis n is generated by the Pauli operators.

Rn(γ) = cos(γ/2) I − i sin(γ/2) (nxX + nyY + nzZ)

The half angle is not a typo. The state lives on a sphere of directions, and a 360° rotation of that sphere returns the state to minus itself. That sign is a global phase, so it is invisible, which is why the two pictures stay consistent.

Setting γ = π recovers the familiar gates up to a global phase.

X = iRx(π)   Y = iRy(π)   Z = iRz(π)   H = iR(x+z)/√2(π)

Accumulated unitary for the current sequence, to three decimals:

04

You already built this circuit. It was a Mach–Zehnder.

Coupler, phase shifter, coupler, detector. The quantum circuit H · Rz(φ) · H is the same instrument written in different notation.

Split a signal into two arms with a 3 dB coupler. Delay one arm. Recombine with a second coupler. Which detector lights up depends entirely on the relative phase between the arms. No engineer finds that surprising.

Now replace the two arms with the two states of one qubit. The first H is the input coupler. The phase shifter is Rz(φ). The second H is the output coupler. The detector is the measurement.

P(1) = sin2(φ/2) = (1 − cosφ) / 2

This single result is the engine of both halves of the field. Quantum computing arranges φ so that wrong answers cancel. Quantum sensing lets the world set φ and then reads it off the fringe.

Bench 04  The interferometer and the circuit are the same device
state at the selected stage
Show state after
Read the sphere while you drag. After the first H the arrow sits on the equator and the outcome is a coin flip. The phase shifter walks it around the equator, and the probabilities never budge. The second H tips the equator back onto the vertical axis, and only then does the phase become something a detector can see.
05

Where did AND and OR go?

They are still available, but they cost an extra wire. Reversibility is not a style choice. It is the price of being a rotation.

A rotation can always be undone by rotating back. So every quantum gate is invertible, and an invertible map needs as many outputs as inputs. A two in, one out AND gate cannot be a rotation of anything.

The fix is old and it is classical. Keep the inputs and write the answer onto a spare wire. CNOT does this for XOR. The Toffoli gate, a doubly controlled NOT, does it for AND.

Because NAND is universal for classical logic and Toffoli gives you NAND for free, any classical circuit can be run on a quantum computer. Flip the inputs below and watch the third wire.

Bench 05  Reversible logic

Set the inputs

The catch is bookkeeping. Those extra wires do not vanish. They hold intermediate results, and any leftover that is correlated with the computation will ruin the interference you were trying to build. Uncomputing them, by running the circuit backwards after copying the answer out, is a standard and unavoidable part of quantum algorithm design.
06

Two qubits, and the arrows disappear

The best visual definition of entanglement. Each qubit individually has no direction left, and yet the pair is perfectly defined.

Two bits have four possible values. Two qubits carry four complex amplitudes, one for each of those values. Ten qubits carry 1024 amplitudes. Fifty qubits carry more than a quadrillion, which is why simulating them on a classical machine is hopeless.

The trap is to imagine those amplitudes as a warehouse of parallel answers. They are not. Measuring n qubits returns exactly n bits. The amplitudes are not an output, they are an internal ledger, and the only way to profit is to arrange for the unwanted entries to cancel.

Now the strange part. Run H on the first qubit and then CNOT onto the second. The pair is in a perfectly definite state. But look at either qubit on its own and the Bloch arrow has shrunk to nothing.

Bench 06  Two qubits, four amplitudes, two arrows
qubit A alone
qubit B alone
The information moved. It did not vanish. It left the individual qubits and went into the correlation between them. A full length arrow on each sphere means the two qubits are independent. A zero length arrow on both, with a pure state overall, is maximum entanglement. This is also exactly what noise looks like to one qubit, which is the key to section 08.
07

An algorithm is interference you designed on purpose

Grover's search on four items, in full. One oracle call, and the answer comes out with certainty. Nothing is hidden in this example.

Four boxes. One has a prize. Classically you open boxes until you find it, which takes 2.25 tries on average. Quantum mechanically you need one query, and the answer is certain rather than probable.

The trick has two moves. The oracle flips the sign of the marked amplitude, which no probability could ever do because probabilities cannot be negative. Then the diffusion step reflects every amplitude about their mean. The marked entry was below the mean, so it is thrown far above it. The other three land on zero.

Step through it. Watch the bars go below the axis. That is the whole reason quantum computing works.

Bench 07  Grover search on four items

Marked item

Step

Scaling, honestly. Grover finds one item among N in about (π/4)√N queries instead of N/2. That is a quadratic speedup, not an exponential one. Shor's factoring algorithm is exponential, and it uses the same idea with a different interference pattern, built from the discrete Fourier transform you already know.
08

Quantum sensing: stop computing the phase and measure it

Same interferometer. Same fringe. This time the world supplies the phase shift and you want to know what it was.

Put a qubit on the equator with an H. Now leave it alone for a time τ. If the qubit has a magnetic moment and sits in a field B, it precesses about the vertical axis at the Larmor rate. It accumulates phase.

φ = γ B τ
a second H turns that phase into an outcome
P(1) = ½ (1 − e−τ/T₂ cos φ)

This is a Ramsey sequence, and it is the backbone of atomic clocks, magnetometers with nitrogen vacancy centers in diamond, and molecular spin qubits. The qubit is a lock-in amplifier whose reference oscillator is itself.

Two things fight each other. Longer τ accumulates more phase per unit of field, so sensitivity improves. But the environment scrambles the phase, and the fringe contrast decays as exp(−τ/T₂). The optimum is not at the coherence time. It sits at exactly half of it.

Bench 08  Ramsey interferometry
during the free evolution
The design rule that falls out. Minimum detectable field goes as 1/(γ√τ e−τ/T₂). Differentiate and the best interrogation time is τ = T₂/2, whatever the material. So every hour spent doubling T₂ buys a factor of √2 in sensitivity. That is why coherence time is the number that materials people chase.
09

How good can a sensor get?

Averaging N independent probes beats down noise as 1/√N. Entangling them first gets you 1/N. The catch is real and worth stating.

Every measurement of a qubit is one coin flip. Repeat with N independent qubits and the phase uncertainty falls as 1/√N. Engineers know this as shot noise. In this field it is called the standard quantum limit, and it is not a law of nature. It is the law for uncorrelated probes.

Entangle the N qubits into a GHZ state and the accumulated phase is Nφ instead of φ. The fringe gets N times finer, and the uncertainty falls as 1/N. That is the Heisenberg limit, and the gain over shot noise is √N.

The catch. A GHZ state also decoheres about N times faster. With realistic noise much of the advantage is eaten, and the honest engineering answer is that entangled sensing wins in narrow regimes rather than everywhere. Toggle the noise below and watch the crossover appear.

Bench 09  Shot noise against the Heisenberg limit
independent probes, 1/√N GHZ entangled, 1/N
Why an engineer should care. These two curves set the specification sheet for every quantum sensor. They tell you how much averaging time buys how much resolution, and whether entanglement is worth its considerable cost in control hardware. Most deployed quantum sensors today run at the standard quantum limit and win by having an enormous γ, not by entangling anything.
10

Where engineers actually plug in

Very little of the work is quantum mechanics. Most of it is control, signal integrity, thermal design, and coding theory, done to unusual tolerances.

The four ideas on this page carry most of the conceptual load. A qubit is a normalized complex pair. A gate is a rotation. Entanglement moves information from the parts into the correlations. Interference converts unreadable phase into readable outcomes.

From there the work looks familiar.

CONTROL
Microwave and pulse engineering

Gates are shaped pulses. Amplitude and phase errors of a fraction of a percent are the difference between a working and a useless processor.

SIGNAL CHAIN
Cryogenic electronics

Attenuation, filtering, and heat budgets between 300 K and 10 mK. A microwatt in the wrong place ends the experiment.

FEEDBACK
Real time classical compute

Error correction needs syndrome decoding inside the coherence time. That is an FPGA and latency problem with a hard deadline.

CODING
Error correction

Surface codes are linear codes over GF(2) with a geometric constraint. Anyone comfortable with LDPC decoding is already most of the way there.

MATERIALS
Coherence by design

T₂ is set by two level defects, surface chemistry, and dielectric loss. Section 08 showed why every factor of two here is worth chasing.

METROLOGY
Calibration and characterization

Tomography, randomized benchmarking, and drift tracking. This is instrumentation engineering with a quantum readout.

A note on what was left out. Measurement in the collapse sense, decoherence as entanglement with the environment, the full tensor product formalism, and the Fourier structure behind Shor's algorithm. Each deserves its own page. None of them changes the four ideas above.