Quantum Computing Asked on May 23, 2021
Here is my code
import numpy as np
import qiskit
from qiskit import *
number_of_qubits = 3
backend_sim = Aer.get_backend('qasm_simulator')
#Generate a circuit in qiskit
input_circuit = QuantumCircuit(number_of_qubits, number_of_qubits)
input_circuit.x(0)
input_circuit.h(1)
input_circuit.cx(0,1)
input_circuit.i(1)
input_circuit.x(1)
job_sim = execute(input_circuit, backend_sim, shots=1024)
result_sim = job_sim.result()
counts = result_sim.get_counts(input_circuit)
print(counts)
No matter what gates I try (e.g. I can remove the last X gate), the result is always '000': 1024
. What am I doing wrong?
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP