# Unable to make sense of the output of X gate

Please see the output of the two following Qiskit programs.

Program 1:

qc = QuantumCircuit(3, 3)

from qiskit.providers.aer import AerSimulator
sim = AerSimulator() # make new simulator object

# Create quantum circuit with 6 qubits and 6 classical bits:
qc = QuantumCircuit(6, 6)

# BELOW LINE IS COMMENTED
#qc.x([3,4,5]) # Perform X-gates on qubits 3,4,5

# measure qubits 0,1,2,3,4,5 to classical bits 0,1,2,3,4,5 respectively
qc.measure([0,1,2,3,4,5],[0,1,2,3,4,5])
qc.draw() # returns a drawing of the circuit

job = sim.run(qc) # run the experiment
result = job.result() # get the results
result.get_counts() # interpret the results as a "counts" dictionary

OUTPUT: {'000000': 1024}



Program 2:

from qiskit import QuantumCircuit
qc = QuantumCircuit(3, 3)

from qiskit.providers.aer import AerSimulator
sim = AerSimulator() # make new simulator object

# Create quantum circuit with 6 qubits and 6 classical bits:
qc = QuantumCircuit(6, 6)

qc.x([3,4,5]) # Perform X-gates on qubits 3,4,5

# measure qubits 0,1,2,3,4,5 to classical bits 0,1,2,3,4,5 respectively
qc.measure([0,1,2,3,4,5],[0,1,2,3,4,5])
qc.draw() # returns a drawing of the circuit

job = sim.run(qc) # run the experiment
result = job.result() # get the results
result.get_counts() # interpret the results as a "counts" dictionary

OUTPUT: {'111000': 1024}


I am not able to make sense of the output. It's as if the output is mapped to the wrong bits. I found this example is on https://learn.qiskit.org/course/introduction/the-atoms-of-computation

• Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
– Community Bot
Feb 16 at 19:24