Question 7 (Harder): Non-Clifford Gates (State Initialization with Clifford and Non-Clifford Gates)
Source: Chapter 04, slides 6-8, 11-16; Chapter 03, slides 38-39
These problems go beyond the base Question 7 set: targets that need both a non-uniform amplitude and a relative phase at once, a genuine two-qubit controlled-phase primitive (not just a single-qubit non-Clifford gate riding on one entangled branch), multiple independent non-Clifford corrections combining on the same term, and a non-Clifford target reached only after a connectivity-forced swap network.
Problem 1: a fully general single-qubit target, both amplitude weight and relative phase at once,
Circuit:
q0: |0> --RY(2pi/5)--P(pi/6)--
Step 1 (start). .
Step 2 (after ). Using the general rule with :
Step 3 (after ). multiplies only the amplitude, leaving untouched:
the target state exactly.
Why this is harder than any base-file single-qubit problem. Every single-qubit problem in the base Question 7 file used either an for the weight or a / for the phase, never both together. This is the fully general point on the Bloch sphere: fixes the polar angle (here , giving weight ), and separately fixes the azimuthal angle (here ) — the two parameters are set by two independent gates, in that order, and neither alone reaches the target.
Problem 2: a genuine two-qubit controlled-phase gate,
Circuit:
q0: |0> --H--*----------
|
q1: |0> --H--P(pi/4)----
(the controlled box denotes a controlled-phase gate: it multiplies the amplitude by only on the term where both q0 and q1 are , and leaves every other term untouched — unlike a plain or sitting on a single wire, which would touch every term where that one qubit is , regardless of the other qubit’s value)
Step 1 (start). .
Step 2 (after on both q0 and q1).
Step 3 (after the controlled-phase gate). Only the term has both control and target equal to , so only it picks up ; the other three terms () each have at least one qubit at and are untouched.
the target state.
Why a single-wire or cannot do this. Placing a on q1 alone, for instance, would multiply both and by (every term with q1), giving , which is a different state entirely. Reaching a phase on only the joint term requires the two-qubit controlled-phase primitive, contrasted directly with every base-file problem where a single-wire or was always enough because the entangling controlled-NOT had already collapsed the superposition down to exactly two terms.
Problem 3: two independent non-Clifford corrections landing on the same joint term,
Circuit:
q0: |0> --H--*-----*--------
| |
q1: |0> -----X-----|--T-----
|
q2: |0> ------------X--T----
Step 1 (start). .
Step 2 (after on q0, then controlled-NOT q0q1, then controlled-NOT q0q2). As in Problem 4 of the base Question 7 file, this builds the ordinary GHZ state:
Step 3 (after on q1). The term has q1, so it picks up ; has q1 and is untouched.
Step 4 (after on q2). The term (now carrying ) has q2 too, so it picks up a second factor of ; is again untouched, since it has q2.
the target state.
Why this is harder. Two separate gates, on two separate qubits, both land their phase on the same joint term because both of those qubits happen to be only in that term. The angles add (), exactly as in Problem 8 of the base file, but here the two contributions come from two different physical qubits rather than two gates in sequence on one qubit, so it is easy to mistakenly place a where it would also touch the branch (e.g. a on a qubit that is in one term and in the other only for terms other than ) and get the wrong state; here the check that both target qubits are only in the term is essential.
Problem 4: non-uniform entanglement weight and a relative phase together,
Circuit:
q0: |0> --RY(pi/3)--*----------
|
q1: |0> -------------X--P(pi/3)--
Step 1 (start). .
Step 2 (after on q0). on q0, tensor on q1:
Step 3 (after controlled-NOT, control q0, target q1). The term has control , so q1 flips: ; the term has control and is untouched.
Step 4 (after on q1). Only the term has q1, so it alone picks up ; the term has q1 and is untouched.
the target state exactly.
Why this is harder than Problem 6 of the base file. The base file’s non-maximally-entangled example only fixed the weight ratio between the two terms with a single ; here the phase of the second term must independently be fixed to as well, requiring a third gate () placed after the entangling controlled-NOT so that it lands only on the branch that needs the phase, combining the techniques of Problems 1 and 6 of the base file into one circuit.
Problem 5: connectivity-constrained non-Clifford state, , entangling non-adjacent qubits q0 and q2 with only nearest-neighbor gates available
Hardware constraint: 2-qubit gates only between adjacent wires and .
Circuit:
q0: |0> --H--*--x-----------
| |
q1: |0> -----X--x-----------
q2: |0> --------------T-----
(read carefully: the x--x denotes swap between q1 and q2, drawn as occupying q1’s column and reaching across to q2)
Step 1 (start). .
Step 2 (after on q0). .
Step 3 (after controlled-NOT, control q0, target q1 — an allowed adjacent gate). , an ordinary Bell pair sitting on the adjacent pair q0,q1.
Step 4 (after swap between q1 and q2 — also an allowed adjacent gate). Swap exchanges the values on wires q1,q2 in every term: unaffected; becomes ().
the entangling partner of q0 has now been physically relocated from q1 onto q2, with q1 back at .
Step 5 (after on q2). The term has q2, so it picks up ; has q2 and is untouched.
the target state, with q0 and q2 entangled (carrying the non-Clifford phase) and q1 disentangled at .
Why this is harder. This combines the swap-network routing technique of Problem 3 in the harder Question 5 file with a non-Clifford phase correction, and the correction must be applied after the swap has finished relocating the entanglement. Applying the to q2 before the swap would do nothing, since q2 is still in both terms at that point. Applying it to q1 after the swap would also do nothing, since q1 has already been vacated back to in both terms. The order of routing versus phase correction matters here in a way no base-file problem tested.
Problem 6: phase kickback, target: , built by kicking a non-Clifford phase from the target qubit back onto the control
Notation reminder. A subscript like or just labels which physical qubit that factor belongs to; it carries no extra meaning beyond “this piece of the tensor product lives on qubit .” It only becomes necessary to write once a multi-qubit state has been split into separate factors, since at that point you need a way to say which wire each factor is describing.
Circuit:
q0: |0> --H--*----------
|
q1: |0> --X--P(pi/4)----
What phase kickback is, in plain terms. Normally, a gate applied to qubit A, controlled by qubit B, is expected to change qubit A and leave qubit B alone. Phase kickback is the surprising opposite: qubit A (the target) does not change at all, and qubit B (the control) is the one that picks up a phase. This happens precisely when the target is already sitting in an eigenstate of the gate being controlled.
Why an eigenstate causes this. A state is an eigenstate of a gate if : applying does not move to a different state at all, it can only multiply it by the number . For , the state is exactly such an eigenstate, since by direct inspection of the matrix (the row of is just ).
Now consider a controlled- gate acting on , with q0 as control and q1 (already prepared in the eigenstate ) as target:
- on the branch where q0, the control is off, so the gate does not fire at all, and q1 stays ;
- on the branch where q0, the control is on, so the gate fires on q1. But q1 is , an eigenstate of , so the gate cannot send it anywhere else. All it can do is multiply that entire branch by the eigenvalue .
So the net effect of the whole gate is: the “q0” branch gets multiplied by , and the “q0” branch does not. That is exactly what applying directly to q0 would look like. The phase that conceptually belongs to the target, because it came from the target’s eigenvalue, ends up stamped onto the control instead, since the target itself had nowhere else to go. This is phase kickback, and it is the core mechanism behind quantum phase estimation and the oracle construction used in Grover’s algorithm.
Step 1 (start). .
Step 2 (after on q1). , q1 now holds the eigenstate .
Step 3 (after on q0). on q0, tensor on q1 throughout:
Step 4 (after controlled-, control q0, target q1). The term has control (q0) , so the controlled gate is off and it is untouched. The term has control , so the gate fires: it multiplies the amplitude by , the eigenvalue picked up by target q1, while q1 itself stays exactly , unchanged.
Step 5, factor out q1. Every term still has q1, so the state has not become entangled at all. It factors back apart:
the target state.
Why this is different from every other problem in this file. In Problems 1 through 5, the non-Clifford gate always sits directly on the qubit whose amplitude is being changed. Here the gate is physically applied to q1, yet q1 ends the circuit completely unchanged at ; it is q0, the control, that ends up carrying the non-Clifford phase, purely because the target happened to already be an eigenstate of the gate being controlled. Contrast this directly with Problem 2 of this file, where the controlled-phase gate genuinely entangles the two qubits because neither input qubit was prepared as an eigenstate of the phase gate beforehand. Kickback only produces this clean, unentangled result because the target was deliberately set to an eigenstate first.