Checkpoint-1

System #0

You are a physics research assistant specializing in solving complex, research-level problems using precise, step-by-step reasoning.

Input Problems will be provided in Markdown format.

Output (Markdown format)

  1. Step-by-Step Derivation - Show every non-trivial step in the solution. Justify steps using relevant physical laws, theorems, or mathematical identities.
  2. Mathematical Typesetting - Use LaTeX for all mathematics: $...$ for inline expressions, $$...$$ for display equations.
  3. Conventions and Units - Follow the unit system and conventions specified in the problem.
  4. Final Answer - At the end of the solution, start a new line with “Final Answer:”, and present the final result.

    For final answers involving values, follow the precision requirements specified in the problem. If no precision is specified: - If an exact value is possible, provide it (e.g., \$\sqrt(2)\$, \$\pi/4\$). - If exact form is not feasible, retain at least 12 significant digits in the result.

  5. Formatting Compliance - If the user requests a specific output format (e.g., code, table), provide the final answer accordingly.

User #1

Problem setup:

In quantum error correction, you encode quantum states into logical states made of many qubits in order to improve their resilience to errors. In quantum error detection, you do the same but can only detect the presence of errors and not correct them. In this problem, we will consider a single [[4,2,2]] quantum error detection code, which encodes two logical qubits into four physical qubits, and investigate how robust logical quantum operations in this code are to quantum errors.

Our convention is that the four physical qubits in the [[4,2,2]] code are labelled 0,1,2,3. The two logical qubits are labelled A and B. The stabilizers are \(XXXX\) and \(ZZZZ\), where \(X\) and \(Z\) are Pauli matrices. The logical \(X\) and \(Z\) operators on the two qubits are \(X_A = XIXI\), \(X_B=XXII\), \(Z_A = ZZII\), \(Z_B = ZIZI\), up to multiplication by stabilizers.

We will consider different state preparation circuits consisting of controlled not \(CNOT_{ij}\) gates, where \(CNOT_{ij}\) has control qubit \(i\) and target qubit \(j\). As a simple model of quantum errors in hardware, we will suppose that each \(CNOT_{ij}\) gate in the circuit has a two qubit depolarizing error channel following it that produces one of the 15 non-identity two-qubit Paulis with equal probability \(p/15\). The probability \(p\) indicates the probability of an error in a single two-qubit gate. We will assess the logical infidelity of certain state preparation protocols as a function of the physical infidelity \(p\).

Checkpoints

Checkpoint 1

Suppose that we wish to prepare a logical two-qubit GHZ state \((|00\rangle_{AB}+|11\rangle_{AB})/\sqrt{2}\) in the [[4,2,2]] code. To do so, we use the following state preparation circuit:

\[ (CNOT_{03}) (H_0) (CNOT_{21}) (H_2). \]

Note that this equation is written in matrix multiplication order, while the quantum operations in the circuit occur in the reverse order (from right-to-left in the above equation). \(H\) is a single-qubit Hadamard gate.

What is the physical state fidelity of the final physical 4-qubit state at the end of the circuit as a function of the two-qubit gate error rate \(p\)?

Assistant #2
Reasoning (model)

We are given: “Suppose that we wish to prepare a logical two-qubit GHZ state \((|00\rangle_{AB}+|11\rangle_{AB})/\sqrt{2}\) in the [[4,2,2]] code. To do so, we use the following state preparation circuit:

\[ (CNOT_{03}) (H_0) (CNOT_{21}) (H_2). \]

Note: The equation is written in matrix multiplication order, but the quantum operations occur in reverse order. So the actual circuit order from initial state to final state is: Start with some initial state? Typically, we start with all qubits in |0>. But careful: The problem says: “prepare a logical two-qubit GHZ state”. That state is \((|00\rangle_{AB}+|11\rangle_{AB})/\sqrt{2}\). But note: The code is [[4,2,2]]. So the logical qubits A and B are encoded into 4 physical qubits. The circuit given: (CNOT_{03}) (H_0) (CNOT_{21}) (H_2). But wait: There is no mention of initial state? Usually, we start with all qubits in |0>. But then apply these gates. Let’s check: The circuit: From right to left: First apply H_2, then CNOT_{21}, then H_0, then CNOT_{03}. So the circuit is: Step 1: H on qubit 2. Step 2: CNOT with control 2, target 1. Step 3: H on qubit 0. Step 4: CNOT with control 0, target 3.

We start with state |0000>? But then what is the resulting state? Let’s compute ideal state: Initial: |0>0|0>_1|0>_2|0>_3. After H_2: becomes: |0>_0|0>_1 (H|0>)_2 |0>_3 = |0>_0|0>_1 (|0>+|1>)/√2 _2 |0>_3. After CNOT{21}: control qubit 2, target qubit 1. So: if qubit2 is |0>, then qubit1 remains; if qubit2 is |1>, then flip qubit1. So state becomes: = (|0>0|0>_1|0>_2|0>_3 + |0>_0|1>_1|1>_2|0>_3)/√2. After H_0: Apply H on qubit0. So: = ( (H|0>)_0|0>_1|0>_2|0>_3 + (H|0>)_0|1>_1|1>_2|0>_3 )/√2 = ( (|0>+|1>)/√2 _0|0>_1|0>_2|0>_3 + (|0>+|1>)/√2 _0|1>_1|1>_2|0>_3 )/√2 = 1/√2 * [ 1/√2 (|0000> + |1000>) + 1/√2 (|0110> + |1110>) ]? Wait careful: First term: (|0>+|1>)_0 |0>_1|0>_2|0>_3 = |0000> + |1000>. Second term: (|0>+|1>)_0 |1>_1|1>_2|0>_3 = |0110> + |1110>. So overall: (1/√2)*1/√2 (|0000>+|1000>+|0110>+|1110>) = 1/2 (|0000>+|1000>+|0110>+|1110>). After CNOT{03}: control qubit 0, target qubit 3. So: For each term: |0000>: control 0=0, so target unchanged: |0000>. |1000>: control=1, so flip target: becomes |1001>. |0110>: control=0, so unchanged: |0110>. |1110>: control=1, so flip: becomes |1111>. So final state: 1/2 (|0000> + |1001> + |0110> + |1111>).

