# Tag Info

2

To remove the last gate you can do qc.data.pop(). Example: qc = QuantumCircuit(1) qc.h(0) qc.draw('text') output: ┌───┐ q_0: ┤ H ├ └───┘ Then: qc.data.pop() qc.draw('text') output: q_0:

3

I think your explanation based on the circuit is perfectly adequate. For a more rigorous "proof", why not simply take the output of the circuit? Substitute in $x_i=0$ for all $i$ and see that all the outputs are $(|0\rangle+|1\rangle)/\sqrt{2}$ for $i\neq 1$ and $(|0\rangle+(-1)^{x_1}|1\rangle)/\sqrt{2}$ for $i=1$, exactly as it would be for the ...

3

As you pointed out correctly, both $H^{\otimes n}$ and QFT applied on input state $|0\rangle^{\otimes n}$ return state $$|\psi\rangle = \frac{1}{\sqrt{2^n}}\sum_{i=0}^{2^n}|i\rangle.$$ There is no special reason why $n$ qubit Hadamard gate cannot replace QFT for $|0\rangle^{\otimes n}$ input. Maybe, an author of article about Simon's algorithm wanted to be ...

2

The $\frac{1}{\sqrt{2}}$ is due to the normalization condition which says that sum of the squares of the amplitudes of the must be equal to one while the square of the amplitude refers to the probability of getting that particular state when the qubits are measured The vectors $|+⟩$ and $|-⟩$ are known as the eigenvectors for the Hadamard gate. When we apply ...

3

#1: the $1/\sqrt{2}$ is a normalization which ensures that the length'' of the vector is one. #2: The notation $|\pm\rangle$ is just a label for the two states defined above. Since the states $|0\rangle, |1\rangle$ are elements of a vector space, you can take linear combinations and therefore construct the states $|\pm\rangle$

3

The issue is that you are using noisy hardware with imperfect operations and measurements. In particular, the most likely problem here is that after you prepare a qubit it immediately begins decaying towards the ground state $|0\rangle$ via interactions with the environment. Each qubit will be slightly more likely to be measured as 0 instead of 1 than you'd ...

Top 50 recent answers are included