-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqFold.html
More file actions
741 lines (691 loc) · 36 KB
/
qFold.html
File metadata and controls
741 lines (691 loc) · 36 KB
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
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>qFold on Amazon Braket - Multi-language Guide</title>
<!-- Font Awesome 6 -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
::-webkit-scrollbar {
width: 0px;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
line-height: 1.6;
color: #333;
background-color: #f4f7f9;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
}
a {
color: rgb(237, 113, 0);
text-decoration: none;
transition: color 0.2s ease;
}
a:hover {
text-decoration: underline;
color: #c25900;
}
/* Верхняя панель: флаги справа, логотипы партнёров слева */
.top-bar {
width: 100%;
max-width: 1000px;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
flex-wrap: wrap;
gap: 12px;
}
.partner-logos {
display: flex;
align-items: center;
gap: 12px;
background: rgba(255,255,255,0.7);
padding: 4px 12px;
border-radius: 40px;
backdrop-filter: blur(2px);
}
.partner-logos img {
height: 32px;
width: auto;
object-fit: contain;
transition: transform 0.2s ease;
}
.partner-logos img:hover {
transform: scale(1.05);
}
.language-switcher {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
gap: 6px;
padding: 0;
background: none;
}
.lang-btn {
background: none;
border: none;
padding: 0;
margin: 0;
cursor: pointer;
transition: opacity 0.2s ease;
opacity: 0.5;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 0;
box-shadow: none;
}
.lang-btn.active {
opacity: 1;
background: none;
}
.lang-btn:hover {
opacity: 0.8;
background: none;
}
.lang-btn svg {
width: 28px;
height: 20px;
border-radius: 2px;
display: block;
}
.card {
background: white;
padding: clamp(20px, 5vw, 40px);
border-radius: 16px;
/* box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); */
max-width: 1000px;
width: 100%;
transition: all 0.2s ease;
margin-bottom: 30px;
}
.header-container {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 2px solid rgb(237, 113, 0);
padding-bottom: 16px;
margin-bottom: 28px;
flex-wrap: wrap;
gap: 16px;
}
.logo-area {
display: flex;
align-items: center;
gap: 15px;
flex-wrap: wrap;
}
.logo {
width: 50px;
height: auto;
border-radius: 8px;
object-fit: contain;
}
h1 {
margin: 0;
color: #232f3e;
font-size: clamp(1.4rem, 5vw, 1.9rem);
font-weight: 600;
}
h1 a {
color: rgb(237, 113, 0);
}
.description {
margin-bottom: 25px;
}
.step {
display: flex;
margin-bottom: 24px;
flex-wrap: wrap;
}
.step-number {
background: rgb(237, 113, 0);
color: white;
width: 32px;
height: 32px;
border-radius: 50%;
text-align: center;
line-height: 32px;
font-weight: bold;
margin-right: 18px;
flex-shrink: 0;
font-size: 1rem;
}
.step-text {
flex: 1;
min-width: 200px;
}
code {
background: #eef2f5;
padding: 2px 6px;
border-radius: 6px;
font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
font-size: 0.85em;
color: #d63384;
word-break: break-word;
}
.warning {
background: #fff4e5;
border-left: 5px solid rgb(237, 113, 0);
padding: 16px 20px;
margin: 28px 0;
font-size: 0.95rem;
border-radius: 12px;
}
/* Консоль */
.console-section {
margin-top: 24px;
margin-bottom: 20px;
}
.console-title {
font-weight: 600;
font-size: 1.1rem;
margin-bottom: 12px;
display: flex;
align-items: center;
gap: 8px;
color: #2c3e50;
}
.console-title i {
color: rgb(237, 113, 0);
}
.console-window {
background: #1e1e2f;
border-radius: 16px;
overflow: hidden;
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
font-size: 0.85rem;
}
.console-output {
background: #0f0f1a;
color: #d4d4dc;
padding: 16px;
height: 200px;
overflow-y: auto;
white-space: pre-wrap;
word-break: break-word;
border-bottom: 1px solid #2a2a3a;
}
.console-line {
margin-bottom: 6px;
display: flex;
gap: 8px;
}
.console-prompt {
color: #6eff9e;
user-select: none;
}
.console-input-line {
display: flex;
align-items: center;
gap: 8px;
background: #1e1e2f;
padding: 12px 16px;
border-top: 1px solid #2a2a3a;
}
.console-input-prompt {
color: #6eff9e;
font-weight: bold;
}
.console-input {
background: transparent;
border: none;
color: #f0f0f0;
font-family: inherit;
font-size: 0.85rem;
flex: 1;
outline: none;
}
.console-input::placeholder {
color: #6c6c8a;
}
.console-help {
background: #2a2a3a;
padding: 6px 12px;
border-radius: 8px;
font-size: 0.7rem;
color: #bbb;
text-align: center;
margin-top: 8px;
}
.console-help span {
color: #ffaa44;
}
.footer {
text-align: center;
margin-top: auto;
padding: 20px 0 10px;
font-size: 0.85rem;
color: #5a6874;
border-top: 1px solid #e2e8f0;
width: 100%;
max-width: 1000px;
}
.footer a {
color: rgb(237, 113, 0);
font-weight: 600;
}
.github-icon {
margin-right: 6px;
font-size: 0.9rem;
}
ul {
margin: 8px 0 0 20px;
padding-left: 0;
}
li {
margin-bottom: 6px;
}
@media (max-width: 680px) {
body {
padding: 12px;
}
.top-bar {
flex-direction: row;
justify-content: space-between;
}
.step {
flex-direction: column;
}
.step-number {
margin-bottom: 8px;
margin-right: 0;
}
.card {
padding: 18px;
}
.language-switcher {
gap: 4px;
}
.lang-btn svg {
width: 24px;
height: 17px;
}
.console-output {
height: 160px;
}
.logo {
width: 40px;
}
.partner-logos img {
height: 28px;
}
}
@media (max-width: 480px) {
.lang-btn svg {
width: 20px;
height: 14px;
}
.language-switcher {
gap: 3px;
}
.logo {
width: 35px;
}
.partner-logos img {
height: 24px;
}
.partner-logos {
padding: 2px 8px;
gap: 8px;
}
}
</style>
</head>
<body>
<div class="top-bar">
<div class="partner-logos">
<img src="https://qfoldit.github.io/img/1/logo/iDMT_logo.png" alt="iDMT Logo" title="iDMT - Innovation Centre in Digital Molecular Technologies">
<img src="https://qfoldit.github.io/img/h3d_final_logo.png" alt="H3D Logo" title="H3D - Holistic Drug Discovery and Development Centre">
</div>
<div class="language-switcher" id="langSwitcher">
<button class="lang-btn" data-lang="en">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30" width="22" height="16">
<clipPath id="t">
<path d="M0,0 v30 h60 v-30 z"/>
</clipPath>
<path d="M0,0 v30 h60 v-30 z" fill="#012169"/>
<path d="M0,0 L60,30 M60,0 L0,30" stroke="#fff" stroke-width="6"/>
<path d="M0,0 L60,30 M60,0 L0,30" stroke="#C8102E" stroke-width="3"/>
<path d="M30,0 v30 M0,15 h60" stroke="#fff" stroke-width="10"/>
<path d="M30,0 v30 M0,15 h60" stroke="#C8102E" stroke-width="5"/>
</svg>
</button>
<button class="lang-btn" data-lang="de">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 5 3" width="28" height="20">
<rect width="5" height="1" y="0" fill="#000"/>
<rect width="5" height="1" y="1" fill="#D00"/>
<rect width="5" height="1" y="2" fill="#FFCE00"/>
</svg>
</button>
<button class="lang-btn" data-lang="fr">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3 2" width="28" height="20">
<rect width="1" height="2" x="0" fill="#0055A4"/>
<rect width="1" height="2" x="1" fill="#fff"/>
<rect width="1" height="2" x="2" fill="#EF4135"/>
</svg>
</button>
<button class="lang-btn" data-lang="ru">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3 2" width="28" height="20">
<rect width="3" height="2/3" fill="#fff"/>
<rect y="0.66" width="3" height="0.66" fill="#0039A6"/>
<rect y="1.32" width="3" height="0.68" fill="#D52B1E"/>
</svg>
</button>
<button class="lang-btn" data-lang="ja">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3 2" width="28" height="20">
<rect width="3" height="2" fill="#fff"/>
<circle cx="1.5" cy="1" r="0.6" fill="#BC002D"/>
</svg>
</button>
<button class="lang-btn" data-lang="zh">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3 2" width="28" height="20">
<rect width="3" height="2" fill="#DE2910"/>
<circle cx="1.2" cy="0.9" r="0.4" fill="#FFDE00"/>
<polygon points="1.2,0.7 1.25,0.82 1.38,0.82 1.28,0.89 1.31,1.01 1.2,0.94 1.09,1.01 1.12,0.89 1.02,0.82 1.15,0.82" fill="#FFDE00"/>
<polygon points="1.2,0.9 1.23,0.97 1.31,0.97 1.25,1.01 1.27,1.09 1.2,1.05 1.13,1.09 1.15,1.01 1.09,0.97 1.17,0.97" fill="#FFDE00"/>
</svg>
</button>
</div>
</div>
<div class="card">
<div class="header-container">
<div class="logo-area">
<img src="https://qfoldit.github.io/img/1/logo/amazon-braket.svg" alt="Amazon Braket Logo" class="logo">
<h1 data-i18n="title">qFold on <a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">Amazon Braket</a></h1>
</div>
</div>
<p class="description" data-i18n="description">Quick guide to deploying the quantum protein folding algorithm on <a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">AWS Braket</a>.</p>
<!-- Step 1 -->
<div class="step">
<div class="step-number">1</div>
<div class="step-text" data-i18n="step1">
<strong>Console access:</strong> Log in to your AWS account and navigate to <strong><a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">Amazon Braket</a></strong>. Make sure you are in a region that supports the required devices (e.g., <em>us-east-1</em>).
</div>
</div>
<!-- Step 2 -->
<div class="step">
<div class="step-number">2</div>
<div class="step-text" data-i18n="step2">
<strong>Create a notebook:</strong> In the left menu, select <strong>Notebooks</strong> → <strong>Create notebook instance</strong>.
<ul>
<li>Name: <code>qfold-instance</code></li>
<li>Type: <code>ml.t3.medium</code> (minimum sufficient)</li>
</ul>
</div>
</div>
<!-- Step 3 -->
<div class="step">
<div class="step-number">3</div>
<div class="step-text" data-i18n="step3">
<strong>Open Jupyter:</strong> When the status changes to <span style="color: green;">InService</span>, click <strong>Open JupyterLab</strong>.
</div>
</div>
<!-- Step 4 -->
<div class="step">
<div class="step-number">4</div>
<div class="step-text" data-i18n="step4">
<strong>Find qFold:</strong> Navigate to <code>amazon-braket-examples / examples / hybrid_quantum_algorithms / qfold</code> and open the file <code><a href="https://github.com/qfoldit/AWS-Deploy/tree/main/source/src/notebook/healthcare-and-life-sciences/c-1-protein-folding-quantum-random-walk" target="blank">qfold.ipynb</a></code>.
</div>
</div>
<!-- Step 5 -->
<div class="step">
<div class="step-number">5</div>
<div class="step-text" data-i18n="step5">
<strong>Device configuration:</strong> In the code, find the <code>device</code> variable.
<ul>
<li>For free test: <code>LocalSimulator()</code></li>
<li>For QPU: provide ARN (e.g., Rigetti or IonQ).</li>
</ul>
</div>
</div>
<!-- Warning -->
<div class="warning" data-i18n="warning">
<strong>Note:</strong> Running on real QPU is paid. First debug on a local simulator.
</div>
<!-- Step 6 -->
<div class="step">
<div class="step-number">6</div>
<div class="step-text" data-i18n="step6">
<strong>Run:</strong> Click <em>Run → Run All Cells</em>. The protein structure optimization results will appear in the bottom cells.
</div>
</div>
<!-- Встроенная консоль -->
<div class="console-section">
<div class="console-title">
<i class="fas fa-terminal"></i> <span data-i18n="console_title">Interactive Console </span>
</div>
<div class="console-window">
<div class="console-output" id="consoleOutput">
<div class="console-line"><span class="console-prompt">$</span> <span>Welcome to qFold demo terminal</span></div>
<div class="console-line"><span class="console-prompt">$</span> <span>Type 'help' to see available commands</span></div>
<div class="console-line"><span class="console-prompt">$</span> <span>Example: device = LocalSimulator()</span></div>
<div class="console-line"><span class="console-prompt">$</span> <span>─────────────────────────────</span></div>
</div>
<div class="console-input-line">
<span class="console-input-prompt">❯</span>
<input type="text" class="console-input" id="consoleInput" placeholder="Enter command... (help for list)" autocomplete="off">
</div>
</div>
<div class="console-help">
💡 <span>help</span> — show commands | <span>clear</span> — clear console | <span>run_qfold</span> — simulate qFold execution
</div>
</div>
</div>
<div class="footer" data-i18n="footer">
Quick start with qFold in the <a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">AWS ecosystem</a>.<br>
<i class="fab fa-github github-icon"></i> <a href="https://github.com/qfoldit" target="_blank" rel="noopener">github.com/qfoldit</a>
</div>
<script>
// ---------- TRANSLATIONS ----------
const translations = {
en: {
title: 'qFold on <a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">Amazon Braket</a>',
description: 'Quick guide to deploying the quantum protein folding algorithm on <a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">AWS Braket</a>.',
step1: '<strong>Console access:</strong> Log in to your AWS account and navigate to <strong><a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">Amazon Braket</a></strong>. Make sure you are in a region that supports the required devices (e.g., <em>us-east-1</em>).',
step2: '<strong>Create a notebook:</strong> In the left menu, select <strong>Notebooks</strong> → <strong>Create notebook instance</strong>.<br><ul><li>Name: <code>qfold-instance</code></li><li>Type: <code>ml.t3.medium</code> (minimum sufficient)</li></ul>',
step3: '<strong>Open Jupyter:</strong> When the status changes to <span style="color: green;">InService</span>, click <strong>Open JupyterLab</strong>.',
step4: '<strong>Find qFold:</strong> Navigate to <code>amazon-braket-examples / examples / hybrid_quantum_algorithms / qfold</code> and open the file <code>qfold.ipynb</code>.',
step5: '<strong>Device configuration:</strong> In the code, find the <code>device</code> variable.<br><ul><li>For free test: <code>LocalSimulator()</code></li><li>For QPU: provide ARN (e.g., Rigetti or IonQ).</li></ul>',
warning: '<strong>Note:</strong> Running on real QPU is paid. First debug on a local simulator.',
step6: '<strong>Run:</strong> Click <em>Run → Run All Cells</em>. The protein structure optimization results will appear in the bottom cells.',
footer: 'Quick start with qFold in the <a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">AWS ecosystem</a>.<br><i class="fab fa-github github-icon"></i> <a href="https://github.com/qfoldit" target="_blank" rel="noopener">github.com/qfoldit</a>',
console_title: 'Interactive Console '
},
de: {
title: 'qFold auf <a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">Amazon Braket</a>',
description: 'Kurzanleitung zur Bereitstellung des Quanten-Faltungsalgorithmus für Proteine auf <a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">AWS Braket</a>.',
step1: '<strong>Konsolenzugriff:</strong> Melden Sie sich bei Ihrem AWS-Konto an und navigieren Sie zu <strong><a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">Amazon Braket</a></strong>. Stellen Sie sicher, dass Sie sich in einer Region befinden, die die erforderlichen Geräte unterstützt (z. B. <em>us-east-1</em>).',
step2: '<strong>Notebook erstellen:</strong> Wählen Sie im linken Menü <strong>Notebooks</strong> → <strong>Create notebook instance</strong>.<br><ul><li>Name: <code>qfold-instance</code></li><li>Typ: <code>ml.t3.medium</code> (minimal ausreichend)</li></ul>',
step3: '<strong>Jupyter öffnen:</strong> Wenn der Status auf <span style="color: green;">InService</span> wechselt, klicken Sie auf <strong>Open JupyterLab</strong>.',
step4: '<strong>qFold finden:</strong> Navigieren Sie zu <code>amazon-braket-examples / examples / hybrid_quantum_algorithms / qfold</code> und öffnen Sie die Datei <code>qfold.ipynb</code>.',
step5: '<strong>Gerätekonfiguration:</strong> Suchen Sie im Code nach der Variablen <code>device</code>.<br><ul><li>Für kostenlosen Test: <code>LocalSimulator()</code></li><li>Für QPU: ARN angeben (z. B. Rigetti oder IonQ).</li></ul>',
warning: '<strong>Hinweis:</strong> Die Ausführung auf echten QPUs ist kostenpflichtig. Debuggen Sie zuerst auf einem lokalen Simulator.',
step6: '<strong>Ausführen:</strong> Klicken Sie auf <em>Run → Run All Cells</em>. Die Ergebnisse der Proteinoptimierung erscheinen in den unteren Zellen.',
footer: 'Schnelleinstieg mit qFold im <a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">AWS-Ökosystem</a>.<br><i class="fab fa-github github-icon"></i> <a href="https://github.com/qfoldit" target="_blank" rel="noopener">github.com/qfoldit</a>',
console_title: 'Interaktive Konsole '
},
fr: {
title: 'qFold sur <a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">Amazon Braket</a>',
description: 'Guide rapide pour déployer l\'algorithme quantique de repliement des protéines sur <a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">AWS Braket</a>.',
step1: '<strong>Accès à la console :</strong> Connectez-vous à votre compte AWS et accédez à <strong><a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">Amazon Braket</a></strong>. Assurez-vous d\'être dans une région prenant en charge les appareils requis (par exemple <em>us-east-1</em>).',
step2: '<strong>Créer un notebook :</strong> Dans le menu de gauche, sélectionnez <strong>Notebooks</strong> → <strong>Create notebook instance</strong>.<br><ul><li>Nom : <code>qfold-instance</code></li><li>Type : <code>ml.t3.medium</code> (minimum suffisant)</li></ul>',
step3: '<strong>Ouvrir Jupyter :</strong> Lorsque le statut passe à <span style="color: green;">InService</span>, cliquez sur <strong>Open JupyterLab</strong>.',
step4: '<strong>Trouver qFold :</strong> Accédez à <code>amazon-braket-examples / examples / hybrid_quantum_algorithms / qfold</code> et ouvrez le fichier <code>qfold.ipynb</code>.',
step5: '<strong>Configuration de l\'appareil :</strong> Dans le code, trouvez la variable <code>device</code>.<br><ul><li>Pour un test gratuit : <code>LocalSimulator()</code></li><li>Pour QPU : fournissez l\'ARN (ex. Rigetti ou IonQ).</li></ul>',
warning: '<strong>Remarque :</strong> L\'exécution sur un vrai QPU est payante. Déboguez d\'abord sur un simulateur local.',
step6: '<strong>Exécuter :</strong> Cliquez sur <em>Run → Run All Cells</em>. Les résultats d\'optimisation de la structure des protéines apparaîtront dans les cellules du bas.',
footer: 'Démarrage rapide avec qFold dans l\'<a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">écosystème AWS</a>.<br><i class="fab fa-github github-icon"></i> <a href="https://github.com/qfoldit" target="_blank" rel="noopener">github.com/qfoldit</a>',
console_title: 'Console interactive '
},
ru: {
title: 'qFold на <a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">Amazon Braket</a>',
description: 'Краткое руководство по развертыванию квантового алгоритма сворачивания белка на <a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">AWS Braket</a>.',
step1: '<strong>Доступ к консоли:</strong> Войдите в свою учетную запись AWS и перейдите в сервис <strong><a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">Amazon Braket</a></strong>. Убедитесь, что вы находитесь в регионе, поддерживающем нужные устройства (например, <em>us-east-1</em>).',
step2: '<strong>Создание блокнота:</strong> В левом меню выберите <strong>Notebooks</strong> → <strong>Create notebook instance</strong>.<br><ul><li>Имя: <code>qfold-instance</code></li><li>Тип: <code>ml.t3.medium</code> (минимально достаточный)</li></ul>',
step3: '<strong>Открытие Jupyter:</strong> Когда статус сменится на <span style="color: green;">InService</span>, нажмите <strong>Open JupyterLab</strong>.',
step4: '<strong>Поиск qFold:</strong> Перейдите по пути: <code>amazon-braket-examples / examples / hybrid_quantum_algorithms / qfold</code> и откройте файл <code>qfold.ipynb</code>.',
step5: '<strong>Настройка устройства:</strong> В коде найдите переменную <code>device</code>.<br><ul><li>Для бесплатного теста: <code>LocalSimulator()</code></li><li>Для QPU: укажите ARN (например, Rigetti или IonQ).</li></ul>',
warning: '<strong>Внимание:</strong> Запуск на реальных квантовых процессорах (QPU) платный. Сначала отладьте код на локальном симуляторе.',
step6: '<strong>Запуск:</strong> Нажмите <em>Run → Run All Cells</em>. Результаты оптимизации структуры белка появятся в нижних ячейках.',
footer: 'Быстрый старт с qFold в <a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">экосистеме AWS</a>.<br><i class="fab fa-github github-icon"></i> <a href="https://github.com/qfoldit" target="_blank" rel="noopener">github.com/qfoldit</a>',
console_title: 'Интерактивная консоль '
},
ja: {
title: '<a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">Amazon Braket</a> での qFold',
description: '<a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">AWS Braket</a> での量子タンパク質フォールディングアルゴリズム展開のクイックガイド。',
step1: '<strong>コンソールアクセス:</strong> AWS アカウントにログインし、<strong><a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">Amazon Braket</a></strong> サービスに移動します。必要なデバイスをサポートするリージョン(例: <em>us-east-1</em>)にいることを確認してください。',
step2: '<strong>ノートブックの作成:</strong> 左側のメニューから <strong>Notebooks</strong> → <strong>Create notebook instance</strong> を選択します。<br><ul><li>名前: <code>qfold-instance</code></li><li>タイプ: <code>ml.t3.medium</code> (最小限で十分)</li></ul>',
step3: '<strong>Jupyter を開く:</strong> ステータスが <span style="color: green;">InService</span> に変わったら、<strong>Open JupyterLab</strong> をクリックします。',
step4: '<strong>qFold を見つける:</strong> <code>amazon-braket-examples / examples / hybrid_quantum_algorithms / qfold</code> に移動し、<code>qfold.ipynb</code> ファイルを開きます。',
step5: '<strong>デバイス設定:</strong> コード内で <code>device</code> 変数を見つけます。<br><ul><li>無料テストの場合: <code>LocalSimulator()</code></li><li>QPU の場合: ARN を指定します(例: Rigetti または IonQ)。</li></ul>',
warning: '<strong>注意:</strong> 実際の QPU での実行は有料です。まずローカルシミュレーターでデバッグしてください。',
step6: '<strong>実行:</strong> <em>Run → Run All Cells</em> をクリックします。タンパク質構造の最適化結果が下部のセルに表示されます。',
footer: 'AWS エコシステムで qFold を迅速に開始するために作成されました。<br><i class="fab fa-github github-icon"></i> <a href="https://github.com/qfoldit" target="_blank" rel="noopener">github.com/qfoldit</a>',
console_title: 'インタラクティブコンソール '
},
zh: {
title: '<a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">Amazon Braket</a> 上的 qFold',
description: '在 <a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">AWS Braket</a> 上部署量子蛋白质折叠算法的快速指南。',
step1: '<strong>控制台访问:</strong> 登录您的 AWS 账户,进入 <strong><a href="https://aws.amazon.com/braket/" target="_blank" rel="noopener">Amazon Braket</a></strong> 服务。确保您所在的区域支持所需的设备(例如 <em>us-east-1</em>)。',
step2: '<strong>创建笔记本:</strong> 在左侧菜单中选择 <strong>Notebooks</strong> → <strong>Create notebook instance</strong>。<br><ul><li>名称:<code>qfold-instance</code></li><li>类型:<code>ml.t3.medium</code>(最低配置足够)</li></ul>',
step3: '<strong>打开 Jupyter:</strong> 当状态变为 <span style="color: green;">InService</span> 时,点击 <strong>Open JupyterLab</strong>。',
step4: '<strong>查找 qFold:</strong> 导航到 <code>amazon-braket-examples / examples / hybrid_quantum_algorithms / qfold</code> 并打开文件 <code>qfold.ipynb</code>。',
step5: '<strong>设备配置:</strong> 在代码中找到变量 <code>device</code>。<br><ul><li>免费测试:<code>LocalSimulator()</code></li><li>使用 QPU:提供 ARN(例如 Rigetti 或 IonQ)。</li></ul>',
warning: '<strong>注意:</strong> 在真实 QPU 上运行需要付费。请先在本地模拟器上进行调试。',
step6: '<strong>运行:</strong> 点击 <em>Run → Run All Cells</em>。蛋白质结构优化结果将显示在底部单元格中。',
footer: '为在 AWS 生态系统中快速启动 qFold 而创建。<br><i class="fab fa-github github-icon"></i> <a href="https://github.com/qfoldit" target="_blank" rel="noopener">github.com/qfoldit</a>',
console_title: '交互式控制台(演示)'
}
};
// DOM elements for i18n
const elements = {
title: document.querySelector('[data-i18n="title"]'),
description: document.querySelector('[data-i18n="description"]'),
step1: document.querySelector('[data-i18n="step1"]'),
step2: document.querySelector('[data-i18n="step2"]'),
step3: document.querySelector('[data-i18n="step3"]'),
step4: document.querySelector('[data-i18n="step4"]'),
step5: document.querySelector('[data-i18n="step5"]'),
warning: document.querySelector('[data-i18n="warning"]'),
step6: document.querySelector('[data-i18n="step6"]'),
footer: document.querySelector('[data-i18n="footer"]'),
console_title: document.querySelector('[data-i18n="console_title"]')
};
let currentLang = localStorage.getItem('qfold_lang') || 'en';
function setLanguage(lang) {
if (!translations[lang]) return;
for (const key in elements) {
if (elements[key] && translations[lang][key]) {
elements[key].innerHTML = translations[lang][key];
}
}
// Обновляем активный класс у кнопок
document.querySelectorAll('.lang-btn').forEach(btn => {
const btnLang = btn.getAttribute('data-lang');
if (btnLang === lang) {
btn.classList.add('active');
} else {
btn.classList.remove('active');
}
});
localStorage.setItem('qfold_lang', lang);
document.documentElement.lang = lang;
}
document.querySelectorAll('.lang-btn').forEach(btn => {
btn.addEventListener('click', () => setLanguage(btn.getAttribute('data-lang')));
});
setLanguage(currentLang);
// ---------- КОНСОЛЬ (демонстрационная) ----------
const outputDiv = document.getElementById('consoleOutput');
const inputField = document.getElementById('consoleInput');
function addLine(text, isCommand = false) {
const lineDiv = document.createElement('div');
lineDiv.className = 'console-line';
if (isCommand) {
lineDiv.innerHTML = `<span class="console-prompt">❯</span> <span>${escapeHtml(text)}</span>`;
} else {
lineDiv.innerHTML = `<span class="console-prompt">$</span> <span>${escapeHtml(text)}</span>`;
}
outputDiv.appendChild(lineDiv);
outputDiv.scrollTop = outputDiv.scrollHeight;
}
function escapeHtml(str) {
return str.replace(/[&<>]/g, function(m) {
if (m === '&') return '&';
if (m === '<') return '<';
if (m === '>') return '>';
return m;
}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, function(c) {
return c;
});
}
function clearConsole() {
outputDiv.innerHTML = '';
addLine('Console cleared. Type help for commands.');
}
function processCommand(cmd) {
const trimmed = cmd.trim().toLowerCase();
if (trimmed === 'clear') {
clearConsole();
return;
}
if (trimmed === 'help') {
addLine('Available commands:');
addLine(' help – show this help');
addLine(' clear – clear console output');
addLine(' run_qfold – simulate qFold execution (local simulator)');
addLine(' device – show current device info');
addLine(' LocalSimulator() – display simulator status');
addLine(' <any python-like> – demo response');
return;
}
if (trimmed === 'run_qfold') {
addLine('Running qFold with LocalSimulator()...');
setTimeout(() => {
addLine('✅ Quantum circuit executed.');
addLine('📊 Optimized protein structure: energy = -12.37 kcal/mol');
addLine('💡 Folding pathway predicted. See notebook for full details.');
}, 300);
return;
}
if (trimmed === 'device') {
addLine('Current device: LocalSimulator() (free, runs on CPU)');
addLine('To use QPU, set device = AwsDevice("arn:aws:braket:...")');
return;
}
if (trimmed === 'localsimulator()') {
addLine('LocalSimulator() initialized. Backend: "braket_sv" (state vector)');
addLine('You can now run circuits: task = device.run(circuit, shots=1000)');
return;
}
// Fallback для любых других команд (демонстрация)
if (cmd.trim().length > 0) {
addLine(`Command '${cmd}' not recognized. Type 'help' for available commands.`);
}
}
inputField.addEventListener('keypress', (e) => {
if (e.key === 'Enter') {
const cmd = inputField.value;
if (cmd.trim().length > 0) {
addLine(cmd, true);
processCommand(cmd);
}
inputField.value = '';
}
});
</script>
</body>
</html>