Is that the logical GHZ state? The logical GHZ state is (|00>_AB + |11>_AB)/√2. But what are the logical states? The code is [[4,2,2]]. The logical operators: X_A = XIXI, X_B=XXII, Z_A=ZZII, Z_B=ZIZI. We need to check: What are the code words? The stabilizers are XXXX and ZZZZ. So the code space is 4-dimensional? Actually, [[4,2,2]] means: n=4, k=2, d=2. So there are 2 logical qubits, so 4 logical states. They are usually: |00>_L = (|0000>+|1111>)/√2? But careful: The stabilizers: XXXX and ZZZZ. The code space is the subspace of 4 qubits that are +1 eigenstates of both XXXX and ZZZZ. Check: For state |0000>, XXXX|0000> = |1111>, so not eigenstate. So |0000> is not in code space. Actually, the code words: One common representation: |00>_L = (|0000>+|1111>)/√2, |01>_L = (|0011>+|1100>)/√2, |10>__L = (|0101>+|1010>)/√2, |11>_L = (|0110>+|1001>)/√2. But check: Our final state: 1/2 (|0000>+|1001>+|0110>+|1111>). That equals? Group: (|0000>+|1111>)/2 + (|1001>+|0110>)/2. That is (|00>_L + |11>_L)/√2? Because |00>_L = (|0000>+|1111>)/√2, and |11>_L = (|0110>+|1001>)/√2. So indeed, our state is (1/√2)(|00>_L + |11>_L)/? Actually: (1/2)(|0000>+|1111>) = (1/√2)|00>_L/√2? Wait: |00>_L = (|0000>+|1111>)/√2, so (|0000>+|1111>)/2 = (1/√2)|00>_L. Similarly, (|1001>+|0110>)/2 = (1/√2)|11>_L. So overall state = 1/√2 (|00>_L + |11>_L). So it is the logical GHZ state. So circuit is correct.

Now: We want: “What is the physical state fidelity of the final physical 4-qubit state at the end of the circuit as a function of the two-qubit gate error rate p?” Interpretation: The circuit has gates: H_2, CNOT_{21}, H_0, CNOT_{03}. But note: The problem says: “each CNOT_{ij} gate in the circuit has a two qubit depolarizing error channel following it that produces one of the 15 non-identity two-qubit Paulis with equal probability p/15.” But wait: What about Hadamard gates? They are single-qubit gates. Are they error-free? The problem statement: “As a simple model of quantum errors in hardware, we will suppose that each CNOT_{ij} gate in the circuit has a two qubit depolarizing error channel following it that produces one of the 15 non-identity two-qubit Paulis with equal probability p/15.” So only CNOT gates have errors. The Hadamard gates are perfect? That is implied: “each CNOT_{ij} gate” so only CNOT gates have errors. So there are two CNOT gates: CNOT_{21} and CNOT_{03}. So each of these gates is followed by an error channel that with probability p applies a random two-qubit Pauli error on the two qubits involved (the control and target). And with probability 1-p, no error. And the error is one of the 15 non-identity Paulis, each with probability p/15.

We want: “the physical state fidelity” of the final physical state. Fidelity is between the ideal state (which is the state we get if no errors occur) and the actual state (which is a mixed state due to errors). But careful: “physical state fidelity” might mean the fidelity of the actual output state to the ideal state. But the actual output state is a density matrix that comes from applying the circuit with errors. So we need to compute: ρ_actual = E_{circuit}(|0000><0000|) where E_{circuit} is the composition of perfect gates and error channels. But note: The error channels act after each CNOT. So the process: Start: |0><0|^⊗4. Then apply H_2 (perfect). Then apply CNOT_{21} (perfect) followed by error channel on qubits 2 and 1. That error channel: With probability 1-p, identity; with probability p, a random Pauli from {I,X,Y,Z}⊗{I,X,Y,Z} minus II? Actually: “non-identity two-qubit Paulis” so there are 15. So each occurs with probability p/15. Then apply H_0 (perfect). Then apply CNOT_{03} (perfect) followed by error channel on qubits 0 and 3.

So we want the fidelity F = <ψ_ideal| ρ_actual |ψ_ideal> where |ψ_ideal> = 1/2 (|0000>+|1001>+|0110>+|1111>).

We need to compute ρ_actual. Because errors are Pauli errors, and the ideal state is a stabilizer state? Actually, the ideal state is a code state of the [[4,2,2]] code? But careful: The ideal state is not a pure stabilizer state? Actually, it is a logical GHZ state. But it is a superposition of two code words. But it is still a stabilizer state? Possibly we can compute the effect of Pauli errors on it.

Alternatively, we can compute the evolution step by step. But note: The errors are applied after each CNOT. And they are depolarizing channels on two qubits. So we can compute the overall channel as a composition. But careful: The gates are not all CNOTs? But we can compute the effect of errors on the final state. Alternatively, we can compute the probability that no error occurs? But errors might cancel? But since errors are random Paulis, they will generally take the state out of the ideal state. But wait: Some errors might be undetectable? But we are computing physical state fidelity, not logical fidelity. Physical state fidelity is the overlap between the actual state and the ideal state. That is: F = Tr(ρ_ideal ρ_actual). And ρ_ideal = |ψ><ψ|.

Because the errors are Pauli errors, and the ideal state is a specific state, we can compute the average fidelity. Actually, the process is: The circuit is a unitary U (ideal circuit). Then errors occur at two steps. So the actual state is: ρ = E_2 ∘ U_2 ∘ E_1 ∘ U_1 (|0><0|) where U_1 = CNOT_{21} after H_2? Actually, careful: The order: Step 1: H_2. So state becomes: ρ1 = H_2 |0><0| H_2† on qubit2, others unchanged. Step 2: CNOT_{21} (perfect). So ρ2 = CNOT_{21} ρ1 CNOT_{21}†. Step 3: Error channel on qubits 2 and 1: This is a depolarizing channel on these two qubits. So ρ3 = (1-p) ρ2 + (p/15) * sum_{P in Paulis on {2,1}, P ≠ I⊗I} P ρ2 P†. Step 4: H_0. So ρ4 = H_0 ρ3 H_0†. Step 5: CNOT_{03} (perfect). So ρ5 = CNOT_{03} ρ4 CNOT_{03}†. Step 6: Error channel on qubits 0 and 3: ρ_final = (1-p) ρ5 + (p/15) * sum_{Q in Paulis on {0,3}, Q ≠ I⊗I} Q ρ5 Q†.

We want F = <ψ| ρ_final |ψ>.

