Created
July 29, 2020 10:28
-
-
Save dakk/5578a763ce542ca5a6b4f5b486003f2b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Qiskit | |
(* Create the circuit *) | |
let qc = quantum_circuit 2 2 | |
|> h 0 | |
|> id 1 | |
|> barrier | |
|> cx 0 1 | |
|> barrier | |
|> measure 0 0 | |
|> measure 1 1 | |
|> draw;; | |
(* Start a simulation *) | |
Aer.get_backend "qasm_simulator" | |
|> execute qc | |
|> result | |
|> get_counts | |
|> Visualization.plot_histogram; | |
(* Run the circuit on real quantum hardware *) | |
let prov = IBMQ.enable_account "IBMQ_API_KEY" in | |
let j = Provider.get_backend "ibmq_london" prov |> execute qc in | |
Tools.Monitor.job_monitor j; | |
j | |
|> result | |
|> get_counts | |
|> Visualization.plot_histogram;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment