forked from oreilly-qc/oreilly-qc.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
624 lines (582 loc) · 32.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
<!DOCTYPE html>
<html lang="en">
<head>
<title>Programming Quantum Computers</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Note to self: This is useful for platform debugging. Do not delete.
<script type="text/javascript">
window.onerror = function(message, source, lineno, colno, error)
{ alert('Beta Error: ' + message + ' src:' + source + ' line:' + lineno + ' col:' + colno); }
</script>
-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<link rel="stylesheet" href="static/css/custom.css">
<link rel="stylesheet" href="static/css/fontawesome-all.css">
<link href="https://fonts.googleapis.com/css?family=Raleway:600&display=swap" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="./external/ace/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="https://machinelevel.github.io/QCEngine/src/qcengine_bitfield.js"></script>
<script type="text/javascript" src="https://machinelevel.github.io/QCEngine/src/qcengine_reg.js"></script>
<script type="text/javascript" src="https://machinelevel.github.io/QCEngine/src/qcengine_int.js"></script>
<script type="text/javascript" src="https://machinelevel.github.io/QCEngine/src/qcengine_basicops.js"></script>
<script type="text/javascript" src="https://machinelevel.github.io/QCEngine/src/qcengine_widgets.js"></script>
<script type="text/javascript" src="https://machinelevel.github.io/QCEngine/src/qcengine_staff.js"></script>
<script type="text/javascript" src="https://machinelevel.github.io/QCEngine/src/qcengine_scriptpanel.js"></script>
<script type="text/javascript" src="https://machinelevel.github.io/QCEngine/src/qcengine_panel.js"></script>
<script type="text/javascript" src="./sample_shortcuts.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-sm navbar-light bg-light">
<a class="navbar-brand" href="#">
<img src="images/logo_small.png" href="#">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="./docs/build/index.html">Docs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="http://shop.oreilly.com/product/0636920167433.do">O'Reilly</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://www.amazon.com/Programming-Quantum-Computers-Essential-Algorithms/dp/1492039683">Buy Book</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Engines
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#" onclick="do_aboutqce_modal();">QCEngine</a>
<a class="dropdown-item" href="#" onclick="do_engine_modal('Qiskit');">Qiskit</a>
<a class="dropdown-item" href="#" onclick="do_engine_modal('OpenQASM');">OpenQASM</a>
<a class="dropdown-item" href="#" onclick="do_engine_modal('QSharp');">Q#</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#" onclick="do_engine_modal('Cirq');">Cirq</a>
<a class="dropdown-item" href="#" onclick="do_addengine_modal();">Add your engine here!</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/oreilly-qc/oreilly-qc.github.io/blob/master/errata/errata.md">Errata</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#" onclick="do_contact_modal();">Contact</a>
</li>
</ul>
</div>
</nav>
<!-- Note: This old-style title banner is a placeholder, until we get the real banner (commented out below) to wrap nicely. -->
<div id="title-div">
<table>
<tr>
<td valign="middle" style="width:13%; max-height:150px;">
<a href="https://www.amazon.com/Programming-Quantum-Computers-Essential-Algorithms/dp/1492039683">
<img class="img-thumbnail" src="images/book_cover.png" style="max-height:150px;">
</a>
</td>
<td valign="middle" style="max-width:90%; max-height:150px;">
<img src="images/title3.png" style="max-width:90%; max-height:80px;"/>
</td>
</tr>
</table>
</div>
<!--
<div class="row ml-1" style="height: 15%; min-height: 150px;">
<div class="col-m-3 mt-3 h-100">
<a href="https://www.amazon.com/Programming-Quantum-Computers-Essential-Algorithms/dp/1492039683">
<img class="img-thumbnail" src="images/book_cover.png" style="height:100%;">
</a>
</div>
<div class="col-m-9 mt-4">
<div class="row ml-3">
<h1 class="display-4">Programming Quantum Computers</h1>
</div>
<div class="row mt-2 ml-4">
<h2>Code Samples</h2>
</div>
</div>
</div>
-->
<div class="row flex-grow-1 mt-4">
<div class="col-sm-6">
<div class="card mb-5">
<div class="card-header">
<div class="btn-group">
<button type="button" class="btn btn-success" onclick="handle_run_button();">
<span class="glyphicon glyphicon-play"></span>
Run Program
</button>
</div>
<div class="btn-group">
<div class="btn-group" role="group">
<span id="example_choice_span"></span>
</div>
</div>
<div class="btn-group">
<div class="btn-group" role="group">
<span id="engine_choice_span"></span>
</div>
</div>
<div class="btn-group">
<button type="button" class="btn btn-small btn-outline-dark" onclick="click_editor_zoom(-2);">
<i class="fas fa-search-minus"></i>
</button>
<button type="button" class="btn btn-small btn-outline-dark" onclick="click_editor_zoom(2);">
<i class="fas fa-search-plus"></i>
</button>
</div>
<div id="example_github_span">
</div>
</div>
<div class="card-body card-no-margin">
<div id="bug_span">
</div>
<div class="mb-2" id="sample_info_span" style="display:none;">
<i class="fas fa-exclamation-triangle"></i>
<b>This sample takes a while to run.</b>
</div>
<span id="disable_info_span" style="display:none;"></span>
<div id="editor_boot_panel" class="panel-body panel-resizable ej-no-margin">
<div id="editor_div" class="editor"></div>
</div>
</div>
<div id="github_links_footer" class="card-footer text-muted">
</div>
</div>
</div>
<div class="col-sm-6">
<div id="progress_panel" style="display:none;">
<div class="container-fluid pad-right-only">
<div class="progress">
<div id="progress_bar" class="progress-bar" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100">25%</div>
</div>
</div>
</div>
<div class="card mb-5" style="display:none;">
<div class="card-header">
<b>How to run this sample</b>
<div class="btn-group">
<button type="button" class="btn btn-small btn-outline-dark" onclick="click_gate_zoom(-1);">
<i class="fas fa-search-minus"></i>
</button>
<button type="button" class="btn btn-small btn-outline-dark" onclick="click_gate_zoom(1);">
<i class="fas fa-search-plus"></i>
</button>
</div>
</div>
<div class="card-body">
<div id="how_to_boot_panel" class="panel-body panel-resizable">
<span id="how-to-span">(text goes here)</span>
</div>
</div>
</div>
<div id="image_output_div" class="card mb-5" style="display:none;">
<div class="card-header">
<b>Image output</b>
</div>
<div class="card-body">
<div id="image_boot_panel" class="panel-body panel-resizable">
<span id="image_info_span"></span>
<table id="images_table">
<tr>
<td align="center" style="padding: 10px; border: 4px solid #ddd;">
<canvas id="display_ground_truth"></canvas><br/>
<span id="display_ground_truth_span"></span>
</td>
<td align="center" style="padding: 10px; border: 4px solid #ddd;">
<canvas id="display_qfull_res"></canvas><br/>
<span id="display_qfull_res_span"></span>
</td>
</tr>
<tr>
<td align="center" style="padding: 10px; border: 4px solid #ddd;">
<canvas id="display_monte_carlo"></canvas><br/>
<span id="display_monte_carlo_span"></span>
</td>
<td align="center" style="padding: 10px; border: 4px solid #ddd;">
<canvas id="display_qss"></canvas><br/>
<span id="display_qss_span"></span>
</td>
</tr>
<tr>
<td align="center" style="padding: 10px; border: 4px solid #ddd;">
<canvas id="display_confidence"></canvas><br/>
<span id="display_confidence_span"></span>
</td>
</tr>
</table>
<table>
<tr>
<td colspan="2" align="center" style="padding: 10px; border: 4px solid #ddd;">
<canvas id="display_cwtable"></canvas><br/>
<span id="display_cwtable_span"></span>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="card mb-5">
<div class="card-header">
<b>Program circuit</b>
<div class="btn-group">
<button type="button" class="btn btn-small btn-outline-dark" onclick="click_gate_zoom(-1);">
<i class="fas fa-search-minus"></i>
</button>
<button type="button" class="btn btn-small btn-outline-dark" onclick="click_gate_zoom(1);">
<i class="fas fa-search-plus"></i>
</button>
</div>
</div>
<div class="card-body">
<div id="staff_boot_panel" class="panel-resizable">
<div id="staff_popin_div" class="right" style="resize: both; overflow: auto;">
<canvas id="draw_gate_canvas" style="display:block;"></canvas>
</div>
</div>
</div>
</div>
<div class="card mb-5">
<div class="card-header">
<b>Circle notation</b>
<div class="btn-group">
<button type="button" class="btn btn-small btn-outline-dark" onclick="click_circle_zoom(-1);">
<i class="fas fa-search-minus"></i>
</button>
<button type="button" class="btn btn-small btn-outline-dark" onclick="click_circle_zoom(1);">
<i class="fas fa-search-plus"></i>
</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-default ej-btn-cstyle">
<img src="images/circ_style_00a.png" height="18" onclick="click_circle_style(0);"></span>
</button>
<button type="button" class="btn btn-default ej-btn-cstyle">
<img src="images/circ_style_01a.png" height="18" onclick="click_circle_style(1);"></span>
</button>
<button type="button" class="btn btn-default ej-btn-cstyle">
<img src="images/circ_style_10a.png" height="18" onclick="click_circle_style(2);"></span>
</button>
<button type="button" class="btn btn-default ej-btn-cstyle">
<img src="images/circ_style_11a.png" height="18" onclick="click_circle_style(3);"></span>
</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-default ej-btn-cstyle">
<img src="images/circ_fill_small.png" height="18" onclick="click_circle_fill(-1);"></span>
</button>
<button type="button" class="btn btn-default ej-btn-cstyle">
<img src="images/circ_fill_big.png" height="18" onclick="click_circle_fill(1);"></span>
</button>
</div>
</div>
<div class="card-body">
<div id="circle_boot_panel" class="panel-body panel-resizable">
<div id="circle_div" class="right" style="resize: both; overflow: auto;">
<canvas id="circle_canvas" style="display:block;"></canvas>
</div>
</div>
</div>
</div>
<div class="card mb-5">
<div class="card-header">
<b>Program output</b>
<div class="btn-group">
<button type="button" class="btn btn-small btn-outline-dark" onclick="click_output_zoom(-1);">
<i class="fas fa-search-minus"></i>
</button>
<button type="button" class="btn btn-small btn-outline-dark" onclick="click_output_zoom(1);">
<i class="fas fa-search-plus"></i>
</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-default" onclick="clear_output(false);" title="Clear output">
<span class="glyphicon glyphicon-erase"></span>
</button>
</div>
</div>
<div class="card-body">
<textarea id="script_output_textarea" style="font-family:monospace; font-size:12pt; width:100%; height:100px; resize:both;">
(program output goes here)
</textarea>
</div>
</div>
</div>
</div>
</div>
<!--
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
Engine-specific info dialogs are below. These are provided separately, so that we have the flexibility
to customize each one as required.
Modal dialogs are not elegant, and I'm open to suggestions for a better way to do this.
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
-->
<div class="modal fade" id="AboutQCE_runModal" tabindex="-1" role="dialog" aria-labelledby="AboutQCE_runModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="AboutQCE_runModalLabel">QCEngine Notes</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
QCEngine is intended to be a lightweight quantum computation simulator,
useful for quick sketches and demonstrations.
<br/>
<br/>
It will let you run JavaScript code, simulating the quantum computing as
though you had a real QC, up to about 25 qubits (depending on your browser).
The best way to get familiar with QCEngine is to run the book samples on
this page, along with the <b><a href="./docs/build/index.html" target="_blank">QCEngine Docs</a></b>.
<br/>
<br/>
For more serious development tasks, there are many other simulation engines available:
<br/>
<ul>
<li><b><a href="qiskit.org" target="_default">Qiskit</a></b> -
An open-source software development kit (SDK) for working with OpenQASM and the
IBM Q quantum processors. Create quantum computing programs, compile, and execute them online
in a real quantum processors.</li>
<li><b><a href="https://quantum-computing.ibm.com" target="_default">IBM Q Experience</a></b> -
A complete online environment, containing tools and information for programming quantum
simulations as well as physical quantum computers.</li>
<li><b><a href="https://www.microsoft.com/en-us/quantum/development-kit" target="_default">Microsoft QDK</a></b> -
A complete software development system for developing and running programs for quantum computers.</li>
<li><b><a href="https://www.dwavesys.com/take-leap" target="_default">D-Wave</a></b> -
A physical QPU using a quantum annealing model. See Example 10-2 ("Kitten and Tiger") for a good example
of use. The D-Wave website provides a rich set of libraries and educational materials.</li>
<li><b><a href="https://github.com/quantumlib/Cirq" target="_default">Cirq</a></b> -
Google's Cirq is a software library for writing, manipulating, and optimizing quantum circuits and then running them against quantum computers and simulators.</li>
<li><b><a href="http://www.quantumplayground.net" target="_default">Google QC Playground</a></b> -
An approachable online environment for discovering quantum computing.</li>
</ul>
...just to name a few.
<br/>
<br/>
If you have questions or comments
about running these book samples, the authors would love to hear from you
at <b><a href="mailto:[email protected]">[email protected]</a></b>.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="Contact_runModal" tabindex="-1" role="dialog" aria-labelledby="Contact_runModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="Contact_runModalLabel">Contacting us</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
If you have questions or comments
about running these book samples, the authors would love to hear from you.
They can be reached through the Github code samples
<b><a href="https://github.com/oreilly-qc/oreilly-qc.github.io/graphs/contributors" target="_blank">contributors page</a></b>,
or else at <b><a href="mailto:[email protected]">[email protected]</a></b>.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="CheatSheet_runModal" tabindex="-1" role="dialog" aria-labelledby="CheatSheet_runModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="CheatSheet_runModalLabel">QCEngine Command Cheat Sheet</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
This sheet provides a quick-reference for most common QCEngine commands.
The best way to become familiar with QCEngine commands is to try running the book
samples in this page.
If you find things missing or unclear, the authors would love to hear from you
at <b><a href="mailto:[email protected]">[email protected]</a></b>.
<br/>
<br/>
<b>"qc." Commands:</b> Commands such as <code>qc.reset()</code> and <code>qc.cnot(t,c)</code> execute
using a quantum computation simulator. In most cases, they take a <b>target mask</b> and a <b>condition mask</b>,
to specify which qubits the instructions act on. Some commands also take a rotation angle.
<br/>
<br/>
<b>Qubit Masks:</b> Qubits are be specified using an integer, where each bit corresponds to one of the
qubits in the quantum computer.
<br/>
<br/>
(...this is under sonstruction)
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="AddEngine_runModal" tabindex="-1" role="dialog" aria-labelledby="AddEngine_runModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="AddEngine_runModalLabel">Add new engines and samples!</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<b>Have a favorite quantum simulator, or even a real QPU?</b>
<br/>
We'd love to add your sample code here.
<br/>
<br/>
Providing these samples for as many systems as possible helps our readers, so please contact us
at <b><a href="mailto:[email protected]">[email protected]</a></b>.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="Qiskit_runModal" tabindex="-1" role="dialog" aria-labelledby="Qiskit_runModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="Qiskit_runModalLabel">Running Qiskit Sample Code</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
The Qiskit versions of examples in this book are written in Python, designed to run
as Qiskit notebooks, at <a href="https://qiskit.org" target="_blank">https://qiskit.org</a>.
<br/><br/>
Qiskit is an open-source software development kit (SDK) for working with OpenQASM and the
IBM Q quantum processors. Create quantum computing programs, compile, and execute them online
in a real quantum processors.
<br/><br/>
To run this sample, go to the Qiskit site and create a new notebook, and then paste this
sample code into it.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" onclick="window.open('https://qiskit.org', '_blank');">Go to Qiskit.org</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="Cirq_runModal" tabindex="-1" role="dialog" aria-labelledby="Cirq_runModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="Cirq_runModalLabel">Running Cirq Sample Code</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
The Cirq versions of examples in this book are written in Python, designed to run
using Cirq from Google.
<br/><br/>
Cirq is a software library for writing, manipulating, and optimizing quantum circuits and then running them against quantum computers and simulators. Cirq attempts to expose the details of hardware, instead of abstracting them away.
<br/><br/>
To run this sample, <a href="https://cirq.readthedocs.io/en/stable/install.html" target="_blank">install Cirq using these instructions</a> and then run the scripts using Python.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" onclick="window.open('https://github.com/quantumlib/Cirq', '_blank');">Go to Cirq in Github</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="DWave_runModal" tabindex="-1" role="dialog" aria-labelledby="DWave_runModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="DWave_runModalLabel">Running DWave Sample Code</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
The D-Wave versions of examples in this book are written in Python, designed to run either in simulation or on
actual D-Wave hardware, using the D-Wave libraries at <a href="https://www.dwavesys.com/take-leap" target="_blank">https://www.dwavesys.com/take-leap</a>.
<br/><br/>
DWave provides a complete software development kit for working with their simulators and hardware.
<br/><br/>
To run this sample, go to the DWave site and create an account, and follow the installation instructions,
and run this Python script.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" onclick="window.open('https://www.dwavesys.com/take-leap', '_blank');">Go to the D-Wave website</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="OpenQASM_runModal" tabindex="-1" role="dialog" aria-labelledby="OpenQASM_runModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="OpenQASM_runModalLabel">Running OpenQASM Sample Code</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
The OpenQASM versions of examples in this book are designed to run
using the <b>IBM Q Experience Quantum Composer</b>, at <a href="https://quantum-computing.ibm.com" target="_blank">https://quantum-computing.ibm.com</a>.
<br/><br/>
The <b>Quantum Composer</b> is a graphical user interface for programming a quantum processor.
<br/><br/>
To run this sample, go to the Q Experience site and create new circuit using the Circuit Composer,
then paste the code into the Circuit Editor.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" onclick="window.open('https://quantum-computing.ibm.com', '_blank');">Go to IBM Q Experience</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="QSharp_runModal" tabindex="-1" role="dialog" aria-labelledby="QSharp_runModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="QSharp_runModalLabel">Running Q# Sample Code</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
The Q# versions of examples in this book are designed to be executed as Q# Notebooks in the Microsoft Quantum Development Kit (QDK).
<br/><br/>
You can run them online <b><a href="https://mybinder.org/v2/gh/oreilly-qc/oreilly-qc.github.io/master" target="_blank">here</a></b>, or you can <b><a href="https://docs.microsoft.com/quantum/install-guide/jupyter" target="_blank">download and install</a></b> Microsoft Quantum Development Kit to run them locally.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" onclick="window.open('https://mybinder.org/v2/gh/oreilly-qc/oreilly-qc.github.io/qsharp', '_blank');">Go to Online Q# Notebooks</button>
<button type="button" class="btn btn-success" onclick="window.open('https://docs.microsoft.com/quantum/install-guide/jupyter', '_blank');">Go to QDK Website</button>
</div>
</div>
</div>
</div>
<!-- Note: using jquery $.getScript("static/js/custom.js"); breaks the Kindle version -->
<script src="./static/js/custom.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>