Created
December 24, 2021 12:44
-
-
Save RanjanSushant/0b1a9ae87898ca2fdfaa02a5eeb1dfab to your computer and use it in GitHub Desktop.
codesphere_q_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
//creating the circuit for the bell state | |
const phiPlus = Q` | |
H-X#0 | |
I-X#1 | |
` | |
//rendering the circuit on the page | |
document.body.appendChild(phiPlus.toDom()) | |
//simulating and reporting the results | |
const reportArr = phiPlus.report$().split('\n') | |
//Rendering the result on the page | |
for(let i = 1; i < reportArr.length - 1; i++) { | |
const div = document.createElement('div') | |
div.appendChild(document.createTextNode(reportArr[i])) | |
document.body.appendChild(div) | |
document.body.appendChild(document.createElement('br')) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment