Conversation
Quantum js vis branch
Update gate to not create default amazonBraketSymbols for gates.
Update bundle.js, no longer creates default AmazonBraketSymbols for Qjs
Reduce width of palette on creation in a JupyterNotebook via braket()…
| console.log("1. From Scratch\n" + | ||
| "2. From Text Diagram\n" | ||
| /*+ "3. From Table Transposed\n"*/); | ||
| selection = +prompt(mark); |
There was a problem hiding this comment.
Afai understand this is converting the prompt result into a number ? This could be more explicit, it's not quickly obvious what that syntax does
There was a problem hiding this comment.
Yes, I can use the Number() cast instead of +() cast to Number to clarity instead.
|
|
||
|
|
||
| function prepareCircuit() { | ||
| let selection = NaN; |
There was a problem hiding this comment.
Any particular reason it starts with NaN and not null/0 etc
There was a problem hiding this comment.
No, I only wanted to instantiate selection as some Falsey value.
| test("Testing evaluateInput() with input 'help' and an empty circuit.", () => { | ||
| let expectedText = runner.printMenu(); | ||
| runner.evaluateInput("help", circuit); | ||
| expect(console.log).toHaveBeenCalled(); |
| test("Testing evaluateInput() with input '-h' and an empty circuit.", () => { | ||
| let expectedText = runner.printMenu(); | ||
| runner.evaluateInput("-h", circuit); | ||
| expect(console.log).toHaveBeenCalled(); |
| } | ||
| // | ||
| let registerIndices; | ||
| let re = /\[(\s*\d+\s*,{0,1}\s*)+\]/g; |
There was a problem hiding this comment.
This is a regex that selects an array of integers from a string, i.e. any substring of the form "[integer1, integer2, integer3...]". I'll make the clear in a comment in the code.
| break; | ||
| default: | ||
| let circuitBackup = circuit.clone(); | ||
| let re = /((\w+-*)+\(\s*\d+\s*,\s*\[(\s*\d+\s*,{0,1}\s*)+\]\s*(,\s*\d+\.{0,1}\d*\s*)*\))/g; |
There was a problem hiding this comment.
ACK. Will update.
… as references to set$ method
…eneration in evaluateInput() method
…e bundle.css to match
Reduce width of palette on creation in a JupyterNotebook via braket()…
Quantum js vis branch
Quantum js cli
…arameters object as an argument
No description provided.