2

I have QC like this

enter image description here

The final state before measure should be $|1⟩ ⊗ |-⟩$, and it will be $\frac{1}{\sqrt{2}}(|10⟩ - |11⟩)$, so the probability of this QC should be a half is $|10⟩$ and other half is $|11⟩$. But the result of this QC is a half is $|01⟩$ and other half is $|11⟩$.

enter image description here

Can someone explain me why? The script is down below.

from qiskit import QuantumCircuit, transpile
from qiskit.providers.aer import AerSimulator
from qiskit.visualization import plot_histogram

simulator = AerSimulator() circuit = QuantumCircuit(2) circuit.x(0) circuit.x(1) circuit.h(1) circuit.measure_all() circuit.draw('mpl')

compiled_circuit = transpile(circuit, simulator) job = simulator.run(compiled_circuit, shots = 1000) result = job.result() counts = result.get_counts(circuit) plot_histogram(counts)

print(counts)

Joe_LL
  • 21
  • 2

1 Answers1

3

Could it be that states are labeled from right to left? Try the H gate on q0 and see if the labeling reverses.

SC_87
  • 31
  • 2
  • 1
    Oh, you are right, the result become |10⟩ and |11⟩, should read the label from right to left. – Joe_LL Dec 28 '23 at 03:23