Created
August 8, 2018 06:15
-
-
Save mapmeld/68bd066b9d4b1573921b4937f0aec5e0 to your computer and use it in GitHub Desktop.
QISkit-js-demo
This file contains 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
const Cloud = require('@qiskit/cloud'); | |
const cloud = new Cloud(); | |
let API_KEY = '...'; | |
// qasm | |
let circuit = 'include "qelib1.inc";qreg q[1];creg c[1];measure q -> c;'; | |
cloud.login(API_KEY).then(() => { | |
cloud.backends().then( async function (res) { | |
let job = await cloud.run(circuit, { backend: 'ibmqx4', engine: 'ibmqx4' }); | |
console.log(job); | |
// later | |
let output = await cloud.job('jobid'); | |
console.log(output.circuits[0].result); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment