├── .gitignore ├── Makefile ├── README.md ├── lib ├── const0.js ├── deutsch-oracle.js ├── entangle.js ├── h_gate.js ├── id_gate.js ├── load_circuit.js ├── prepare.js ├── qiskit-parse-qasm.js ├── qubits.js ├── s_gate.js ├── tensor.js ├── x_gate.js ├── y_gate.js └── z_gate.js ├── notes ├── blas.md ├── qiskit-aer.md ├── qiskit-wasi.md ├── schrodinger.md └── spin.md ├── package-lock.json ├── package.json └── src ├── bell.cc ├── blas_dgemm.c ├── not_gate.py └── qobj-simulator-example.input /.gitignore: -------------------------------------------------------------------------------- 1 | bell 2 | *.dSYM 3 | node_modules 4 | blas_dgemm 5 | 6 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: bell 2 | 3 | bell: src/bell.cc 4 | clang++ --std=c++14 -o $@ -g $< 5 | 6 | BLAS_DIR=../OpenBLAS 7 | blas_dgemm: src/blas_dgemm.c 8 | ${CC} -o $@ $< -I${BLAS_DIR} -L${BLAS_DIR} -lopenblas -pthread 9 | ${CC} -o $@ $< -I${BLAS_DIR} -L${BLAS_DIR} -lopenblas -pthread 10 | 11 | .PHONY: clean 12 | clean: 13 | rm -f bell 14 | 15 | -------------------------------------------------------------------------------- /lib/const0.js: -------------------------------------------------------------------------------- 1 | const qiskit = require('qiskit'); 2 | const qasm = qiskit.qasm; 3 | const sim = qiskit.sim; 4 | const parser = new qasm.Parser(); 5 | 6 | console.log('QASM Version: ', qasm.version); 7 | 8 | const const0 = ` 9 | IBMQASM 2.0; 10 | include "qelib1.inc"; 11 | qreg q[1]; 12 | creg c[1]; 13 | 14 | x q[1]; 15 | measure q -> c; 16 | `; 17 | 18 | 19 | function CircuitFor(qasm_source) { 20 | const parsed = parser.parse(qasm_source); 21 | 22 | let nrQubits = 0; 23 | parsed.some((entry) => { 24 | if (entry.type === 'qubit') { 25 | nrQubits = entry.number; 26 | return true; 27 | }; 28 | }); 29 | console.log(`Create Circuit with ${nrQubits} qubits`); 30 | const circuit = new sim.Circuit({ nQubits: nrQubits }); 31 | //console.log(parsed); 32 | parsed.forEach((entry) => { 33 | if (entry.type === 'x') { 34 | //console.log(entry.type, entry.identifiers); 35 | //circuit.addGate(entry.type, 36 | } 37 | 38 | }); 39 | return circuit; 40 | } 41 | 42 | const circuit = CircuitFor(const0); 43 | circuit.addGate('x', 0, 0); 44 | //circuit.addGate('cx', 1, [0, 1]); 45 | circuit.run(); 46 | console.log(circuit.state); 47 | -------------------------------------------------------------------------------- /lib/deutsch-oracle.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The goal of this program is to simulate the deutsch-oracle 3 | * algoritm and provide a JavaScript example for it. 4 | * 5 | * There are lots of great resources on the internet that provide 6 | * the theory. Our hope is that this can compliment those resources. 7 | * 8 | * Usage 9 | * Run as a script: 10 | * $ node lib/deutsch-oracle.js 11 | * 12 | * Step through with debugger: 13 | * $ node --inspect-brk lib/deutsch-oracle.js 14 | * 15 | * Run in RPEL: 16 | * $ node 17 | * Welcome to Node.js v12.4.0. 18 | * Type ".help" for more information. 19 | * > const d = require('./lib/deutsch-oracle.js'); 20 | * > d.balanced0() 21 | * > d.balanced1() 22 | * > d.const0() 23 | * > d.const1() 24 | */ 25 | const { Circuit, Gate } = require('qiskit').sim; 26 | 27 | const printTensor = (state) => { 28 | if (state[0].re === 0 && state[1].re === 0) { 29 | _printTensor([0, 1], [state[2].re, state[3].re]); 30 | } else { 31 | _printTensor([1, 0], [state[0].re, state[1].re]); 32 | } 33 | } 34 | 35 | function _printTensor(qubit0, qubit1) { 36 | const padding = 23; 37 | console.log(`${qubit0[0]} ⌈${qubit1[0]}`.padEnd(padding, ' ') + '⌉'); 38 | console.log(` ⌊${qubit1[1]}`.padEnd(padding, ' ') + '⌋'); 39 | console.log(`${qubit0[1]} ⌈${qubit1[0]}`.padEnd(padding, ' ') + '⌉'); 40 | console.log(` ⌊${qubit1[1]}`.padEnd(padding, ' ') + '⌋'); 41 | } 42 | 43 | function print(oracle) { 44 | oracle.forEach((row) => { console.log(row); } ); 45 | console.log(); 46 | } 47 | 48 | function measureQubit0(state) { 49 | return state[0].re === 0 && state[1].re === 0 ? '|1>' : '|0>'; 50 | } 51 | 52 | function run(fn) { 53 | const matrix = oracleMatrixFrom(fn); 54 | const circuit = Circuit.createCircuit(2); 55 | circuit.init(); 56 | circuit.add(Gate.x, 0, 1) 57 | .add(Gate.h, 1, 0) 58 | .add(Gate.h, 1, 1) 59 | .add(new Gate('uf', matrix), 2, [0, 1]) 60 | .add(Gate.h, 3, 0) 61 | .print(); 62 | 63 | console.log('Oracle matrix (uf):'); 64 | print(matrix); 65 | 66 | circuit.run(); 67 | 68 | console.log('Final state:'); 69 | console.log(circuit.stateToString()); 70 | console.log(); 71 | 72 | console.log('Show tensor state:'); 73 | printTensor(circuit.state); 74 | console.log(); 75 | 76 | const qubit0 = measureQubit0(circuit.state); 77 | console.log('Measure qubit 0:'); 78 | console.log(`qubit[0]: ${qubit0}, Function is ${qubit0 === '|1>' ? 79 | 'balanced' : 'constant'}!`); 80 | console.log(); 81 | } 82 | 83 | function oracleMatrixFrom(f) { 84 | const dim = 4; 85 | const input = [{x: 0, y: 0}, {x:0, y:1}, {x:1, y:0}, {x:1, y:1}]; 86 | const matrix = []; 87 | for (let i = 0; i < dim; i++) { 88 | matrix.push(new Array(dim).fill(0)); 89 | } 90 | 91 | for (let z = 0; z < input.length; z++) { 92 | const x = input[z].x; 93 | const y = input[z].y; 94 | const result = y ^ f(x); 95 | if (x === 0) { 96 | matrix[z][result] = 1; 97 | } else { 98 | matrix[z][2+result] = 1; 99 | } 100 | } 101 | return matrix; 102 | } 103 | 104 | 105 | function balanced0() { 106 | console.log(' Balanced function f(0) = 1, f(1) = 0'); 107 | run(x => (x === 0) ? 1 : 0); 108 | } 109 | 110 | function balanced1() { 111 | console.log(' Balanced function f(0) = 0, f(1) = 1'); 112 | run(x => (x === 0) ? 0 : 1); 113 | } 114 | 115 | function const0() { 116 | console.log(' Constant 0 function f(0) = 0, f(1) = 0'); 117 | run(x => 0); 118 | } 119 | 120 | function const1() { 121 | console.log(' Constant 1 function f(0) = 1, f(1) = 1'); 122 | run(x => 1); 123 | } 124 | 125 | module.exports = { 126 | balanced0, 127 | balanced1, 128 | const0, 129 | const1 130 | }; 131 | 132 | if (require.main === module) { 133 | balanced0(); 134 | balanced1(); 135 | const0(); 136 | const1(); 137 | } 138 | -------------------------------------------------------------------------------- /lib/entangle.js: -------------------------------------------------------------------------------- 1 | const { Circuit, gates, Gate } = require('qiskit').sim; 2 | 3 | console.log(Gate.cx); 4 | console.log(Gate.h); 5 | const circuit = Circuit.createCircuit(2); 6 | circuit.addGate(Gate.h, 0, 0).addGate(Gate.cx, 1, [0, 1]).print(); 7 | circuit.run(); 8 | console.log(circuit.stateToString()); 9 | -------------------------------------------------------------------------------- /lib/h_gate.js: -------------------------------------------------------------------------------- 1 | const math = require('mathjs'); 2 | const { Circuit, Gate } = require('qiskit').sim; 3 | 4 | console.log(Gate.h.matrix); 5 | const circuit = Circuit.createCircuit(1); 6 | circuit.addGate(Gate.h, 0, 0).run(); 7 | console.log('Hadamard: ', circuit.stateToString()); 8 | 9 | // Applying the Hadamard twice will give back the original state, in this case 10 | // the zero state. 11 | const c = Circuit.createCircuit(1); 12 | c.addGate(Gate.h, 0, 0).addGate(Gate.h, 1, 0).run(); 13 | console.log('Hadamard twice:', c.stateToString()); 14 | -------------------------------------------------------------------------------- /lib/id_gate.js: -------------------------------------------------------------------------------- 1 | const { Circuit, Gate } = require('qiskit').sim; 2 | 3 | console.log(Gate.id); 4 | const circuit = Circuit.createCircuit(1); 5 | circuit.addGate(Gate.id, 0, 0).run(); 6 | console.log(circuit.stateToString()); 7 | -------------------------------------------------------------------------------- /lib/load_circuit.js: -------------------------------------------------------------------------------- 1 | const { Circuit, Gate } = require('qiskit').sim; 2 | 3 | const circuit = Circuit.createCircuit(2); 4 | circuit.addGate(Gate.cx, 0, 1).addGate(Gate.h, 1, 0).run(); 5 | console.log(circuit.stateToString()); 6 | -------------------------------------------------------------------------------- /lib/prepare.js: -------------------------------------------------------------------------------- 1 | const { Circuit, Gate } = require('qiskit').sim; 2 | 3 | const circuit = Circuit.createCircuit(1); 4 | console.log(Gate.h); 5 | circuit.addGate(Gate.h, 0, 0).run(); 6 | console.log(circuit.stateToString()); 7 | -------------------------------------------------------------------------------- /lib/qiskit-parse-qasm.js: -------------------------------------------------------------------------------- 1 | const qiskit = require('qiskit'); 2 | const qasm = qiskit.qasm; 3 | const sim = qiskit.sim; 4 | const Circuit = sim.Circuit; 5 | 6 | 7 | const const0 = ` 8 | IBMQASM 2.0; 9 | include "qelib1.inc"; 10 | qreg q[1]; 11 | creg c[1]; 12 | 13 | x q[1]; 14 | measure q -> c; 15 | `; 16 | 17 | console.log('QASM Version: ', qasm.version); 18 | const parser = new qasm.Parser(); 19 | 20 | const p = parser.parse(const0); 21 | console.log(p); 22 | const c = new Circuit({nQubits: 1}, p); 23 | console.log(c); 24 | c.run(); 25 | console.log(c); 26 | -------------------------------------------------------------------------------- /lib/qubits.js: -------------------------------------------------------------------------------- 1 | const qubits = require('jsqubits').jsqubits 2 | const zero_ket = qubits('|01>'); 3 | console.log(zero_ket.toString()); 4 | -------------------------------------------------------------------------------- /lib/s_gate.js: -------------------------------------------------------------------------------- 1 | const math = require('mathjs'); 2 | const { Circuit, Gate } = require('qiskit').sim; 3 | 4 | console.log(Gate.s.matrix); 5 | const circuit = Circuit.createCircuit(1); 6 | circuit.addGate(Gate.x, 0, 0).addGate(Gate.s, 1, 0).run(); 7 | 8 | console.log(math.pow(math.e, math.multiply(math.i, math.PI / 2))); 9 | console.log(math.i); 10 | 11 | console.log(circuit.stateToString()); 12 | -------------------------------------------------------------------------------- /lib/tensor.js: -------------------------------------------------------------------------------- 1 | console.log(` Qubit System: 2 | qubits end-based 3 | q[0] ----H--------------------------- q[2] 4 | q[1] -------------------------------- q[1] 5 | q[2] -------------------------------- q[0] 6 | `); 7 | 8 | const numQubits = 3 9 | const dimension = 8 10 | // Wires, or the qubits that the Haramard gate operates on. It only 11 | // operates on a single qubit which is qubit 0 in our case. 12 | const wires = [0]; 13 | // The transformation which is a 4x4 matrix. 14 | /* 15 | const T = [ 16 | [ 0, 0, 0, 0], 17 | [ 0, 0, 0, 0], 18 | [ 0, 0, 0, 0], 19 | [ 0, 0, 0, 0], 20 | ]; 21 | */ 22 | const T = [ 23 | [ 0, 0, 0, 0, 0, 0, 0, 0], 24 | [ 0, 0, 0, 0, 0, 0, 0, 0], 25 | [ 0, 0, 0, 0, 0, 0, 0, 0], 26 | [ 0, 0, 0, 0, 0, 0, 0, 0], 27 | [ 0, 0, 0, 0, 0, 0, 0, 0], 28 | [ 0, 0, 0, 0, 0, 0, 0, 0], 29 | [ 0, 0, 0, 0, 0, 0, 0, 0], 30 | [ 0, 0, 0, 0, 0, 0, 0, 0], 31 | ]; 32 | // Make the indexes end-based meaning that instead of being 0 this will 33 | // make it 1. So the the wire/qubit being used by the gate is now 1 instead 34 | // of zero. 35 | for (let i = 0; i < wires.length; i += 1) { 36 | wires[i] = numQubits - 1 - wires[i]; 37 | } 38 | wires.reverse(); 39 | console.log('wires used:', wires, '(end-based)'); 40 | 41 | const unusedWires = []; 42 | for (let i = 0; i < numQubits; i += 1) { 43 | // Remember that the wires that are used by the gate are in the wires 44 | // array. We are here adding them to the unusedWires array if they are not 45 | // used. 46 | if (wires.indexOf(i) === -1) { 47 | unusedWires.push(i); 48 | } 49 | } 50 | console.log('unused wires:', unusedWires, '(end-based)'); 51 | 52 | let i = dimension; 53 | while (i--) { 54 | let j = dimension; 55 | while (j--) { 56 | let bitsEquals = true; 57 | let unusedCount = unusedWires.length; 58 | while (unusedCount--) { 59 | const b = 1 << unusedWires[unusedCount]; 60 | console.log(`${i} & (${b}) !== ${j} & (${b}) => ${(i & b)} !== ${(j & b)}`); 61 | if ((i & b) !== (j & b)) { 62 | bitsEquals = false; 63 | console.log('bitsEqual:', bitsEquals); 64 | break; 65 | } 66 | } 67 | T[i][j] = bitsEquals ? '*' : '-'; 68 | } 69 | } 70 | console.log(T); 71 | 72 | const I = [ 73 | [1, 0], 74 | [0, 1] 75 | ]; 76 | -------------------------------------------------------------------------------- /lib/x_gate.js: -------------------------------------------------------------------------------- 1 | const { Circuit, Gate } = require('qiskit').sim; 2 | 3 | const circuit = Circuit.createCircuit(1); 4 | circuit.addGate(Gate.x, 0, 0).run(); 5 | console.log('x-gate measure:'); 6 | console.log(circuit.stateToString()); 7 | 8 | const c = Circuit.createCircuit(1); 9 | c.addGate('h', 0, 0).addGate('z', 1, 0).addGate('h', 2, 0).run(); 10 | console.log('h-z-h-gate measure:'); 11 | console.log(c.stateToString()); 12 | -------------------------------------------------------------------------------- /lib/y_gate.js: -------------------------------------------------------------------------------- 1 | const { Circuit, Gate } = require('qiskit').sim; 2 | 3 | const circuit = Circuit.createCircuit(1); 4 | circuit.addGate(Gate.y, 0, 0).run(); 5 | console.log(circuit.state, circuit.state.toString()); 6 | -------------------------------------------------------------------------------- /lib/z_gate.js: -------------------------------------------------------------------------------- 1 | const { Circuit, Gate } = require('qiskit').sim; 2 | 3 | console.log('Z gate: ', Gate.z); 4 | const circuit = Circuit.createCircuit(1); 5 | circuit.addGate(Gate.z, 0, 0).run(); 6 | console.log(circuit.state, circuit.state.toString()); 7 | -------------------------------------------------------------------------------- /notes/blas.md: -------------------------------------------------------------------------------- 1 | ### Basic Linear Algebra Subprograms (BLAS) 2 | Provides low level matrix operations. 3 | BLAS is the computational kernel ("the bottom of the food chain") in linear 4 | algebra or scientific applications. 5 | 6 | * BLAS1 (vector-vector operations) 7 | * BLAS2 (matrix-vector operations) 8 | * BLAS3 (matrix-matrix operations) 9 | 10 | ### Level 1 11 | This level only has functions declarations that deal with vector operations, 12 | like dot products, vectors norms. 13 | ``` 14 | ax + y = y 15 | ``` 16 | The function for this is named axpy which means `a x plus y`. 17 | 18 | ### Level 2 19 | Matrix-vector fuction declarations like matrix-vector multiplication 20 | `gemv' general matrix vector multiplication. 21 | 22 | ### dgemm 23 | Double precision GEneral Matrix to Matrix Multiplication (gemm). 24 | So this multiplies two input matrices with each other to produce a third. 25 | 26 | ```c 27 | void cblas_dgemm (const CBLAS_LAYOUT layout, 28 | const CBLAS_TRANSPOSE transa, 29 | const CBLAS_TRANSPOSE transb, 30 | const MKL_INT m, 31 | const MKL_INT n, 32 | const MKL_INT k, 33 | const double alpha, 34 | const double *a, 35 | const MKL_INT lda, 36 | const double *b, 37 | const MKL_INT ldb, 38 | const double beta, 39 | double *c, 40 | const MKL_INT ldc); 41 | ``` 42 | 43 | There is a concrete example in [blas.c](../src/blas.c). 44 | 45 | The matrix multiplication in this example looks like this: 46 | ``` 47 | ⌈1 2⌉⌈1⌉ = ⌈1*1+2*2⌉ = ⌈ 5⌉ 48 | |3 4|⌊2⌋ |3*1+4*2| |11| 49 | ⌊5 6⌋ ⌊5*1+6*2⌋ ⌊17⌋ 50 | ``` 51 | Now notice that this operations matrix (the one on the left) is defined as: 52 | ```c 53 | double input1[6] = {1.0, 3.0, 5.0, 54 | 2.0, 4.0, 6.0}; 55 | ``` 56 | So we are giving it with the first column, followed by the second. 57 | 58 | And if we want to have more inputs to the operations we have to specify them. 59 | So lets add one more 60 | ``` 61 | ⌈1 2⌉⌈1 3⌉ = ⌈1*1+2*2 1*3+2*4⌉ = ⌈ 5 11⌉ 62 | |3 4|⌊2 4⌋ |3*1+4*2 3*3+4*4| |11 25| 63 | ⌊5 6⌋ ⌊5*1+6*2 5*3+6*4⌋ ⌊17 39⌋ 64 | ``` 65 | So I spent a good amount if time trying to add another input column and just 66 | kept getting the wrong. The issue was that I was not changing the ldb which 67 | specifics the columns or rows that this input matrix uses. Think about if you 68 | were writing a loop, you'd need to know the number of columns/rows that the 69 | matrix is dealing with. The array is just that an ordered list of numbers and 70 | can be interpreted in different ways. 71 | 72 | ``` 73 | ⌈1 2⌉⌈1 3 5⌉ = ⌈1*1+2*2 1*3+2*4 1*5+2*6⌉ = ⌈ 5 11 15⌉ 74 | |3 4|⌊2 4 6⌋ |3*1+4*2 3*3+4*4 3*5+4*6| |11 24 39| 75 | ⌊5 6⌋ ⌊5*1+6*2 5*3+5*4 5*3+6*6⌋ ⌊17 35 51⌋ 76 | ``` 77 | 78 | ```c 79 | cblas_dgemm(CblasColMajor, 80 | CblasNoTrans, 81 | CblasTrans, 82 | 3, 83 | 3, 84 | 2, 85 | 1, 86 | A, 87 | 3, 88 | B, 89 | 3, 90 | 2, 91 | C, 92 | 3); 93 | ``` 94 | -------------------------------------------------------------------------------- /notes/qiskit-aer.md: -------------------------------------------------------------------------------- 1 | ### qiskit-aer 2 | 3 | ### Building 4 | ```console 5 | $ cd qiskit-aer 6 | $ conda create -y -n QiskitDevEnv python=3 7 | $ conda activate QiskitDevEnv 8 | ``` 9 | This environment can be deactivated using: 10 | ```console 11 | $ conda deactivate 12 | ``` 13 | Install all the dependencies: 14 | ```console 15 | (QiskitDevEnv) $ pip install -r requirements-dev.txt 16 | ``` 17 | 18 | We can also build a standalone version: 19 | ```console 20 | $ mkdir out 21 | $ cd out 22 | $ cmake.. 23 | ... 24 | -- Conan executing: /home/danielbevenius/.local/bin/conan install . -s build_type=Release -s compiler=gcc -s compiler.version=11 -s compiler.libcxx=libstdc++11 -e=CONAN_CMAKE_PROGRAM=/home/danielbevenius/.local/lib/python3.10/site-packages/cmake/data/bin/cmake -g=cmake --build=missing 25 | ERROR: Invalid setting '11' is not a valid 'settings.compiler.version' value. 26 | Possible values are ['4.1', '4.4', '4.5', '4.6', '4.7', '4.8', '4.9', '5', '5.1', '5.2', '5.3', '5.4', '5.5', '6', '6.1', '6.2', '6.3', '6.4', '6.5', '7', '7.1', '7.2', '7.3', '7.4', '7.5', '8', '8.1', '8.2', '8.3', '8.4', '9', '9.1', '9.2', '9.3', '10', '10.1'] 27 | Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting" 28 | ``` 29 | I updated Conan but still ran into this issue, but this was due to a stale 30 | setting.xml in `~/.conan/setting.yml`. Removing this file allowed the 31 | configuration of cmake to succeed: 32 | ```console 33 | $ rm ~/.conan/settings.yml 34 | ``` 35 | After that I ran into the following issue: 36 | ```console 37 | CONAN_CMAKE_PROGRAM=/home/danielbevenius/.local/lib/python3.10/site-packages/cmake/data/bin/cmake 38 | spdlog/1.9.2: Not found in local cache, looking in remotes... 39 | spdlog/1.9.2: Trying with 'conan-center'... 40 | spdlog/1.9.2: WARN: Remote https://conan.bintray.com is deprecated and will be shut down soon. 41 | spdlog/1.9.2: WARN: Please use the new 'conancenter' default remote. 42 | spdlog/1.9.2: WARN: Add it to your remotes with: conan remote add -i 0 conancenter https://center.conan.io 43 | ERROR: HTTPSConnectionPool(host='conan.bintray.com', port=443): Max retries exceeded with url: /v1/ping (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)'))) 44 | 45 | Unable to connect to conan-center=https://conan.bintray.com 46 | 1. Make sure the remote is reachable or, 47 | 2. Disable it by using conan remote disable, 48 | Then try again. 49 | CMake Error at cmake/conan.cmake:402 (message): 50 | Conan install failed='1' 51 | Call Stack (most recent call first): 52 | cmake/conan.cmake:497 (conan_cmake_install) 53 | cmake/conan_utils.cmake:71 (conan_cmake_run) 54 | cmake/dependency_utils.cmake:20 (setup_conan) 55 | CMakeLists.txt:145 (setup_dependencies) 56 | ``` 57 | This was caused by a stale url in `remotes.json`: 58 | ```console 59 | $ vi ~/.conan/remotes.json 60 | ``` 61 | Updating the `url` to `https://center.conan.io` fixed this issue: 62 | ```json 63 | "url": "https://center.conan.io", 64 | ``` 65 | 66 | Then we can build using: 67 | ```console 68 | $ cmake --build . --config Release -- -j4 69 | ``` 70 | 71 | ### Building with c++ tests 72 | ```console 73 | $ cmake -DBUILD_TESTS=True .. 74 | $ make -j8 test 75 | ``` 76 | 77 | ### Running tests 78 | The project uses [tox](https://tox.readthedocs.io/en/latest/) so it needs to 79 | be installed: 80 | ```console 81 | $ sudo pip install tox 82 | ``` 83 | 84 | Then the tests are run using the `tox` command: 85 | ```console 86 | $ tox 87 | ``` 88 | This will run a number of tests and I think it does so in multiple environments. 89 | For simple C++ code updates hopefully using -DBUILD_TESTS=True will allow for a 90 | faster development cycle. 91 | 92 | 93 | ### compiler warnings 94 | ```console 95 | In file included from /home/danielbevenius/work/quantum/qiskit-aer/src/controllers/controller.hpp:54, 96 | from /home/danielbevenius/work/quantum/qiskit-aer/src/controllers/qasm_controller.hpp:18, 97 | from /home/danielbevenius/work/quantum/qiskit-aer/contrib/standalone/qasm_simulator.cpp:25: 98 | /home/danielbevenius/work/quantum/qiskit-aer/src/transpile/cacheblocking.hpp: In member function ‘virtual void AER::Transpile::CacheBlocking::optimize_circuit(AER::Circuit&, AER::Noise::NoiseModel&, const opset_t&, AER::ExperimentResult&) const’: 99 | /home/danielbevenius/work/quantum/qiskit-aer/src/transpile/cacheblocking.hpp:208:21: warning: comparison of integer expressions of different signedness: ‘AER::Transpile::uint_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 100 | 208 | for(uint_t i=0;i&, AER::Transpile::reg_t&, bool) const’: 125 | /home/danielbevenius/work/quantum/qiskit-aer/src/transpile/cacheblocking.hpp:229:29: warning: comparison of integer expressions of different signedness: ‘std::vector::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 126 | 229 | if(blockedQubits.size() >= block_bits_) 127 | | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ 128 | ``` 129 | So we have `blockedQubits` which is of type `req_t` which can be found in 130 | `src/framework/types.hpp`: 131 | ```c++ 132 | using reg_t = std::vector; 133 | 134 | ``` 135 | The vector size() function returns an unsigned int. But then we want to compare 136 | this value to the int block_bits_. 137 | ```c++ 138 | mutable int block_bits_; //qubits less than this will be blocked 139 | ``` 140 | 141 | So size and block_bits could be anything in the ranges: 142 | ``` 143 | size : 0 -> 4294967295 144 | block_bits : -2,147,483,648 -> 2147483647. 145 | ``` 146 | The check looks like this: 147 | ```c++ 148 | if(blockedQubits.size() >= block_bits_) 149 | break; 150 | ``` 151 | So this is checking the the number of elements/size of the vector with the 152 | number of blocked_bits_, and if the size is greater than or equal to the 153 | block_bits_ then break out of the loop. Now the problem is that while blockedQubits.size() can only be a 154 | positive number block_bit_ could be a negative value. 155 | 156 | So lets say that the size for the vector is 10, and block_bits_ for some reason 157 | is -1. How do we safely compare there values. We can't cast -1 to an unsigned 158 | int as that would become 4294967295 will probably be larger than the size of the 159 | vector and the above is statement would be true. But is we know that block_bits 160 | is a positive value we can safely cast it to an unsigned value. 161 | 162 | If we first check block_bits_ then we can cast it to an unsigned int as it will 163 | fit (the largest possible positive value would be 2,147,483,647 and the max limit 164 | for an unsigned int is 4294967295). And what we are interested in the code is 165 | if the blockedQubits.size() is greater or equal to blocked_bits, and if blocked_bits_ 166 | is negative then it is greater for sure. 167 | ```c++ 168 | if(block_bits_ > 0 && blockedQubits.size() >= static_cast(block_bits_)) 169 | break; 170 | ``` 171 | 172 | Next warning, also in src/transpile/cacheblocking.hpp: 173 | ```console 174 | In file included from /home/danielbevenius/work/quantum/qiskit-aer/src/controllers/controller.hpp:54, 175 | from /home/danielbevenius/work/quantum/qiskit-aer/src/controllers/qasm_controller.hpp:18, 176 | from /home/danielbevenius/work/quantum/qiskit-aer/contrib/standalone/qasm_simulator.cpp:25: 177 | /home/danielbevenius/work/quantum/qiskit-aer/src/transpile/cacheblocking.hpp: In member function ‘void AER::Transpile::CacheBlocking::define_blocked_qubits(std::vector&, AER::Transpile::reg_t&, bool) const’: 178 | /home/danielbevenius/work/quantum/qiskit-aer/src/transpile/cacheblocking.hpp:238:18: warning: comparison of integer expressions of different signedness: ‘AER::Transpile::uint_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 179 | 238 | for(j=0;j 222 | 223 | int main(int argc, char** argv) { 224 | unsigned int u = 10; 225 | int s = -1; 226 | int r = 0; 227 | if (u > -1) { 228 | r = 1; 229 | } else { 230 | r = 2; 231 | } 232 | //assert(u > -1); 233 | 234 | return 0; 235 | ``` 236 | 237 | ```console 238 | (lldb) expr -f b -- (unsigned int) s 239 | (unsigned int) $4 = 0b11111111111111111111111111111111 240 | (lldb) expr -f i -- (unsigned int) s 241 | (unsigned int) $5 = 242 | (lldb) expr -- (unsigned int) s 243 | (unsigned int) $6 = 4294967295 244 | (lldb) expr -- u > (unsigned int) s 245 | (bool) $7 = false 246 | (lldb) expr -- (unsigned int) u 247 | (unsigned int) $8 = 10 248 | ``` 249 | An expression that has an unsigned int will implicitly convert the int to 250 | an unsigned in which in the case of a negative value will become 251 | 2⁸ + negative_number: 252 | ``` 253 | 2³²-1 + (-1) = 4294967295 254 | ``` 255 | ```console 256 | (lldb) expr (unsigned int) -1 257 | (unsigned int) $10 = 4294967295 258 | (lldb) expr (unsigned int) -2 259 | (unsigned int) $11 = 4294967294 260 | (lldb) expr (unsigned int) -3 261 | (unsigned int) $12 = 4294967293 262 | (lldb) expr (unsigned int) -4 263 | (unsigned int) $13 = 4294967292 264 | ``` 265 | Looking at this again I guess another option would be to make `block_bits_`, 266 | `qubits_`. and `gpu_blocking_bits_` uint_t in the CacheBlocking class. 267 | 268 | 269 | Another warning src/simulators/statevector/statevector_state_chunk.hpp: 270 | ```console 271 | template 272 | template 273 | cmatrix_t State::vec2density(const reg_t &qubits, const T &vec) { 274 | const size_t N = qubits.size(); 275 | const size_t DIM = 1ULL << N; 276 | auto qubits_sorted = qubits; 277 | std::sort(qubits_sorted.begin(), qubits_sorted.end()); 278 | 279 | // Return full density matrix 280 | cmatrix_t densmat(DIM, DIM); 281 | if ((N == BaseState::num_qubits_) && (qubits == qubits_sorted)) { 282 | const int_t mask = QV::MASKS[N]; 283 | #pragma omp parallel for if (2 * N > omp_qubit_threshold_ && \ 284 | BaseState::threads_ > 1) \ 285 | num_threads(BaseState::threads_) 286 | ``` 287 | Notice that N is an long unsigned int, and it is being compared with 288 | omp_qubity_threshold (omp=OpenMP) which is an int: 289 | ```c++ 290 | int omp_qubit_threshold_ = 14; 291 | ``` 292 | It does not look like this value could ever be less than zero so perhaps it 293 | can be changed into `uint_t`? 294 | 295 | Another warning this time in src/simulators/density_matrix/densitymatrix_state_chunk.hpp: 296 | ```console 297 | /home/danielbevenius/work/quantum/qiskit-aer/src/simulators/density_matrix/densitymatrix_state_chunk.hpp:1037:25: warning: comparison of integer expressi ons of different signedness: ‘AER::int_t’ {aka ‘long int’} and ‘const size_t’ {aka ‘const long unsigned int’} [-Wsign-compare] 298 | 1250 1037 | for (int_t i = 0; i < VDIM; ++i) { 299 | 1251 | ~~^~~~~~ 300 | ``` 301 | The index (i) can be changed to uint_t as VDIM is also unsigned. 302 | 303 | 304 | ```console 305 | /home/danielbevenius/work/quantum/qiskit-aer/src/simulators/density_matrix/densitymatrix_state_chunk.hpp:584:6: required from here 306 | /home/danielbevenius/work/quantum/qiskit-aer/src/simulators/density_matrix/densitymatrix_state_chunk.hpp:1014:22: warning: comparison of integer expressions of different signedness: ‘AER::int_t’ {aka ‘long int’} and ‘AER::uint_t’ {aka ‘long unsigned int’} [-Wsign-compare] 307 | 1014 | for(iChunk=1;iChunk(matrix > const&, std::vector >&, matrix >&)': 53 | qasm_simulator.cpp:(.text._Z21eigensystem_hermitianIdEvRK6matrixISt7complexIT_EERSt6vectorIS2_SaIS2_EERS4_[_Z21eigensystem_hermitianIdEvRK6matrixISt7complexIT_EERSt6vectorIS2_SaIS2_EERS4_]+0x7c): undefined reference to `dlamch_' 54 | 55 | /usr/bin/ld: qasm_simulator.cpp:(.text._Z21eigensystem_hermitianIdEvRK6matrixISt7complexIT_EERSt6vectorIS2_SaIS2_EERS4_[_Z21eigensystem_hermitianIdEvRK6matrixISt7complexIT_EERSt6vectorIS2_SaIS2_EERS4_]+0x28f): undefined reference to `zheevx_' 56 | collect2: error: ld returned 1 exit status 57 | make[2]: *** [CMakeFiles/qasm_simulator.dir/build.make:122: Release/qasm_simulator] Error 1 58 | make[1]: *** [CMakeFiles/Makefile2:123: CMakeFiles/qasm_simulator.dir/all] Error 2 59 | make: *** [Makefile:160: all] Error 2 60 | ``` 61 | 62 | ```console 63 | $ nm CMakeFiles/qasm_simulator.dir/contrib/standalone/qasm_simulator.cpp.o | grep _Z21eigensystem_hermitianIdEvRK6matrixISt7complexIT_EERSt6vectorIS2_SaIS2_EERS4_ 64 | 0000000000000000 W _Z21eigensystem_hermitianIdEvRK6matrixISt7complexIT_EERSt6vectorIS2_SaIS2_EERS4_ 65 | ``` 66 | So this function uses these `slamch_` but it is not defined in the object file 67 | and would therefore need to be linked but that is not being done. 68 | 69 | $ nm -C CMakeFiles/qasm_simulator.dir/contrib/standalone/qasm_simulator.cpp.o | grep slamch_ 70 | U slamch_ 71 | ``` 72 | So this is indefined in the object file. It is in the header but there is no 73 | implementation for it so compilation. If we take a debug build and then use 74 | lldb we should be able to figure out where this symbol is defined: 75 | ``` 76 | $ lldb -- ./Debug/qasm_simulator 77 | (lldb) br s -n main 78 | (lldb) r 79 | (lldb) target modules lookup --symbol slamch_ 80 | 1 symbols match 'slamch_' in /home/danielbevenius/work/quantum/qiskit-aer/out2/Debug/qasm_simulator: 81 | 82 | 1 symbols match 'slamch_' in /usr/lib64/libopenblas.so.0: 83 | Address: libopenblas.so.0[0x0000000001ef35f0] (libopenblas.so.0.PT_LOAD[2]..text + 31241712) 84 | Summary: libopenblas.so.0`slamch_ 85 | (lldb) target modules lookup --symbol cheevx_ 86 | 1 symbols match 'cheevx_' in /home/danielbevenius/work/quantum/qiskit-aer/out2/Debug/qasm_simulator: 87 | 88 | 1 symbols match 'cheevx_' in /usr/lib64/libopenblas.so.0: 89 | Address: libopenblas.so.0[0x0000000001c0de80] (libopenblas.so.0.PT_LOAD[2]..text + 28204672) 90 | Summary: libopenblas.so.0`cheevx_ 91 | ``` 92 | So we can see that these are in /usr/lib64/libopenblas.so.0 which is the shared 93 | library: 94 | ```console 95 | $ nm -D /usr/lib64/libopenblas-r0.3.10.so | grep slamch_ 96 | 0000000001f853e0 T LAPACKE_slamch_work 97 | 0000000001ef35f0 T slamch_ 98 | ``` 99 | But we are linking against the static library and it does not seem to be there: 100 | ```console 101 | $ nm /usr/lib64/libopenblas.a | grep slamch_ 102 | ``` 103 | Why is this symbol not include in the static archive? 104 | Hmm, look at these symbols they seem to all come from the LAPACK library. This 105 | seems to happen if a fortran compiler is not available when compiling OpenBLAS. 106 | Adding a fortran compiler and then re-compiling: 107 | ```console 108 | $ sudo dnf install -y gfortran 109 | ``` 110 | And after this we can see that we have the symbols in the static archive: 111 | ```console 112 | $ nm libopenblas.a | grep slamch_ 113 | ... 114 | lapacke_slamch_work.o: 115 | 0000000000000000 T LAPACKE_slamch_work 116 | ``` 117 | (Recall that T means that the symbol is in the .text segment). 118 | 119 | That took care of one issue but another surfaced after this: 120 | ```console 121 | [100%] Linking CXX executable Release/qasm_simulator 122 | /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/9/libgomp.a(target.o): in function `gomp_target_init': 123 | (.text+0x33c): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking 124 | /usr/bin/ld: /usr/lib64/libopenblas.a(cunmtr.o): in function `cunmtr_': 125 | cunmtr.f:(.text+0x305): undefined reference to `_gfortran_concat_string' 126 | /usr/bin/ld: cunmtr.f:(.text+0x4bf): undefined reference to `_gfortran_concat_string' 127 | /usr/bin/ld: cunmtr.f:(.text+0x521): undefined reference to `_gfortran_concat_string' 128 | /usr/bin/ld: cunmtr.f:(.text+0x561): undefined reference to `_gfortran_concat_string' 129 | /usr/bin/ld: /usr/lib64/libopenblas.a(zunmtr.o): in function `zunmtr_': 130 | zunmtr.f:(.text+0x304): undefined reference to `_gfortran_concat_string' 131 | /usr/bin/ld: /usr/lib64/libopenblas.a(zunmtr.o):zunmtr.f:(.text+0x4bf): more undefined references to `_gfortran_concat_string' follow 132 | collect2: error: ld returned 1 exit status 133 | make[2]: *** [CMakeFiles/qasm_simulator.dir/build.make:122: Release/qasm_simulator] Error 1 134 | make[1]: *** [CMakeFiles/Makefile2:123: CMakeFiles/qasm_simulator.dir/all] Error 2 135 | make: *** [Makefile:160: all] Error 2 136 | ``` 137 | I was able to force this by updating CMakeFiles/qasm_simulator.dir/link.txt: 138 | ``` 139 | ccache /usr/lib64/ccache/c++ -static -static-libgcc -static-libstdc++ -ffast-math -pedantic -Wall -Wfloat-equal -Wundef -Wcast-align -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wshadow -Woverloaded-virtual -fopenmp -O3 -DNDEBUG -fopenmp CMakeFiles/qasm_simulator.dir/contrib/standalone/qasm_simulator.cpp.o CMakeFiles/qasm_simulator.dir/src/simulators/statevector/qv_avx2.cpp.o -o Release/qasm_simulator /usr/lib64/libopenblas.a /usr/lib/gcc/x86_64-redhat-linux/9/libgfortran.a /usr/lib64/libdl.a -lquadmath /home/danielbevenius/.conan/data/spdlog/1.5.0/_/_/package/942d5c94aa934511ee4500bda27908cb4e791b24/lib/libspdlog.a -lpthread /home/danielbevenius/.conan/data/fmt/6.2.0/_/_/package/b911f48570f9bb2902d9e83b2b9ebf9d376c8c56/lib/libfmt.a -pthread 140 | ``` 141 | The additions are libgfortran.a and -lquadmath 142 | 143 | 144 | Also make sure that you are using the correct clang++. I have one with wasm support 145 | which is in ~/opt/bin and in the PATH. Use /usr/bin instead. 146 | 147 | Now, after this I can compile but not link: 148 | ```console 149 | $ make 150 | [ 50%] Linking CXX executable qasm_simulator.wasm 151 | wasm-ld: error: CMakeFiles/qasm_simulator.wasm.dir/contrib/standalone/qasm_simulator.cpp.o: undefined symbol: zgemm_ 152 | wasm-ld: error: CMakeFiles/qasm_simulator.wasm.dir/contrib/standalone/qasm_simulator.cpp.o: undefined symbol: zgemm_ 153 | ``` 154 | 155 | Lets compile a dynamically linked executable and see which libraries it uses: 156 | ```console 157 | $ ldd Release/qasm_simulator 158 | linux-vdso.so.1 (0x00007fffcaf0a000) 159 | libopenblas.so.0 => /lib64/libopenblas.so.0 (0x00007fd8ecc25000) 160 | libdl.so.2 => /lib64/libdl.so.2 (0x00007fd8ecc1e000) 161 | libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fd8eca24000) 162 | libm.so.6 => /lib64/libm.so.6 (0x00007fd8ec8de000) 163 | libgomp.so.1 => /lib64/libgomp.so.1 (0x00007fd8ec8a4000) 164 | libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fd8ec88a000) 165 | libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd8ec866000) 166 | libc.so.6 => /lib64/libc.so.6 (0x00007fd8ec69d000) 167 | libgfortran.so.5 => /lib64/libgfortran.so.5 (0x00007fd8ec3fb000) 168 | /lib64/ld-linux-x86-64.so.2 (0x00007fd8eef14000) 169 | libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007fd8ec3b1000) 170 | ``` 171 | The candidates that I would consider would be `openblas`,`gomp`, `gfortran`, and 172 | `quadmath`. 173 | We have to look for dynamic symbols (`-D`): 174 | ```console 175 | $ nm -D /lib64/libopenblas.so | grep zgemm_ 176 | 0000000000153d70 T zgemm_ 177 | ... 178 | ``` 179 | We can also check the this symbol exist in the static openblas lib: 180 | ```console 181 | $ nm /lib64/libopenblas.a | grep zgemm_ 182 | 0000000000000000 T zgemm_ 183 | ``` 184 | So what is missing is that when we are linking... 185 | 186 | 187 | ```console 188 | $ nm -C CMakeFiles/qasm_simulator.dir/contrib/standalone/qasm_simulator.cpp.o | grep zgemm_ 189 | U zgemm_ 190 | ``` 191 | 192 | We might need install static libc and libstdc++ if we don't have them locally: 193 | ```console 194 | $ sudo yum install glibc-static libstdc++-static 195 | ``` 196 | ```console 197 | $ cmake .. -DSTATIC_LINKING=True -DWASI_TARGET=True 198 | ``` 199 | CMake reports that is can find the OpenBLAS library: 200 | ``` 201 | -- BLAS library found: /usr/lib64/libopenblas.a 202 | ``` 203 | The problem is that we cannot specify this library to the wasm-ld linker as it 204 | only deals with wasm object files. 205 | 206 | $ cp /usr/lib64/libopenblas.a ~/work/wasm/wasi-sdk/download/wasi-sdk-8.0/share/wasi-sysroot/lib/ 207 | 208 | ### Basic Linear Algebra Subprograms (BLAS) 209 | Provides low level matrix operations. 210 | 211 | ### Linear Algebra Package (LAPACK) 212 | Is a library of higher level linear algebra operations. LAPACK is built on top 213 | of BLAS (uses BLAS operations) 214 | 215 | Came out of a project named LINPACK which was written in the 70/80s. LAPACK is 216 | designed to work well on modern computers with regard to CPU caches. LAPACK was 217 | originally written in FORTRAN and the first FORTRAN standards restricted 218 | identifiers to only 6 characters which is why the symbols in LAPACK are very 219 | compact. 220 | 221 | The format for symboal is `pmmaaa` where p 222 | 223 | 224 | 225 | 226 | ### Qiskit-Aer 227 | Uses [Conda](https://docs.conda.io/en/latest/) which is a package, deps, and 228 | environment manager for multiple (any?) language. I though it was just for 229 | python. 230 | So it can be used to set up separate environments which is a nice thing so that 231 | installed programs deps don't conflict with each other. 232 | 233 | Installing conda: 234 | ```console 235 | $ sudo dnf install conda 236 | ``` 237 | Next we create a conda environment for development: 238 | ```console 239 | $ conda create -y -n QiskitDevEnv python=3 240 | ``` 241 | Then we can activate this newly created environment using: 242 | ```console 243 | $ conda activate QiskitDevEnv 244 | ``` 245 | To deactive: 246 | ```console 247 | $ conda deactivate 248 | ``` 249 | Install dev deps: 250 | ```console 251 | $ sudo pip install -r requirements-dev.txt 252 | # pip install conan 253 | $ sudo dnf install openblas-devel 254 | $ sudo dnf install openblas-static 255 | $ sudo dnf install libgfortran-static 256 | 257 | 258 | Building as a standalone executable: 259 | ```console 260 | $ mkdir out && cd out 261 | $ cmake .. 262 | $ cmake --build . --config Release -- -j8 263 | ``` 264 | ```console 265 | $ file Release/qasm_simulator 266 | Release/qasm_simulator: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=b8a30ab828bed5f736f4cfea8dc0396884eb08bc, for GNU/Linux 3.2.0, with debug_info, not stripped 267 | $ ldd Release/qasm_simulator 268 | linux-vdso.so.1 (0x00007ffff7fcf000) 269 | libopenblas.so.0 => /usr/lib64/libopenblas.so.0 (0x00007ffff5cc0000) 270 | libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007ffff5cb9000) 271 | libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007ffff5c97000) 272 | libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007ffff5a9e000) 273 | libm.so.6 => /usr/lib64/libm.so.6 (0x00007ffff5958000) 274 | libgomp.so.1 => /usr/lib64/libgomp.so.1 (0x00007ffff591e000) 275 | libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007ffff5902000) 276 | libc.so.6 => /usr/lib64/libc.so.6 (0x00007ffff5739000) 277 | libgfortran.so.5 => /usr/lib64/libgfortran.so.5 (0x00007ffff5497000) 278 | /lib64/ld-linux-x86-64.so.2 (0x00007ffff7fd1000) 279 | libquadmath.so.0 => /usr/lib64/libquadmath.so.0 (0x00007ffff544d000) 280 | ``` 281 | After building we can verify that we can run the simulator using: 282 | ```console 283 | $ ./Release/qasm_simulator src/qobj-simulator-example.input > output 284 | ``` 285 | 286 | So to be able to run this completely in a browser we need to be able to 287 | statically link it. 288 | 289 | 290 | Building with debug symbols: 291 | ```console 292 | $ cmake -DCMAKE_BUILD_TYPE=Debug .. 293 | $ make -j8 294 | ``` 295 | 296 | ### Try with emscripten 297 | ```console 298 | $ git clone https://github.com/emscripten-core/emsdk.git 299 | $ cd emsdk 300 | $ ./emsdk install latest 301 | $ ./emsdk activate latest 302 | $ source ./emsdk_env.sh 303 | ``` 304 | 305 | 306 | 307 | ### Conan 308 | 309 | -------------------------------------------------------------------------------- /notes/schrodinger.md: -------------------------------------------------------------------------------- 1 | #### Schrödinger's Equation 2 | Is a tool to understand how a particles wave function changes at different 3 | points in space and how it evolves over time. One would solve the equation for 4 | a specific particle interacting with a physical system and the result is a wave 5 | function for that particle. 6 | 7 | The time-dependent Schrödinger equation is: 8 | ``` 9 | iħ ∂Ψ(x,t) = HΨ(x,t) 10 | -- 11 | ∂t 12 | 13 | i = imaginary number 14 | ħ = h/2π, h = Planck's constant, this is called the reduced Planck's constant 15 | Ψ = is function of location x and time t. 16 | H = Hamiltonian operator (^ = operator) 17 | ∂Ψ(x,t) = partial derivative of Ψ(x,t) with respect to x and t 18 | ``` 19 | 20 | The time-dependent Schrödinger equation with the kinetic and potential energy 21 | terms separated. This information is contains in the Hamiltonian operator. 22 | ``` 23 | iħ(∂/∂t)Ψ(r, t) = [-ħ²/(2m)∇² + V(r)] Ψ(r, t) 24 | 25 | ħ = represents the reduced Planck constant (h-bar). 26 | (∂/∂t) = is the partial derivative with respect to time. 27 | Ψ(r, t) = is the wave function, depending on position r and time t. 28 | Ψ = is function of location x and time t. 29 | [-ħ²/(2m)∇² + V(r)] = represents the operator with kinetic energy (involving the 30 | Laplacian ∇²) and potential energy V(r). 31 | ``` 32 | The solution to the equation is a wave function, Ψ(x,t), which describes the 33 | quantum state of the particle. 34 | 35 | So with the output of the Schrödinger equation, the wave function, describes the 36 | quantum state of the particle. 37 | 38 | If we take the square of the wave function (|Ψ|²) that tells us the probability 39 | density of finding the particle at a given point. This is a probability 40 | distribution and tells us the probability of finding the electron is a region. 41 | Think of when we have an LLM where we get a probability distribution of the next 42 | token to predict. There is a set of positions (a region) where the electron is 43 | likely to be found. These regions are called orbitals. Orbitals don't imply that 44 | any motion like obiting they only describe the probability of finding the 45 | electron in a region. They are like probability "clouds". 46 | 47 | TODO: Add details about orbitals 48 | -------------------------------------------------------------------------------- /notes/spin.md: -------------------------------------------------------------------------------- 1 | ## Spin 2 | Not spin like plant, but a fundamental property of particles, like charge or 3 | mass. So it is not something that a particle does, but something it has, like 4 | something the weighs 1.5 kg, it may have a spin of 3 (just making the numbers 5 | up). Spin is a fundamental property of particles, like charge or mass. 6 | 7 | Spin values are quantized, meaning that they can only take on certain values. 8 | Electrons, protons, and neutrons have a spin of +1/2 or -1/2. 9 | 10 | I've read that spin is about angular momentum but not in the classical physics 11 | sense. Spin insn't about the particle moving through space, but about the 12 | particle's intrinsic angular momentum. It's a property of the particle, not 13 | something it does. 14 | 15 | Me: 16 | ``` 17 | I’m confused by the usage of angular momentum with regards to spin. The usage of 18 | angular momentum sounds like a measurement of rotation or am I misunderstanding 19 | the name? 20 | ``` 21 | ChatGPT 4: 22 | ``` 23 | Your confusion is understandable. The term "angular momentum" in the context of 24 | spin in quantum mechanics can indeed be misleading if interpreted through 25 | everyday experiences of rotation and circular motion. 26 | 27 | 1. Classical Angular Momentum: In classical physics, angular momentum is 28 | indeed associated with the rotation of an object around an axis. For example, a 29 | spinning top, a planet orbiting the sun, or a swinging pendulum all have 30 | classical angular momentum. It's a measure of the extent to which an object is 31 | rotating and depends on the object's mass, shape, and how fast it's spinning or 32 | orbiting. 33 | 34 | 2. Quantum Spin as a Form of Angular Momentum: In quantum mechanics, "spin" 35 | is a form of angular momentum, but it's not due to any literal spinning motion. 36 | Particles like electrons have spin, but they are point-like with no internal 37 | structure to spin around an axis. Spin in quantum mechanics is an intrinsic 38 | property of particles, much like mass or charge. It's a fundamental aspect of a 39 | particle's identity, defined by the mathematics of quantum theory. 40 | 41 | 3. Why the Term 'Angular Momentum'?: The reason we use the term "angular 42 | momentum" for spin is largely historical and mathematical. Spin obeys 43 | mathematical rules similar to those of classical angular momentum (like 44 | conservation laws), and it contributes to the total angular momentum of systems 45 | in quantum mechanics. But unlike classical angular momentum, it doesn't 46 | correspond to any visible motion. 47 | 48 | In summary, while spin is a type of angular momentum in quantum mechanics, it 49 | doesn't involve actual rotation or circular motion. It's an intrinsic quantum 50 | property that follows some of the same mathematical rules as classical angular 51 | momentum but doesn't have a direct analogy in everyday physical motion. 52 | ``` 53 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "learning-quantum-computing", 3 | "version": "0.0.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@qiskit/algo": { 8 | "version": "0.9.0", 9 | "resolved": "https://registry.npmjs.org/@qiskit/algo/-/algo-0.9.0.tgz", 10 | "integrity": "sha512-qz/1AgzRVunrp5/tXGSq1lnPdsezQs1RTJEGju3xzVWjq9XcE2o9jxifMcfVrZBGSXTH5R8TlWgXZVb0jnIY4g==", 11 | "requires": { 12 | "@qiskit/algo-anu": "^0.9.0", 13 | "@qiskit/algo-ibm": "^0.9.0", 14 | "@qiskit/algo-js": "^0.9.0", 15 | "@qiskit/utils": "^0.9.0" 16 | } 17 | }, 18 | "@qiskit/algo-anu": { 19 | "version": "0.9.0", 20 | "resolved": "https://registry.npmjs.org/@qiskit/algo-anu/-/algo-anu-0.9.0.tgz", 21 | "integrity": "sha512-711YoKAAnuSi8XMGS6WuvJ0A+wFqZMehO7opEK3Kz58Ij6Eesmx9OLc85Ln79MItzCHU9C0BLRUelfTwZfSZ4w==", 22 | "requires": { 23 | "@qiskit/utils": "^0.9.0", 24 | "request-promise-native": "^1.0.7" 25 | } 26 | }, 27 | "@qiskit/algo-ibm": { 28 | "version": "0.9.0", 29 | "resolved": "https://registry.npmjs.org/@qiskit/algo-ibm/-/algo-ibm-0.9.0.tgz", 30 | "integrity": "sha512-EVd9Xf7xSLCnFcTbQZYvKvKaCZLJ1nqd4LWh96M4awgvgeYctBQ88eM2C1xoN2KAsy8qQX65XIiFqucy3/TciA==", 31 | "requires": { 32 | "@qiskit/utils": "^0.9.0" 33 | } 34 | }, 35 | "@qiskit/algo-js": { 36 | "version": "0.9.0", 37 | "resolved": "https://registry.npmjs.org/@qiskit/algo-js/-/algo-js-0.9.0.tgz", 38 | "integrity": "sha512-JfBu2e3Rk8tm0H4PHD2VjxgcAzoU2L0bCmtL6ITFEt2Y3sLtvypyiAxM5Ql2c0uUR7xnm9dRagHLR5EmJCRzKA==", 39 | "requires": { 40 | "@qiskit/utils": "^0.9.0", 41 | "jsqubits": "^1.1.0" 42 | } 43 | }, 44 | "@qiskit/cloud": { 45 | "version": "0.9.0", 46 | "resolved": "https://registry.npmjs.org/@qiskit/cloud/-/cloud-0.9.0.tgz", 47 | "integrity": "sha512-mU24WsTicw34pc6vKhWdZ9GZbjCBh99EqoPbdRcviJCiaTkEiqYlep8BaeGigxKL3V1HiueQwKJep8TsXKCV3Q==", 48 | "requires": { 49 | "@qiskit/utils": "^0.9.0", 50 | "request": "^2.88.0", 51 | "request-promise-native": "^1.0.7" 52 | } 53 | }, 54 | "@qiskit/qasm": { 55 | "version": "0.9.0", 56 | "resolved": "https://registry.npmjs.org/@qiskit/qasm/-/qasm-0.9.0.tgz", 57 | "integrity": "sha512-MnXvZrsVff7l6NkFFDzHmeyz/pNQTU06poOr4eCiIgx5CGXt905HMVjLz2K/TMz3d2kzK6Q6dI9hXWXg3LmLgw==", 58 | "requires": { 59 | "@qiskit/utils": "^0.9.0", 60 | "jison": "^0.4.18" 61 | } 62 | }, 63 | "@qiskit/sim": { 64 | "version": "0.9.0", 65 | "resolved": "https://registry.npmjs.org/@qiskit/sim/-/sim-0.9.0.tgz", 66 | "integrity": "sha512-AZq70fJkcj+KMnN2v3eQEC4tRFeKEVJ3CZ1CgxDg3SgMVErX7LYh4X2UJdnkFaHPwDwLbw/s8kVFryNKR7GmCQ==", 67 | "requires": { 68 | "@qiskit/qasm": "^0.9.0", 69 | "@qiskit/utils": "^0.9.0", 70 | "mathjs": "^5.10.0" 71 | }, 72 | "dependencies": { 73 | "decimal.js": { 74 | "version": "10.2.0", 75 | "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.0.tgz", 76 | "integrity": "sha512-vDPw+rDgn3bZe1+F/pyEwb1oMG2XTlRVgAa6B4KccTEpYgF8w6eQllVbQcfIJnZyvzFtFpxnpGtx8dd7DJp/Rw==" 77 | }, 78 | "mathjs": { 79 | "version": "5.10.3", 80 | "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-5.10.3.tgz", 81 | "integrity": "sha512-ySjg30BC3dYjQm73ILZtwcWzFJde0VU6otkXW/57IjjuYRa3Qaf0Kb8pydEuBZYtqW2OxreAtsricrAmOj3jIw==", 82 | "requires": { 83 | "complex.js": "2.0.11", 84 | "decimal.js": "10.2.0", 85 | "escape-latex": "1.2.0", 86 | "fraction.js": "4.0.12", 87 | "javascript-natural-sort": "0.7.1", 88 | "seed-random": "2.2.0", 89 | "tiny-emitter": "2.1.0", 90 | "typed-function": "1.1.0" 91 | } 92 | } 93 | } 94 | }, 95 | "@qiskit/utils": { 96 | "version": "0.9.0", 97 | "resolved": "https://registry.npmjs.org/@qiskit/utils/-/utils-0.9.0.tgz", 98 | "integrity": "sha512-uz0y3Ei6IFeBSL+JrF5hkJ3l0ZVQjK6Ej3rE/xKPoZvlqWDlBfoVAVKVijrcz7d3bwFAUOV2QKgqpDX8/Y69iw==", 99 | "requires": { 100 | "all-your-base": "^0.3.0", 101 | "debug": "^4.1.1", 102 | "lodash": "^4.17.11" 103 | } 104 | }, 105 | "JSONSelect": { 106 | "version": "0.4.0", 107 | "resolved": "https://registry.npmjs.org/JSONSelect/-/JSONSelect-0.4.0.tgz", 108 | "integrity": "sha1-oI7cxn6z/L6Z7WMIVTRKDPKCu40=" 109 | }, 110 | "JSV": { 111 | "version": "4.0.2", 112 | "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", 113 | "integrity": "sha1-0Hf2glVx+CEy+d/67Vh7QCn+/1c=" 114 | }, 115 | "ajv": { 116 | "version": "6.10.0", 117 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", 118 | "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", 119 | "requires": { 120 | "fast-deep-equal": "^2.0.1", 121 | "fast-json-stable-stringify": "^2.0.0", 122 | "json-schema-traverse": "^0.4.1", 123 | "uri-js": "^4.2.2" 124 | } 125 | }, 126 | "all-your-base": { 127 | "version": "0.3.0", 128 | "resolved": "https://registry.npmjs.org/all-your-base/-/all-your-base-0.3.0.tgz", 129 | "integrity": "sha1-61apxC2l0XNeradF6S0FaLaFDTQ=" 130 | }, 131 | "amdefine": { 132 | "version": "1.0.1", 133 | "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", 134 | "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", 135 | "optional": true 136 | }, 137 | "ansi-regex": { 138 | "version": "2.1.1", 139 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 140 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" 141 | }, 142 | "ansi-styles": { 143 | "version": "3.2.1", 144 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 145 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 146 | "requires": { 147 | "color-convert": "^1.9.0" 148 | } 149 | }, 150 | "asn1": { 151 | "version": "0.2.4", 152 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", 153 | "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", 154 | "requires": { 155 | "safer-buffer": "~2.1.0" 156 | } 157 | }, 158 | "assert-plus": { 159 | "version": "1.0.0", 160 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 161 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" 162 | }, 163 | "async": { 164 | "version": "0.9.2", 165 | "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", 166 | "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" 167 | }, 168 | "asynckit": { 169 | "version": "0.4.0", 170 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 171 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 172 | }, 173 | "aws-sign2": { 174 | "version": "0.7.0", 175 | "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", 176 | "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" 177 | }, 178 | "aws4": { 179 | "version": "1.8.0", 180 | "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", 181 | "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" 182 | }, 183 | "balanced-match": { 184 | "version": "1.0.0", 185 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 186 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" 187 | }, 188 | "bcrypt-pbkdf": { 189 | "version": "1.0.2", 190 | "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", 191 | "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", 192 | "requires": { 193 | "tweetnacl": "^0.14.3" 194 | } 195 | }, 196 | "brace-expansion": { 197 | "version": "1.1.11", 198 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 199 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 200 | "requires": { 201 | "balanced-match": "^1.0.0", 202 | "concat-map": "0.0.1" 203 | } 204 | }, 205 | "camelcase": { 206 | "version": "5.3.1", 207 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", 208 | "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" 209 | }, 210 | "caseless": { 211 | "version": "0.12.0", 212 | "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", 213 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" 214 | }, 215 | "cjson": { 216 | "version": "0.3.0", 217 | "resolved": "https://registry.npmjs.org/cjson/-/cjson-0.3.0.tgz", 218 | "integrity": "sha1-5kObkHA9MS/24iJAl76pLOPQKhQ=", 219 | "requires": { 220 | "jsonlint": "1.6.0" 221 | } 222 | }, 223 | "cli-color": { 224 | "version": "1.4.0", 225 | "resolved": "https://registry.npmjs.org/cli-color/-/cli-color-1.4.0.tgz", 226 | "integrity": "sha512-xu6RvQqqrWEo6MPR1eixqGPywhYBHRs653F9jfXB2Hx4jdM/3WxiNE1vppRmxtMIfl16SFYTpYlrnqH/HsK/2w==", 227 | "requires": { 228 | "ansi-regex": "^2.1.1", 229 | "d": "1", 230 | "es5-ext": "^0.10.46", 231 | "es6-iterator": "^2.0.3", 232 | "memoizee": "^0.4.14", 233 | "timers-ext": "^0.1.5" 234 | } 235 | }, 236 | "cliui": { 237 | "version": "5.0.0", 238 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", 239 | "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", 240 | "requires": { 241 | "string-width": "^3.1.0", 242 | "strip-ansi": "^5.2.0", 243 | "wrap-ansi": "^5.1.0" 244 | } 245 | }, 246 | "color-convert": { 247 | "version": "1.9.3", 248 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 249 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 250 | "requires": { 251 | "color-name": "1.1.3" 252 | } 253 | }, 254 | "color-name": { 255 | "version": "1.1.3", 256 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 257 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" 258 | }, 259 | "colors": { 260 | "version": "0.5.1", 261 | "resolved": "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz", 262 | "integrity": "sha1-fQAj6usVTo7p/Oddy5I9DtFmd3Q=" 263 | }, 264 | "combined-stream": { 265 | "version": "1.0.8", 266 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 267 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 268 | "requires": { 269 | "delayed-stream": "~1.0.0" 270 | } 271 | }, 272 | "complex.js": { 273 | "version": "2.0.11", 274 | "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.0.11.tgz", 275 | "integrity": "sha512-6IArJLApNtdg1P1dFtn3dnyzoZBEF0MwMnrfF1exSBRpZYoy4yieMkpZhQDC0uwctw48vii0CFVyHfpgZ/DfGw==" 276 | }, 277 | "concat-map": { 278 | "version": "0.0.1", 279 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 280 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" 281 | }, 282 | "core-util-is": { 283 | "version": "1.0.2", 284 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 285 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 286 | }, 287 | "cross-spawn": { 288 | "version": "6.0.5", 289 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", 290 | "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", 291 | "requires": { 292 | "nice-try": "^1.0.4", 293 | "path-key": "^2.0.1", 294 | "semver": "^5.5.0", 295 | "shebang-command": "^1.2.0", 296 | "which": "^1.2.9" 297 | } 298 | }, 299 | "cycle": { 300 | "version": "1.0.3", 301 | "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", 302 | "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=" 303 | }, 304 | "d": { 305 | "version": "1.0.0", 306 | "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", 307 | "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", 308 | "requires": { 309 | "es5-ext": "^0.10.9" 310 | } 311 | }, 312 | "dashdash": { 313 | "version": "1.14.1", 314 | "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", 315 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", 316 | "requires": { 317 | "assert-plus": "^1.0.0" 318 | } 319 | }, 320 | "debug": { 321 | "version": "4.1.1", 322 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", 323 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", 324 | "requires": { 325 | "ms": "^2.1.1" 326 | } 327 | }, 328 | "decamelize": { 329 | "version": "1.2.0", 330 | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", 331 | "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" 332 | }, 333 | "decimal.js": { 334 | "version": "10.1.1", 335 | "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.1.1.tgz", 336 | "integrity": "sha512-vEEgyk1fWVEnv7lPjkNedAIjzxQDue5Iw4FeX4UkNUDSVyD/jZTD0Bw2kAO7k6iyyJRAhM9oxxI0D1ET6k0Mmg==" 337 | }, 338 | "deep-equal": { 339 | "version": "0.2.2", 340 | "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.2.tgz", 341 | "integrity": "sha1-hLdFiW80xoTpjyzg5Cq69Du6AX0=" 342 | }, 343 | "delayed-stream": { 344 | "version": "1.0.0", 345 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 346 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 347 | }, 348 | "ebnf-parser": { 349 | "version": "0.1.10", 350 | "resolved": "https://registry.npmjs.org/ebnf-parser/-/ebnf-parser-0.1.10.tgz", 351 | "integrity": "sha1-zR9rpHfFY4xAyX7ZtXLbW6tdgzE=" 352 | }, 353 | "ecc-jsbn": { 354 | "version": "0.1.2", 355 | "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", 356 | "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", 357 | "requires": { 358 | "jsbn": "~0.1.0", 359 | "safer-buffer": "^2.1.0" 360 | } 361 | }, 362 | "emoji-regex": { 363 | "version": "7.0.3", 364 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", 365 | "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" 366 | }, 367 | "end-of-stream": { 368 | "version": "1.4.1", 369 | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", 370 | "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", 371 | "requires": { 372 | "once": "^1.4.0" 373 | } 374 | }, 375 | "es5-ext": { 376 | "version": "0.10.50", 377 | "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz", 378 | "integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==", 379 | "requires": { 380 | "es6-iterator": "~2.0.3", 381 | "es6-symbol": "~3.1.1", 382 | "next-tick": "^1.0.0" 383 | } 384 | }, 385 | "es6-iterator": { 386 | "version": "2.0.3", 387 | "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", 388 | "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", 389 | "requires": { 390 | "d": "1", 391 | "es5-ext": "^0.10.35", 392 | "es6-symbol": "^3.1.1" 393 | } 394 | }, 395 | "es6-symbol": { 396 | "version": "3.1.1", 397 | "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", 398 | "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", 399 | "requires": { 400 | "d": "1", 401 | "es5-ext": "~0.10.14" 402 | } 403 | }, 404 | "es6-weak-map": { 405 | "version": "2.0.2", 406 | "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", 407 | "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", 408 | "requires": { 409 | "d": "1", 410 | "es5-ext": "^0.10.14", 411 | "es6-iterator": "^2.0.1", 412 | "es6-symbol": "^3.1.1" 413 | } 414 | }, 415 | "escape-latex": { 416 | "version": "1.2.0", 417 | "resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz", 418 | "integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw==" 419 | }, 420 | "escodegen": { 421 | "version": "1.3.3", 422 | "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.3.3.tgz", 423 | "integrity": "sha1-8CQBb1qI4Eb9EgBQVek5gC5sXyM=", 424 | "requires": { 425 | "esprima": "~1.1.1", 426 | "estraverse": "~1.5.0", 427 | "esutils": "~1.0.0", 428 | "source-map": "~0.1.33" 429 | } 430 | }, 431 | "esprima": { 432 | "version": "1.1.1", 433 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.1.1.tgz", 434 | "integrity": "sha1-W28VR/TRAuZw4UDFCb5ncdautUk=" 435 | }, 436 | "estraverse": { 437 | "version": "1.5.1", 438 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz", 439 | "integrity": "sha1-hno+jlip+EYYr7bC3bzZFrfLr3E=" 440 | }, 441 | "esutils": { 442 | "version": "1.0.0", 443 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.0.0.tgz", 444 | "integrity": "sha1-gVHTWOIMisx/t0XnRywAJf5JZXA=" 445 | }, 446 | "event-emitter": { 447 | "version": "0.3.5", 448 | "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", 449 | "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", 450 | "requires": { 451 | "d": "1", 452 | "es5-ext": "~0.10.14" 453 | } 454 | }, 455 | "execa": { 456 | "version": "1.0.0", 457 | "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", 458 | "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", 459 | "requires": { 460 | "cross-spawn": "^6.0.0", 461 | "get-stream": "^4.0.0", 462 | "is-stream": "^1.1.0", 463 | "npm-run-path": "^2.0.0", 464 | "p-finally": "^1.0.0", 465 | "signal-exit": "^3.0.0", 466 | "strip-eof": "^1.0.0" 467 | } 468 | }, 469 | "extend": { 470 | "version": "3.0.2", 471 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", 472 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 473 | }, 474 | "extsprintf": { 475 | "version": "1.3.0", 476 | "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", 477 | "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" 478 | }, 479 | "eyes": { 480 | "version": "0.1.8", 481 | "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", 482 | "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" 483 | }, 484 | "fast-deep-equal": { 485 | "version": "2.0.1", 486 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", 487 | "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" 488 | }, 489 | "fast-json-stable-stringify": { 490 | "version": "2.0.0", 491 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", 492 | "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" 493 | }, 494 | "find-up": { 495 | "version": "3.0.0", 496 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", 497 | "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", 498 | "requires": { 499 | "locate-path": "^3.0.0" 500 | } 501 | }, 502 | "forever-agent": { 503 | "version": "0.6.1", 504 | "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", 505 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" 506 | }, 507 | "form-data": { 508 | "version": "2.3.3", 509 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", 510 | "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", 511 | "requires": { 512 | "asynckit": "^0.4.0", 513 | "combined-stream": "^1.0.6", 514 | "mime-types": "^2.1.12" 515 | } 516 | }, 517 | "fraction.js": { 518 | "version": "4.0.12", 519 | "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.0.12.tgz", 520 | "integrity": "sha512-8Z1K0VTG4hzYY7kA/1sj4/r1/RWLBD3xwReT/RCrUCbzPszjNQCCsy3ktkU/eaEqX3MYa4pY37a52eiBlPMlhA==" 521 | }, 522 | "fs.realpath": { 523 | "version": "1.0.0", 524 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 525 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" 526 | }, 527 | "get-caller-file": { 528 | "version": "2.0.5", 529 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", 530 | "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" 531 | }, 532 | "get-stream": { 533 | "version": "4.1.0", 534 | "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", 535 | "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", 536 | "requires": { 537 | "pump": "^3.0.0" 538 | } 539 | }, 540 | "getpass": { 541 | "version": "0.1.7", 542 | "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", 543 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", 544 | "requires": { 545 | "assert-plus": "^1.0.0" 546 | } 547 | }, 548 | "glob": { 549 | "version": "7.1.4", 550 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", 551 | "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", 552 | "requires": { 553 | "fs.realpath": "^1.0.0", 554 | "inflight": "^1.0.4", 555 | "inherits": "2", 556 | "minimatch": "^3.0.4", 557 | "once": "^1.3.0", 558 | "path-is-absolute": "^1.0.0" 559 | } 560 | }, 561 | "har-schema": { 562 | "version": "2.0.0", 563 | "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", 564 | "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" 565 | }, 566 | "har-validator": { 567 | "version": "5.1.3", 568 | "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", 569 | "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", 570 | "requires": { 571 | "ajv": "^6.5.5", 572 | "har-schema": "^2.0.0" 573 | } 574 | }, 575 | "home-or-tmp": { 576 | "version": "3.0.0", 577 | "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-3.0.0.tgz", 578 | "integrity": "sha1-V6j+JM8zzdUkhgoVgh3cJchmcfs=" 579 | }, 580 | "http-signature": { 581 | "version": "1.2.0", 582 | "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", 583 | "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", 584 | "requires": { 585 | "assert-plus": "^1.0.0", 586 | "jsprim": "^1.2.2", 587 | "sshpk": "^1.7.0" 588 | } 589 | }, 590 | "i": { 591 | "version": "0.3.6", 592 | "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz", 593 | "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0=" 594 | }, 595 | "inflight": { 596 | "version": "1.0.6", 597 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 598 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 599 | "requires": { 600 | "once": "^1.3.0", 601 | "wrappy": "1" 602 | } 603 | }, 604 | "inherits": { 605 | "version": "2.0.3", 606 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 607 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 608 | }, 609 | "invert-kv": { 610 | "version": "2.0.0", 611 | "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", 612 | "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" 613 | }, 614 | "is-fullwidth-code-point": { 615 | "version": "2.0.0", 616 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", 617 | "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" 618 | }, 619 | "is-promise": { 620 | "version": "2.1.0", 621 | "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", 622 | "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" 623 | }, 624 | "is-stream": { 625 | "version": "1.1.0", 626 | "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", 627 | "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" 628 | }, 629 | "is-typedarray": { 630 | "version": "1.0.0", 631 | "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", 632 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" 633 | }, 634 | "isexe": { 635 | "version": "2.0.0", 636 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 637 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" 638 | }, 639 | "isstream": { 640 | "version": "0.1.2", 641 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", 642 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" 643 | }, 644 | "javascript-natural-sort": { 645 | "version": "0.7.1", 646 | "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", 647 | "integrity": "sha1-+eIwPUUH9tdDVac2ZNFED7Wg71k=" 648 | }, 649 | "jison": { 650 | "version": "0.4.18", 651 | "resolved": "https://registry.npmjs.org/jison/-/jison-0.4.18.tgz", 652 | "integrity": "sha512-FKkCiJvozgC7VTHhMJ00a0/IApSxhlGsFIshLW6trWJ8ONX2TQJBBz6DlcO1Gffy4w9LT+uL+PA+CVnUSJMF7w==", 653 | "requires": { 654 | "JSONSelect": "0.4.0", 655 | "cjson": "0.3.0", 656 | "ebnf-parser": "0.1.10", 657 | "escodegen": "1.3.x", 658 | "esprima": "1.1.x", 659 | "jison-lex": "0.3.x", 660 | "lex-parser": "~0.1.3", 661 | "nomnom": "1.5.2" 662 | } 663 | }, 664 | "jison-lex": { 665 | "version": "0.3.4", 666 | "resolved": "https://registry.npmjs.org/jison-lex/-/jison-lex-0.3.4.tgz", 667 | "integrity": "sha1-gcoo2E+ESZ36jFlNzePYo/Jux6U=", 668 | "requires": { 669 | "lex-parser": "0.1.x", 670 | "nomnom": "1.5.2" 671 | } 672 | }, 673 | "jsbn": { 674 | "version": "0.1.1", 675 | "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", 676 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" 677 | }, 678 | "json-schema": { 679 | "version": "0.2.3", 680 | "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", 681 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" 682 | }, 683 | "json-schema-traverse": { 684 | "version": "0.4.1", 685 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 686 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" 687 | }, 688 | "json-stringify-safe": { 689 | "version": "5.0.1", 690 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", 691 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" 692 | }, 693 | "jsonlint": { 694 | "version": "1.6.0", 695 | "resolved": "https://registry.npmjs.org/jsonlint/-/jsonlint-1.6.0.tgz", 696 | "integrity": "sha1-iKpGvCiaesk7tGyuLVihh6m7SUo=", 697 | "requires": { 698 | "JSV": ">= 4.0.x", 699 | "nomnom": ">= 1.5.x" 700 | } 701 | }, 702 | "jsprim": { 703 | "version": "1.4.1", 704 | "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", 705 | "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", 706 | "requires": { 707 | "assert-plus": "1.0.0", 708 | "extsprintf": "1.3.0", 709 | "json-schema": "0.2.3", 710 | "verror": "1.10.0" 711 | } 712 | }, 713 | "jsqubits": { 714 | "version": "1.1.0", 715 | "resolved": "https://registry.npmjs.org/jsqubits/-/jsqubits-1.1.0.tgz", 716 | "integrity": "sha512-T2bijcpQjOGxNDnwrLRLPmUneg0Lekp/aoaeWF9QKVEcR90zIXODoLh3nbGzYOvnOehkvi/teFOLIrdFnTKWng==" 717 | }, 718 | "lcid": { 719 | "version": "2.0.0", 720 | "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", 721 | "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", 722 | "requires": { 723 | "invert-kv": "^2.0.0" 724 | } 725 | }, 726 | "lex-parser": { 727 | "version": "0.1.4", 728 | "resolved": "https://registry.npmjs.org/lex-parser/-/lex-parser-0.1.4.tgz", 729 | "integrity": "sha1-ZMTwJfF/1Tv7RXY/rrFvAVp0dVA=" 730 | }, 731 | "locate-path": { 732 | "version": "3.0.0", 733 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", 734 | "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", 735 | "requires": { 736 | "p-locate": "^3.0.0", 737 | "path-exists": "^3.0.0" 738 | } 739 | }, 740 | "lodash": { 741 | "version": "4.17.11", 742 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", 743 | "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" 744 | }, 745 | "lodash.toarray": { 746 | "version": "4.4.0", 747 | "resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz", 748 | "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE=" 749 | }, 750 | "lru-queue": { 751 | "version": "0.1.0", 752 | "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", 753 | "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", 754 | "requires": { 755 | "es5-ext": "~0.10.2" 756 | } 757 | }, 758 | "map-age-cleaner": { 759 | "version": "0.1.3", 760 | "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", 761 | "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", 762 | "requires": { 763 | "p-defer": "^1.0.0" 764 | } 765 | }, 766 | "mathjs": { 767 | "version": "5.9.0", 768 | "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-5.9.0.tgz", 769 | "integrity": "sha512-f1xmJklkTCr48y023cFy/ZSoVzOfgHp1gutvebi/Vv5RLly6j8G9T2/XHkfXewZKcwPDbhBkFEYljaCjudxulQ==", 770 | "requires": { 771 | "complex.js": "2.0.11", 772 | "decimal.js": "10.1.1", 773 | "escape-latex": "1.2.0", 774 | "fraction.js": "4.0.12", 775 | "javascript-natural-sort": "0.7.1", 776 | "seed-random": "2.2.0", 777 | "tiny-emitter": "2.1.0", 778 | "typed-function": "1.1.0" 779 | } 780 | }, 781 | "mem": { 782 | "version": "4.3.0", 783 | "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", 784 | "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", 785 | "requires": { 786 | "map-age-cleaner": "^0.1.1", 787 | "mimic-fn": "^2.0.0", 788 | "p-is-promise": "^2.0.0" 789 | } 790 | }, 791 | "memoizee": { 792 | "version": "0.4.14", 793 | "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz", 794 | "integrity": "sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg==", 795 | "requires": { 796 | "d": "1", 797 | "es5-ext": "^0.10.45", 798 | "es6-weak-map": "^2.0.2", 799 | "event-emitter": "^0.3.5", 800 | "is-promise": "^2.1", 801 | "lru-queue": "0.1", 802 | "next-tick": "1", 803 | "timers-ext": "^0.1.5" 804 | } 805 | }, 806 | "mime-db": { 807 | "version": "1.40.0", 808 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", 809 | "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" 810 | }, 811 | "mime-types": { 812 | "version": "2.1.24", 813 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", 814 | "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", 815 | "requires": { 816 | "mime-db": "1.40.0" 817 | } 818 | }, 819 | "mimic-fn": { 820 | "version": "2.1.0", 821 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", 822 | "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" 823 | }, 824 | "minimatch": { 825 | "version": "3.0.4", 826 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 827 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 828 | "requires": { 829 | "brace-expansion": "^1.1.7" 830 | } 831 | }, 832 | "minimist": { 833 | "version": "0.0.8", 834 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 835 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" 836 | }, 837 | "mkdirp": { 838 | "version": "0.5.1", 839 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 840 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 841 | "requires": { 842 | "minimist": "0.0.8" 843 | } 844 | }, 845 | "ms": { 846 | "version": "2.1.1", 847 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 848 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 849 | }, 850 | "mute-stream": { 851 | "version": "0.0.8", 852 | "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", 853 | "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" 854 | }, 855 | "ncp": { 856 | "version": "1.0.1", 857 | "resolved": "https://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz", 858 | "integrity": "sha1-0VNn5cuHQyuhF9K/gP30Wuz7QkY=" 859 | }, 860 | "next-tick": { 861 | "version": "1.0.0", 862 | "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", 863 | "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" 864 | }, 865 | "nice-try": { 866 | "version": "1.0.5", 867 | "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", 868 | "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" 869 | }, 870 | "node-emoji": { 871 | "version": "1.10.0", 872 | "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.10.0.tgz", 873 | "integrity": "sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw==", 874 | "requires": { 875 | "lodash.toarray": "^4.4.0" 876 | } 877 | }, 878 | "node-persist": { 879 | "version": "3.0.4", 880 | "resolved": "https://registry.npmjs.org/node-persist/-/node-persist-3.0.4.tgz", 881 | "integrity": "sha512-/0r1KYqeEKrVvxwQ513rAUG7sNndoi+qgXdRutfaaRWc4axVeoINq2s5vOZ6xVUWKm67ML0gR5UhBuha6M8VJg==", 882 | "requires": { 883 | "mkdirp": "~0.5.1" 884 | } 885 | }, 886 | "nomnom": { 887 | "version": "1.5.2", 888 | "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.5.2.tgz", 889 | "integrity": "sha1-9DRUSKhTz71cDSYyDyR3qwUm/i8=", 890 | "requires": { 891 | "colors": "0.5.x", 892 | "underscore": "1.1.x" 893 | } 894 | }, 895 | "npm-run-path": { 896 | "version": "2.0.2", 897 | "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", 898 | "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", 899 | "requires": { 900 | "path-key": "^2.0.0" 901 | } 902 | }, 903 | "oauth-sign": { 904 | "version": "0.9.0", 905 | "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", 906 | "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" 907 | }, 908 | "once": { 909 | "version": "1.4.0", 910 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 911 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 912 | "requires": { 913 | "wrappy": "1" 914 | } 915 | }, 916 | "os-locale": { 917 | "version": "3.1.0", 918 | "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", 919 | "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", 920 | "requires": { 921 | "execa": "^1.0.0", 922 | "lcid": "^2.0.0", 923 | "mem": "^4.0.0" 924 | } 925 | }, 926 | "p-defer": { 927 | "version": "1.0.0", 928 | "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", 929 | "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" 930 | }, 931 | "p-finally": { 932 | "version": "1.0.0", 933 | "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", 934 | "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" 935 | }, 936 | "p-is-promise": { 937 | "version": "2.1.0", 938 | "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", 939 | "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==" 940 | }, 941 | "p-limit": { 942 | "version": "2.2.0", 943 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", 944 | "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", 945 | "requires": { 946 | "p-try": "^2.0.0" 947 | } 948 | }, 949 | "p-locate": { 950 | "version": "3.0.0", 951 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", 952 | "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", 953 | "requires": { 954 | "p-limit": "^2.0.0" 955 | } 956 | }, 957 | "p-try": { 958 | "version": "2.2.0", 959 | "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", 960 | "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" 961 | }, 962 | "path-exists": { 963 | "version": "3.0.0", 964 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", 965 | "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" 966 | }, 967 | "path-is-absolute": { 968 | "version": "1.0.1", 969 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 970 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" 971 | }, 972 | "path-key": { 973 | "version": "2.0.1", 974 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", 975 | "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" 976 | }, 977 | "performance-now": { 978 | "version": "2.1.0", 979 | "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", 980 | "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" 981 | }, 982 | "pkginfo": { 983 | "version": "0.4.1", 984 | "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz", 985 | "integrity": "sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8=" 986 | }, 987 | "prettyjson": { 988 | "version": "1.2.1", 989 | "resolved": "https://registry.npmjs.org/prettyjson/-/prettyjson-1.2.1.tgz", 990 | "integrity": "sha1-/P+rQdGcq0365eV15kJGYZsS0ok=", 991 | "requires": { 992 | "colors": "^1.1.2", 993 | "minimist": "^1.2.0" 994 | }, 995 | "dependencies": { 996 | "colors": { 997 | "version": "1.3.3", 998 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", 999 | "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==" 1000 | }, 1001 | "minimist": { 1002 | "version": "1.2.0", 1003 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", 1004 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" 1005 | } 1006 | } 1007 | }, 1008 | "prompt": { 1009 | "version": "1.0.0", 1010 | "resolved": "https://registry.npmjs.org/prompt/-/prompt-1.0.0.tgz", 1011 | "integrity": "sha1-jlcSPDlquYiJf7Mn/Trtw+c15P4=", 1012 | "requires": { 1013 | "colors": "^1.1.2", 1014 | "pkginfo": "0.x.x", 1015 | "read": "1.0.x", 1016 | "revalidator": "0.1.x", 1017 | "utile": "0.3.x", 1018 | "winston": "2.1.x" 1019 | }, 1020 | "dependencies": { 1021 | "colors": { 1022 | "version": "1.3.3", 1023 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", 1024 | "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==" 1025 | } 1026 | } 1027 | }, 1028 | "psl": { 1029 | "version": "1.1.31", 1030 | "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", 1031 | "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" 1032 | }, 1033 | "pump": { 1034 | "version": "3.0.0", 1035 | "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", 1036 | "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", 1037 | "requires": { 1038 | "end-of-stream": "^1.1.0", 1039 | "once": "^1.3.1" 1040 | } 1041 | }, 1042 | "punycode": { 1043 | "version": "2.1.1", 1044 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", 1045 | "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" 1046 | }, 1047 | "qiskit": { 1048 | "version": "0.9.0", 1049 | "resolved": "https://registry.npmjs.org/qiskit/-/qiskit-0.9.0.tgz", 1050 | "integrity": "sha512-zS9XMWmJ2tAjAVPKgenwDue25nGixgKSL4ZstJtUnCEXI0l4qhVI1cH3FBJxlMOkULNKef6ByTm5MAF+X8OErQ==", 1051 | "requires": { 1052 | "@qiskit/algo": "^0.9.0", 1053 | "@qiskit/cloud": "^0.9.0", 1054 | "@qiskit/qasm": "^0.9.0", 1055 | "@qiskit/sim": "^0.9.0", 1056 | "@qiskit/utils": "^0.9.0", 1057 | "cli-color": "^1.4.0", 1058 | "home-or-tmp": "^3.0.0", 1059 | "node-emoji": "^1.10.0", 1060 | "node-persist": "^3.0.4", 1061 | "prettyjson": "^1.2.1", 1062 | "prompt": "^1.0.0", 1063 | "yargs": "^13.2.4" 1064 | } 1065 | }, 1066 | "qs": { 1067 | "version": "6.5.2", 1068 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", 1069 | "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" 1070 | }, 1071 | "read": { 1072 | "version": "1.0.7", 1073 | "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", 1074 | "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", 1075 | "requires": { 1076 | "mute-stream": "~0.0.4" 1077 | } 1078 | }, 1079 | "request": { 1080 | "version": "2.88.0", 1081 | "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", 1082 | "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", 1083 | "requires": { 1084 | "aws-sign2": "~0.7.0", 1085 | "aws4": "^1.8.0", 1086 | "caseless": "~0.12.0", 1087 | "combined-stream": "~1.0.6", 1088 | "extend": "~3.0.2", 1089 | "forever-agent": "~0.6.1", 1090 | "form-data": "~2.3.2", 1091 | "har-validator": "~5.1.0", 1092 | "http-signature": "~1.2.0", 1093 | "is-typedarray": "~1.0.0", 1094 | "isstream": "~0.1.2", 1095 | "json-stringify-safe": "~5.0.1", 1096 | "mime-types": "~2.1.19", 1097 | "oauth-sign": "~0.9.0", 1098 | "performance-now": "^2.1.0", 1099 | "qs": "~6.5.2", 1100 | "safe-buffer": "^5.1.2", 1101 | "tough-cookie": "~2.4.3", 1102 | "tunnel-agent": "^0.6.0", 1103 | "uuid": "^3.3.2" 1104 | }, 1105 | "dependencies": { 1106 | "punycode": { 1107 | "version": "1.4.1", 1108 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", 1109 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" 1110 | }, 1111 | "tough-cookie": { 1112 | "version": "2.4.3", 1113 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", 1114 | "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", 1115 | "requires": { 1116 | "psl": "^1.1.24", 1117 | "punycode": "^1.4.1" 1118 | } 1119 | } 1120 | } 1121 | }, 1122 | "request-promise-core": { 1123 | "version": "1.1.2", 1124 | "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz", 1125 | "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==", 1126 | "requires": { 1127 | "lodash": "^4.17.11" 1128 | } 1129 | }, 1130 | "request-promise-native": { 1131 | "version": "1.0.7", 1132 | "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.7.tgz", 1133 | "integrity": "sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==", 1134 | "requires": { 1135 | "request-promise-core": "1.1.2", 1136 | "stealthy-require": "^1.1.1", 1137 | "tough-cookie": "^2.3.3" 1138 | } 1139 | }, 1140 | "require-directory": { 1141 | "version": "2.1.1", 1142 | "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", 1143 | "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" 1144 | }, 1145 | "require-main-filename": { 1146 | "version": "2.0.0", 1147 | "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", 1148 | "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" 1149 | }, 1150 | "revalidator": { 1151 | "version": "0.1.8", 1152 | "resolved": "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz", 1153 | "integrity": "sha1-/s5hv6DBtSoga9axgZgYS91SOjs=" 1154 | }, 1155 | "rimraf": { 1156 | "version": "2.6.3", 1157 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", 1158 | "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", 1159 | "requires": { 1160 | "glob": "^7.1.3" 1161 | } 1162 | }, 1163 | "safe-buffer": { 1164 | "version": "5.1.2", 1165 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 1166 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 1167 | }, 1168 | "safer-buffer": { 1169 | "version": "2.1.2", 1170 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 1171 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 1172 | }, 1173 | "seed-random": { 1174 | "version": "2.2.0", 1175 | "resolved": "https://registry.npmjs.org/seed-random/-/seed-random-2.2.0.tgz", 1176 | "integrity": "sha1-KpsZ4lCoFwmSMaW5mk2vgLf77VQ=" 1177 | }, 1178 | "semver": { 1179 | "version": "5.7.0", 1180 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", 1181 | "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" 1182 | }, 1183 | "set-blocking": { 1184 | "version": "2.0.0", 1185 | "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", 1186 | "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" 1187 | }, 1188 | "shebang-command": { 1189 | "version": "1.2.0", 1190 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", 1191 | "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", 1192 | "requires": { 1193 | "shebang-regex": "^1.0.0" 1194 | } 1195 | }, 1196 | "shebang-regex": { 1197 | "version": "1.0.0", 1198 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", 1199 | "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" 1200 | }, 1201 | "signal-exit": { 1202 | "version": "3.0.2", 1203 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", 1204 | "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" 1205 | }, 1206 | "source-map": { 1207 | "version": "0.1.43", 1208 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", 1209 | "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", 1210 | "optional": true, 1211 | "requires": { 1212 | "amdefine": ">=0.0.4" 1213 | } 1214 | }, 1215 | "sshpk": { 1216 | "version": "1.16.1", 1217 | "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", 1218 | "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", 1219 | "requires": { 1220 | "asn1": "~0.2.3", 1221 | "assert-plus": "^1.0.0", 1222 | "bcrypt-pbkdf": "^1.0.0", 1223 | "dashdash": "^1.12.0", 1224 | "ecc-jsbn": "~0.1.1", 1225 | "getpass": "^0.1.1", 1226 | "jsbn": "~0.1.0", 1227 | "safer-buffer": "^2.0.2", 1228 | "tweetnacl": "~0.14.0" 1229 | } 1230 | }, 1231 | "stack-trace": { 1232 | "version": "0.0.10", 1233 | "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", 1234 | "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" 1235 | }, 1236 | "stealthy-require": { 1237 | "version": "1.1.1", 1238 | "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", 1239 | "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" 1240 | }, 1241 | "string-width": { 1242 | "version": "3.1.0", 1243 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", 1244 | "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", 1245 | "requires": { 1246 | "emoji-regex": "^7.0.1", 1247 | "is-fullwidth-code-point": "^2.0.0", 1248 | "strip-ansi": "^5.1.0" 1249 | } 1250 | }, 1251 | "strip-ansi": { 1252 | "version": "5.2.0", 1253 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", 1254 | "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", 1255 | "requires": { 1256 | "ansi-regex": "^4.1.0" 1257 | }, 1258 | "dependencies": { 1259 | "ansi-regex": { 1260 | "version": "4.1.0", 1261 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", 1262 | "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" 1263 | } 1264 | } 1265 | }, 1266 | "strip-eof": { 1267 | "version": "1.0.0", 1268 | "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", 1269 | "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" 1270 | }, 1271 | "timers-ext": { 1272 | "version": "0.1.7", 1273 | "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", 1274 | "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", 1275 | "requires": { 1276 | "es5-ext": "~0.10.46", 1277 | "next-tick": "1" 1278 | } 1279 | }, 1280 | "tiny-emitter": { 1281 | "version": "2.1.0", 1282 | "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", 1283 | "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" 1284 | }, 1285 | "tough-cookie": { 1286 | "version": "2.5.0", 1287 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", 1288 | "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", 1289 | "requires": { 1290 | "psl": "^1.1.28", 1291 | "punycode": "^2.1.1" 1292 | } 1293 | }, 1294 | "tunnel-agent": { 1295 | "version": "0.6.0", 1296 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 1297 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 1298 | "requires": { 1299 | "safe-buffer": "^5.0.1" 1300 | } 1301 | }, 1302 | "tweetnacl": { 1303 | "version": "0.14.5", 1304 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", 1305 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" 1306 | }, 1307 | "typed-function": { 1308 | "version": "1.1.0", 1309 | "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-1.1.0.tgz", 1310 | "integrity": "sha512-TuQzwiT4DDg19beHam3E66oRXhyqlyfgjHB/5fcvsRXbfmWPJfto9B4a0TBdTrQAPGlGmXh/k7iUI+WsObgORA==" 1311 | }, 1312 | "underscore": { 1313 | "version": "1.1.7", 1314 | "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.1.7.tgz", 1315 | "integrity": "sha1-QLq4S60Z0jAJbo1u9ii/8FXYPbA=" 1316 | }, 1317 | "uri-js": { 1318 | "version": "4.2.2", 1319 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", 1320 | "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", 1321 | "requires": { 1322 | "punycode": "^2.1.0" 1323 | } 1324 | }, 1325 | "utile": { 1326 | "version": "0.3.0", 1327 | "resolved": "https://registry.npmjs.org/utile/-/utile-0.3.0.tgz", 1328 | "integrity": "sha1-E1LDQOuCDk2N26A5pPv6oy7U7zo=", 1329 | "requires": { 1330 | "async": "~0.9.0", 1331 | "deep-equal": "~0.2.1", 1332 | "i": "0.3.x", 1333 | "mkdirp": "0.x.x", 1334 | "ncp": "1.0.x", 1335 | "rimraf": "2.x.x" 1336 | } 1337 | }, 1338 | "uuid": { 1339 | "version": "3.3.2", 1340 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", 1341 | "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" 1342 | }, 1343 | "verror": { 1344 | "version": "1.10.0", 1345 | "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", 1346 | "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", 1347 | "requires": { 1348 | "assert-plus": "^1.0.0", 1349 | "core-util-is": "1.0.2", 1350 | "extsprintf": "^1.2.0" 1351 | } 1352 | }, 1353 | "which": { 1354 | "version": "1.3.1", 1355 | "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", 1356 | "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", 1357 | "requires": { 1358 | "isexe": "^2.0.0" 1359 | } 1360 | }, 1361 | "which-module": { 1362 | "version": "2.0.0", 1363 | "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", 1364 | "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" 1365 | }, 1366 | "winston": { 1367 | "version": "2.1.1", 1368 | "resolved": "https://registry.npmjs.org/winston/-/winston-2.1.1.tgz", 1369 | "integrity": "sha1-PJNJ0ZYgf9G9/51LxD73JRDjoS4=", 1370 | "requires": { 1371 | "async": "~1.0.0", 1372 | "colors": "1.0.x", 1373 | "cycle": "1.0.x", 1374 | "eyes": "0.1.x", 1375 | "isstream": "0.1.x", 1376 | "pkginfo": "0.3.x", 1377 | "stack-trace": "0.0.x" 1378 | }, 1379 | "dependencies": { 1380 | "async": { 1381 | "version": "1.0.0", 1382 | "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", 1383 | "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=" 1384 | }, 1385 | "colors": { 1386 | "version": "1.0.3", 1387 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", 1388 | "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" 1389 | }, 1390 | "pkginfo": { 1391 | "version": "0.3.1", 1392 | "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.3.1.tgz", 1393 | "integrity": "sha1-Wyn2qB9wcXFC4J52W76rl7T4HiE=" 1394 | } 1395 | } 1396 | }, 1397 | "wrap-ansi": { 1398 | "version": "5.1.0", 1399 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", 1400 | "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", 1401 | "requires": { 1402 | "ansi-styles": "^3.2.0", 1403 | "string-width": "^3.0.0", 1404 | "strip-ansi": "^5.0.0" 1405 | } 1406 | }, 1407 | "wrappy": { 1408 | "version": "1.0.2", 1409 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1410 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 1411 | }, 1412 | "y18n": { 1413 | "version": "4.0.0", 1414 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", 1415 | "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" 1416 | }, 1417 | "yargs": { 1418 | "version": "13.2.4", 1419 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", 1420 | "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", 1421 | "requires": { 1422 | "cliui": "^5.0.0", 1423 | "find-up": "^3.0.0", 1424 | "get-caller-file": "^2.0.1", 1425 | "os-locale": "^3.1.0", 1426 | "require-directory": "^2.1.1", 1427 | "require-main-filename": "^2.0.0", 1428 | "set-blocking": "^2.0.0", 1429 | "string-width": "^3.0.0", 1430 | "which-module": "^2.0.0", 1431 | "y18n": "^4.0.0", 1432 | "yargs-parser": "^13.1.0" 1433 | } 1434 | }, 1435 | "yargs-parser": { 1436 | "version": "13.1.0", 1437 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.0.tgz", 1438 | "integrity": "sha512-Yq+32PrijHRri0vVKQEm+ys8mbqWjLiwQkMFNXEENutzLPP0bE4Lcd4iA3OQY5HF+GD3xXxf0MEHb8E4/SA3AA==", 1439 | "requires": { 1440 | "camelcase": "^5.0.0", 1441 | "decamelize": "^1.2.0" 1442 | } 1443 | } 1444 | } 1445 | } 1446 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "learning-quantum-computing", 3 | "version": "0.0.1", 4 | "author": "Daniel Bevenius", 5 | "license": "Apache-2.0", 6 | "dependencies": { 7 | "jsqubits": "^1.1.0", 8 | "mathjs": "^5.9.0", 9 | "qiskit": "^0.9.0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/bell.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | enum class Color { 5 | Blue, Green, Brown 6 | }; 7 | 8 | enum class Sex { 9 | Male, Female 10 | }; 11 | 12 | struct Student { 13 | Sex sex; 14 | int height; 15 | Color eye_color; 16 | }; 17 | 18 | std::ostream& operator<<(std::ostream& out, Color c) { 19 | switch (c) { 20 | case Color::Blue: out << "blue"; break; 21 | case Color::Green: out << "green"; break; 22 | case Color::Brown: out << "brown"; break; 23 | default: out << int(c); break; 24 | } 25 | return out; 26 | } 27 | 28 | std::ostream& operator<<(std::ostream& out, Sex s) { 29 | switch (s) { 30 | case Sex::Male: out << "male"; break; 31 | case Sex::Female: out << "female"; break; 32 | } 33 | return out; 34 | } 35 | 36 | bool bells_inequality(std::list students, int height, Color eye_color); 37 | 38 | 39 | int main(int argc, char** argv) { 40 | std::list students { 41 | { Sex::Male, 165, Color::Green }, 42 | { Sex::Female, 182, Color::Blue }, 43 | { Sex::Male, 192, Color::Blue }, 44 | { Sex::Female, 162, Color::Brown } 45 | }; 46 | for (auto& s : students) { 47 | std::cout << "sex:" << s.sex << 48 | ", height:" << s.height << 49 | ", color:" << s.eye_color << '\n'; 50 | } 51 | 52 | std::cout << std::boolalpha << bells_inequality(students, 181, Color::Brown) << '\n'; 53 | return 0; 54 | } 55 | 56 | bool bells_inequality(std::list students, 57 | int height, 58 | Color eye_color) { 59 | std::list males_under; 60 | std::list all_taller_not_color; 61 | std::list males_not_color; 62 | for (auto& s : students) { 63 | if (s.sex == Sex::Male && s.height < height) { 64 | males_under.push_back(s); 65 | } 66 | if (s.height > height && s.eye_color != eye_color) { 67 | all_taller_not_color.push_back(s); 68 | } 69 | if (s.sex == Sex::Male && s.eye_color != eye_color) { 70 | males_not_color.push_back(s); 71 | } 72 | } 73 | std::cout << males_under.size() << "+" << all_taller_not_color.size() << ">=" << males_not_color.size() << '\n'; 74 | return males_under.size() + all_taller_not_color.size() >= males_not_color.size(); 75 | } 76 | 77 | -------------------------------------------------------------------------------- /src/blas_dgemm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char** argv) { 5 | int i=0; 6 | double input1[6] = {1.0, 3.0, 5.0, 7 | 2.0, 4.0, 6.0}; 8 | int lda = 3; // number of columns when ColMajor 9 | 10 | double input2[4] = {1.0, 2.0, 11 | 3.0, 4.0}; 12 | int ldb = 2; // number of columns when ColMajor 13 | 14 | double output[6] = {.0, .0, .0, .0, .0, .0}; 15 | int ldc = 3; // number of columns when ColMajor 16 | 17 | int m = 3; 18 | int n = 2; 19 | int k = 2; 20 | 21 | // multiply two matricies with double precision values 22 | cblas_dgemm(CblasColMajor, 23 | CblasNoTrans, 24 | CblasNoTrans, 25 | m, // m, rows in the first input matrix 26 | n, // n, columns in the second input matrix 27 | k, // k columns of first input matrix, rows of second input matrix 28 | 1, // value to scale the values with 29 | input1, 30 | lda, // lda 31 | input2, 32 | ldb, // ldb 33 | 1, // value use to scale output 34 | output, 35 | ldc); // for row major 36 | 37 | for(int i=0; i < 6; i++) { 38 | printf("%lf ", output[i]); 39 | } 40 | printf("\n"); 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /src/not_gate.py: -------------------------------------------------------------------------------- 1 | from qutip import * 2 | 3 | import numpy as np 4 | import matplotlib.pyplot as plt 5 | import math 6 | 7 | def not_gate(qubit): 8 | return Qobj([[0, 1], 9 | [1, 0]]) * b 10 | 11 | bloch = Bloch() 12 | b = basis(2, 0) 13 | n = not_gate(b); 14 | print(b) 15 | print(n) 16 | bloch.add_states(n) 17 | bloch.show() 18 | -------------------------------------------------------------------------------- /src/qobj-simulator-example.input: -------------------------------------------------------------------------------- 1 | { 2 | "qobj_id": "danbev_1", 3 | "schema_version": "1.0.0", 4 | "type": "QASM", 5 | "header": { 6 | "description": "Set of Experiments 1", 7 | "backend_name": "ibmqx2"}, 8 | "config": { 9 | "shots": 1024, 10 | "memory_slots": 1, 11 | "init_qubits": true 12 | }, 13 | "experiments": [ 14 | { 15 | "header": { 16 | "memory_slots": 1, 17 | "n_qubits": 3, 18 | "clbit_labels": [["c1", 0]], 19 | "qubit_labels": [null,["q", 0],["q",1]] 20 | }, 21 | "config": {}, 22 | "instructions": [ 23 | {"name": "u1", "qubits": [1], "params": [0.4]}, 24 | {"name": "u2", "qubits": [1], "params": [0.4,0.2]}, 25 | {"name": "u3", "qubits": [1], "params": [0.4,0.2,-0.3]}, 26 | {"name": "snapshot", "label": "snapstate1", "snapshot_type": "statevector"}, 27 | {"name": "cx", "qubits": [1,2]}, 28 | {"name": "barrier", "qubits": [1]}, 29 | {"name": "measure", "qubits": [1], "register": [2], "memory": [0]}, 30 | {"name": "u2", "qubits": [1], "params": [0.4,0.2], "conditional": 2} 31 | ] 32 | } 33 | ] 34 | } 35 | --------------------------------------------------------------------------------