quest_bind 0.3.7

Wrapper around the Quantum Exact Simulation Toolkit (QuEST)
Documentation
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
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- For Mobile Devices -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.17"/>
        <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <title>QuEST: Debugging</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="style.css" rel="stylesheet" type="text/css"/>
        <link href='https://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
        <link href="jquery.smartmenus.bootstrap.css" rel="stylesheet">
        <script type="text/javascript" src="jquery.smartmenus.js"></script>
        <!-- SmartMenus jQuery Bootstrap Addon -->
        <script type="text/javascript" src="jquery.smartmenus.bootstrap.js"></script>
        <!-- SmartMenus jQuery plugin -->
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand"><img alt="Logo" src="logo.png"/></a>
                    <a class="navbar-brand"><b>QuEST</b> v3.4.0<br>The Quantum Exact Simulation Toolkit</a>
                </div>
            </div>
        </nav>
        <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
            <div class="content" id="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 panel " style="padding-bottom: 15px;">
                            <div style="margin-bottom: 15px;">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Debugging</div>  </div>
</div><!--header-->
<div class="contents">

<p>Utilities for seeding and debugging, such as state-logging.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga924ef2dbda6b733b4041270077c76ece"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__debug.html#ga924ef2dbda6b733b4041270077c76ece">copyStateFromGPU</a> (<a class="el" href="structQureg.html">Qureg</a> qureg)</td></tr>
<tr class="memdesc:ga924ef2dbda6b733b4041270077c76ece"><td class="mdescLeft">&#160;</td><td class="mdescRight">In GPU mode, this copies the state-vector (or density matrix) from GPU memory (qureg.deviceStateVec) to RAM (qureg.stateVec), where it can be accessed/modified by the user.  <a href="group__debug.html#ga924ef2dbda6b733b4041270077c76ece">More...</a><br /></td></tr>
<tr class="separator:ga924ef2dbda6b733b4041270077c76ece"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga11448560006dd165128e404b54ebb2f7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__debug.html#ga11448560006dd165128e404b54ebb2f7">copyStateToGPU</a> (<a class="el" href="structQureg.html">Qureg</a> qureg)</td></tr>
<tr class="memdesc:ga11448560006dd165128e404b54ebb2f7"><td class="mdescLeft">&#160;</td><td class="mdescRight">In GPU mode, this copies the state-vector (or density matrix) from RAM (qureg.stateVec) to VRAM / GPU-memory (qureg.deviceStateVec), which is the version operated upon by other calls to the API.  <a href="group__debug.html#ga11448560006dd165128e404b54ebb2f7">More...</a><br /></td></tr>
<tr class="separator:ga11448560006dd165128e404b54ebb2f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadc5c01d8ea32e28c188db52be26116b6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__debug.html#gadc5c01d8ea32e28c188db52be26116b6">getEnvironmentString</a> (<a class="el" href="structQuESTEnv.html">QuESTEnv</a> env, char str[200])</td></tr>
<tr class="memdesc:gadc5c01d8ea32e28c188db52be26116b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets <code>str</code> to a string containing information about the runtime environment, including whether simulation is using CUDA (for GPU), OpenMP (for multithreading) and/or MPI (for distribution).  <a href="group__debug.html#gadc5c01d8ea32e28c188db52be26116b6">More...</a><br /></td></tr>
<tr class="separator:gadc5c01d8ea32e28c188db52be26116b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaf64c49f51b622702e66d917bf5b5e16"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__debug.html#gaaf64c49f51b622702e66d917bf5b5e16">getQuESTSeeds</a> (<a class="el" href="structQuESTEnv.html">QuESTEnv</a> env, unsigned long int **seeds, int *numSeeds)</td></tr>
<tr class="memdesc:gaaf64c49f51b622702e66d917bf5b5e16"><td class="mdescLeft">&#160;</td><td class="mdescRight">Obtain the seeds presently used in random number generation.  <a href="group__debug.html#gaaf64c49f51b622702e66d917bf5b5e16">More...</a><br /></td></tr>
<tr class="separator:gaaf64c49f51b622702e66d917bf5b5e16"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa696c94112e5fbbc996af10dfc4e2c1c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__debug.html#gaa696c94112e5fbbc996af10dfc4e2c1c">initDebugState</a> (<a class="el" href="structQureg.html">Qureg</a> qureg)</td></tr>
<tr class="memdesc:gaa696c94112e5fbbc996af10dfc4e2c1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialises <code>qureg</code> to be in the un-normalised, non-physical state with with <img class="formulaInl" alt="$n$" src="form_60.png"/>-th complex amplitude given by <img class="formulaInl" alt="$2n/10 + i(2n+1)/10$" src="form_61.png"/>.  <a href="group__debug.html#gaa696c94112e5fbbc996af10dfc4e2c1c">More...</a><br /></td></tr>
<tr class="separator:gaa696c94112e5fbbc996af10dfc4e2c1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga51a64b05d31ef9bcf6a63ce26c0092db"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__debug.html#ga51a64b05d31ef9bcf6a63ce26c0092db">invalidQuESTInputError</a> (const char *errMsg, const char *errFunc)</td></tr>
<tr class="memdesc:ga51a64b05d31ef9bcf6a63ce26c0092db"><td class="mdescLeft">&#160;</td><td class="mdescRight">An internal function called when invalid arguments are passed to a QuEST API call, which the user can optionally override by redefining.  <a href="group__debug.html#ga51a64b05d31ef9bcf6a63ce26c0092db">More...</a><br /></td></tr>
<tr class="separator:ga51a64b05d31ef9bcf6a63ce26c0092db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab27234d9ccf440bb5e5d834e8f7e3938"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__debug.html#gab27234d9ccf440bb5e5d834e8f7e3938">reportPauliHamil</a> (<a class="el" href="structPauliHamil.html">PauliHamil</a> hamil)</td></tr>
<tr class="memdesc:gab27234d9ccf440bb5e5d834e8f7e3938"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print the <code><a class="el" href="structPauliHamil.html" title="A Pauli Hamiltonian, expressed as a real-weighted sum of pauli products, and which can hence represen...">PauliHamil</a></code> to screen.  <a href="group__debug.html#gab27234d9ccf440bb5e5d834e8f7e3938">More...</a><br /></td></tr>
<tr class="separator:gab27234d9ccf440bb5e5d834e8f7e3938"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf8a14ae79c3fb2c0b5f6255cc37bebf9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__debug.html#gaf8a14ae79c3fb2c0b5f6255cc37bebf9">reportQuESTEnv</a> (<a class="el" href="structQuESTEnv.html">QuESTEnv</a> env)</td></tr>
<tr class="memdesc:gaf8a14ae79c3fb2c0b5f6255cc37bebf9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Report information about the QuEST environment.  <a href="group__debug.html#gaf8a14ae79c3fb2c0b5f6255cc37bebf9">More...</a><br /></td></tr>
<tr class="separator:gaf8a14ae79c3fb2c0b5f6255cc37bebf9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga97d96af7c7ea7b31e32cbe3b25377e09"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__debug.html#ga97d96af7c7ea7b31e32cbe3b25377e09">reportQuregParams</a> (<a class="el" href="structQureg.html">Qureg</a> qureg)</td></tr>
<tr class="memdesc:ga97d96af7c7ea7b31e32cbe3b25377e09"><td class="mdescLeft">&#160;</td><td class="mdescRight">Report metainformation about a set of qubits: number of qubits, number of probability amplitudes.  <a href="group__debug.html#ga97d96af7c7ea7b31e32cbe3b25377e09">More...</a><br /></td></tr>
<tr class="separator:ga97d96af7c7ea7b31e32cbe3b25377e09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacd5f0ee488157837a8483c1515817f98"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__debug.html#gacd5f0ee488157837a8483c1515817f98">reportState</a> (<a class="el" href="structQureg.html">Qureg</a> qureg)</td></tr>
<tr class="memdesc:gacd5f0ee488157837a8483c1515817f98"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print the current state vector of probability amplitudes for a set of qubits to file.  <a href="group__debug.html#gacd5f0ee488157837a8483c1515817f98">More...</a><br /></td></tr>
<tr class="separator:gacd5f0ee488157837a8483c1515817f98"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa33ed720560d051eb4126b4a534bc4c6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__debug.html#gaa33ed720560d051eb4126b4a534bc4c6">reportStateToScreen</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, <a class="el" href="structQuESTEnv.html">QuESTEnv</a> env, int reportRank)</td></tr>
<tr class="memdesc:gaa33ed720560d051eb4126b4a534bc4c6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print the current state vector of probability amplitudes for a set of qubits to standard out.  <a href="group__debug.html#gaa33ed720560d051eb4126b4a534bc4c6">More...</a><br /></td></tr>
<tr class="separator:gaa33ed720560d051eb4126b4a534bc4c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga555451c697ea4a9d27389155f68fdabc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__debug.html#ga555451c697ea4a9d27389155f68fdabc">seedQuEST</a> (<a class="el" href="structQuESTEnv.html">QuESTEnv</a> *env, unsigned long int *seedArray, int numSeeds)</td></tr>
<tr class="memdesc:ga555451c697ea4a9d27389155f68fdabc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Seeds the random number generator with a custom array of key(s), overriding the default keys.  <a href="group__debug.html#ga555451c697ea4a9d27389155f68fdabc">More...</a><br /></td></tr>
<tr class="separator:ga555451c697ea4a9d27389155f68fdabc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae53fad7ebafccf236ad62b41e3244214"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__debug.html#gae53fad7ebafccf236ad62b41e3244214">seedQuESTDefault</a> (<a class="el" href="structQuESTEnv.html">QuESTEnv</a> *env)</td></tr>
<tr class="memdesc:gae53fad7ebafccf236ad62b41e3244214"><td class="mdescLeft">&#160;</td><td class="mdescRight">Seeds the random number generator with the (master node) current time and process ID.  <a href="group__debug.html#gae53fad7ebafccf236ad62b41e3244214">More...</a><br /></td></tr>
<tr class="separator:gae53fad7ebafccf236ad62b41e3244214"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8d31fe2d1ad4d01e2a1f5f6b8bc15b77"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__debug.html#ga8d31fe2d1ad4d01e2a1f5f6b8bc15b77">syncQuESTEnv</a> (<a class="el" href="structQuESTEnv.html">QuESTEnv</a> env)</td></tr>
<tr class="memdesc:ga8d31fe2d1ad4d01e2a1f5f6b8bc15b77"><td class="mdescLeft">&#160;</td><td class="mdescRight">Guarantees that all code up to the given point has been executed on all nodes (if running in distributed mode)  <a href="group__debug.html#ga8d31fe2d1ad4d01e2a1f5f6b8bc15b77">More...</a><br /></td></tr>
<tr class="separator:ga8d31fe2d1ad4d01e2a1f5f6b8bc15b77"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac7e38d768a1bd79019f88cc1e6295092"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__debug.html#gac7e38d768a1bd79019f88cc1e6295092">syncQuESTSuccess</a> (int successCode)</td></tr>
<tr class="memdesc:gac7e38d768a1bd79019f88cc1e6295092"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs a logical AND on all successCodes held by all processes.  <a href="group__debug.html#gac7e38d768a1bd79019f88cc1e6295092">More...</a><br /></td></tr>
<tr class="separator:gac7e38d768a1bd79019f88cc1e6295092"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Utilities for seeding and debugging, such as state-logging. </p>
<dl class="section author"><dt>Author</dt><dd>Ania Brown </dd>
<dd>
Tyson Jones </dd>
<dd>
Balint Koczor </dd>
<dd>
Nicolas Vogt of HQS (one-qubit damping) </dd></dl>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga924ef2dbda6b733b4041270077c76ece"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga924ef2dbda6b733b4041270077c76ece">&#9670;&nbsp;</a></span>copyStateFromGPU()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void copyStateFromGPU </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>In GPU mode, this copies the state-vector (or density matrix) from GPU memory (qureg.deviceStateVec) to RAM (qureg.stateVec), where it can be accessed/modified by the user. </p>
<p>In CPU mode, this function has no effect. In conjunction with <a class="el" href="group__debug.html#ga11448560006dd165128e404b54ebb2f7" title="In GPU mode, this copies the state-vector (or density matrix) from RAM (qureg.stateVec) to VRAM / GPU...">copyStateToGPU()</a>, this allows a user to directly modify the state-vector in a harware agnostic way. Note though that users should instead use <a class="el" href="group__init.html#gabc0c64f8adf307d2a44184dc0f8ca66e" title="Overwrites a subset of the amplitudes in state-vector qureg, with those passed in reals and imags.">setAmps()</a> if possible.</p>
<p>For example, to set the first real element to 1, one could do: </p><div class="fragment"><div class="line"><a class="code" href="group__debug.html#ga924ef2dbda6b733b4041270077c76ece">copyStateFromGPU</a>(qureg);</div>
<div class="line">qureg.<a class="code" href="structQureg.html#a441e4cacef6bd17adb9813c7442d42fe">stateVec</a>.real[0] = 1;</div>
<div class="line"><a class="code" href="group__debug.html#ga11448560006dd165128e404b54ebb2f7">copyStateToGPU</a>(qureg);</div>
</div><!-- fragment --><p>Note users should never access qureg.deviceStateVec directly.</p>
<dl class="section see"><dt>See also</dt><dd><ul>
<li><a class="el" href="group__debug.html#ga11448560006dd165128e404b54ebb2f7" title="In GPU mode, this copies the state-vector (or density matrix) from RAM (qureg.stateVec) to VRAM / GPU...">copyStateToGPU()</a></li>
</ul>
</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">qureg</td><td>the qureg of which to copy <code>.deviceStateVec</code> to <code>.stateVec</code> in GPU mode </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Ania Brown </dd>
<dd>
Tyson Jones (doc) </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST__cpu_8c_source.html#l00045">45</a> of file <a class="el" href="QuEST__cpu_8c_source.html">QuEST_cpu.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;                                   {</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__gpu_8cu_source.html#l00020">DEBUG</a>, <a class="el" href="QuEST_8h_source.html#l00346">Qureg::deviceStateVec</a>, <a class="el" href="QuEST_8h_source.html#l00332">Qureg::numAmpsPerChunk</a>, and <a class="el" href="QuEST_8h_source.html#l00341">Qureg::stateVec</a>.</p>

