When I implement a 3-qubit circuit in Qiskit, circuit is executed smoothly at the simulator but counts I read back as results does not contain all of the qubits that are defined and included in the circuit.
from qiskit import QuantumRegister, ClassicalRegister, assemble, Aer
from qiskit import QuantumCircuit, execute,IBMQ
from qiskit.tools.monitor import job_monitor
backend = Aer.get_backend('aer_simulator')
q = QuantumRegister(3,'q')
c = ClassicalRegister(3,'c')
circuit = QuantumCircuit(q,c)
circuit.h(q[0])
circuit.x(q[0])
circuit.y(q[0])
circuit.z(q[0])
circuit.x(q[1])
circuit.h(q[1])
circuit.z(q[1])
circuit.y(q[2])
circuit.measure(q,c)
job = execute(circuit, backend, shots=1024)
counts = job.result().get_counts()
circuit.save_statevector()
qobj = assemble(circuit)
state = backend.run(qobj).result().get_statevector()
print(counts)
print(state)
{'111': 2065, '100': 2062, '101': 2051, '110': 2014}
Statevector([0.+0.0000000e+00j, 0.+0.0000000e+00j, 0.+0.0000000e+00j,
0.+0.0000000e+00j, 1.-1.2246468e-16j, 0.+0.0000000e+00j,
0.+0.0000000e+00j, 0.+0.0000000e+00j],
dims=(2, 2, 2))
000,011,010 and 001 are not evaluated and some statevectors are empty. What is the reason of this result ?