22 | * Wesley Janssen
23 |
24 |
25 | [Poly1305-donna](https://github.com/floodyberry/poly1305-donna)
26 | --------------------------------------------------------------
27 |
28 | * Andrew Moon (@floodyberry)
29 |
--------------------------------------------------------------------------------
/.metadata/.plugins/org.eclipse.wst.jsdt.core/variablesAndContainers.dat:
--------------------------------------------------------------------------------
1 | Ch06_BattleShip )org.eclipse.wst.jsdt.launching.WebProject ,org.eclipse.wst.jsdt.launching.JRE_CONTAINER rC:/Users/vsilva/Documents/Books/Quantum/Workspace/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/system.js 1org.eclipse.wst.jsdt.launching.baseBrowserLibrary ~C:/Users/vsilva/Documents/Books/Quantum/Workspace/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/baseBrowserLibrary.js yC:/Users/vsilva/Documents/Books/Quantum/Workspace/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/browserWindow.js oC:/Users/vsilva/Documents/Books/Quantum/Workspace/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/xhr.js pC:/Users/vsilva/Documents/Books/Quantum/Workspace/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/dom5.js
--------------------------------------------------------------------------------
/Ch03/IBMQuantumExperience/node_modules/ajv/lib/dot/defaults.def:
--------------------------------------------------------------------------------
1 | {{## def.assignDefault:
2 | if ({{=$passData}} === undefined)
3 | {{=$passData}} = {{? it.opts.useDefaults == 'shared' }}
4 | {{= it.useDefault($sch.default) }}
5 | {{??}}
6 | {{= JSON.stringify($sch.default) }}
7 | {{?}};
8 | #}}
9 |
10 |
11 | {{## def.defaultProperties:
12 | {{
13 | var $schema = it.schema.properties
14 | , $schemaKeys = Object.keys($schema); }}
15 | {{~ $schemaKeys:$propertyKey }}
16 | {{ var $sch = $schema[$propertyKey]; }}
17 | {{? $sch.default !== undefined }}
18 | {{ var $passData = $data + it.util.getProperty($propertyKey); }}
19 | {{# def.assignDefault }}
20 | {{?}}
21 | {{~}}
22 | #}}
23 |
24 |
25 | {{## def.defaultItems:
26 | {{~ it.schema.items:$sch:$i }}
27 | {{? $sch.default !== undefined }}
28 | {{ var $passData = $data + '[' + $i + ']'; }}
29 | {{# def.assignDefault }}
30 | {{?}}
31 | {{~}}
32 | #}}
33 |
--------------------------------------------------------------------------------
/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Ch06_BattleShip/python/qbattleship-sim.py:
--------------------------------------------------------------------------------
1 | ##C:/Python27/python.exe
2 |
3 | # Simulates damage data for Win32 Test
4 |
5 | import sys
6 | #from qiskit import QuantumProgram
7 | #import Qconfig
8 | import getpass, random, math
9 |
10 | import cgi
11 | import cgitb
12 |
13 | # solve the relative dependencies if you clone QISKit from the Git repo and use like a global.
14 | sys.path.append('../../qiskit-sdk-py/')
15 |
16 | # debug
17 | cgitb.enable(display=0, logdir=".")
18 |
19 | form = cgi.FieldStorage()
20 |
21 | # Damage [[0,0,0,0,0],[0,0,0,0,0]]
22 | damage = [ [0]*5 for _ in range(2)] # this will hold the prob of a 1 for each qubit for each player
23 | #randPos = random.sample(range(5), 3)
24 |
25 | for ship in range(5):
26 | damage[0][ship] = random.random() # randPos[ship]
27 | damage[1][ship] = random.random()
28 |
29 | #print ("Content-type: application/json\n\n")
30 | print ("{\"status\": 200, \"message\":\"" + str(sys.argv) + "\", \"damage\":" + str(damage) + " }")
31 |
32 |
--------------------------------------------------------------------------------
/Ch03/IBMQuantumExperience/node_modules/performance-now/lib/performance-now.js.map:
--------------------------------------------------------------------------------
1 | {
2 | "version": 3,
3 | "file": "performance-now.js",
4 | "sourceRoot": "..",
5 | "sources": [
6 | "src/performance-now.coffee"
7 | ],
8 | "names": [],
9 | "mappings": ";AAAA;AAAA,MAAA;;EAAA,IAAG,4DAAA,IAAiB,WAAW,CAAC,GAAhC;IACE,MAAM,CAAC,OAAP,GAAiB,SAAA;aAAG,WAAW,CAAC,GAAZ,CAAA;IAAH,EADnB;GAAA,MAEK,IAAG,oDAAA,IAAa,OAAO,CAAC,MAAxB;IACH,MAAM,CAAC,OAAP,GAAiB,SAAA;aAAG,CAAC,cAAA,CAAA,CAAA,GAAmB,YAApB,CAAA,GAAoC;IAAvC;IACjB,MAAA,GAAS,OAAO,CAAC;IACjB,cAAA,GAAiB,SAAA;AACf,UAAA;MAAA,EAAA,GAAK,MAAA,CAAA;aACL,EAAG,CAAA,CAAA,CAAH,GAAQ,GAAR,GAAc,EAAG,CAAA,CAAA;IAFF;IAGjB,cAAA,GAAiB,cAAA,CAAA;IACjB,MAAA,GAAS,OAAO,CAAC,MAAR,CAAA,CAAA,GAAmB;IAC5B,YAAA,GAAe,cAAA,GAAiB,OAR7B;GAAA,MASA,IAAG,IAAI,CAAC,GAAR;IACH,MAAM,CAAC,OAAP,GAAiB,SAAA;aAAG,IAAI,CAAC,GAAL,CAAA,CAAA,GAAa;IAAhB;IACjB,QAAA,GAAW,IAAI,CAAC,GAAL,CAAA,EAFR;GAAA,MAAA;IAIH,MAAM,CAAC,OAAP,GAAiB,SAAA;aAAO,IAAA,IAAA,CAAA,CAAM,CAAC,OAAP,CAAA,CAAJ,GAAuB;IAA1B;IACjB,QAAA,GAAe,IAAA,IAAA,CAAA,CAAM,CAAC,OAAP,CAAA,EALZ;;AAXL"
10 | }
--------------------------------------------------------------------------------
/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Ch03/IBMQuantumExperience/node_modules/ajv/lib/dot/uniqueItems.jst:
--------------------------------------------------------------------------------
1 | {{# def.definitions }}
2 | {{# def.errors }}
3 | {{# def.setupKeyword }}
4 | {{# def.$data }}
5 |
6 |
7 | {{? ($schema || $isData) && it.opts.uniqueItems !== false }}
8 | {{? $isData }}
9 | var {{=$valid}};
10 | if ({{=$schemaValue}} === false || {{=$schemaValue}} === undefined)
11 | {{=$valid}} = true;
12 | else if (typeof {{=$schemaValue}} != 'boolean')
13 | {{=$valid}} = false;
14 | else {
15 | {{?}}
16 |
17 | var {{=$valid}} = true;
18 | if ({{=$data}}.length > 1) {
19 | var i = {{=$data}}.length, j;
20 | outer:
21 | for (;i--;) {
22 | for (j = i; j--;) {
23 | if (equal({{=$data}}[i], {{=$data}}[j])) {
24 | {{=$valid}} = false;
25 | break outer;
26 | }
27 | }
28 | }
29 | }
30 |
31 | {{? $isData }} } {{?}}
32 |
33 | if (!{{=$valid}}) {
34 | {{# def.error:'uniqueItems' }}
35 | } {{? $breakOnError }} else { {{?}}
36 | {{??}}
37 | {{? $breakOnError }} if (true) { {{?}}
38 | {{?}}
39 |
--------------------------------------------------------------------------------
/Ch04/p04-01.obj:
--------------------------------------------------------------------------------
1 | {
2 | "id": "aA46vJHgnKQko3u5L1QqbUDk31sY2m",
3 | "config": {
4 | "max_credits": 10,
5 | "backend": "local_qasm_simulator",
6 | "shots": 1024
7 | },
8 | "circuits": [{
9 | "name": "Circuit",
10 | "config": {
11 | "coupling_map": "None",
12 | "layout": "None",
13 | "basis_gates": "u1,u2,u3,cx,id",
14 | "seed": 123
15 | },
16 | "compiled_circuit": {
17 | "operations": [{
18 | "name": "u3",
19 | "params": [3.141592653589793, 0.0, 3.141592653589793],
20 | "texparams": ["\\pi", "0", "\\pi"],
21 | "qubits": [0]
22 | }, {
23 | "name": "measure",
24 | "qubits": [0],
25 | "clbits": [0]
26 | }],
27 | "header": {
28 | "number_of_qubits": 1,
29 | "qubit_labels": [
30 | ["qr", 0]
31 | ],
32 | "number_of_clbits": 1,
33 | "clbit_labels": [
34 | ["cr", 1]
35 | ]
36 | }
37 | },
38 | "compiled_circuit_qasm": "OPENQASM 2.0;\ninclude \"qelib1.inc \";\nqreg qr[1];\ncreg cr[1];\nu3(3.14159265358979,0,3.14159265358979) qr[0];\nmeasure qr[0] -> cr[0];\n"
39 | }]
40 | }
--------------------------------------------------------------------------------
/Ch06/battleship/js/notify.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Bootstrap Growl notifications
3 | *
4 | * See http://bootstrap-notify.remabledesigns.com/
5 | *
6 | * Requires: JQuery
7 | */
8 |
9 | /**
10 | * Display a notification on the top right of the window:
11 | *
12 | * notify('Welcome back.', 'warning');
13 | *
14 | *
15 | * @param message The text
16 | * @param type Notification type: success, info, danger , inverse, warning.
17 | */
18 | function notify(message, type) {
19 | $.growl({
20 | message : message
21 | /*
22 | * icon: 'glyphicon glyphicon-warning-sign', url:
23 | * 'https://github.com/mouse0270/bootstrap-notify', target: '_blank'
24 | */
25 | }, {
26 | type : type,
27 | allow_dismiss : true,
28 | label : 'Cancel',
29 | className : 'btn-xs btn-inverse',
30 | placement : {
31 | from : 'top',
32 | align : 'right'
33 | },
34 | delay : 10000,
35 | animate : {
36 | enter : 'animated fadeIn',
37 | exit : 'animated fadeOut'
38 | },
39 | offset : {
40 | x : 20,
41 | y : 85
42 | }
43 | });
44 | };
45 |
--------------------------------------------------------------------------------
/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------