<p class="reference">Referenced by <a class="el" href="utilities_8cpp_source.html#l00856">areEqual()</a>, <a class="el" href="QuEST__gpu_8cu_source.html#l01632">densmatr_calcTotalProb()</a>, <a class="el" href="QuEST__gpu_8cu_source.html#l01655">statevec_calcTotalProb()</a>, <a class="el" href="QuEST__gpu_8cu_source.html#l00771">statevec_compareStates()</a>, <a class="el" href="QuEST__gpu_8cu_source.html#l00543">statevec_reportStateToScreen()</a>, <a class="el" href="test__data__structures_8cpp_source.html#l00768">TEST_CASE()</a>, <a class="el" href="utilities_8cpp_source.html#l01071">toQMatrix()</a>, and <a class="el" href="utilities_8cpp_source.html#l01113">toQVector()</a>.</p>

</div>
</div>
<a id="ga11448560006dd165128e404b54ebb2f7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga11448560006dd165128e404b54ebb2f7">&#9670;&nbsp;</a></span>copyStateToGPU()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void copyStateToGPU </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>In GPU mode, this copies the state-vector (or density matrix) from RAM (qureg.stateVec) to VRAM / GPU-memory (qureg.deviceStateVec), which is the version operated upon by other calls to the API. </p>
<p>In CPU mode, this function has no effect. In conjunction with <a class="el" href="group__debug.html#ga924ef2dbda6b733b4041270077c76ece" title="In GPU mode, this copies the state-vector (or density matrix) from GPU memory (qureg....">copyStateFromGPU()</a> (which should be called first), this allows a user to directly modify the state-vector in a harware agnostic way. Note though that users should instead use <a class="el" href="group__init.html#gabc0c64f8adf307d2a44184dc0f8ca66e" title="Overwrites a subset of the amplitudes in state-vector qureg, with those passed in reals and imags.">setAmps()</a> if possible.</p>
<p>For example, to set the first real element to 1, one could do: </p><div class="fragment"><div class="line"><a class="code" href="group__debug.html#ga924ef2dbda6b733b4041270077c76ece">copyStateFromGPU</a>(qureg);</div>
<div class="line">qureg.<a class="code" href="structQureg.html#a441e4cacef6bd17adb9813c7442d42fe">stateVec</a>.real[0] = 1;</div>
<div class="line"><a class="code" href="group__debug.html#ga11448560006dd165128e404b54ebb2f7">copyStateToGPU</a>(qureg);</div>
</div><!-- fragment --><p>Note users should never access qureg.deviceStateVec directly.</p>
<dl class="section see"><dt>See also</dt><dd><ul>
<li><a class="el" href="group__debug.html#ga924ef2dbda6b733b4041270077c76ece" title="In GPU mode, this copies the state-vector (or density matrix) from GPU memory (qureg....">copyStateFromGPU()</a></li>
</ul>
</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">qureg</td><td>the qureg of which to copy <code>.stateVec</code> to <code>.deviceStateVec</code> in GPU mode </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Ania Brown </dd>
<dd>
Tyson Jones (doc) </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST__cpu_8c_source.html#l00042">42</a> of file <a class="el" href="QuEST__cpu_8c_source.html">QuEST_cpu.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;                                 {</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__gpu_8cu_source.html#l00020">DEBUG</a>, <a class="el" href="QuEST_8h_source.html#l00346">Qureg::deviceStateVec</a>, <a class="el" href="QuEST_8h_source.html#l00332">Qureg::numAmpsPerChunk</a>, and <a class="el" href="QuEST_8h_source.html#l00341">Qureg::stateVec</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST__gpu_8cu_source.html#l00727">statevec_initStateFromSingleFile()</a>, <a class="el" href="test__data__structures_8cpp_source.html#l00768">TEST_CASE()</a>, and <a class="el" href="utilities_8cpp_source.html#l01201">toQureg()</a>.</p>

