Starting from the -qubit computational basis state , apply one Hadamard gate to every qubit. Since ,
Thus parallel Hadamard gates prepare the uniform quantum superposition.
The Hadamard gate conjugates the Pauli X gate into the Pauli Z gate:
When the control qubit is , all three circuits act as the identity on the target. When it is , the right-hand circuit acts on the target as . It therefore agrees with the Controlled-Z gate on every computational basis state, proving
Conjugating both sides by and using immediately gives the reverse identity
After the first Hadamard gate, the joint state is
The controlled SWAP gate then gives
After the second Hadamard gate, it is
Starting from , the first layer of Hadamard gates gives
The Boolean quantum oracle then gives
Using the Walsh-Hadamard transform identity
the final state is
Apply a Hadamard gate to every qubit. The amplitude of becomes
It equals in case (I) and in case (II). A computational-basis measurement therefore returns with certainty in case (I) and never returns it in case (II). This is the Deutsch-Jozsa algorithm.
For the distributed problem, Alice prepares
using one query to her quantum oracle, and sends these qubits to Bob. Bob applies his phase oracle, producing
The function is constant zero in case (1) and balanced in case (2). Bob applies and measures as above: outcome identifies case (1), while every other outcome identifies case (2), with certainty.
Prepare an ancilla qubit in . To measure , apply a Hadamard gate to each data qubit, apply a controlled-NOT gate from each data qubit to the ancilla, measure the ancilla in the computational basis, and apply a Hadamard gate to each data qubit again. The ancilla records the parity of the two rotated computational-basis bits, so outcome corresponds to eigenvalue and outcome to eigenvalue . The data register is projected by , so its complete post-measurement state is retained. For , perform the same ancilla-assisted Pauli measurement but apply the basis-changing Hadamard gates only to the second data qubit.
Let
where is the Hadamard gate. For a computational-basis string , define the phase reflection
Thus changes the sign of , while changes the sign of the marked state.
Conjugating by reflects in the hyperplane perpendicular to , so
is the Grover diffusion operator, the reflection about . The Grover iteration operator
is the product of two reflections. It acts as a rotation through in the plane spanned by the marked state and the normalized uniform superposition of unmarked states, where
It is the identity up to sign on the orthogonal complement of that plane.
Put and . After the first Hadamard gate and the two controlled Pauli gates, the joint state is
The final Hadamard gate changes this to
Conditioned on ancilla outcome , the normalized data state is therefore
Write the input in the two eigenspaces of as
where the displayed eigenstates are normalized. A direct PBC measurement gives
with probabilities and . Hence the ancilla circuit and the Pauli measurement have identical outcome distributions and conditional data states after identifying the Pauli outcome with .
Since the Hadamard gate conjugates to ,
For , each exponential is , so
For ,
Using gives
so one convenient logarithm is
Both products are Clifford operations: the first is the identity and the second is a one-qubit Pauli Y gate up to global phase.
Yes. The states and are orthogonal, since
A joint projective measurement in the Bell basis therefore distinguishes them with certainty. Concretely, a controlled-NOT followed by a Hadamard gate converts the Bell basis into the computational basis before measurement.
Apply the gates from left to right. The first Hadamard gate and the first controlled-NOT gate produce the Bell state
The parallel gates then produce
The final controlled-NOT has the lower qubit as control; it interchanges and , whose amplitudes here are equal. Thus the output is
By quantum measurement in the computational basis, every basis outcome has probability equal to the squared modulus of its amplitude:
After the first Hadamard gate and the controlled unitary gate, the state is
The final Hadamard gate gives
Hence the Hadamard test returns one with probability
If , then and the outcome is zero with certainty. If , then modulo and the outcome is one with certainty. The single measurement therefore distinguishes the two promised cases exactly.
The operators act on different qubits and therefore commute, so
Since ,
The scalar is a global phase. Thus each factor uses two Hadamard gates and one phase gate, and applying the factors in parallel or sequentially gives an exact quantum circuit of elementary gates.
Apply Hadamard gates to to prepare
Reversibly compute the efficiently decidable predicate into an ancillary qubit and measure it. The success probability is , and conditioned on success the first register is exactly
Restart after a failed measurement. After attempts, the probability that all attempts fail is below , so the state is prepared with probability at least using a number of gates polynomial in and .
Apply a Hadamard gate to Alice's qubit, followed by a controlled-NOT gate from Alice to Bob and another from Alice to Charlie:
Thus this circuit gives the required quantum circuit preparation of a three-qubit GHZ state.
For quantum teleportation, Alice holds an unknown input and one member of a shared pair; Bob holds qubit 3. Alice applies a CNOT gate from 1 to 2 and a Hadamard gate on 1, then measures both in the computational basis. Expansion gives the Bell-basis teleportation identity
Every outcome pair has probability , independently of the input. Alice sends these two classical bits, and Bob applies
The order of the two corrections matters only by a global sign for the doubly nonzero outcome. The transformation also transfers entanglement with an untouched reference, because the identity is linear in the input amplitudes.
Before receiving the bits, Bob must average over all four Pauli-related states, obtaining for any input. Thus teleportation requires classical communication and does not send information faster than light. The original input is consumed by Alice's measurement, so no second copy remains and the no-cloning theorem is respected. Ideal qubit teleportation consumes one shared Bell pair and two classical bits, as well as local gates and measurements. Imperfect entanglement, gate error, detection error or lost classical records reduce practical fidelity; teleportation transfers the quantum state, not the underlying material particle.
A qubit has state with . An -qubit register occupies a -dimensional Hilbert space and may contain entanglement. This large state space does not mean that a measurement reads out all its complex amplitudes: computational-basis outcomes occur with the Born rule probabilities.
A quantum circuit prepares a register, applies quantum gates, and measures selected outputs, possibly using classical feed-forward. Closed gates are unitary operators and therefore reversible; initialization, measurement and discarding can be treated using a larger system and environment. Single-qubit rotations together with an entangling two-qubit gate give a universal quantum gate set. The CNOT gate acts as .
For example, a Hadamard gate on the first qubit of followed by a CNOT creates . A Hadamard produces amplitudes with relative signs, so later gates can make unwanted alternatives interfere destructively and useful alternatives reinforce. Quantum algorithms organize this interference to improve a specified computational task; superposition alone does not supply an arbitrary speedup or permit reading every branch.
A finite discrete universal set such as Clifford gates together with a non-Clifford phase gate approximates general unitaries to chosen precision. Runtime includes the number of gates, repetitions and classical processing. Measurement outcomes may require multiple runs to estimate a probability or amplify success.
Quantum decoherence and imperfect gates limit an implementation. Quantum error correction encodes logical information into several physical qubits and measures error syndromes without directly learning the encoded amplitudes. Under appropriate noise and control assumptions, fault tolerance permits reliable longer computations; simply maintaining an isolated ideal state is not a realistic account of a large processor.
Quantum teleportation transfers an unknown qubit state using a previously shared Bell pair, local operations and two classical bits. It requires no description of the unknown complex amplitudes and produces no extra copy.
Let the input be , and let Alice and Bob share . Alice applies a controlled-NOT gate from to , then a Hadamard gate to . Expanding the circuit gives the Bell-basis teleportation identity in computational-output form:
Her projective measurement yields each bit pair with probability . She sends the two classical bits, and Bob applies to recover . The order is the inverse of the displayed conditional operator; interchanging these Pauli corrections changes only an irrelevant global phase when both bits are one.
Before receiving the bits, Bob has
Thus teleportation respects the no-communication theorem and cannot transmit the usable unknown state faster than the classical message. Alice's input has been measured, and the shared entanglement resource has been consumed, in agreement with the no-cloning theorem. The protocol transfers the state, not the material particle initially carrying it.
A physical implementation must distribute and preserve an entangled pair, implement a Bell-basis measurement and transmit its result to a controllable output system. Imperfect entanglement, lost outcomes and noisy corrections reduce quantum fidelity; a heralded probabilistic experiment must report its success probability separately from conditional fidelity. Ideal deterministic teleportation assumes every Bell outcome can be identified and corrected.
Insert Hadamard gates on every data qubit immediately after encoding by a bit-flip repetition code and immediately before its bit-flip detection and recovery. The intervening physical error is thereby conjugated by , and turns a single Pauli Z gate error into a single bit flip for the original correction circuit. The encoded logical codewords are now and . The syndrome ancillas and the final inverse encoding stay unchanged. This protects against phase flips in the new basis; it does not simultaneously correct arbitrary bit flips in the physical basis.