Reviewing the results of your quantum circuit on Quantum Lab Notebooks
In this section, we'll conclude this chapter by running the circuit on a quantum simulator and a real device. We'll then review the results by following these steps:
- From the open Notebook, enter and run the following in the next empty cell:
backend = Aer.get_backend('qasm_simulator')
The preceding code generates a
backend
object that will connect to the specified simulator or device. In this case, we are generating abackend
object linked to the QASM simulator. - In the next empty cell, let's run the
execute
function. This function takes in three parameters—the circuit we wish to run, the backend we want to run it on, and how manyshots
we wish to execute. The returned object will be a job object with the contents of the executed circuit on the backend. The code for this can be seen here:job_simulator = execute(qc, backend, shots=1024)
- We now want to extract the results...