</div>
</div>
<a id="gadc5c01d8ea32e28c188db52be26116b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadc5c01d8ea32e28c188db52be26116b6">&#9670;&nbsp;</a></span>getEnvironmentString()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void getEnvironmentString </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQuESTEnv.html">QuESTEnv</a>&#160;</td>
          <td class="paramname"><em>env</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>str</em>[200]&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets <code>str</code> to a string containing information about the runtime environment, including whether simulation is using CUDA (for GPU), OpenMP (for multithreading) and/or MPI (for distribution). </p>
<p>The number of CPU threads and distributed ranks is also reported. Note there is currently no reporting of the number of GPU cores used.</p>
<p>The string format is: </p><div class="fragment"><div class="line"><span class="stringliteral">&quot;CUDA=b OpenMP=b MPI=b threads=n ranks=n&quot;</span></div>
</div><!-- fragment --><p>where <b>b</b> is 0 or 1, and <b>n</b> are integers.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">env</td><td>object representing the execution environment. A single instance is used for each program </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">str</td><td>to be populated with the output string </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Ania Brown </dd>
<dd>
Tyson Jones </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST__cpu__distributed_8c_source.html#l00198">198</a> of file <a class="el" href="QuEST__cpu__distributed_8c_source.html">QuEST_cpu_distributed.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;                                                      {</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    <span class="keywordtype">int</span> ompStatus=0;</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    <span class="keywordtype">int</span> numThreads=1;</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;<span class="preprocessor"># ifdef _OPENMP</span></div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    ompStatus=1;</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    numThreads=omp_get_max_threads(); </div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;<span class="preprocessor"># endif</span></div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;    sprintf(str, <span class="stringliteral">&quot;CUDA=0 OpenMP=%d MPI=1 threads=%d ranks=%d&quot;</span>, ompStatus, numThreads, env.<a class="code" href="structQuESTEnv.html#af22aacd7c9905accae28484785c193b4">numRanks</a>);</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST_8h_source.html#l00365">QuESTEnv::numRanks</a>.</p>

</div>
</div>
<a id="gaaf64c49f51b622702e66d917bf5b5e16"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaf64c49f51b622702e66d917bf5b5e16">&#9670;&nbsp;</a></span>getQuESTSeeds()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void getQuESTSeeds </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQuESTEnv.html">QuESTEnv</a>&#160;</td>
          <td class="paramname"><em>env</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long int **&#160;</td>
          <td class="paramname"><em>seeds</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>numSeeds</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Obtain the seeds presently used in random number generation. </p>
<p>This function sets argument <code>seeds</code> to the address of the array of keys which have seeded QuEST's <a href="http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html">Mersenne Twister</a> random number generator. <code>numSeeds</code> is set to the length of <code>seeds</code>. These are the seeds which inform the outcomes of random functions like <a class="el" href="group__normgate.html#ga2a3794103125f1e3cfa103f8b1963656" title="Measures a single qubit, collapsing it randomly to 0 or 1.">measure()</a>, and are set using <a class="el" href="group__debug.html#ga555451c697ea4a9d27389155f68fdabc" title="Seeds the random number generator with a custom array of key(s), overriding the default keys.">seedQuEST()</a> and <a class="el" href="group__debug.html#gae53fad7ebafccf236ad62b41e3244214" title="Seeds the random number generator with the (master node) current time and process ID.">seedQuESTDefault()</a>.</p>
<blockquote class="doxtable">
<p>The output <code>seeds</code> array <b>must not</b> be freed, and should not be modified. </p>
</blockquote>
<p>Obtaining QuEST's seeds is useful for seeding your own random number generators, so that a simulation (with random QuEST measurements, and your own random decisions) can be precisely repeated later, just by calling <a class="el" href="group__debug.html#ga555451c697ea4a9d27389155f68fdabc" title="Seeds the random number generator with a custom array of key(s), overriding the default keys.">seedQuEST()</a>.</p>
<p>Note this function merely sets the arguments to the attributes for <code>env</code>. I.e. </p><div class="fragment"><div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span>* seeds;</div>
<div class="line"><span class="keywordtype">int</span> numSeeds;</div>
<div class="line"><a class="code" href="group__debug.html#gaaf64c49f51b622702e66d917bf5b5e16">getQuESTSeeds</a>(env, &amp;seeds, &amp;numSeeds);</div>
<div class="line"> </div>
<div class="line">func(seeds, numSeeds);</div>
</div><!-- fragment --><p>is equivalent to </p><div class="fragment"><div class="line">func(env.<a class="code" href="structQuESTEnv.html#a66feaa60d3adc7dcf6f8b66514989356">seeds</a>, env.<a class="code" href="structQuESTEnv.html#a46e67e1a5ab930e04ff59f83f1d8630d">numSeeds</a>);</div>
</div><!-- fragment --><p>However, one should not rely upon their local pointer from <a class="el" href="group__debug.html#gaaf64c49f51b622702e66d917bf5b5e16" title="Obtain the seeds presently used in random number generation.">getQuESTSeeds()</a> to be automatically updated after a subsequent call to <a class="el" href="group__debug.html#ga555451c697ea4a9d27389155f68fdabc" title="Seeds the random number generator with a custom array of key(s), overriding the default keys.">seedQuEST()</a> or <a class="el" href="group__debug.html#gae53fad7ebafccf236ad62b41e3244214" title="Seeds the random number generator with the (master node) current time and process ID.">seedQuESTDefault()</a>. Instead, <a class="el" href="group__debug.html#gaaf64c49f51b622702e66d917bf5b5e16" title="Obtain the seeds presently used in random number generation.">getQuESTSeeds()</a> should be recalled.</p>
<dl class="section see"><dt>See also</dt><dd><ul>
<li><a class="el" href="group__debug.html#ga555451c697ea4a9d27389155f68fdabc" title="Seeds the random number generator with a custom array of key(s), overriding the default keys.">seedQuEST()</a></li>
<li><a class="el" href="group__debug.html#gae53fad7ebafccf236ad62b41e3244214" title="Seeds the random number generator with the (master node) current time and process ID.">seedQuESTDefault()</a></li>
</ul>
</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">env</td><td>the <a class="el" href="structQuESTEnv.html" title="Information about the environment the program is running in.">QuESTEnv</a> runtime environment </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">seeds</td><td>a pointer to an unitialised array to be modified </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">numSeeds</td><td>a pointer to an integer to be modified </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Tyson Jones </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST_8c_source.html#l01622">1622</a> of file <a class="el" href="QuEST_8c_source.html">QuEST.c</a>.</p>
<div class="fragment"><div class="line"><a name="l01622"></a><span class="lineno"> 1622</span>&#160;                                                                           {</div>
<div class="line"><a name="l01623"></a><span class="lineno"> 1623</span>&#160;    *seeds = env.<a class="code" href="structQuESTEnv.html#a66feaa60d3adc7dcf6f8b66514989356">seeds</a>;</div>
<div class="line"><a name="l01624"></a><span class="lineno"> 1624</span>&#160;    *numSeeds = env.<a class="code" href="structQuESTEnv.html#a46e67e1a5ab930e04ff59f83f1d8630d">numSeeds</a>;</div>
<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST_8h_source.html#l00367">QuESTEnv::numSeeds</a>, and <a class="el" href="QuEST_8h_source.html#l00366">QuESTEnv::seeds</a>.</p>

