Exam4Training

What is the output of the result in the below snippet?

What is the output of the result in the below snippet?

ghz = QuantumCircuit(3)

ghz.x(0)

ghz.h(0)

ghz.cx([0,0],[1,2])

ghz.measure_all()

backend_qasm = BasicAer.get_backend(‘qasm_simulator’)

job = execute(ghz, backend_qasm,shots=1024)

result = job.result().get_counts()
A . {‘111’: 300, ‘000’: 724}
B . {‘100’: 514, ‘010’: 510}
C . {‘100’: 253, ‘010’: 261, ‘111’: 253, ‘000’: 261}
D . {‘000’: 512, ‘111’:512}

Answer: D

Exit mobile version