Because the ideal state |ψ> is produced by the ideal circuit, we can also think: Let U = overall ideal circuit. Then |ψ> = U|0000>. And the actual process is: ρ_final = U (with errors inserted) applied to |0><0|. But careful: The errors are applied in the middle. But we can “push” the errors through the later gates? Because the later gates are unitaries. But note: The errors are on specific qubits. And the gates after them are on other qubits? Actually, H_0 acts on qubit 0, but error on qubits 2 and 1 commutes with H_0? Not necessarily? But H_0 acts only on qubit 0, so it commutes with any operator on qubits 2 and 1. So indeed, the error on qubits 2 and1 commutes with H_0. And then CNOT_{03} acts on qubits 0 and 3. Does it commute with an error on qubits 2 and 1? Yes, because they act on disjoint sets. So we can actually push the first error channel to the end? But careful: The error channel is applied after the CNOT_{21}. But then we have H_0 and CNOT_{03}. Since these gates commute with operators on qubits 2 and 1, we can actually move the error channel to after the entire circuit? But wait: The error channel is applied to the state after CNOT_{21}. But if we conjugate that error by the subsequent unitaries that act on other qubits, they remain the same because they commute. So indeed, we can say: The overall effect is that the ideal circuit U is applied, but then we have an error channel on qubits 2 and 1 (but now the error operators are conjugated by U? Actually, careful: We have: ρ_final = (Error on 0,3) ∘ CNOT_{03} ∘ H_0 ∘ (Error on 2,1) ∘ CNOT_{21} ∘ H_2 (|0><0|). But since H_0 and CNOT_{03} commute with any operator on qubits 2 and 1, we can write: ρ_final = (Error on 0,3) ∘ CNOT_{03} ∘ H_0 ∘ CNOT_{21} ∘ H_2 ∘ (Error on 2,1) (|0><0|)? Not exactly: Because the error on 2,1 is applied after CNOT_{21} but before H_0. But if we want to move it to after H_0, we need to conjugate it by H_0. But H_0 commutes with operators on qubits 2 and 1, so it’s fine. Similarly, CNOT_{03} commutes with operators on qubits 2 and 1. So indeed, we can move the error channel on qubits 2,1 to the very end. But careful: The error channel on qubits 2,1 is defined as: E_{21}(ρ) = (1-p)ρ + (p/15) ∑{P in Paulis on {2,1} excluding II} P ρ P†. And if we move it through H_0 and CNOT{03}, since these act on qubits 0 and 3, they commute with P on qubits 2,1. So indeed, we have: ρ_final = (Error on 0,3) ∘ U ∘ (Error on 2,1) (|0><0|) where U = CNOT_{03} ∘ H_0 ∘ CNOT_{21} ∘ H_2. But wait: Check order: Initially: H_2, then CNOT_{21}, then Error on 2,1, then H_0, then CNOT_{03}, then Error on 0,3. So if we move Error on 2,1 to after H_0, it becomes: H_0 ∘ Error on 2,1 = Error on 2,1 ∘ H_0 because H_0 commutes. Similarly, moving through CNOT_{03} gives: CNOT_{03} ∘ Error on 2,1 = Error on 2,1 ∘ CNOT_{03}. So then the entire sequence becomes: Error on 0,3 ∘ CNOT_{03} ∘ H_0 ∘ CNOT_{21} ∘ H_2 ∘ Error on 2,1. But that is U ∘ Error on 2,1? Actually careful: U = CNOT_{03} ∘ H_0 ∘ CNOT_{21} ∘ H_2. So then ρ_final = Error on 0,3 ∘ U ∘ Error on 2,1 (|0><0|). But then we can also move Error on 2,1 to after U? But careful: U acts on all qubits. But Error on 2,1 acts only on qubits 2 and 1. Does U commute with operators on qubits 2 and 1? Not necessarily: U includes CNOT_{03} and H_0. Those act on qubits 0 and 3, so they commute with operators on qubits 2 and 1. But U also includes CNOT_{21} and H_2. Those act on qubits 2 and 1. So if we try to move Error on 2,1 through U, we would get: U ∘ Error on 2,1 = (CNOT_{03} ∘ H_0 ∘ CNOT_{21} ∘ H_2) ∘ Error on 2,1. But CNOT_{21} and H_2 do not commute with an arbitrary Pauli on qubits 2 and 1? Actually, they do: Because if we conjugate a Pauli on qubits 2 and 1 by CNOT_{21} and H_2, we get another Pauli on qubits 2 and 1. But then it’s not the same error channel? But wait: The error channel is defined as: E_{21}(ρ) = (1-p)ρ + (p/15) ∑{P} P ρ P†. If we conjugate this channel by a unitary V that acts on qubits 2 and 1, then V E{21}(V† ρ V) V† = (1-p)ρ + (p/15) ∑{P} (V P V†) ρ (V P V†)†. But that is actually the same set because as P runs over all non-identity Paulis on two qubits, so does V P V† (since Clifford group acts transitively on Paulis). So indeed, if V is a Clifford gate on those qubits, then V E{21} V† = E_{21}? Check: For a depolarizing channel, it is invariant under unitary conjugation by Clifford gates? Actually, the two-qubit depolarizing channel is: ρ -> (1-p)ρ + (p/15) ∑{P ≠ I} P ρ P. Under conjugation by a Clifford unitary U, we get: U ρ U† -> (1-p)UρU† + (p/15) ∑{P ≠ I} U P U† UρU† (U P U†)† = (1-p)ρ’ + (p/15) ∑{Q ≠ I} Q ρ’ Q, because the set {U P U†} is exactly the set of all non-identity Paulis (if U is Clifford). So yes, the depolarizing channel is invariant under conjugation by Clifford gates that act on the same qubits. But careful: Our U is not entirely on qubits 2 and 1; it has parts on qubits 0 and 3. But those commute. So we can actually move the error channel through U if we conjugate it appropriately. But then we would get: ρ_final = Error on 0,3 ∘ (U ∘ Error on 2,1 ∘ U†) ∘ U (|0><0|) = Error on 0,3 ∘ (U Error on 2,1 U†) ∘ (U|0><0|U†). And since U Error on 2,1 U† is a depolarizing channel on qubits 2 and 1? But careful: U includes gates on qubits 2 and 1: H_2 and CNOT{21}. So U Error on 2,1 U† will be a channel on qubits 2 and 1 that is still depolarizing? Actually, check: U = CNOT_{03} ∘ H_0 ∘ CNOT_{21} ∘ H_2. But note: CNOT_{03} and H_0 commute with operators on qubits 2 and 1. So U Error on 2,1 U† = (CNOT_{03} H_0) ∘ (CNOT_{21} H_2) Error on 2,1 (H_2† CNOT_{21}†) ∘ (H_0† CNOT_{03}†). And since CNOT_{03} H_0 commutes with anything on qubits 2,1, this is equal to (CNOT_{21} H_2) Error on 2,1 (H_2† CNOT_{21}†). And as argued, for a Clifford gate on two qubits, the depolarizing channel is invariant. So indeed, U Error on 2,1 U† = Error on 2,1. So then we get: ρ_final = Error on 0,3 ∘ Error on 2,1 ∘ (U|0><0|U†) = Error on 0,3 ∘ Error on 2,1 (|ψ><ψ|), where |ψ> is the ideal state. So the overall effect is that the ideal state is first subjected to a depolarizing channel on qubits 2 and 1, and then to a depolarizing channel on qubits 0 and 3. And these two channels commute because they act on disjoint sets. So then: ρ_final = E_{0,3} ∘ E_{2,1} (|ψ><ψ|).

And these channels are independent. And they are two-qubit depolarizing channels: E(ρ) = (1-p)ρ + (p/15) ∑_{P in Paulis on that pair, P ≠ II} P ρ P.

So then the fidelity F = <ψ| ρ_final |ψ> = <ψ| E_{0,3} ∘ E_{2,1} (|ψ><ψ|) |ψ>.

And because these channels are acting on disjoint qubits, we can compute the effect on the overlap. In general, if we have a state |ψ> and a depolarizing channel on a subset of qubits, the fidelity is: F = Tr( |ψ><ψ| E(ρ) ) = (1-p) + (p/15) ∑{P} <ψ| P |ψ><ψ| P |ψ>? Actually careful: E(ρ) = (1-p)ρ + (p/15) ∑{P ≠ I} P ρ P. So <ψ| E(ρ) |ψ> = (1-p) + (p/15) ∑{P ≠ I} <ψ| P |ψ><ψ| P |ψ>? But that is if ρ = |ψ><ψ|. But wait: Actually, careful: For a given Pauli P acting on a set of qubits, we have: <ψ| P |ψ><ψ| P |ψ> is not necessarily |<ψ|P|ψ>|^2? Actually, since |ψ> is a pure state, Tr(|ψ><ψ| P |ψ><ψ| P) = |<ψ|P|ψ>|^2. So indeed, F = (1-p) + (p/15) ∑{P ≠ I} |<ψ|P|ψ>|^2.

But careful: This is if the depolarizing channel acts on all qubits that P acts on. But here we have two separate channels on disjoint sets. And they commute. So overall, if we apply two independent depolarizing channels on disjoint sets, then the fidelity becomes: F = <ψ| E_{0,3} ∘ E_{2,1} (|ψ><ψ|) |ψ> = = (1-p)^2? Not exactly because the errors from different channels can combine? Actually, because they act on disjoint sets, the overall channel is: ρ -> (1-p)^2 ρ + (1-p)(p/15) ∑{P on {0,3} non-I} P ρ P + (1-p)(p/15) ∑{Q on {2,1} non-I} Q ρ Q + (p/15)^2 ∑{P on {0,3} non-I} ∑{Q on {2,1} non-I} (P Q) ρ (P Q). Then fidelity = <ψ|ρ|ψ> = (1-p)^2 + (1-p)(p/15) [∑{P on {0,3}} |<ψ|P|ψ>|^2] + (1-p)(p/15) [∑{Q on {2,1}} |<ψ|Q|ψ>|^2] + (p/15)^2 [∑{P on {0,3}} ∑{Q on {2,1}} |<ψ|P Q|ψ>|^2].

But careful: The sums are over non-identity Paulis. So we need to compute these overlaps for our state |ψ> = 1/2 (|0000>+|1001>+|0110>+|1111>).

Let’s denote qubits: 0,1,2,3. Our state: |ψ> = (|0000> + |1001> + |0110> + |1111>)/2.

We want to compute <ψ| P |ψ> for various Paulis. But note: Paulis that act on disjoint sets: There are Paulis on qubits {0,3} and on qubits {2,1}. And also products from both sets.

Because the state is symmetric? Actually, it might be easier to compute the expectation values of Paulis on these pairs. Alternatively, we can compute the density matrix of |ψ><ψ| on each pair? But careful: The state is entangled across these pairs. But we can compute the reduced density matrices on qubits {0,3} and on qubits {2,1}? But then the expectation of a Pauli on {0,3} is Tr(ρ_{03} P). But then we need to sum over all non-identity Paulis on that pair. But then we need to compute Tr(ρ_{03} P) for each P. But careful: That gives <ψ|P|ψ> if P acts only on qubits 0 and 3. But then we need to sum |<ψ|P|ψ>|^2? Actually, careful: The fidelity term is: (p/15) * ∑{P on {0,3} non-I} |<ψ|P|ψ>|^2. But if we compute Tr(ρ{03} P), that is exactly <ψ|P|ψ> because P acts only on qubits 0 and 3. So then we need to compute these for all Paulis on two qubits. There are 15 such Paulis. But maybe we can compute the reduced density matrix ρ_{03} explicitly. Similarly for qubits {2,1}.

Let’s compute ρ_{03} from |ψ>. |ψ> = 1/2 (|0000> + |1001> + |0110> + |1111>). To get ρ_{03}, we trace out qubits 1 and 2. Write basis for qubits 0,3: |00>, |01>, |10>, |11>. The state |ψ> in terms of qubits 1,2 and 0,3: |ψ> = 1/2 ( |0>0|0>_3 |00>{12} + |1>0|0>_3? Actually careful: Term1: |0000> = |0>_0|0>_1|0>_2|0>_3 = |00>{03} ⊗ |00>{12}? But careful: Order: qubits: 0,1,2,3. So if we group as (0,3) and (1,2), then: |0000> = |0>_0|0>_3 ⊗ |0>_1|0>_2 = |00>{03} ⊗ |00>{12}. Term2: |1001> = |1>_0|0>_1|0>_2|1>_3 = |10>{03}? Actually: qubit0=1, qubit3=1 gives |11>? Wait: careful: For qubits 0 and 3, the basis order: usually we list qubit0 then qubit3. So |1001> means: qubit0=1, qubit1=0, qubit2=0, qubit3=1. So in the (0,3) group, that is: qubit0=1, qubit3=1, so that is |11>{03}? But then qubits (1,2): qubit1=0, qubit2=0 gives |00>{12}. So actually, |1001> = |11>{03} ⊗ |00>{12}? But wait: That would be if qubit0=1 and qubit3=1, then it’s |11> but careful: The basis for two qubits: usually |00>, |01>, |10>, |11>. So if qubit0=1 and qubit3=1, then that is |11> indeed. But then term3: |0110> = |0>0|1>_1|1>_2|0>_3 = |00>{03}? Because qubit0=0, qubit3=0 gives |00>{03} and qubits (1,2): qubit1=1, qubit2=1 gives |11>{12}. Term4: |1111> = |1>0|1>_1|1>_2|1>_3 = |11>{03} ⊗ |11>{12}. So then |ψ> = 1/2 ( |00>{03}|00>{12} + |11>{03}|00>{12} + |00>{03}|11>{12} + |11>{03}|11>{12} ) = 1/2 ( (|00>{03}+|11>{03}) ⊗ |00>{12} + (|00>{03}+|11>{03}) ⊗ |11>{12} )? That would be = 1/2 (|00>{03}+|11>{03}) ⊗ (|00>{12}+|11>{12}). But wait, check: That gives: 1/2 (|00>|00> + |00>|11> + |11>|00> + |11>|11>) which is exactly our state? But then that would mean that |ψ> is a product state between pairs (0,3) and (1,2)? But is that true? Actually, our state is: |ψ> = 1/2 (|0000>+|1001>+|0110>+|1111>). But if we write it as (|00>{03}+|11>{03})/√2 ⊗ (|00>{12}+|11>{12})/√2, then that product is 1/2 (|00>|00> + |00>|11> + |11>|00> + |11>|11>). But our state has terms: |0000>, |1001>, |0110>, |1111>. But careful: |1001> means: qubit0=1, qubit1=0, qubit2=0, qubit3=1. In the grouping (0,3) and (1,2), |1001> becomes: (qubit0,qubit3) = (1,1) so that is |11>{03} and (qubit1,qubit2) = (0,0) so that is |00>{12}. So that matches: |11>{03} ⊗ |00>{12}. And |0110> becomes: (0,0) and (1,1) so that is |00>{03} ⊗ |11>{12}. So indeed, |ψ> = (|00>{03}+|11>{03})/√2 ⊗ (|00>{12}+|11>{12})/√2. So the state factorizes into two Bell states on pairs (0,3) and (1,2)! That is interesting. So then: ρ{03} = Tr_{12}(|ψ><ψ|) = the density matrix of the Bell state on qubits 0 and 3? Actually, careful: |ψ> = |Φ^+>{03} ⊗ |Φ^+>{12} where |Φ^+> = (|00>+|11>)/√2. So then ρ_{03} = |Φ^+><Φ^+|{03} because tracing out the other pair gives 1. Similarly, ρ{12} = |Φ^+><Φ^+|_{12}.

So then we can compute the overlaps for Paulis on qubits 0 and 3. For a two-qubit Pauli on qubits 0 and 3, we want <ψ|P|ψ> = Tr(ρ_{03} P) because P acts only on qubits 0 and 3. And since ρ_{03} is the Bell state |Φ^+><Φ^+|, we know that for Paulis on two qubits, the expectation values are: For Bell state |Φ^+> = (|00>+|11>)/√2, we have: <Φ^+| I⊗I |Φ^+> = 1. <Φ^+| X⊗X |Φ^+> = 1? Actually, check: (X⊗X)|Φ^+> = (|11>+|00>)/√2 = |Φ^+>, so expectation = 1. <Φ^+| Y⊗Y |Φ^+> = ? (Y⊗Y)|Φ^+> = (i)(-i) (|11> - |00>?) Actually, compute properly: Y|0> = i|1>, Y|1> = -i|0>. So Y⊗Y|00> = i * i |11> = -|11>. Y⊗Y|11> = (-i)(-i)|00> = -|00>. So Y⊗Y|Φ^+> = -(|11>+|00>)/√2 = -|Φ^+>, so expectation = -1. <Φ^+| Z⊗Z |Φ^+> =? Z⊗Z|00> = |00>, Z⊗Z|11> = |11>, so expectation = 1. What about Paulis that are not symmetric? For example, I⊗X: (I⊗X)|Φ^+> = (|01>+|10>)/√2 = |Ψ^+>, so expectation = <Φ^+|Ψ^+> = 0. Similarly, any Pauli that is not of the form A⊗A? Actually, for Bell state, the only nonzero expectations are for Paulis that are in the stabilizer of the Bell state? Actually, the Bell state |Φ^+> is stabilized by X⊗X and Z⊗Z (and -Y⊗Y). So indeed, the expectation values are: For Pauli P on two qubits, <Φ^+|P|Φ^+> is nonzero only if P is I⊗I, X⊗X, Y⊗Y, Z⊗Z. And then: I⊗I: 1 X⊗X: 1 Y⊗Y: -1 Z⊗Z: 1. But careful: That is for the Bell state |Φ^+> = (|00>+|11>)/√2. So then |<ψ|P|ψ>|^2 for P on qubits 0,3: If P = I⊗I, but that’s identity, so not included in error sum. For P = X⊗X: squared = 1. For P = Y⊗Y: squared = 1. For P = Z⊗Z: squared = 1. For any other Pauli on qubits 0,3, the expectation is 0. So there are 3 Paulis on qubits 0,3 that give nonzero squared overlap of 1. But wait: There are 15 non-identity Paulis. Among them, how many are of the form A⊗A? Actually, the Paulis on two qubits: They are products of Paulis on each qubit. The ones that are “symmetric” in the sense that they are the same on both qubits? That gives: X⊗X, Y⊗Y, Z⊗Z. Also what about I⊗X? That is not symmetric. So indeed, only these 3 give nonzero expectation. But wait: Also what about X⊗I? That gives 0. So yes. So for the depolarizing channel on qubits 0 and 3, the contribution to fidelity is: (1-p) from the no-error part? Actually, careful: The channel on qubits 0,3: E_{03}(ρ) = (1-p)ρ + (p/15) ∑{P in Paulis on {0,3} non-I} P ρ P. So if we apply this to |ψ><ψ|, then <ψ| E{03}(|ψ><ψ|) |ψ> = (1-p) + (p/15) ∑_{P non-I} |<ψ|P|ψ>|^2 = (1-p) + (p/15)3 = 1-p + p/5 = 1 - (4/5)p. But wait: That is if we only had errors on qubits 0,3. But we also have errors on qubits 2,1. And similarly, for qubits 2,1, since ρ_{12} is also a Bell state (|Φ^+> on qubits 1,2), the same analysis applies: For any Pauli on qubits 1,2 that is not identity, only those that are X⊗X, Y⊗Y, Z⊗Z give expectation 1, and others give 0. So similarly, if we only had errors on qubits 2,1, the fidelity would be 1 - (4/5)p.

But careful: These channels are applied sequentially. And they act on disjoint sets. And because the state factorizes as |ψ> = |Φ^+>{03} ⊗ |Φ^+>{12}, the effect of the depolarizing channel on qubits 0,3 only affects the first factor, and similarly for qubits 2,1. And these channels are independent. So then the overall fidelity after both channels is the product? But careful: The channels are not necessarily giving a fidelity that multiplies because the errors are not necessarily independent in the sense of fidelity? Actually, if we have two independent depolarizing channels on two separate subsystems, and the ideal state is a product state, then the fidelity is the product of the fidelities from each channel. But here our state is a product state: |ψ> = |Φ^+>{03} ⊗ |Φ^+>{12}. And the depolarizing channel on qubits 0,3 acts only on the first factor, and similarly on qubits 2,1 on the second factor. And these channels are applied independently. So then the overall state becomes: ρ = E_{03}(|Φ^+><Φ^+|) ⊗ E_{12}(|Φ^+><Φ^+|). And then the fidelity F = Tr( (|Φ^+><Φ^+| ⊗ |Φ^+><Φ^+|) ρ ) = [Tr(|Φ^+><Φ^+| E_{03}(|Φ^+><Φ^+|))] * [Tr(|Φ^+><Φ^+| E_{12}(|Φ^+><Φ^+|))] because the state is product. And each of those is 1 - (4/5)p. So then overall fidelity would be (1 - (4/5)p)^2. But wait: Is that correct? Let’s check: Our derivation earlier using moving errors to the end gave: ρ_final = E_{0,3} ∘ E_{2,1} (|ψ><ψ|). And since these channels act on disjoint qubits, they commute. And if |ψ> is a product state between these two pairs, then indeed E_{0,3} ∘ E_{2,1} (|ψ><ψ|) = E_{0,3}(|Φ^+><Φ^+|) ⊗ E_{2,1}(|Φ^+><Φ^+|). And then fidelity = F_{03} * F_{12} where F_{03} = <Φ^+| E_{0,3}(|Φ^+><Φ^+|) |Φ^+> = 1 - (4/5)p, and similarly for the other. So then overall fidelity = (1 - (4/5)p)^2. But wait: There is also the possibility of errors from both channels simultaneously? That is included in the product because (1-p)^2 term gives fidelity 1, and cross terms: (1-p)(p/15)3 from first and similarly from second give? Actually, let’s derive properly: E_{03}(ρ) = (1-p)ρ + (p/15) ∑{P in {0,3} non-I} P ρ P. So if ρ = |Φ^+><Φ^+|, then F{03} = (1-p) + (p/15)3 = 1-p + p/5 = 1 - 4p/5. Similarly, F_{12} = 1 - 4p/5. And since the channels are independent, the overall effect on the product state is: ρ_final = [ (1-p)^2 + … ] Actually, careful: The combined channel is: E_{03} ∘ E_{12} (ρ_{03} ⊗ ρ_{12}) = E_{03}(ρ_{03}) ⊗ E_{12}(ρ_{12}) because they act on different subsystems. So then fidelity = F_{03} * F_{12} = (1 - 4p/5)^2. So that seems to be the answer.

But wait: Is that the physical state fidelity? That is the overlap between the ideal state and the actual state. But careful: The actual state is not necessarily a product state? But it is because the errors act independently on disjoint sets. So yes.

But wait: There is also the possibility that errors from different gates could cancel? But no, because we are averaging over errors. So the fidelity is the average over error patterns. And since errors are independent, the average fidelity is indeed the product of the fidelities from each error channel? But careful: The fidelity of a channel applied to a pure state is defined as F = ∫ <ψ| E(|ψ><ψ|) |ψ> d(error) but here we are computing exactly that: E(|ψ><ψ|) is a mixture. And we computed that as (1-p)^2 |ψ><ψ| + … and then <ψ| that gives (1-p)^2 + … and that equals (1 - 4p/5)^2? Let’s check by expanding: From two independent depolarizing channels on two disjoint pairs, the overall effect on |ψ><ψ| is: With probability (1-p)^2: no error -> fidelity contribution: (1-p)^2. With probability (1-p)(p/15) from first channel error (and no error on second): There are 15 such terms from first channel, but only 3 give nonzero overlap of 1, and the other 12 give 0. So contribution: (1-p)(p/15)3 = (1-p)p/5. Similarly, from second channel error (and no error on first): contribution: (1-p)p/5. With probability (p/15)^2 from both channels errors: There are 1515 =225 terms. But careful: The overlap <ψ| (P ⊗ Q) |ψ><ψ| (P ⊗ Q) |ψ> = |<ψ|P⊗Q|ψ>|^2. And since |ψ> = |Φ^+>{03} ⊗ |Φ^+>{12}, we have <ψ|P⊗Q|ψ> = <Φ^+|P|Φ^+> * <Φ^+|Q|Φ^+>. So this is nonzero only if both P and Q are among the ones that give ±1. That is, P must be one of {X⊗X, Y⊗Y, Z⊗Z} on qubits 0,3, and Q must be one of {X⊗X, Y⊗Y, Z⊗Z} on qubits 1,2. So there are 33 = 9 terms. And each gives product: (<Φ^+|P|Φ^+>)^2 * (<Φ^+|Q|Φ^+>)^2. But note: (<Φ^+|P|Φ^+>)^2 is always 1 because even if it is -1, squared gives 1. So each such term gives 1. So contribution from both errors: (p/15)^2 * 9 = p^2/25. So total fidelity = (1-p)^2 + 2(1-p)*p/5 + p^2/25 = (1 - 2p + p^2) + (2p/5 - 2p^2/5) + p^2/25 = 1 - 2p + p^2 + 0.4p - 0.4p^2 + 0.04p^2 = 1 - 1.6p + (1 - 0.4 + 0.04)p^2 = 1 - 1.6p + 0.64p^2 = (1 - 0.8p)^2. And 0.8p = 4p/5. So indeed F = (1 - 4p/5)^2. So the physical state fidelity is (1 - 4p/5)^2.

But wait: Is that the answer? That is the fidelity of the output state to the ideal state. But the problem asks: “What is the physical state fidelity of the final physical 4-qubit state at the end of the circuit as a function of the two-qubit gate error rate p?” So answer: F = (1 - 4p/5)^2.

But wait: There is also the possibility of errors from the Hadamard gates? But the problem says only CNOT gates have errors. So that’s it.

Thus answer for Subproblem 1: F = (1 - 4p/5)^2.

But wait: The problem might expect an expression in terms of p. So I’ll put: Final Answer: \boxed{(1 - \frac{4p}{5})^2}

But let me double-check: The circuit has two CNOT gates. Each CNOT gate error channel acts on two qubits. And we showed that by moving the errors to the end, the overall effect is two independent depolarizing channels on the pairs (0,3) and (2,1). And since the ideal state is a product of Bell states on these pairs, the fidelity from a depolarizing channel on a Bell state is: F_Bell = 1 - 4/5 p? Actually, for a two-qubit depolarizing channel on a Bell state, the fidelity is: (1-p) + (p/15)*3 = 1 - p + p/5 = 1 - 4p/5. And since they are independent, overall fidelity is product: (1 - 4p/5)^2. That seems correct.

So I’ll answer that.

Thus for Subproblem 1:

Step 1. Understand the Circuit and Ideal State

The goal is to prepare the logical GHZ state:

\[ |\psi_{\text{ideal}}\rangle = \frac{|00\rangle_{AB} + |11\rangle_{AB}}{\sqrt{2}} \]

in the \([[4,2,2]]\) code, using the circuit:

\[ (\text{CNOT}_{03}) (H_0) (\text{CNOT}_{21}) (H_2) \]

The operations are applied from right to left:

  1. Apply \(H_2\) (Hadamard on qubit 2)
  2. Apply \(\text{CNOT}_{21}\) (control qubit 2, target qubit 1)
  3. Apply \(H_0\) (Hadamard on qubit 0)
  4. Apply \(\text{CNOT}_{03}\) (control qubit 0, target qubit 3)

Starting from the initial state \(|0000\rangle\), the ideal output is:

\[ |\psi\rangle = \frac{1}{2} \left( |0000\rangle + |1001\rangle + |0110\rangle + |1111\rangle \right) \]

This is equivalent to:

\[ |\psi\rangle = |\Phi^+\rangle_{03} \otimes |\Phi^+\rangle_{12}, \quad \text{where} \quad |\Phi^+\rangle = \frac{|00\rangle + |11\rangle}{\sqrt{2}} \]

Step 2. Model the Errors

Each CNOT gate is followed by a two-qubit depolarizing error channel:

  • With probability \(1 - p\), no error occurs.
  • With probability \(p\), a non-identity two-qubit Pauli error occurs, chosen uniformly from the 15 possibilities.

The error channels act on the qubit pairs involved in each CNOT:

  • After \(\text{CNOT}_{21}\): error channel on qubits 2 and 1
  • After \(\text{CNOT}_{03}\): error channel on qubits 0 and 3

Hadamard gates are assumed to be error-free.


Step 3. Simplify the Error Analysis

Since the later gates (\(H_0\) and \(\text{CNOT}_{03}\)) act on qubits disjoint from those affected by the first error channel, we can commute the first error channel to the end of the circuit. Similarly, the second error channel already acts at the end.

Thus, the overall effect is equivalent to applying the ideal circuit \(U\) followed by two independent depolarizing channels:

  • \(E_{21}\): acts on qubits 2 and 1
  • \(E_{03}\): acts on qubits 0 and 3

So the final state is:

\[ \rho_{\text{final}} = E_{03} \circ E_{21} \left( |\psi\rangle\langle\psi| \right) \]

Since the ideal state factors as:

\[ |\psi\rangle = |\Phi^+\rangle_{03} \otimes |\Phi^+\rangle_{12} \]

and the error channels act on disjoint qubit pairs, we have:

\[ \rho_{\text{final}} = E_{03}(|\Phi^+\rangle\langle\Phi^+|)_{03} \otimes E_{21}(|\Phi^+\rangle\langle\Phi^+|)_{12} \]

Step 4. Compute the Fidelity from One Depolarizing Channel

The two-qubit depolarizing channel on a pair of qubits is:

\[ E(\rho) = (1 - p)\rho + \frac{p}{15} \sum_{P \neq I \otimes I} P \rho P^\dagger \]

For a Bell state \(|\Phi^+\rangle\), the fidelity is:

\[ F = \langle \Phi^+ | E(|\Phi^+\rangle\langle\Phi^+|) | \Phi^+ \rangle = (1 - p) + \frac{p}{15} \sum_{P \neq I \otimes I} |\langle \Phi^+ | P | \Phi^+ \rangle|^2 \]

Only the Pauli operators \(X \otimes X\), \(Y \otimes Y\), and \(Z \otimes Z\) have non-zero overlap with \(|\Phi^+\rangle\), and each gives \(|\langle \Phi^+ | P | \Phi^+ \rangle|^2 = 1\). There are 3 such operators, so:

\[ F = 1 - p + \frac{3p}{15} = 1 - \frac{4p}{5} \]

Step 5. Combine the Two Independent Error Channels

Since the error channels act on independent subsystems, the overall fidelity is the product of the individual fidelities:

\[ F_{\text{total}} = \left(1 - \frac{4p}{5}\right) \cdot \left(1 - \frac{4p}{5}\right) = \left(1 - \frac{4p}{5}\right)^2 \]

Final Answer:

\[ \boxed{\left(1 - \frac{4p}{5}\right)^2} \]
User #3

Populate your final answer into the code template provided below. This step is purely for formatting/display purposes. No additional reasoning or derivation should be performed. Do not import any modules or packages beyond what is provided in the template.

import sympy as sp

p = sp.symbols('p')

def answer(p):
    r"""
    Return the expression of the physical state fidelity of the final physical 4-qubit state
    at the end of the circuit as a function of the two-qubit gate error rate $p$.

    Inputs
    ----------
    p: sympy.Symbol, two-qubit gate error rate $p$

    Outputs
    ----------
    F_physical: sympy.Expr, the physical state fidelity of the final physical 4-qubit state
    """

    # ------------------ FILL IN YOUR RESULTS BELOW ------------------
    F_physical = ...  # a SymPy expression of inputs
    # ---------------------------------------------------------------

    return F_physical
Assistant #4
Reasoning (model)

We are given a function template to fill. The answer we derived is F_physical = (1 - 4p/5)^2. We need to express this in SymPy. Note: We are to return a SymPy expression. Let’s write: (1 - 4p/5)2 But note: We must use SymPy’s rationals to avoid floating point. Alternatively, we can write: (1 - 4p/5)**2 but SymPy will handle the rationals.

However, note that the expression is (1 - (4/5)*p)^2.

Let’s write it as: (1 - 4p/5)*2

But in SymPy, we can use Rational or just let it be.

Since the problem says to use the template, we define:

F_physical = (1 - 4p/5)*2

However, note that 4/5 in Python is 0.8, but we want an exact symbolic expression.

We can use: (1 - (4sp.Rational(1,5))p)**2

Alternatively, we can write: (1 - 4p/5)*2 and SymPy will treat 4/5 as a rational if we use symbols.

But note: p is a symbol, and 4/5 in SymPy is Rational(4,5). So we can write:

F_physical = (1 - 4p/5)*2

However, to be safe, we can use:

F_physical = (1 - (4sp.Rational(1,5))p)**2

But the problem says: “Do not import any modules or packages beyond what is provided in the template.”

The template already imports sympy as sp. So we can use sp.Rational.

Alternatively, we can use:

F_physical = (1 - 4p/5)*2

and since p is a symbol, SymPy will treat 4/5 as a rational.

Let’s test in a SymPy environment:

import sympy as sp p = sp.symbols(‘p’) expr = (1 - 4p/5)2 print(expr) # gives (1 - 4p/5)**2, which is correct.

But note: 4/5 in SymPy is a rational number. So it’s safe.

However, if we want to be extra safe, we can write:

F_physical = (1 - sp.Rational(4,5)p)*2

But the problem does not require one over the other.

I’ll use the simpler form: (1 - 4p/5)*2

Let’s write the code accordingly.

Final Answer:

import sympy as sp

p = sp.symbols('p')

def answer(p):
    r"""
    Return the expression of the physical state fidelity of the final physical 4-qubit state
    at the end of the circuit as a function of the two-qubit gate error rate $p$.

    Inputs
    ----------
    p: sympy.Symbol, two-qubit gate error rate $p$

    Outputs
    ----------
    F_physical: sympy.Expr, the physical state fidelity of the final physical 4-qubit state
    """

    # ------------------ FILL IN YOUR RESULTS BELOW ------------------
    F_physical = (1 - 4*p/5)**2
    # ---------------------------------------------------------------

    return F_physical