</div>
</div>
<a id="gaa696c94112e5fbbc996af10dfc4e2c1c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa696c94112e5fbbc996af10dfc4e2c1c">&#9670;&nbsp;</a></span>initDebugState()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void initDebugState </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialises <code>qureg</code> to be in the un-normalised, non-physical state with with <img class="formulaInl" alt="$n$" src="form_60.png"/>-th complex amplitude given by <img class="formulaInl" alt="$2n/10 + i(2n+1)/10$" src="form_61.png"/>. </p>
<p>This is used internally for debugging and testing.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">qureg</td><td>the register to have its amplitudes overwritten </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Ania Brown </dd>
<dd>
Tyson Jones (doc) </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST_8c_source.html#l01578">1578</a> of file <a class="el" href="QuEST_8c_source.html">QuEST.c</a>.</p>
<div class="fragment"><div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>&#160;                                 {</div>
<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>&#160;    <a class="code" href="QuEST__internal_8h.html#ad9fd3017ea40cf63fd04b39e03494972">statevec_initDebugState</a>(qureg);</div>
<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__cpu_8c_source.html#l01657">statevec_initDebugState()</a>.</p>

<p class="reference">Referenced by <a class="el" href="test__calculations_8cpp_source.html#l00117">TEST_CASE()</a>.</p>

</div>
</div>
<a id="ga51a64b05d31ef9bcf6a63ce26c0092db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga51a64b05d31ef9bcf6a63ce26c0092db">&#9670;&nbsp;</a></span>invalidQuESTInputError()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void invalidQuESTInputError </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>errMsg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>errFunc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>An internal function called when invalid arguments are passed to a QuEST API call, which the user can optionally override by redefining. </p>
<p>This function is a weak symbol, so that users can choose how input errors are handled, by redefining it in their own code. Users must ensure that the triggered API call does not continue (e.g. the user exits or throws an exception), else QuEST will continue with the valid input and likely trigger a seg-fault. This function is triggered before any internal state-change, hence it is safe to interrupt with exceptions.</p>
<p>E.g. in C </p><div class="fragment"><div class="line"><span class="keywordtype">void</span> <a class="code" href="group__debug.html#ga51a64b05d31ef9bcf6a63ce26c0092db">invalidQuESTInputError</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* errMsg, <span class="keyword">const</span> <span class="keywordtype">char</span>* errFunc) {</div>
<div class="line"> </div>
<div class="line">     <span class="comment">// log to file</span></div>
<div class="line">     printf(<span class="stringliteral">&quot;ERROR! Writing to file...\n&quot;</span>);</div>
<div class="line">     FILE *fp = fopen(<span class="stringliteral">&quot;errorlog.txt&quot;</span>, <span class="stringliteral">&quot;w&quot;</span>);</div>
<div class="line">     fprintf(fp, <span class="stringliteral">&quot;incorrect usage of function &#39;%s&#39;: %s&quot;</span>, errFunc, errMsg);</div>
<div class="line">     fclose(fp);</div>
<div class="line">     </div>
<div class="line">     <span class="comment">// exit</span></div>
<div class="line">     exit(1);</div>
<div class="line">} </div>
</div><!-- fragment --><p>This function is compatible with C++ exceptions, though note the user of extern "C": </p><div class="fragment"><div class="line"><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> <span class="keywordtype">void</span> <a class="code" href="group__debug.html#ga51a64b05d31ef9bcf6a63ce26c0092db">invalidQuESTInputError</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* errMsg, <span class="keyword">const</span> <span class="keywordtype">char</span>* errFunc) {</div>
<div class="line"> </div>
<div class="line">    <span class="keywordtype">string</span> err = <span class="stringliteral">&quot;in function &quot;</span> + string(errFunc) + <span class="stringliteral">&quot;: &quot;</span> + string(errMsg);</div>
<div class="line">    <span class="keywordflow">throw</span> std::invalid_argument(err);</div>
<div class="line">} </div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">errMsg</td><td>a string describing the nature of the argument error </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">errFunc</td><td>the name of the invalidly-called API function </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="group__debug.html#ga51a64b05d31ef9bcf6a63ce26c0092db" title="An internal function called when invalid arguments are passed to a QuEST API call,...">invalidQuESTInputError()</a></td><td><ul>
<li>unless overriden by the user </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Tyson Jones</dd></dl>
<p>An internal function called when invalid arguments are passed to a QuEST API call, which the user can optionally override by redefining.</p>
<p>an negative qubit index). This is redefined here to, in lieu of printing and exiting, throw a C++ exception which can be caught (and hence unit tested for) by Catch2 </p>

