1] What is ZX applied to |0>?

2] What is ZX applied to H|0>?
3] Suppose we have a qubit in the state |ψ⟩. We know that if we measure it in the standard basis, the probability of getting a 0 is 29. Now, if we instead first apply a Hadamard gate and then measure the resulting qubit H|ψ⟩ in the sign basis, what is the probability of getting a +?

1] To understand what ZX applied to |0> means, let's break it down.

- The state |0> represents a qubit in the basis state 0, which means it is in the state |0> = [1 0]ᵀ.
- ZX is an operation that combines the Pauli-Z and Pauli-X gates.
- The Pauli-Z gate, represented as Z, acts on the basis states by flipping the sign of the state |1>. It leaves the state |0> unchanged: Z|0> = |0>.
- The Pauli-X gate, represented as X, acts on the basis states by flipping the states: X|0> = |1> and X|1> = |0>.

Therefore, applying the ZX gate to |0> would result in ZX|0> = XZ|0> = X|0> = |1>.

2] Now, let's consider what happens when you apply ZX to H|0>.
- The Hadamard gate, represented as H, operates as follows: H|0> = 1/√2 (|0> + |1>).
- Applying ZX to H|0> means applying ZX to 1/√2 (|0> + |1>).
- Multiplying the ZX operations with the Hadamard gate: ZX(H|0>) = ZX(1/√2 (|0> + |1>)).
- Distributing the ZX operation over the superposition: 1/√2 (ZX|0> + ZX|1>).
- Using the definition of ZX, we know ZX|0> = XZ|0> = X|0> = |1>, and ZX|1> = XZ|1> = X|1> = |0>.

Therefore, ZX(H|0>) = 1/√2 (|1> + |0>) = 1/√2 (|0> + |1>) = H|0>.

3] In this scenario, we start with a qubit |ψ⟩ and measure it in the standard basis, where the probability of getting a 0 is 29%. Then, we apply a Hadamard gate H and measure the resulting qubit H|ψ⟩ in the sign basis, and we are interested in the probability of getting a +.

Let's break it down step by step:
- Initially, we have a qubit |ψ⟩, and we measure it in the standard basis. The probability of getting a 0 is 29%. This means that the amplitude of the state |0⟩ is equal to the square root of the probability, √0.29, while the amplitude of the state |1⟩ is equal to √(1 - 0.29) = √0.71.
- Next, we apply a Hadamard gate H to the qubit H|ψ⟩. This transforms |0⟩ to 1/√2 (|0⟩ + |1⟩) and |1⟩ to 1/√2 (|0⟩ - |1⟩).
- Then, we measure the resulting qubit in the sign basis, which corresponds to measuring in the diagonal basis |+⟩ and |-⟩, where |+⟩ = 1/√2 (|0⟩ + |1⟩) and |-⟩ = 1/√2 (|0⟩ - |1⟩). We are interested in the probability of getting the state |+⟩.
- To calculate the probability of getting the state |+⟩, we need to project the state H|ψ⟩ onto the |+⟩ basis state using the inner product.
- The inner product of H|ψ⟩ and |+⟩ is given by ⟨+|H|ψ⟩.
- Substituting the expressions for |+⟩ and H|ψ⟩, we have ⟨+|H|ψ⟩ = ⟨+|H[√0.29|0⟩ + √0.71|1⟩].
- Expanding the expression, ⟨+|H|ψ⟩ = ⟨+|H[√0.29|0⟩] + ⟨+|H[√0.71|1⟩].
- Since ⟨+| = 1/√2 (⟨0| + ⟨1|), we can rewrite the above expression as 1/√2 (⟨0|H[√0.29|0⟩] + ⟨1|H[√0.71|1⟩]).
- Applying the Hadamard gate H to |0⟩ and |1⟩, we have 1/√2 (⟨0|H[√0.29|0⟩] + ⟨1|H[√0.71|1⟩]) = 1/√2 (⟨0|1/√2 (√0.29|0⟩ + √0.29|1⟩) + ⟨1|1/√2 (√0.71|0⟩ - √0.71|1⟩)).
- Simplifying further, we get 1/√2 (1/√2 (√0.29)⟨0|0⟩ + 1/√2 (√0.29)⟨0|1⟩ + 1/√2 (√0.71)⟨1|0⟩ - 1/√2 (√0.71)⟨1|1⟩).
- The inner products ⟨0|0⟩ and ⟨1|1⟩ are equal to 1, while ⟨0|1⟩ and ⟨1|0⟩ are equal to 0.
- Substituting these values, we have 1/√2 (1/√2 (√0.29) + 0 + 0 - 1/√2 (√0.71)).
- Simplifying further, 1/√2 (0.29 - √0.71) = 0.29/√2 - 1/√2 √0.71.

Therefore, the probability of getting the state |+⟩ is 0.29/√2 - 1/√2 √0.71.