Question 5 (Harder): Quantum Algorithms (State Initialization with Clifford Gates)
Source: Chapter 03, slides 3, 7-12, 28, 30-34, 38-39, 43-44
These problems go beyond the base Question 5 set: graph states built from many overlapping gates, longer phase-bookkeeping chains on more qubits, and circuits constrained to nearest-neighbor connectivity, forcing a genuine swap network instead of a direct controlled-NOT.
Problem 1: the 3-qubit triangle graph state (every pair connected by )
Target: apply to all three qubits, then a between every pair , , — a complete graph on 3 vertices.
Circuit:
q0: |0> --H--*-----*-----
| |
q1: |0> --H--Z--*--|-----
| |
q2: |0> --H-----Z--Z-----
Step 1, why term-by-term tracing does not scale here. With three overlapping gates touching all basis terms, listing each term’s fate one at a time (as in Question 6) is slow and error-prone. Instead use the standard graph-state shortcut: after the state is an equal-weight sum over all bit strings, and each multiplies the amplitude of a term by exactly when both bits are — so its net effect is just to add to a running exponent.
Step 2, after .
Step 3, accumulate the phase exponent from all three gates. contributes , contributes , contributes (using 1-indexed bit labels matching the qubit order ):
Step 4, evaluate the sign on each of the 8 terms.
Final state.
Why this is harder than any base-file problem. Every one of the 8 basis terms is now populated with an independently determined sign fixed by three overlapping two-qubit gates acting on the same three wires, rather than a single controlled-NOT chain that only ever touches two terms at a time.
Problem 2: a 5-qubit GHZ state with a combined non-trivial global phase,
Circuit:
q0: |0> --H--*--*--*--*----------
| | | |
q1: |0> -----X--|--|--|--Z-------
| | |
q2: |0> --------X--|--|----------
| |
q3: |0> -----------X--|----------
|
q4: |0> --------------X--S-------
Step 1 (start). .
Step 2 (after on q0). .
Step 3 (after controlled-NOT from q0 to each of q1, q2, q3, q4 in turn). Every one of the four controlled-NOTs has control q0, which is still on the second term at the moment each fires, so each flips its target in turn:
the 5-qubit GHZ state.
Step 4 (after on q4). multiplies the amplitude by whenever q4 is ; the term has q4 and picks up , while is untouched.
Step 5 (after on q1). multiplies the amplitude by whenever q1 is ; the term (carrying coefficient ) has q1, so its coefficient becomes , while is untouched.
the target state.
Why this is harder. Reaching a target relative phase of requires combining two different single-qubit Clifford phase corrections ( contributing , contributing ) applied on two different qubits, both of which only act on the shared branch. Careless bookkeeping (applying them in the wrong place, or on the branch by mistake) silently produces the wrong global phase, whereas every base-file GHZ problem only ever needed a single phase correction.
Problem 3: nearest-neighbor connectivity, Bell pair on non-adjacent qubits q0 and q3 via a swap network
Hardware constraint: 2-qubit gates are only physically available between adjacent wires, , , . Target: , i.e. q0 and q3 entangled as a Bell pair, q1 and q2 left at .
Circuit:
q0: |0> --H--*--------------
|
q1: |0> -----X--x-----------
|
q2: |0> --------x--x--------
|
q3: |0> --------------x-----
(the x--x columns denote swap; the second swap is between q2 and q3)
Step 1, why controlled-NOT(q0,q3) directly is not available. The problem restricts 2-qubit gates to adjacent pairs, so entanglement must first be created locally, then physically moved along the register using swap gates, exactly the technique used for connectivity-limited hardware.
Step 2 (after on q0). .
Step 3 (after controlled-NOT, control q0, target q1). , an ordinary adjacent Bell pair on q0,q1.
Step 4 (after swap between q1 and q2). Swap exchanges the values sitting on wires in every term: is unaffected (); becomes ().
Step 5 (after swap between q2 and q3). unaffected; becomes ().
the target state: q0 and q3 hold the Bell correlation, q1 and q2 are back to , disentangled.
Why this is harder. Every base-file problem allowed any wire to interact with any other wire directly; here the connectivity constraint forces two extra swap gates purely to relocate an entangled partner across the register, a genuinely different (and more error-prone) kind of circuit design than picking the right gate sequence on a fully-connected register.
Problem 4: merging two independent Bell pairs into one 4-term entangled cluster with a single connecting
Target: starting from two ordinary Bell pairs, and , apply one between and to link them.
Circuit:
q0: |0> --H--*-----------
|
q1: |0> -----X--*--------
|
q2: |0> --H-----Z--------
q3: |0> -----------*-----
|
(continued) q2 --Z--(already shown above), q3 unused by CZ, paired via its own CNOT below
To keep the diagram unambiguous, draw it as two clearly separated stages:
Stage A (build the two Bell pairs):
q0: |0> --H--*--------
|
q1: |0> -----X--------
q2: |0> --H--------*--
|
q3: |0> ------------X--
Stage B (connect them):
q1: ----*--
|
q2: ----Z--
Step 1 (after Stage A). Each pair independently becomes a Bell state, by Problem 1 of the base Question 5 file:
Step 2, apply between q1 and q2 to every one of the 4 terms. multiplies a term’s amplitude by exactly when both q1 and q2 are in that term; read off for each term:
Final state.
Why this is harder. This is a genuine 4-term entangled state on 4 qubits (not reducible to a tensor product of two 2-term Bell pairs any more, since the connecting correlates all four qubits together), yet it is built by composing two small, independently-verifiable circuits (Stage A, checked against Problem 5 of the base file) with one extra linking gate — the harder skill is tracking how a single additional gate changes all four amplitudes of an already-entangled multi-qubit state at once, rather than building the state gate-by-gate from scratch.