<p class="definition">Definition at line <a class="el" href="QuEST__validation_8c_source.html#l00209">209</a> of file <a class="el" href="QuEST__validation_8c_source.html">QuEST_validation.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;                                                                     {</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;    <a class="code" href="QuEST__validation_8c.html#a4904c29bfd00713c13ce54bf40a6afe1">default_invalidQuESTInputError</a>(errMsg, errFunc);</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__validation_8c_source.html#l00199">default_invalidQuESTInputError()</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST__validation_8c_source.html#l00216">QuESTAssert()</a>, <a class="el" href="QuEST__validation_8c_source.html#l00543">validateFileOpened()</a>, <a class="el" href="QuEST__validation_8c_source.html#l00673">validateHamilFileCoeffParsed()</a>, <a class="el" href="QuEST__validation_8c_source.html#l00664">validateHamilFileParams()</a>, <a class="el" href="QuEST__validation_8c_source.html#l00693">validateHamilFilePauliCode()</a>, and <a class="el" href="QuEST__validation_8c_source.html#l00683">validateHamilFilePauliParsed()</a>.</p>

</div>
</div>
<a id="gab27234d9ccf440bb5e5d834e8f7e3938"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab27234d9ccf440bb5e5d834e8f7e3938">&#9670;&nbsp;</a></span>reportPauliHamil()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void reportPauliHamil </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structPauliHamil.html">PauliHamil</a>&#160;</td>
          <td class="paramname"><em>hamil</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Print the <code><a class="el" href="structPauliHamil.html" title="A Pauli Hamiltonian, expressed as a real-weighted sum of pauli products, and which can hence represen...">PauliHamil</a></code> to screen. </p>
<p>The output features a new line for each term, each with format </p><pre class="fragment">c p1 p2 p3 ... pN
</pre><p>where <code>c</code> is the real coefficient of the term, and <code>p1</code> ... <code>pN</code> are numbers <code>0</code>, <code>1</code>, <code>2</code>, <code>3</code> to indicate identity, pauliX, pauliY and pauliZ operators respectively, acting on qubits <code>0</code> through <code>N-1</code> (all qubits). A tab character separates c and p1, but single spaces separate the Pauli operators.</p>
<dl class="section see"><dt>See also</dt><dd><ul>
<li><a class="el" href="group__type.html#ga35b28710877c462927366fa602e591cb" title="Dynamically allocates a Hamiltonian expressed as a real-weighted sum of products of Pauli operators.">createPauliHamil()</a></li>
<li><a class="el" href="group__type.html#gadbe6701dda1d49168f2f23253e370a7a" title="Initialise PauliHamil instance hamil with the given term coefficients and Pauli codes (one for every ...">initPauliHamil()</a></li>
<li><a class="el" href="group__type.html#gaa77376c5e3518186eb085f37826d6008" title="Creates a PauliHamil instance, a real-weighted sum of products of Pauli operators,...">createPauliHamilFromFile()</a></li>
</ul>
</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hamil</td><td>an instantiated <a class="el" href="structPauliHamil.html" title="A Pauli Hamiltonian, expressed as a real-weighted sum of pauli products, and which can hence represen...">PauliHamil</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">invalidQuESTInputError</td><td>if the parameters of <code>hamil</code> are invalid, i.e. if <code>numQubits</code> &lt;= 0, or if <code>numSumTerms</code> &lt;= 0, or if <code>pauliCodes</code> contains an invalid Pauli code. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Tyson Jones </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST_8c_source.html#l01598">1598</a> of file <a class="el" href="QuEST_8c_source.html">QuEST.c</a>.</p>
<div class="fragment"><div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>&#160;                                        {</div>
<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>&#160;    <a class="code" href="QuEST__validation_8c.html#a066b0c4d0b02a0f3b9be7e5c68d9de6a">validatePauliHamil</a>(hamil, __func__);</div>
<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>&#160;    </div>
<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> t=0; t&lt;hamil.<a class="code" href="structPauliHamil.html#a737e46b40ef8990cf004d22eb9dbe2e4">numSumTerms</a>; t++) {</div>
<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>&#160;        printf(REAL_QASM_FORMAT, hamil.<a class="code" href="structPauliHamil.html#ac1c6c9f6299cf83bbba88123216c3cac">termCoeffs</a>[t]);</div>
<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>&#160;        printf(<span class="stringliteral">&quot;\t&quot;</span>);</div>
<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>&#160;        <span class="keywordflow">for</span> (<span class="keywordtype">int</span> q=0; q&lt;hamil.<a class="code" href="structPauliHamil.html#acb49fff0e3160ea1904c9ca34408b4e1">numQubits</a>; q++)</div>
<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>&#160;            printf(<span class="stringliteral">&quot;%d &quot;</span>, (<span class="keywordtype">int</span>) hamil.<a class="code" href="structPauliHamil.html#a4b8d38c403553c07ceddcd40c46ce6c8">pauliCodes</a>[q+t*hamil.<a class="code" href="structPauliHamil.html#acb49fff0e3160ea1904c9ca34408b4e1">numQubits</a>]);</div>
<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>&#160;        printf(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>&#160;    }</div>
<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST_8h_source.html#l00287">PauliHamil::numQubits</a>, <a class="el" href="QuEST_8h_source.html#l00285">PauliHamil::numSumTerms</a>, <a class="el" href="QuEST_8h_source.html#l00281">PauliHamil::pauliCodes</a>, <a class="el" href="QuEST_8h_source.html#l00283">PauliHamil::termCoeffs</a>, and <a class="el" href="QuEST__validation_8c_source.html#l00655">validatePauliHamil()</a>.</p>

</div>
</div>
<a id="gaf8a14ae79c3fb2c0b5f6255cc37bebf9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf8a14ae79c3fb2c0b5f6255cc37bebf9">&#9670;&nbsp;</a></span>reportQuESTEnv()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void reportQuESTEnv </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQuESTEnv.html">QuESTEnv</a>&#160;</td>
          <td class="paramname"><em>env</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Report information about the QuEST environment. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">env</td><td>object representing the execution environment. A single instance is used for each program </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Ania Brown </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST__cpu__distributed_8c_source.html#l00183">183</a> of file <a class="el" href="QuEST__cpu__distributed_8c_source.html">QuEST_cpu_distributed.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;                                 {</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="keywordflow">if</span> (env.<a class="code" href="structQuESTEnv.html#aa648bb336cf8598467cb62db00b9cee8">rank</a>==0){</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;        printf(<span class="stringliteral">&quot;EXECUTION ENVIRONMENT:\n&quot;</span>); </div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;        printf(<span class="stringliteral">&quot;Running distributed (MPI) version\n&quot;</span>);</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;        printf(<span class="stringliteral">&quot;Number of ranks is %d\n&quot;</span>, env.<a class="code" href="structQuESTEnv.html#af22aacd7c9905accae28484785c193b4">numRanks</a>);</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;<span class="preprocessor"># ifdef _OPENMP</span></div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;        printf(<span class="stringliteral">&quot;OpenMP enabled\n&quot;</span>);</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        printf(<span class="stringliteral">&quot;Number of threads available is %d\n&quot;</span>, omp_get_max_threads());</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;<span class="preprocessor"># else</span></div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;        printf(<span class="stringliteral">&quot;OpenMP disabled\n&quot;</span>);</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;<span class="preprocessor"># endif </span></div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;        printf(<span class="stringliteral">&quot;Precision: size of qreal is %ld bytes\n&quot;</span>, <span class="keyword">sizeof</span>(<a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>) );</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    }</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST_8h_source.html#l00365">QuESTEnv::numRanks</a>, <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>, and <a class="el" href="QuEST_8h_source.html#l00364">QuESTEnv::rank</a>.</p>

</div>
</div>
<a id="ga97d96af7c7ea7b31e32cbe3b25377e09"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga97d96af7c7ea7b31e32cbe3b25377e09">&#9670;&nbsp;</a></span>reportQuregParams()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void reportQuregParams </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Report metainformation about a set of qubits: number of qubits, number of probability amplitudes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">qureg</td><td>object representing the set of qubits </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Ania Brown </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST__common_8c_source.html#l00237">237</a> of file <a class="el" href="QuEST__common_8c_source.html">QuEST_common.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;                                   {</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;    <span class="keywordtype">long</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span> numAmps = 1LL &lt;&lt; qureg.<a class="code" href="structQureg.html#a0a86e8a50ea8c998b4a0a6640c5a1218">numQubitsInStateVec</a>;</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    <span class="keywordtype">long</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span> numAmpsPerRank = numAmps/qureg.<a class="code" href="structQureg.html#aa3deb7163aab90a61e755a1f200f5413">numChunks</a>;</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    <span class="keywordflow">if</span> (qureg.<a class="code" href="structQureg.html#ac2929e681d3d95591c18cf168dbbe4f0">chunkId</a>==0){</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;        printf(<span class="stringliteral">&quot;QUBITS:\n&quot;</span>);</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;        printf(<span class="stringliteral">&quot;Number of qubits is %d.\n&quot;</span>, qureg.<a class="code" href="structQureg.html#a0a86e8a50ea8c998b4a0a6640c5a1218">numQubitsInStateVec</a>);</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;        printf(<span class="stringliteral">&quot;Number of amps is %lld.\n&quot;</span>, numAmps);</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;        printf(<span class="stringliteral">&quot;Number of amps per rank is %lld.\n&quot;</span>, numAmpsPerRank);</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;    }</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST_8h_source.html#l00336">Qureg::chunkId</a>, <a class="el" href="QuEST_8h_source.html#l00338">Qureg::numChunks</a>, and <a class="el" href="QuEST_8h_source.html#l00329">Qureg::numQubitsInStateVec</a>.</p>

</div>
</div>
<a id="gacd5f0ee488157837a8483c1515817f98"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacd5f0ee488157837a8483c1515817f98">&#9670;&nbsp;</a></span>reportState()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void reportState </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Print the current state vector of probability amplitudes for a set of qubits to file. </p>
<p>File format: </p><pre class="fragment">real, imag
realComponent1, imagComponent1
realComponent2, imagComponent2
...
realComponentN, imagComponentN
</pre><p>File naming convention:</p>
<p>For each node that the program runs on, a file 'state_rank_[node_rank].csv' is generated. If there is more than one node, ranks after the first do not include the header </p><pre class="fragment">real, imag
</pre><p> so that files are easier to combine.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">qureg</td><td>object representing the set of qubits </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Ania Brown </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST__common_8c_source.html#l00219">219</a> of file <a class="el" href="QuEST__common_8c_source.html">QuEST_common.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;                             {</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    FILE *state;</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <span class="keywordtype">char</span> filename[100];</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    <span class="keywordtype">long</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span> index;</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    sprintf(filename, <span class="stringliteral">&quot;state_rank_%d.csv&quot;</span>, qureg.<a class="code" href="structQureg.html#ac2929e681d3d95591c18cf168dbbe4f0">chunkId</a>);</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    state = fopen(filename, <span class="stringliteral">&quot;w&quot;</span>);</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    <span class="keywordflow">if</span> (qureg.<a class="code" href="structQureg.html#ac2929e681d3d95591c18cf168dbbe4f0">chunkId</a>==0) fprintf(state, <span class="stringliteral">&quot;real, imag\n&quot;</span>);</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160; </div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    <span class="keywordflow">for</span>(index=0; index&lt;qureg.<a class="code" href="structQureg.html#ab0ea0358482b62f43fdd781469607d97">numAmpsPerChunk</a>; index++){</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;<span class="preprocessor">        # if QuEST_PREC==1 || QuEST_PREC==2</span></div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;        fprintf(state, <span class="stringliteral">&quot;%.12f, %.12f\n&quot;</span>, qureg.<a class="code" href="structQureg.html#a441e4cacef6bd17adb9813c7442d42fe">stateVec</a>.real[index], qureg.<a class="code" href="structQureg.html#a441e4cacef6bd17adb9813c7442d42fe">stateVec</a>.imag[index]);</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;<span class="preprocessor">        # elif QuEST_PREC == 4</span></div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;        fprintf(state, <span class="stringliteral">&quot;%.12Lf, %.12Lf\n&quot;</span>, qureg.<a class="code" href="structQureg.html#a441e4cacef6bd17adb9813c7442d42fe">stateVec</a>.real[index], qureg.<a class="code" href="structQureg.html#a441e4cacef6bd17adb9813c7442d42fe">stateVec</a>.imag[index]);</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;<span class="preprocessor">        #endif</span></div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    }</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    fclose(state);</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST_8h_source.html#l00336">Qureg::chunkId</a>, <a class="el" href="QuEST_8h_source.html#l00332">Qureg::numAmpsPerChunk</a>, and <a class="el" href="QuEST_8h_source.html#l00341">Qureg::stateVec</a>.</p>

</div>
</div>
<a id="gaa33ed720560d051eb4126b4a534bc4c6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa33ed720560d051eb4126b4a534bc4c6">&#9670;&nbsp;</a></span>reportStateToScreen()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void reportStateToScreen </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structQuESTEnv.html">QuESTEnv</a>&#160;</td>
          <td class="paramname"><em>env</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>reportRank</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Print the current state vector of probability amplitudes for a set of qubits to standard out. </p>
<p>For debugging purposes. Each rank should print output serially. Only print output for systems &lt;= 5 qubits</p>
<dl class="section author"><dt>Author</dt><dd>Ania Brown </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST_8c_source.html#l01594">1594</a> of file <a class="el" href="QuEST_8c_source.html">QuEST.c</a>.</p>
<div class="fragment"><div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>&#160;                                                                     {</div>
<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>&#160;    <a class="code" href="QuEST__internal_8h.html#a1e57230c7995447039e62a84c0a36524">statevec_reportStateToScreen</a>(qureg, env, reportRank);</div>
<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__cpu_8c_source.html#l01439">statevec_reportStateToScreen()</a>.</p>

</div>
</div>
<a id="ga555451c697ea4a9d27389155f68fdabc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga555451c697ea4a9d27389155f68fdabc">&#9670;&nbsp;</a></span>seedQuEST()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void seedQuEST </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQuESTEnv.html">QuESTEnv</a> *&#160;</td>
          <td class="paramname"><em>env</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long int *&#160;</td>
          <td class="paramname"><em>seedArray</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>numSeeds</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Seeds the random number generator with a custom array of key(s), overriding the default keys. </p>
<p>This determines the sequence of outcomes in functions like <a class="el" href="group__normgate.html#ga2a3794103125f1e3cfa103f8b1963656" title="Measures a single qubit, collapsing it randomly to 0 or 1.">measure()</a> and <a class="el" href="group__normgate.html#gae192ac0759e46c7b20a7182020155240" title="Measures a single qubit, collapsing it randomly to 0 or 1, and additionally gives the probability of ...">measureWithStats()</a>.</p>
<p>In distributed mode, the key(s) passed to the master node will be broadcast to all other nodes, such that every node generates the same sequence of pseudorandom numbers.</p>
<p>This function will copy the contents of <code>seedArray</code> into a permanent array <code>env.seeds</code>, so <code>seedArray</code> is afterward safe to free.</p>
<blockquote class="doxtable">
<p>QuEST uses the <a href="http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html">Mersenne Twister</a> for random number generation. </p>
</blockquote>
<dl class="section see"><dt>See also</dt><dd><ul>
<li>Use <a class="el" href="group__debug.html#gae53fad7ebafccf236ad62b41e3244214" title="Seeds the random number generator with the (master node) current time and process ID.">seedQuESTDefault()</a> to seed via the current timestamp and process id.</li>
<li>Use <a class="el" href="group__debug.html#gaaf64c49f51b622702e66d917bf5b5e16" title="Obtain the seeds presently used in random number generation.">getQuESTSeeds()</a> to obtain the seeds currently being used for RNG.</li>
</ul>
</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">env</td><td>a pointer to the <a class="el" href="structQuESTEnv.html" title="Information about the environment the program is running in.">QuESTEnv</a> runtime environment </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">seedArray</td><td>Array of integers to use as seed. This allows the MT to be initialised with more than a 32-bit integer if required </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">numSeeds</td><td>Length of seedArray </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Ania Brown </dd>
<dd>
Tyson Jones (doc) </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST__cpu__distributed_8c_source.html#l01388">1388</a> of file <a class="el" href="QuEST__cpu__distributed_8c_source.html">QuEST_cpu_distributed.c</a>.</p>
<div class="fragment"><div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>&#160;                                                                          {</div>
<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>&#160; </div>
<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>&#160;    <span class="comment">// it is imperative every node agrees on the seed, so that random decisions </span></div>
<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>&#160;    <span class="comment">// agree on every node. Hence we use only the master node keys.</span></div>
<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>&#160;    MPI_Bcast(seedArray, numSeeds, MPI_UNSIGNED_LONG, 0, MPI_COMM_WORLD);</div>
<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>&#160;    </div>
<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>&#160;    <span class="comment">// free existing seed array, if exists</span></div>
<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>&#160;    <span class="keywordflow">if</span> (env-&gt;<a class="code" href="structQuESTEnv.html#a66feaa60d3adc7dcf6f8b66514989356">seeds</a> != NULL)</div>
<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>&#160;        free(env-&gt;<a class="code" href="structQuESTEnv.html#a66feaa60d3adc7dcf6f8b66514989356">seeds</a>);</div>
<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>&#160;        </div>
<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>&#160;    <span class="comment">// record keys in permanent heap</span></div>
<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>&#160;    env-&gt;<a class="code" href="structQuESTEnv.html#a66feaa60d3adc7dcf6f8b66514989356">seeds</a> = malloc(numSeeds * <span class="keyword">sizeof</span> *(env-&gt;<a class="code" href="structQuESTEnv.html#a66feaa60d3adc7dcf6f8b66514989356">seeds</a>));</div>
<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i&lt;numSeeds; i++)</div>
<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>&#160;        (env-&gt;<a class="code" href="structQuESTEnv.html#a66feaa60d3adc7dcf6f8b66514989356">seeds</a>)[i] = seedArray[i];</div>
<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>&#160;    env-&gt;<a class="code" href="structQuESTEnv.html#a46e67e1a5ab930e04ff59f83f1d8630d">numSeeds</a> = numSeeds;</div>
<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>&#160;    </div>
<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>&#160;    <span class="comment">// pass keys to Mersenne Twister seeder</span></div>
<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>&#160;    <a class="code" href="mt19937ar_8c.html#ac1283f9b1ed571332f5ffe53545ffc16">init_by_array</a>(seedArray, numSeeds); </div>
<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="mt19937ar_8c_source.html#l00080">init_by_array()</a>, <a class="el" href="QuEST_8h_source.html#l00367">QuESTEnv::numSeeds</a>, and <a class="el" href="QuEST_8h_source.html#l00366">QuESTEnv::seeds</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST_8c_source.html#l01614">seedQuESTDefault()</a>.</p>

</div>
</div>
<a id="gae53fad7ebafccf236ad62b41e3244214"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae53fad7ebafccf236ad62b41e3244214">&#9670;&nbsp;</a></span>seedQuESTDefault()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void seedQuESTDefault </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQuESTEnv.html">QuESTEnv</a> *&#160;</td>
          <td class="paramname"><em>env</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Seeds the random number generator with the (master node) current time and process ID. </p>
<p>This is the default seeding used by <a class="el" href="group__type.html#ga8ba2c3388dd64d9348c3b091852d36d4" title="Create the QuEST execution environment.">createQuESTEnv()</a>, and determines the outcomes in functions like <a class="el" href="group__normgate.html#ga2a3794103125f1e3cfa103f8b1963656" title="Measures a single qubit, collapsing it randomly to 0 or 1.">measure()</a> and <a class="el" href="group__normgate.html#gae192ac0759e46c7b20a7182020155240" title="Measures a single qubit, collapsing it randomly to 0 or 1, and additionally gives the probability of ...">measureWithStats()</a>.</p>
<p>In distributed mode, every node agrees on the seed (nominated by the master node) such that every node generates the same sequence of pseudorandom numbers.</p>
<blockquote class="doxtable">
<p>QuEST uses the <a href="http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html">Mersenne Twister</a> for random number generation. </p>
</blockquote>
<dl class="section see"><dt>See also</dt><dd><ul>
<li>Use <a class="el" href="group__debug.html#ga555451c697ea4a9d27389155f68fdabc" title="Seeds the random number generator with a custom array of key(s), overriding the default keys.">seedQuEST()</a> to provide a custom seed, overriding the default.</li>
<li>Use <a class="el" href="group__debug.html#gaaf64c49f51b622702e66d917bf5b5e16" title="Obtain the seeds presently used in random number generation.">getQuESTSeeds()</a> to obtain the seeds currently being used for RNG.</li>
</ul>
</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">env</td><td>a pointer to the <a class="el" href="structQuESTEnv.html" title="Information about the environment the program is running in.">QuESTEnv</a> runtime environment </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Ania Brown </dd>
<dd>
Balint Koczor (Windows compatibility) </dd>
<dd>
Tyson Jones (doc) </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST_8c_source.html#l01614">1614</a> of file <a class="el" href="QuEST_8c_source.html">QuEST.c</a>.</p>
<div class="fragment"><div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>&#160;                                     {</div>
<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>&#160;    </div>
<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>&#160;    <span class="comment">// seed Mersenne Twister random number generator with two keys -- time and pid</span></div>
<div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span> keys[2];</div>
<div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>&#160;    <a class="code" href="QuEST__common_8c.html#a2b323b65cd6512720e6aa27c182fcea0">getQuESTDefaultSeedKey</a>(keys);</div>
<div class="line"><a name="l01619"></a><span class="lineno"> 1619</span>&#160;    <a class="code" href="group__debug.html#ga555451c697ea4a9d27389155f68fdabc">seedQuEST</a>(env, keys, 2);</div>
<div class="line"><a name="l01620"></a><span class="lineno"> 1620</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__common_8c_source.html#l00195">getQuESTDefaultSeedKey()</a>, and <a class="el" href="QuEST__cpu__distributed_8c_source.html#l01388">seedQuEST()</a>.</p>

<p class="reference">Referenced by <a class="el" href="QuEST__cpu__distributed_8c_source.html#l00129">createQuESTEnv()</a>.</p>

</div>
</div>
<a id="ga8d31fe2d1ad4d01e2a1f5f6b8bc15b77"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8d31fe2d1ad4d01e2a1f5f6b8bc15b77">&#9670;&nbsp;</a></span>syncQuESTEnv()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void syncQuESTEnv </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQuESTEnv.html">QuESTEnv</a>&#160;</td>
          <td class="paramname"><em>env</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Guarantees that all code up to the given point has been executed on all nodes (if running in distributed mode) </p>
<dl class="section see"><dt>See also</dt><dd><ul>
<li><a class="el" href="group__debug.html#gac7e38d768a1bd79019f88cc1e6295092" title="Performs a logical AND on all successCodes held by all processes.">syncQuESTSuccess()</a></li>
</ul>
</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">env</td><td>object representing the execution environment. A single instance is used for each program </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Ania Brown </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST__cpu__distributed_8c_source.html#l00164">164</a> of file <a class="el" href="QuEST__cpu__distributed_8c_source.html">QuEST_cpu_distributed.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;                               {</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    MPI_Barrier(MPI_COMM_WORLD);</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">Referenced by <a class="el" href="utilities_8cpp_source.html#l00856">areEqual()</a>, <a class="el" href="utilities_8cpp_source.html#l01375">deleteFilesWithPrefixSynch()</a>, <a class="el" href="QuEST__cpu_8c_source.html#l01691">statevec_initStateFromSingleFile()</a>, <a class="el" href="QuEST__cpu_8c_source.html#l01439">statevec_reportStateToScreen()</a>, <a class="el" href="test__data__structures_8cpp_source.html#l00255">TEST_CASE()</a>, <a class="el" href="utilities_8cpp_source.html#l01071">toQMatrix()</a>, <a class="el" href="utilities_8cpp_source.html#l01201">toQureg()</a>, <a class="el" href="utilities_8cpp_source.html#l01113">toQVector()</a>, and <a class="el" href="utilities_8cpp_source.html#l01362">writeToFileSynch()</a>.</p>

</div>
</div>
<a id="gac7e38d768a1bd79019f88cc1e6295092"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac7e38d768a1bd79019f88cc1e6295092">&#9670;&nbsp;</a></span>syncQuESTSuccess()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int syncQuESTSuccess </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>successCode</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Performs a logical AND on all successCodes held by all processes. </p>
<p>If any one process has a zero successCode all processes will return a zero success code.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">successCode</td><td>1 if process task succeeded, 0 if process task failed </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if all processes succeeded, 0 if any one process failed </dd></dl>
<dl class="section author"><dt>Author</dt><dd>Ania Brown </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST__cpu__distributed_8c_source.html#l00168">168</a> of file <a class="el" href="QuEST__cpu__distributed_8c_source.html">QuEST_cpu_distributed.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;                                     {</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    <span class="keywordtype">int</span> totalSuccess;</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    MPI_Allreduce(&amp;successCode, &amp;totalSuccess, 1, MPI_INT, MPI_LAND, MPI_COMM_WORLD);</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <span class="keywordflow">return</span> totalSuccess;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
<div class="ttc" id="amt19937ar_8c_html_ac1283f9b1ed571332f5ffe53545ffc16"><div class="ttname"><a href="mt19937ar_8c.html#ac1283f9b1ed571332f5ffe53545ffc16">init_by_array</a></div><div class="ttdeci">void init_by_array(unsigned long init_key[], int key_length)</div><div class="ttdef"><b>Definition:</b> <a href="mt19937ar_8c_source.html#l00080">mt19937ar.c:80</a></div></div>
<div class="ttc" id="agroup__debug_html_ga924ef2dbda6b733b4041270077c76ece"><div class="ttname"><a href="group__debug.html#ga924ef2dbda6b733b4041270077c76ece">copyStateFromGPU</a></div><div class="ttdeci">void copyStateFromGPU(Qureg qureg)</div><div class="ttdoc">In GPU mode, this copies the state-vector (or density matrix) from GPU memory (qureg....</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__cpu_8c_source.html#l00045">QuEST_cpu.c:45</a></div></div>
<div class="ttc" id="astructQuESTEnv_html_aa648bb336cf8598467cb62db00b9cee8"><div class="ttname"><a href="structQuESTEnv.html#aa648bb336cf8598467cb62db00b9cee8">QuESTEnv::rank</a></div><div class="ttdeci">int rank</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00364">QuEST.h:364</a></div></div>
<div class="ttc" id="astructQuESTEnv_html_a46e67e1a5ab930e04ff59f83f1d8630d"><div class="ttname"><a href="structQuESTEnv.html#a46e67e1a5ab930e04ff59f83f1d8630d">QuESTEnv::numSeeds</a></div><div class="ttdeci">int numSeeds</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00367">QuEST.h:367</a></div></div>
<div class="ttc" id="astructQureg_html_aa3deb7163aab90a61e755a1f200f5413"><div class="ttname"><a href="structQureg.html#aa3deb7163aab90a61e755a1f200f5413">Qureg::numChunks</a></div><div class="ttdeci">int numChunks</div><div class="ttdoc">Number of chunks the state vector is broken up into – the number of MPI processes used.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00338">QuEST.h:338</a></div></div>
<div class="ttc" id="aQuEST__common_8c_html_a2b323b65cd6512720e6aa27c182fcea0"><div class="ttname"><a href="QuEST__common_8c.html#a2b323b65cd6512720e6aa27c182fcea0">getQuESTDefaultSeedKey</a></div><div class="ttdeci">void getQuESTDefaultSeedKey(unsigned long int *key)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__common_8c_source.html#l00195">QuEST_common.c:195</a></div></div>
<div class="ttc" id="agroup__debug_html_gaaf64c49f51b622702e66d917bf5b5e16"><div class="ttname"><a href="group__debug.html#gaaf64c49f51b622702e66d917bf5b5e16">getQuESTSeeds</a></div><div class="ttdeci">void getQuESTSeeds(QuESTEnv env, unsigned long int **seeds, int *numSeeds)</div><div class="ttdoc">Obtain the seeds presently used in random number generation.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8c_source.html#l01622">QuEST.c:1622</a></div></div>
<div class="ttc" id="agroup__type_html_ga7740e349b4f8bae6451547680f0ce2d6"><div class="ttname"><a href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a></div><div class="ttdeci">#define qreal</div></div>
<div class="ttc" id="astructQureg_html_a0a86e8a50ea8c998b4a0a6640c5a1218"><div class="ttname"><a href="structQureg.html#a0a86e8a50ea8c998b4a0a6640c5a1218">Qureg::numQubitsInStateVec</a></div><div class="ttdeci">int numQubitsInStateVec</div><div class="ttdoc">Number of qubits in the state-vector - this is double the number represented for mixed states.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00329">QuEST.h:329</a></div></div>
<div class="ttc" id="agroup__debug_html_ga51a64b05d31ef9bcf6a63ce26c0092db"><div class="ttname"><a href="group__debug.html#ga51a64b05d31ef9bcf6a63ce26c0092db">invalidQuESTInputError</a></div><div class="ttdeci">void invalidQuESTInputError(const char *errMsg, const char *errFunc)</div><div class="ttdoc">An internal function called when invalid arguments are passed to a QuEST API call,...</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__validation_8c_source.html#l00209">QuEST_validation.c:209</a></div></div>
<div class="ttc" id="astructQureg_html_ac2929e681d3d95591c18cf168dbbe4f0"><div class="ttname"><a href="structQureg.html#ac2929e681d3d95591c18cf168dbbe4f0">Qureg::chunkId</a></div><div class="ttdeci">int chunkId</div><div class="ttdoc">The position of the chunk of the state vector held by this process in the full state vector.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00336">QuEST.h:336</a></div></div>
<div class="ttc" id="astructQureg_html_ab0ea0358482b62f43fdd781469607d97"><div class="ttname"><a href="structQureg.html#ab0ea0358482b62f43fdd781469607d97">Qureg::numAmpsPerChunk</a></div><div class="ttdeci">long long int numAmpsPerChunk</div><div class="ttdoc">Number of probability amplitudes held in stateVec by this process In the non-MPI version,...</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00332">QuEST.h:332</a></div></div>
<div class="ttc" id="astructPauliHamil_html_ac1c6c9f6299cf83bbba88123216c3cac"><div class="ttname"><a href="structPauliHamil.html#ac1c6c9f6299cf83bbba88123216c3cac">PauliHamil::termCoeffs</a></div><div class="ttdeci">qreal * termCoeffs</div><div class="ttdoc">The real coefficient of each Pauli product. This is an array of length PauliHamil....</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00283">QuEST.h:283</a></div></div>
<div class="ttc" id="astructPauliHamil_html_a4b8d38c403553c07ceddcd40c46ce6c8"><div class="ttname"><a href="structPauliHamil.html#a4b8d38c403553c07ceddcd40c46ce6c8">PauliHamil::pauliCodes</a></div><div class="ttdeci">enum pauliOpType * pauliCodes</div><div class="ttdoc">The Pauli operators acting on each qubit, flattened over every operator.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00281">QuEST.h:281</a></div></div>
<div class="ttc" id="aQuEST__internal_8h_html_a1e57230c7995447039e62a84c0a36524"><div class="ttname"><a href="QuEST__internal_8h.html#a1e57230c7995447039e62a84c0a36524">statevec_reportStateToScreen</a></div><div class="ttdeci">void statevec_reportStateToScreen(Qureg qureg, QuESTEnv env, int reportRank)</div><div class="ttdoc">Print the current state vector of probability amplitudes for a set of qubits to standard out.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__cpu_8c_source.html#l01439">QuEST_cpu.c:1439</a></div></div>
<div class="ttc" id="agroup__debug_html_ga11448560006dd165128e404b54ebb2f7"><div class="ttname"><a href="group__debug.html#ga11448560006dd165128e404b54ebb2f7">copyStateToGPU</a></div><div class="ttdeci">void copyStateToGPU(Qureg qureg)</div><div class="ttdoc">In GPU mode, this copies the state-vector (or density matrix) from RAM (qureg.stateVec) to VRAM / GPU...</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__cpu_8c_source.html#l00042">QuEST_cpu.c:42</a></div></div>
<div class="ttc" id="astructQuESTEnv_html_af22aacd7c9905accae28484785c193b4"><div class="ttname"><a href="structQuESTEnv.html#af22aacd7c9905accae28484785c193b4">QuESTEnv::numRanks</a></div><div class="ttdeci">int numRanks</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00365">QuEST.h:365</a></div></div>
<div class="ttc" id="astructPauliHamil_html_a737e46b40ef8990cf004d22eb9dbe2e4"><div class="ttname"><a href="structPauliHamil.html#a737e46b40ef8990cf004d22eb9dbe2e4">PauliHamil::numSumTerms</a></div><div class="ttdeci">int numSumTerms</div><div class="ttdoc">The number of terms in the weighted sum, or the number of Pauli products.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00285">QuEST.h:285</a></div></div>
<div class="ttc" id="astructQuESTEnv_html_a66feaa60d3adc7dcf6f8b66514989356"><div class="ttname"><a href="structQuESTEnv.html#a66feaa60d3adc7dcf6f8b66514989356">QuESTEnv::seeds</a></div><div class="ttdeci">unsigned long int * seeds</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00366">QuEST.h:366</a></div></div>
<div class="ttc" id="aQuEST__internal_8h_html_ad9fd3017ea40cf63fd04b39e03494972"><div class="ttname"><a href="QuEST__internal_8h.html#ad9fd3017ea40cf63fd04b39e03494972">statevec_initDebugState</a></div><div class="ttdeci">void statevec_initDebugState(Qureg qureg)</div><div class="ttdoc">Initialise the state vector of probability amplitudes to an (unphysical) state with each component of...</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__cpu_8c_source.html#l01657">QuEST_cpu.c:1657</a></div></div>
<div class="ttc" id="aQuEST__validation_8c_html_a066b0c4d0b02a0f3b9be7e5c68d9de6a"><div class="ttname"><a href="QuEST__validation_8c.html#a066b0c4d0b02a0f3b9be7e5c68d9de6a">validatePauliHamil</a></div><div class="ttdeci">void validatePauliHamil(PauliHamil hamil, const char *caller)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__validation_8c_source.html#l00655">QuEST_validation.c:655</a></div></div>
<div class="ttc" id="astructQureg_html_a441e4cacef6bd17adb9813c7442d42fe"><div class="ttname"><a href="structQureg.html#a441e4cacef6bd17adb9813c7442d42fe">Qureg::stateVec</a></div><div class="ttdeci">ComplexArray stateVec</div><div class="ttdoc">Computational state amplitudes - a subset thereof in the MPI version.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00341">QuEST.h:341</a></div></div>
<div class="ttc" id="astructPauliHamil_html_acb49fff0e3160ea1904c9ca34408b4e1"><div class="ttname"><a href="structPauliHamil.html#acb49fff0e3160ea1904c9ca34408b4e1">PauliHamil::numQubits</a></div><div class="ttdeci">int numQubits</div><div class="ttdoc">The number of qubits informing the Hilbert dimension of the Hamiltonian.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00287">QuEST.h:287</a></div></div>
<div class="ttc" id="agroup__debug_html_ga555451c697ea4a9d27389155f68fdabc"><div class="ttname"><a href="group__debug.html#ga555451c697ea4a9d27389155f68fdabc">seedQuEST</a></div><div class="ttdeci">void seedQuEST(QuESTEnv *env, unsigned long int *seedArray, int numSeeds)</div><div class="ttdoc">Seeds the random number generator with a custom array of key(s), overriding the default keys.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__cpu__distributed_8c_source.html#l01388">QuEST_cpu_distributed.c:1388</a></div></div>
<div class="ttc" id="aQuEST__validation_8c_html_a4904c29bfd00713c13ce54bf40a6afe1"><div class="ttname"><a href="QuEST__validation_8c.html#a4904c29bfd00713c13ce54bf40a6afe1">default_invalidQuESTInputError</a></div><div class="ttdeci">void default_invalidQuESTInputError(const char *errMsg, const char *errFunc)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__validation_8c_source.html#l00199">QuEST_validation.c:199</a></div></div>
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
</div>
</div>
</div>
</div>
</div>
</body>
        <script type="text/javascript" src="boot.js"></script>
</html>