File: pep.html

package info (click to toggle)
slepc 3.24.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 122,028 kB
  • sloc: ansic: 104,353; javascript: 12,732; python: 5,958; f90: 3,312; cpp: 1,528; makefile: 761; xml: 679; sh: 347
file content (1274 lines) | stat: -rw-r--r-- 125,834 bytes parent folder | download
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
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274

<!DOCTYPE html>


<html lang="en" data-content_root="../../" >

  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>PEP: Polynomial Eigenvalue Problems &#8212; SLEPc 3.24.1 documentation</title>
  
  
  
  <script data-cfasync="false">
    document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
    document.documentElement.dataset.theme = localStorage.getItem("theme") || "";
  </script>
  <!--
    this give us a css class that will be invisible only if js is disabled
  -->
  <noscript>
    <style>
      .pst-js-only { display: none !important; }

    </style>
  </noscript>
  
  <!-- Loaded before other Sphinx assets -->
  <link href="../../_static/styles/theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />
<link href="../../_static/styles/pydata-sphinx-theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />

    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=8f2a1f02" />
    <link rel="stylesheet" type="text/css" href="../../_static/copybutton.css?v=76b2166b" />
    <link rel="stylesheet" type="text/css" href="../../_static/togglebutton.css?v=13237357" />
    <link rel="stylesheet" type="text/css" href="../../_static/sphinx-design.min.css?v=95c83b7e" />
    <link rel="stylesheet" type="text/css" href="../../_static/css/slepc.css?v=d285b177" />
  
  <!-- So that users can add custom icons -->
  <script src="../../_static/scripts/fontawesome.js?digest=8878045cc6db502f8baf"></script>
  <!-- Pre-loaded scripts that we'll load fully later -->
  <link rel="preload" as="script" href="../../_static/scripts/bootstrap.js?digest=8878045cc6db502f8baf" />
<link rel="preload" as="script" href="../../_static/scripts/pydata-sphinx-theme.js?digest=8878045cc6db502f8baf" />

    <script src="../../_static/documentation_options.js?v=d1c46438"></script>
    <script src="../../_static/doctools.js?v=9a2dae69"></script>
    <script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="../../_static/clipboard.min.js?v=a7894cd8"></script>
    <script src="../../_static/copybutton.js?v=a56c686a"></script>
    <script>let toggleHintShow = 'Click to show';</script>
    <script>let toggleHintHide = 'Click to hide';</script>
    <script>let toggleOpenOnPrint = 'true';</script>
    <script src="../../_static/togglebutton.js?v=4a39c7ea"></script>
    <script src="../../_static/design-tabs.js?v=f930bc37"></script>
    <script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
    <script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
    <script>window.MathJax = {"options": {"processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script>
    <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
    <script>DOCUMENTATION_OPTIONS.pagename = 'documentation/manual/pep';</script>
    <link rel="icon" href="../../_static/favicon-slepc.ico"/>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="NEP: Nonlinear Eigenvalue Problems" href="nep.html" />
    <link rel="prev" title="SVD: Singular Value Decomposition" href="svd.html" />
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <meta name="docsearch:language" content="en"/>
  <meta name="docsearch:version" content="3.24" />
  </head>
  
  
  <body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">

  
  
  <div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">Skip to main content</a></div>
  
  <div id="pst-scroll-pixel-helper"></div>
  
  <button type="button" class="btn rounded-pill" id="pst-back-to-top">
    <i class="fa-solid fa-arrow-up"></i>Back to top</button>

  
  <dialog id="pst-search-dialog">
    
<form class="bd-search d-flex align-items-center"
      action="../../search.html"
      method="get">
  <i class="fa-solid fa-magnifying-glass"></i>
  <input type="search"
         class="form-control"
         name="q"
         placeholder="Search the docs ..."
         aria-label="Search the docs ..."
         autocomplete="off"
         autocorrect="off"
         autocapitalize="off"
         spellcheck="false"/>
  <span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form>
  </dialog>

  <div class="pst-async-banner-revealer d-none">
  <aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="Version warning"></aside>
</div>

  
    <header class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
<div class="bd-header__inner bd-page-width">
  <button class="pst-navbar-icon sidebar-toggle primary-toggle" aria-label="Site navigation">
    <span class="fa-solid fa-bars"></span>
  </button>
  
  
  <div class="col-lg-3 navbar-header-items__start">
    
      <div class="navbar-item">

  
    
  

<a class="navbar-brand logo" href="../../index.html">
  
  
  
  
  
    
    
      
    
    
    <img src="../../_static/logo-slepc.gif" class="logo__image only-light" alt="SLEPc Home"/>
    <img src="../../_static/logo-slepc.gif" class="logo__image only-dark pst-js-only" alt="SLEPc Home"/>
  
  
</a></div>
    
  </div>
  
  <div class="col-lg-9 navbar-header-items">
    
    <div class="me-auto navbar-header-items__center">
      
        <div class="navbar-item">
<nav>
  <ul class="bd-navbar-elements navbar-nav">
    
<li class="nav-item ">
  <a class="nav-link nav-internal" href="../../about/index.html">
    About
  </a>
</li>


<li class="nav-item ">
  <a class="nav-link nav-internal" href="../../installation/index.html">
    Installation
  </a>
</li>


<li class="nav-item current active">
  <a class="nav-link nav-internal" href="../index.html">
    Documentation
  </a>
</li>


<li class="nav-item ">
  <a class="nav-link nav-internal" href="../../manualpages/index.html">
    C/Fortran API
  </a>
</li>


<li class="nav-item ">
  <a class="nav-link nav-internal" href="../../slepc4py/index.html">
    slepc4py API
  </a>
</li>


<li class="nav-item ">
  <a class="nav-link nav-internal" href="../../material/index.html">
    Material
  </a>
</li>


<li class="nav-item ">
  <a class="nav-link nav-internal" href="../../contact/index.html">
    Contact
  </a>
</li>

  </ul>
</nav></div>
      
    </div>
    
    
    <div class="navbar-header-items__end">
      
        <div class="navbar-item navbar-persistent--container">
          

<button class="btn search-button-field search-button__button pst-js-only" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
 <i class="fa-solid fa-magnifying-glass"></i>
 <span class="search-button__default-text">Search</span>
 <span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
        </div>
      
      
        <div class="navbar-item">

<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only" aria-label="Color mode" data-bs-title="Color mode"  data-bs-placement="bottom" data-bs-toggle="tooltip">
  <i class="theme-switch fa-solid fa-sun                fa-lg" data-mode="light" title="Light"></i>
  <i class="theme-switch fa-solid fa-moon               fa-lg" data-mode="dark"  title="Dark"></i>
  <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"  title="System Settings"></i>
</button></div>
      
        <div class="navbar-item"><ul class="navbar-icon-links"
    aria-label="Icon Links">
        <li class="nav-item">
          
          
          
          
          
          
          
          
          <a href="https://gitlab.com/slepc/slepc" title="GitLab" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-gitlab fa-lg" aria-hidden="true"></i>
            <span class="sr-only">GitLab</span></a>
        </li>
        <li class="nav-item">
          
          
          
          
          
          
          
          
          <a href="https://www.upv.es" title="UPV" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><img src="https://www.upv.es/favicon.ico" class="icon-link-image" alt="UPV"/></a>
        </li>
        <li class="nav-item">
          
          
          
          
          
          
          
          
          <a href="https://slepc.upv.es/release/_static/rss/slepc-news.xml" title="Feed" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-solid fa-square-rss fa-lg" aria-hidden="true"></i>
            <span class="sr-only">Feed</span></a>
        </li>
</ul></div>
      
    </div>
    
  </div>
  
  
    <div class="navbar-persistent--mobile">

<button class="btn search-button-field search-button__button pst-js-only" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
 <i class="fa-solid fa-magnifying-glass"></i>
 <span class="search-button__default-text">Search</span>
 <span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
    </div>
  

  
    <button class="pst-navbar-icon sidebar-toggle secondary-toggle" aria-label="On this page">
      <span class="fa-solid fa-outdent"></span>
    </button>
  
</div>

    </header>
  

  <div class="bd-container">
    <div class="bd-container__inner bd-page-width">
      
      
      
      <dialog id="pst-primary-sidebar-modal"></dialog>
      <div id="pst-primary-sidebar" class="bd-sidebar-primary bd-sidebar">
        

  
  <div class="sidebar-header-items sidebar-primary__section">
    
    
      <div class="sidebar-header-items__center">
        
          
          
            <div class="navbar-item">
<nav>
  <ul class="bd-navbar-elements navbar-nav">
    
<li class="nav-item ">
  <a class="nav-link nav-internal" href="../../about/index.html">
    About
  </a>
</li>


<li class="nav-item ">
  <a class="nav-link nav-internal" href="../../installation/index.html">
    Installation
  </a>
</li>


<li class="nav-item current active">
  <a class="nav-link nav-internal" href="../index.html">
    Documentation
  </a>
</li>


<li class="nav-item ">
  <a class="nav-link nav-internal" href="../../manualpages/index.html">
    C/Fortran API
  </a>
</li>


<li class="nav-item ">
  <a class="nav-link nav-internal" href="../../slepc4py/index.html">
    slepc4py API
  </a>
</li>


<li class="nav-item ">
  <a class="nav-link nav-internal" href="../../material/index.html">
    Material
  </a>
</li>


<li class="nav-item ">
  <a class="nav-link nav-internal" href="../../contact/index.html">
    Contact
  </a>
</li>

  </ul>
</nav></div>
          
        
      </div>
    
    
    
      <div class="sidebar-header-items__end">
        
          <div class="navbar-item">

<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only" aria-label="Color mode" data-bs-title="Color mode"  data-bs-placement="bottom" data-bs-toggle="tooltip">
  <i class="theme-switch fa-solid fa-sun                fa-lg" data-mode="light" title="Light"></i>
  <i class="theme-switch fa-solid fa-moon               fa-lg" data-mode="dark"  title="Dark"></i>
  <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"  title="System Settings"></i>
</button></div>
        
          <div class="navbar-item"><ul class="navbar-icon-links"
    aria-label="Icon Links">
        <li class="nav-item">
          
          
          
          
          
          
          
          
          <a href="https://gitlab.com/slepc/slepc" title="GitLab" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-gitlab fa-lg" aria-hidden="true"></i>
            <span class="sr-only">GitLab</span></a>
        </li>
        <li class="nav-item">
          
          
          
          
          
          
          
          
          <a href="https://www.upv.es" title="UPV" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><img src="https://www.upv.es/favicon.ico" class="icon-link-image" alt="UPV"/></a>
        </li>
        <li class="nav-item">
          
          
          
          
          
          
          
          
          <a href="https://slepc.upv.es/release/_static/rss/slepc-news.xml" title="Feed" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-solid fa-square-rss fa-lg" aria-hidden="true"></i>
            <span class="sr-only">Feed</span></a>
        </li>
</ul></div>
        
      </div>
    
  </div>
  
    <div class="sidebar-primary-items__start sidebar-primary__section">
        <div class="sidebar-primary-item">
<nav class="bd-docs-nav bd-links"
     aria-label="Section Navigation">
  <p class="bd-links__title" role="heading" aria-level="1">Section Navigation</p>
  <div class="bd-toc-item navbar-nav"><ul class="current nav bd-sidenav">
<li class="toctree-l1 current active has-children"><a class="reference internal" href="index.html">SLEPc Users Manual</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="intro.html">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="eps.html">EPS: Eigenvalue Problem Solver</a></li>
<li class="toctree-l2"><a class="reference internal" href="st.html">ST: Spectral Transformation</a></li>
<li class="toctree-l2"><a class="reference internal" href="svd.html">SVD: Singular Value Decomposition</a></li>
<li class="toctree-l2 current active"><a class="current reference internal" href="#">PEP: Polynomial Eigenvalue Problems</a></li>
<li class="toctree-l2"><a class="reference internal" href="nep.html">NEP: Nonlinear Eigenvalue Problems</a></li>
<li class="toctree-l2"><a class="reference internal" href="mfn.html">MFN: Matrix Function</a></li>
<li class="toctree-l2"><a class="reference internal" href="lme.html">LME: Linear Matrix Equation</a></li>
<li class="toctree-l2"><a class="reference internal" href="aux.html">Auxiliary Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="extra.html">Additional Information</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../hands-on/index.html">Hands-on exercises</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="../hands-on/hands-on0.html">Exercise 0: Hello World</a></li>
<li class="toctree-l2"><a class="reference internal" href="../hands-on/hands-on1.html">Exercise 1: Standard Symmetric Eigenvalue Problem</a></li>
<li class="toctree-l2"><a class="reference internal" href="../hands-on/hands-on2.html">Exercise 2: Standard Non-Symmetric Eigenvalue Problem</a></li>
<li class="toctree-l2"><a class="reference internal" href="../hands-on/hands-on3.html">Exercise 3: Generalized Eigenvalue Problem Stored in a File</a></li>
<li class="toctree-l2"><a class="reference internal" href="../hands-on/hands-on4.html">Exercise 4: Singular Value Decomposition</a></li>
<li class="toctree-l2"><a class="reference internal" href="../hands-on/hands-on5.html">Exercise 5: Problem without Explicit Matrix Storage</a></li>
<li class="toctree-l2"><a class="reference internal" href="../hands-on/hands-on6.html">Exercise 6: Parallel Execution</a></li>
<li class="toctree-l2"><a class="reference internal" href="../hands-on/hands-on7.html">Exercise 7: Use of Deflation Subspaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../hands-on/hands-on8.html">Exercise 8: Quadratic Eigenvalue Problem</a></li>
</ul>
</details></li>
<li class="toctree-l1"><a class="reference internal" href="../faq.html">Frequently Asked Questions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../presentations.html">Presentations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../license.html">License</a></li>
</ul>
</div>
</nav></div>
    </div>
  
  
  <div class="sidebar-primary-items__end sidebar-primary__section">
      <div class="sidebar-primary-item">
<div id="ethical-ad-placement"
      class="flat"
      data-ea-publisher="readthedocs"
      data-ea-type="readthedocs-sidebar"
      data-ea-manual="true">
</div></div>
  </div>


      </div>
      
      <main id="main-content" class="bd-main" role="main">
        
        
          <div class="bd-content">
            <div class="bd-article-container">
              
              <div class="bd-header-article d-print-none">
<div class="header-article-items header-article__inner">
  
    <div class="header-article-items__start">
      
        <div class="header-article-item">

<nav aria-label="Breadcrumb" class="d-print-none">
  <ul class="bd-breadcrumbs">
    
    <li class="breadcrumb-item breadcrumb-home">
      <a href="../../index.html" class="nav-link" aria-label="Home">
        <i class="fa-solid fa-home"></i>
      </a>
    </li>
    
    <li class="breadcrumb-item"><a href="../index.html" class="nav-link">Documentation</a></li>
    
    
    <li class="breadcrumb-item"><a href="index.html" class="nav-link">SLEPc Users Manual</a></li>
    
    <li class="breadcrumb-item active" aria-current="page"><span class="ellipsis">PEP: Polynomial Eigenvalue Problems</span></li>
  </ul>
</nav>
</div>
      
    </div>
  
  
</div>
</div>
              
              
              
                
<div id="searchbox"></div>
                <article class="bd-article">
                  
  <section class="tex2jax_ignore mathjax_ignore" id="pep-polynomial-eigenvalue-problems">
<span id="ch-pep"></span><h1>PEP: Polynomial Eigenvalue Problems<a class="headerlink" href="#pep-polynomial-eigenvalue-problems" title="Link to this heading">#</a></h1>
<p>The Polynomial Eigenvalue Problem (<code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code>) solver object is intended for addressing polynomial eigenproblems of arbitrary degree, <span class="math notranslate nohighlight">\(P(\lambda)x=0\)</span>. A particular instance is the quadratic eigenvalue problem (degree 2), which is the case more often encountered in practice. For this reason, part of the description of this chapter focuses specifically on quadratic eigenproblems.</p>
<p>Currently, most <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code> solvers are based on linearization, either implicit or explicit. The case of explicit linearization allows the use of eigensolvers from <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/EPS/EPS.html">EPS</a></span></code> to solve the linearized problem.</p>
<section id="sec-pep">
<h2>Overview of Polynomial Eigenproblems<a class="headerlink" href="#sec-pep" title="Link to this heading">#</a></h2>
<p>In this section, we review some basic properties of the polynomial eigenvalue problem. The main goal is to set up the notation as well as to describe the linearization approaches that will be employed for solving via an <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/EPS/EPS.html">EPS</a></span></code> object. To simplify, we initially restrict the description to the case of quadratic eigenproblems, and then extend it to the general case of arbitrary degree. For additional background material, the reader is referred to <span id="id1">[<a class="reference internal" href="#id39" title="F. Tisseur and K. Meerbergen. The quadratic eigenvalue problem. SIAM Rev., 43(2):235–286, 2001. doi:10.1137/S0036144500381988.">Tisseur and Meerbergen, 2001</a>]</span>. More information can be found in a paper by <span id="id2">Campos and Roman [<a class="reference internal" href="../../manualpages/PEP/PEPTOAR.html#id37" title="C. Campos and J. E. Roman. Parallel Krylov solvers for the polynomial eigenvalue problem in SLEPc. SIAM J. Sci. Comput., 38(5):S385–S411, 2016. doi:10.1137/15M1022458.">2016</a>]</span>, that focuses specifically on SLEPc implementation of methods based on Krylov iterations on the linearized problem.</p>
<section id="sec-qep">
<h3>Quadratic Eigenvalue Problems<a class="headerlink" href="#sec-qep" title="Link to this heading">#</a></h3>
<p>In many applications, e.g., problems arising from second-order differential equations such as the analysis of damped vibrating systems, the eigenproblem to be solved is quadratic,</p>
<div class="math notranslate nohighlight" id="equation-eq-eigquad">
<span class="eqno">(1)<a class="headerlink" href="#equation-eq-eigquad" title="Link to this equation">#</a></span>\[(K+\lambda C+\lambda^2M)x=0,\]</div>
<p>where <span class="math notranslate nohighlight">\(K,C,M\in\mathbb{C}^{n\times n}\)</span> are the coefficients of a polynomial matrix of degree 2, <span class="math notranslate nohighlight">\(\lambda\in\mathbb{C}\)</span> is the eigenvalue and <span class="math notranslate nohighlight">\(x\in\mathbb{C}^n\)</span> is the eigenvector. As in the case of linear eigenproblems, the eigenvalues and eigenvectors can be complex even in the case that all three matrices are real.</p>
<p>It is important to point out some outstanding differences with respect to the linear eigenproblem. In the quadratic eigenproblem, the number of eigenvalues is <span class="math notranslate nohighlight">\(2n\)</span>, and the corresponding eigenvectors do not form a linearly independent set. If <span class="math notranslate nohighlight">\(M\)</span> is singular, some eigenvalues are infinite. Even when the three matrices are symmetric and positive definite, there is no guarantee that the eigenvalues are real, but still methods can exploit symmetry to some extent. Furthermore, numerical difficulties are more likely than in the linear case, so the computed solution can sometimes be untrustworthy.</p>
<p>If equation <a class="reference internal" href="#equation-eq-eigquad">(1)</a> is written as <span class="math notranslate nohighlight">\(P(\lambda)x=0\)</span>, where <span class="math notranslate nohighlight">\(P\)</span> is the polynomial matrix, then multiplication by <span class="math notranslate nohighlight">\(\lambda^{-2}\)</span> results in <span class="math notranslate nohighlight">\(\operatorname{rev} P(\lambda^{-1})x=0\)</span>, where <span class="math notranslate nohighlight">\(\operatorname{rev} P\)</span> denotes the polynomial matrix with the coefficients of <span class="math notranslate nohighlight">\(P\)</span> in the reverse order. In other words, if a method is available for computing the largest eigenvalues, then reversing the roles of <span class="math notranslate nohighlight">\(M\)</span> and <span class="math notranslate nohighlight">\(K\)</span> results in the computation of the smallest eigenvalues. In general, it is also possible to formulate a spectral transformation for computing eigenvalues closest to a given target, as discussed in section <a class="reference internal" href="#sec-qst"><span class="std std-ref">Spectral Transformation for PEP</span></a>.</p>
<section id="problem-types">
<h4>Problem Types<a class="headerlink" href="#problem-types" title="Link to this heading">#</a></h4>
<p>As in the case of linear eigenproblems, there are some particular properties of the coefficient matrices that confer a certain structure to the quadratic eigenproblem, e.g., symmetry of the spectrum with respect to the real or imaginary axes. These structures are important as long as the solvers are able to exploit them.</p>
<ul class="simple">
<li><p>Hermitian (symmetric) problems, when <span class="math notranslate nohighlight">\(M\)</span>, <span class="math notranslate nohighlight">\(C\)</span>, <span class="math notranslate nohighlight">\(K\)</span> are all Hermitian (symmetric). Eigenvalues are real or come in complex conjugate pairs. Furthermore, if <span class="math notranslate nohighlight">\(M&gt;0\)</span> and <span class="math notranslate nohighlight">\(C,K\geq 0\)</span> then the system is stable, i.e., <span class="math notranslate nohighlight">\(\text{Re}(\lambda)\leq 0\)</span>.</p></li>
<li><p>Hyperbolic problems, a particular class of Hermitian problems where <span class="math notranslate nohighlight">\(M&gt;0\)</span> and <span class="math notranslate nohighlight">\((x^*Cx)^2&gt;4(x^*Mx)(x^*Kx)\)</span> for all nonzero <span class="math notranslate nohighlight">\(x\in\mathbb{C}^n\)</span>. All eigenvalues are real, and form two separate groups of <span class="math notranslate nohighlight">\(n\)</span> eigenvalues, each of them having linearly independent eigenvectors. A particular subset of hyperbolic problems is the class of overdamped problems, where <span class="math notranslate nohighlight">\(C&gt;0\)</span> and <span class="math notranslate nohighlight">\(K\geq 0\)</span>, in which case all eigenvalues are non-positive.</p></li>
<li><p>Gyroscopic problems, when <span class="math notranslate nohighlight">\(M\)</span>, <span class="math notranslate nohighlight">\(K\)</span> are Hermitian, <span class="math notranslate nohighlight">\(M&gt;0\)</span>, and <span class="math notranslate nohighlight">\(C\)</span> is skew-Hermitian, <span class="math notranslate nohighlight">\(C=-C^*\)</span>. The spectrum is symmetric with respect to the imaginary axis, and in the real case, it has a Hamiltonian structure, i.e., eigenvalues come in quadruples <span class="math notranslate nohighlight">\((\lambda,\bar{\lambda},-\lambda,-\bar{\lambda})\)</span>.</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Currently, the problem type is not exploited by <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code> solvers, except for a few exceptions. In the future, we may add more support for structure-preserving solvers.</p>
</div>
</section>
<section id="sec-linearization">
<h4>Linearization<a class="headerlink" href="#sec-linearization" title="Link to this heading">#</a></h4>
<p>It is possible to transform the quadratic eigenvalue problem to a linear generalized eigenproblem <span class="math notranslate nohighlight">\(L_0y=\lambda L_1y\)</span> by doubling the order of the system, i.e., <span class="math notranslate nohighlight">\(L_0,L_1\in\mathbb{C}^{2n\times 2n}\)</span>. There are many ways of doing this. For instance, consider the following two pencils <span class="math notranslate nohighlight">\(L(\lambda)=L_0-\lambda L_1\)</span>,</p>
<div class="math notranslate nohighlight" id="equation-eq-n1">
<span class="eqno">(2)<a class="headerlink" href="#equation-eq-n1" title="Link to this equation">#</a></span>\[\begin{split}\begin{bmatrix}0 &amp; I\\-K &amp; -C\end{bmatrix}-\lambda\begin{bmatrix}I &amp; 0\\0 &amp; M\end{bmatrix},\end{split}\]</div>
<div class="math notranslate nohighlight" id="equation-eq-n2">
<span class="eqno">(3)<a class="headerlink" href="#equation-eq-n2" title="Link to this equation">#</a></span>\[\begin{split}\begin{bmatrix}-K &amp; 0\\0 &amp; I\end{bmatrix}-\lambda\begin{bmatrix}C &amp; M\\I &amp; 0\end{bmatrix}.\end{split}\]</div>
<p>Both of them have the same eigenvalues as the quadratic eigenproblem, and the corresponding eigenvectors can be expressed as</p>
<div class="math notranslate nohighlight" id="equation-eq-linevec">
<span class="eqno">(4)<a class="headerlink" href="#equation-eq-linevec" title="Link to this equation">#</a></span>\[\begin{split}y=\begin{bmatrix}x\\x\lambda\end{bmatrix},\end{split}\]</div>
<p>where <span class="math notranslate nohighlight">\(x\)</span> is the eigenvector of the quadratic eigenproblem.</p>
<p>Other <strong>non-symmetric</strong> linearizations can be obtained by a linear combination of equations <a class="reference internal" href="#equation-eq-n1">(2)</a> and <a class="reference internal" href="#equation-eq-n2">(3)</a>,</p>
<div class="math notranslate nohighlight" id="equation-eq-lingen">
<span class="eqno">(5)<a class="headerlink" href="#equation-eq-lingen" title="Link to this equation">#</a></span>\[\begin{split}\begin{bmatrix}-\beta K &amp; \alpha I\\-\alpha K &amp; -\alpha C+\beta I\end{bmatrix}-\lambda\begin{bmatrix}\alpha I+\beta C &amp; \beta M\\\beta I &amp; \alpha M\end{bmatrix}.\end{split}\]</div>
<p>for any <span class="math notranslate nohighlight">\(\alpha,\beta\in\mathbb{R}\)</span>. The linearizations <a class="reference internal" href="#equation-eq-n1">(2)</a> and <a class="reference internal" href="#equation-eq-n2">(3)</a> are particular cases of equation <a class="reference internal" href="#equation-eq-lingen">(5)</a> taking <span class="math notranslate nohighlight">\((\alpha,\beta)=(1,0)\)</span> and <span class="math notranslate nohighlight">\((0,1)\)</span>, respectively.</p>
<p><strong>Symmetric</strong> linearizations are useful for the case that <span class="math notranslate nohighlight">\(M\)</span>, <span class="math notranslate nohighlight">\(C\)</span>, and <span class="math notranslate nohighlight">\(K\)</span> are all symmetric (Hermitian), because the resulting matrix pencil is symmetric (Hermitian), although indefinite:</p>
<div class="math notranslate nohighlight" id="equation-eq-linsym">
<span class="eqno">(6)<a class="headerlink" href="#equation-eq-linsym" title="Link to this equation">#</a></span>\[\begin{split}\begin{bmatrix}\beta K&amp;\alpha K\\\alpha K&amp;\alpha C-\beta M\end{bmatrix}-\lambda\begin{bmatrix}\alpha K-\beta C&amp;-\beta M\\-\beta M&amp;-\alpha M\end{bmatrix},\end{split}\]</div>
<p>And for gyroscopic problems, we can consider <strong>Hamiltonian</strong> linearizations,</p>
<div class="math notranslate nohighlight" id="equation-eq-linham">
<span class="eqno">(7)<a class="headerlink" href="#equation-eq-linham" title="Link to this equation">#</a></span>\[\begin{split}\begin{bmatrix}\alpha K &amp; -\beta K\\\alpha C+\beta M &amp; \alpha K\end{bmatrix}-\lambda\begin{bmatrix}\beta M &amp; \alpha K+\beta C\\-\alpha M &amp; \beta M\end{bmatrix},\end{split}\]</div>
<p>where one of the matrices is Hamiltonian and the other one is skew-Hamiltonian if <span class="math notranslate nohighlight">\((\alpha,\beta)\)</span> is <span class="math notranslate nohighlight">\((1,0)\)</span> or <span class="math notranslate nohighlight">\((0,1)\)</span>.</p>
<p>In SLEPc, the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPLINEAR.html">PEPLINEAR</a></span></code> solver is based on using one of the above linearizations for solving the quadratic eigenproblem. This solver makes use of linear eigensolvers from the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/EPS/EPS.html">EPS</a></span></code> package.</p>
<p>We could also consider the <em>reversed</em> forms, e.g., the reversed form of equation <a class="reference internal" href="#equation-eq-n2">(3)</a> is</p>
<div class="math notranslate nohighlight" id="equation-eq-n2r">
<span class="eqno">(8)<a class="headerlink" href="#equation-eq-n2r" title="Link to this equation">#</a></span>\[\begin{split}\begin{bmatrix}-C &amp; -M\\I &amp; 0\end{bmatrix}-\frac{1}{\lambda}\begin{bmatrix}K &amp; 0\\0 &amp; I\end{bmatrix},\end{split}\]</div>
<p>which is equivalent to the form <a class="reference internal" href="#equation-eq-n1">(2)</a> for the problem <span class="math notranslate nohighlight">\(\operatorname{rev} P(\lambda^{-1})x=0\)</span>. These reversed forms are not implemented in SLEPc, but the user can use them simply by reversing the roles of <span class="math notranslate nohighlight">\(M\)</span> and <span class="math notranslate nohighlight">\(K\)</span>, and considering the reciprocals of the computed eigenvalues. Alternatively, this can be viewed as a particular case of the spectral transformation (with <span class="math notranslate nohighlight">\(\sigma=0\)</span>), see section <a class="reference internal" href="#sec-qst"><span class="std std-ref">Spectral Transformation for PEP</span></a>.</p>
</section>
</section>
<section id="sec-pep1">
<h3>Polynomials of Arbitrary Degree<a class="headerlink" href="#sec-pep1" title="Link to this heading">#</a></h3>
<p>In general, the polynomial eigenvalue problem can be formulated as</p>
<div class="math notranslate nohighlight" id="equation-eq-pep">
<span class="eqno">(9)<a class="headerlink" href="#equation-eq-pep" title="Link to this equation">#</a></span>\[P(\lambda)x=0,\]</div>
<p>where <span class="math notranslate nohighlight">\(P\)</span> is an <span class="math notranslate nohighlight">\(n\times n\)</span> polynomial matrix of degree <span class="math notranslate nohighlight">\(d\)</span>. An <span class="math notranslate nohighlight">\(n\)</span>-vector <span class="math notranslate nohighlight">\(x\neq 0\)</span> satisfying this equation is called an eigenvector associated with the corresponding eigenvalue <span class="math notranslate nohighlight">\(\lambda\)</span>.</p>
<p>We start by considering the case where <span class="math notranslate nohighlight">\(P\)</span> is expressed in terms of the monomial basis,</p>
<div class="math notranslate nohighlight" id="equation-eq-pepmon">
<span class="eqno">(10)<a class="headerlink" href="#equation-eq-pepmon" title="Link to this equation">#</a></span>\[P(\lambda)=A_0+A_1 \lambda+A_2\lambda^2 +  \dotsb + A_d \lambda^d,\]</div>
<p>where <span class="math notranslate nohighlight">\(A_0,\ldots,A_d\)</span> are the <span class="math notranslate nohighlight">\(n\times n\)</span> coefficient matrices. As before, the problem can be solved via some kind of linearization. One of the most commonly used ones is the first companion form</p>
<div class="math notranslate nohighlight" id="equation-eq-firstcomp">
<span class="eqno">(11)<a class="headerlink" href="#equation-eq-firstcomp" title="Link to this equation">#</a></span>\[L(\lambda)=L_0 -\lambda L_1,\]</div>
<p>where the related linear eigenproblem is <span class="math notranslate nohighlight">\(L(\lambda)y=0\)</span>, with</p>
<div class="math notranslate nohighlight" id="equation-eq-firstcompfull">
<span class="eqno">(12)<a class="headerlink" href="#equation-eq-firstcompfull" title="Link to this equation">#</a></span>\[\begin{split}L_0 =
\begin{bmatrix}
  &amp; I \\
  &amp; &amp; \ddots \\
  &amp; &amp; &amp; I \\
  -A_0 &amp; -A_1 &amp; \cdots  &amp; -A_{d-1}
\end{bmatrix},\quad
L_1 =
\begin{bmatrix}
  I \\
  &amp; \ddots \\
  &amp; &amp; I \\
  &amp; &amp; &amp; A_d
\end{bmatrix}, \quad
y=
\begin{bmatrix}
  x \\ x\lambda\\ \vdots \\ x\lambda^{d-1}
\end{bmatrix}.\end{split}\]</div>
<p>This is the generalization of equation <a class="reference internal" href="#equation-eq-n1">(2)</a>.</p>
<p>The definition of vector <span class="math notranslate nohighlight">\(y\)</span> above contains the successive powers of <span class="math notranslate nohighlight">\(\lambda\)</span>. For large polynomial degree, these values may produce overflow in finite precision computations, or at least lead to numerical instability of the algorithms due to the wide difference in magnitude of the eigenvector entries. For this reason, it is generally recommended to work with non-monomial polynomial bases whenever the degree is not small, e.g., for <span class="math notranslate nohighlight">\(d&gt;5\)</span>.</p>
<p>In the most general formulation of the polynomial eigenvalue problem, <span class="math notranslate nohighlight">\(P\)</span> is expressed as</p>
<div class="math notranslate nohighlight" id="equation-eq-pepnonmon">
<span class="eqno">(13)<a class="headerlink" href="#equation-eq-pepnonmon" title="Link to this equation">#</a></span>\[P(\lambda)=A_0\phi_0(\lambda)+A_1\phi_1(\lambda)+\dots+A_d\phi_d(\lambda),\]</div>
<p>where <span class="math notranslate nohighlight">\(\phi_i\)</span> are the members of a given polynomial basis, for instance, some kind of orthogonal polynomials such as Chebyshev polynomials of the first kind. In that case, the expression of <span class="math notranslate nohighlight">\(y\)</span> in equation <a class="reference internal" href="#equation-eq-firstcompfull">(12)</a> contains <span class="math notranslate nohighlight">\(\phi_0(\lambda),\dots,\phi_d(\lambda)\)</span> instead of the powers of <span class="math notranslate nohighlight">\(\lambda\)</span>. Correspondingly, the form of <span class="math notranslate nohighlight">\(L_0\)</span> and <span class="math notranslate nohighlight">\(L_1\)</span> is different for each type of polynomial basis.</p>
<section id="avoiding-the-linearization">
<h4>Avoiding the Linearization<a class="headerlink" href="#avoiding-the-linearization" title="Link to this heading">#</a></h4>
<p>An alternative to linearization is to directly perform a projection of the polynomial eigenproblem. These methods enforce a Galerkin condition on the polynomial residual, <span class="math notranslate nohighlight">\(P(\theta)u\perp \mathcal{K}\)</span>. Here, the subspace <span class="math notranslate nohighlight">\(\mathcal{K}\)</span> can be built in various ways, for instance with the Jacobi-Davidson method. This family of methods need not worry about operating with vectors of dimension <span class="math notranslate nohighlight">\(dn\)</span>. The downside is that computing more than one eigenvalue is more difficult, since usual deflation strategies cannot be applied. For a detailed description of the polynomial Jacobi-Davidson method in SLEPc, see <span id="id3">[<a class="reference internal" href="../../manualpages/PEP/PEPJDSetProjection.html#id43" title="C. Campos and J. E. Roman. A polynomial Jacobi-Davidson solver with support for non-monomial bases and deflation. BIT, 60(2):295–318, 2020. doi:10.1007/s10543-019-00778-z.">Campos and Roman, 2020</a>]</span>.</p>
</section>
</section>
</section>
<section id="basic-usage">
<h2>Basic Usage<a class="headerlink" href="#basic-usage" title="Link to this heading">#</a></h2>
<p>The user interface of the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code> package is very similar to <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/EPS/EPS.html">EPS</a></span></code>. For basic usage, the most noteworthy difference is that all coefficient matrices <span class="math notranslate nohighlight">\(A_i\)</span> have to be supplied in the form of an array of <a class="reference external" href="https://petsc.org/release/manualpages/Mat/Mat/" title="(in PETSc v3.24)"><span class="xref std std-doc">Mat</span></a>.</p>
<p>A basic example code for solving a polynomial eigenproblem with <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code> is shown in listing <a class="reference internal" href="#fig-ex-pep"><span class="std std-ref">Example code for basic solution with PEP</span></a>, where the code for building matrices <code class="docutils notranslate"><span class="pre">A[0]</span></code>, <code class="docutils notranslate"><span class="pre">A[1]</span></code>, … is omitted. The required steps are the same as those described in chapter <a class="reference internal" href="eps.html#ch-eps"><span class="std std-ref">EPS: Eigenvalue Problem Solver</span></a> for the linear eigenproblem. As always, the solver context is created with <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPCreate.html">PEPCreate</a>()</span></code>. The coefficient matrices are provided with <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPSetOperators.html">PEPSetOperators</a>()</span></code>, and the problem type is specified with <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPSetProblemType.html">PEPSetProblemType</a>()</span></code>. Calling <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPSetFromOptions.html">PEPSetFromOptions</a>()</span></code> allows the user to set up various options through the command line. The call to <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPSolve.html">PEPSolve</a>()</span></code> invokes the actual solver. Then, the solution is retrieved with <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPGetConverged.html">PEPGetConverged</a>()</span></code> and <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPGetEigenpair.html">PEPGetEigenpair</a>()</span></code>. Finally, <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPDestroy.html">PEPDestroy</a>()</span></code> destroys the object.</p>
<div class="literal-block-wrapper docutils container" id="fig-ex-pep">
<div class="code-block-caption"><span class="caption-text">Example code for basic solution with <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code></span><a class="headerlink" href="#fig-ex-pep" title="Link to this code">#</a></div>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#define NMAT 5</span>
<span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w">         </span><span class="n">pep</span><span class="p">;</span><span class="w">       </span><span class="cm">/*  eigensolver context  */</span>
<span class="n"><a href="https://petsc.org/release/manualpages/Mat/Mat/">Mat</a></span><span class="w">         </span><span class="n">A</span><span class="p">[</span><span class="n">NMAT</span><span class="p">];</span><span class="w">   </span><span class="cm">/*  coefficient matrices */</span>
<span class="n"><a href="https://petsc.org/release/manualpages/Vec/Vec/">Vec</a></span><span class="w">         </span><span class="n">xr</span><span class="p">,</span><span class="w"> </span><span class="n">xi</span><span class="p">;</span><span class="w">    </span><span class="cm">/*  eigenvector, x       */</span>
<span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscScalar/">PetscScalar</a></span><span class="w"> </span><span class="n">kr</span><span class="p">,</span><span class="w"> </span><span class="n">ki</span><span class="p">;</span><span class="w">    </span><span class="cm">/*  eigenvalue, k        */</span>
<span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscInt/">PetscInt</a></span><span class="w">    </span><span class="n">j</span><span class="p">,</span><span class="w"> </span><span class="n">nconv</span><span class="p">;</span>
<span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscReal/">PetscReal</a></span><span class="w">   </span><span class="n">error</span><span class="p">;</span>

<span class="n"><a href="../../manualpages/PEP/PEPCreate.html">PEPCreate</a></span><span class="p">(</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PETSC_COMM_WORLD/">PETSC_COMM_WORLD</a></span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">pep</span><span class="p">);</span>
<span class="n"><a href="../../manualpages/PEP/PEPSetOperators.html">PEPSetOperators</a></span><span class="p">(</span><span class="n">pep</span><span class="p">,</span><span class="w"> </span><span class="n">NMAT</span><span class="p">,</span><span class="w"> </span><span class="n">A</span><span class="p">);</span>
<span class="n"><a href="../../manualpages/PEP/PEPSetProblemType.html">PEPSetProblemType</a></span><span class="p">(</span><span class="n">pep</span><span class="p">,</span><span class="w"> </span><span class="n"><a href="../../manualpages/PEP/PEP_GENERAL.html">PEP_GENERAL</a></span><span class="p">);</span><span class="w">  </span><span class="cm">/* optional */</span>
<span class="n"><a href="../../manualpages/PEP/PEPSetFromOptions.html">PEPSetFromOptions</a></span><span class="p">(</span><span class="n">pep</span><span class="p">);</span>
<span class="n"><a href="../../manualpages/PEP/PEPSolve.html">PEPSolve</a></span><span class="p">(</span><span class="n">pep</span><span class="p">);</span>
<span class="n"><a href="../../manualpages/PEP/PEPGetConverged.html">PEPGetConverged</a></span><span class="p">(</span><span class="n">pep</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">nconv</span><span class="p">);</span>
<span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="n">j</span><span class="o">&lt;</span><span class="n">nconv</span><span class="p">;</span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">  </span><span class="n"><a href="../../manualpages/PEP/PEPGetEigenpair.html">PEPGetEigenpair</a></span><span class="p">(</span><span class="n">pep</span><span class="p">,</span><span class="w"> </span><span class="n">j</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">kr</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">ki</span><span class="p">,</span><span class="w"> </span><span class="n">xr</span><span class="p">,</span><span class="w"> </span><span class="n">xi</span><span class="p">);</span>
<span class="w">  </span><span class="n"><a href="../../manualpages/PEP/PEPComputeError.html">PEPComputeError</a></span><span class="p">(</span><span class="n">pep</span><span class="p">,</span><span class="w"> </span><span class="n">j</span><span class="p">,</span><span class="w"> </span><span class="n"><a href="../../manualpages/PEP/PEPErrorType.html">PEP_ERROR_BACKWARD</a></span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">error</span><span class="p">);</span>
<span class="p">}</span>
<span class="n"><a href="../../manualpages/PEP/PEPDestroy.html">PEPDestroy</a></span><span class="p">(</span><span class="o">&amp;</span><span class="n">pep</span><span class="p">);</span>
</pre></div>
</div>
</div>
</section>
<section id="defining-the-problem">
<h2>Defining the Problem<a class="headerlink" href="#defining-the-problem" title="Link to this heading">#</a></h2>
<div class="pst-scrollable-table-container"><table class="table" id="tab-pepbasis">
<caption><span class="caption-text">Polynomial bases available to represent the polynomial matrix in <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code></span><a class="headerlink" href="#tab-pepbasis" title="Link to this table">#</a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>Polynomial Basis</p></th>
<th class="head"><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPBasis.html">PEPBasis</a></span></code></p></th>
<th class="head"><p>Options Database</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>Monomial</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPBasis.html">PEP_BASIS_MONOMIAL</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">monomial</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>Chebyshev (1st kind)</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPBasis.html">PEP_BASIS_CHEBYSHEV1</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">chebyshev1</span></code></p></td>
</tr>
<tr class="row-even"><td><p>Chebyshev (2nd kind)</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPBasis.html">PEP_BASIS_CHEBYSHEV2</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">chebyshev2</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>Legendre</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPBasis.html">PEP_BASIS_LEGENDRE</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">legendre</span></code></p></td>
</tr>
<tr class="row-even"><td><p>Laguerre</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPBasis.html">PEP_BASIS_LAGUERRE</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">laguerre</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>Hermite</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPBasis.html">PEP_BASIS_HERMITE</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">hermite</span></code></p></td>
</tr>
</tbody>
</table>
</div>
<p>As explained in section <a class="reference internal" href="#sec-pep1"><span class="std std-ref">Polynomials of Arbitrary Degree</span></a>, the polynomial matrix <span class="math notranslate nohighlight">\(P(\lambda)\)</span> can be expressed in terms of the monomials <span class="math notranslate nohighlight">\(1\)</span>, <span class="math notranslate nohighlight">\(\lambda\)</span>, <span class="math notranslate nohighlight">\(\lambda^2,\ldots\)</span>, or in a non-monomial basis as in equation <a class="reference internal" href="#equation-eq-pepnonmon">(13)</a>. Hence, when defining the problem we must indicate which is the polynomial basis to be used as well as the coefficient matrices <span class="math notranslate nohighlight">\(A_i\)</span> in that basis representation. By default, a monomial basis is used. Other possible bases are listed in table <a class="reference internal" href="#tab-pepbasis"><span class="std std-ref">Polynomial bases available to represent the polynomial matrix in PEP</span></a>, and can be set with:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/PEP/PEPSetBasis.html">PEPSetBasis</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w"> </span><span class="n">pep</span><span class="p">,</span><span class="n"><a href="../../manualpages/PEP/PEPBasis.html">PEPBasis</a></span><span class="w"> </span><span class="n">basis</span><span class="p">);</span>
</pre></div>
</div>
<p>or with the command-line key <code class="docutils notranslate"><span class="pre">-pep_basis</span> <span class="pre">&lt;name&gt;</span></code>. The matrices are passed with:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/PEP/PEPSetOperators.html">PEPSetOperators</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w"> </span><span class="n">pep</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscInt/">PetscInt</a></span><span class="w"> </span><span class="n">nmat</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Mat/Mat/">Mat</a></span><span class="w"> </span><span class="n">A</span><span class="p">[]);</span>
</pre></div>
</div>
<div class="pst-scrollable-table-container"><table class="table" id="tab-ptypeq">
<caption><span class="caption-text">Problem types considered in <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code></span><a class="headerlink" href="#tab-ptypeq" title="Link to this table">#</a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>Problem Type</p></th>
<th class="head"><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPProblemType.html">PEPProblemType</a></span></code></p></th>
<th class="head"><p>Command line key</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>General</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP_GENERAL.html">PEP_GENERAL</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_general</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>Hermitian</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP_HERMITIAN.html">PEP_HERMITIAN</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_hermitian</span></code></p></td>
</tr>
<tr class="row-even"><td><p>Hyperbolic</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP_HYPERBOLIC.html">PEP_HYPERBOLIC</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_hyperbolic</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>Gyroscopic</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP_GYROSCOPIC.html">PEP_GYROSCOPIC</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_gyroscopic</span></code></p></td>
</tr>
</tbody>
</table>
</div>
<p>As mentioned in section <a class="reference internal" href="#sec-qep"><span class="std std-ref">Quadratic Eigenvalue Problems</span></a>, it is possible to distinguish among different problem types. The problem types currently supported for <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code> are listed in table <a class="reference internal" href="#tab-ptypeq"><span class="std std-ref">Problem types considered in PEP</span></a>. The goal when choosing an appropriate problem type is to let the solver exploit the underlying structure, in order to possibly compute the solution more accurately with less floating-point operations. When in doubt, use the default problem type (<code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP_GENERAL.html">PEP_GENERAL</a></span></code>).</p>
<p>The problem type can be specified at run time with the corresponding command line key or, more usually, within the program with the function:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/PEP/PEPSetProblemType.html">PEPSetProblemType</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w"> </span><span class="n">pep</span><span class="p">,</span><span class="n"><a href="../../manualpages/PEP/PEPProblemType.html">PEPProblemType</a></span><span class="w"> </span><span class="n">type</span><span class="p">);</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Currently, the problem type is ignored in most solvers and it is taken into account only in some cases for the quadratic eigenproblem only.</p>
</div>
<p>Apart from the polynomial basis and the problem type, the definition of the problem is completed with the number and location of the eigenvalues to compute. This is done very much like in <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/EPS/EPS.html">EPS</a></span></code>, but with minor differences.</p>
<p>The number of eigenvalues (and eigenvectors) to compute, <code class="docutils notranslate"><span class="pre">nev</span></code>, is specified with the function:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/PEP/PEPSetDimensions.html">PEPSetDimensions</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w"> </span><span class="n">pep</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscInt/">PetscInt</a></span><span class="w"> </span><span class="n">nev</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscInt/">PetscInt</a></span><span class="w"> </span><span class="n">ncv</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscInt/">PetscInt</a></span><span class="w"> </span><span class="n">mpd</span><span class="p">);</span>
</pre></div>
</div>
<p>The default is to compute only one. This function also allows control over the dimension of the subspaces used internally. The second argument, <code class="docutils notranslate"><span class="pre">ncv</span></code>, is the number of column vectors to be used by the solution algorithm, that is, the largest dimension of the working subspace. The third argument, <code class="docutils notranslate"><span class="pre">mpd</span></code>, is the maximum projected dimension. These parameters can also be set from the command line with <code class="docutils notranslate"><span class="pre">-pep_nev</span></code>, <code class="docutils notranslate"><span class="pre">-pep_ncv</span></code> and <code class="docutils notranslate"><span class="pre">-pep_mpd</span></code>.</p>
<p>For the selection of the portion of the spectrum of interest, there are several alternatives listed in table <a class="reference internal" href="#tab-portionq"><span class="std std-ref">Available possibilities for selection of the eigenvalues of interest in PEP</span></a>, to be selected with:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/PEP/PEPSetWhichEigenpairs.html">PEPSetWhichEigenpairs</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w"> </span><span class="n">pep</span><span class="p">,</span><span class="n"><a href="../../manualpages/PEP/PEPWhich.html">PEPWhich</a></span><span class="w"> </span><span class="n">which</span><span class="p">);</span>
</pre></div>
</div>
<p>The default is to compute the largest magnitude eigenvalues. For the sorting criteria relative to a target value, the scalar <span class="math notranslate nohighlight">\(\tau\)</span> must be specified with:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/PEP/PEPSetTarget.html">PEPSetTarget</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w"> </span><span class="n">pep</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscScalar/">PetscScalar</a></span><span class="w"> </span><span class="n">target</span><span class="p">);</span>
</pre></div>
</div>
<p>or in the command-line with <code class="docutils notranslate"><span class="pre">-pep_target</span></code>. As in <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/EPS/EPS.html">EPS</a></span></code>, complex values of <span class="math notranslate nohighlight">\(\tau\)</span> are allowed only in complex scalar SLEPc builds. The criteria relative to a target must be used in combination with a spectral transformation as explained in section <a class="reference internal" href="#sec-qst"><span class="std std-ref">Spectral Transformation for PEP</span></a>.</p>
<p>There is also support for spectrum slicing, that is, computing all eigenvalues in a given interval, see section <a class="reference internal" href="#sec-qslice"><span class="std std-ref">Spectrum Slicing for PEP</span></a>. For this, the user has to specify the computational interval with:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/PEP/PEPSetInterval.html">PEPSetInterval</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w"> </span><span class="n">pep</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscReal/">PetscReal</a></span><span class="w"> </span><span class="n">a</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscReal/">PetscReal</a></span><span class="w"> </span><span class="n">b</span><span class="p">);</span>
</pre></div>
</div>
<p>or equivalently with <code class="docutils notranslate"><span class="pre">-pep_interval</span> <span class="pre">a,b</span></code>.</p>
<p>Finally, we mention that the use of regions for filtering is also available in <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code>, see section <a class="reference internal" href="eps.html#sec-region"><span class="std std-ref">Specifying a Region for Filtering</span></a>.</p>
<div class="pst-scrollable-table-container"><table class="table" id="tab-portionq">
<caption><span class="caption-text">Available possibilities for selection of the eigenvalues of interest in <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code></span><a class="headerlink" href="#tab-portionq" title="Link to this table">#</a></caption>
<thead>
<tr class="row-odd"><th class="head"><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPWhich.html">PEPWhich</a></span></code></p></th>
<th class="head"><p>Command line key</p></th>
<th class="head"><p>Sorting criterion</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPWhich.html">PEP_LARGEST_MAGNITUDE</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_largest_magnitude</span></code></p></td>
<td><p>Largest <span class="math notranslate nohighlight">\(|\lambda|\)</span></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPWhich.html">PEP_SMALLEST_MAGNITUDE</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_smallest_magnitude</span></code></p></td>
<td><p>Smallest <span class="math notranslate nohighlight">\(|\lambda|\)</span></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPWhich.html">PEP_LARGEST_REAL</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_largest_real</span></code></p></td>
<td><p>Largest <span class="math notranslate nohighlight">\(\mathrm{Re}(\lambda)\)</span></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPWhich.html">PEP_SMALLEST_REAL</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_smallest_real</span></code></p></td>
<td><p>Smallest <span class="math notranslate nohighlight">\(\mathrm{Re}(\lambda)\)</span></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPWhich.html">PEP_LARGEST_IMAGINARY</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_largest_imaginary</span></code></p></td>
<td><p>Largest <span class="math notranslate nohighlight">\(\mathrm{Im}(\lambda)\)</span><a class="footnote-reference brackets" href="#eps-real" id="id4" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPWhich.html">PEP_SMALLEST_IMAGINARY</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_smallest_imaginary</span></code></p></td>
<td><p>Smallest <span class="math notranslate nohighlight">\(\mathrm{Im}(\lambda)\)</span><a class="footnote-reference brackets" href="#eps-real" id="id5" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPWhich.html">PEP_TARGET_MAGNITUDE</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_target_magnitude</span></code></p></td>
<td><p>Smallest <span class="math notranslate nohighlight">\(|\lambda-\tau|\)</span></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPWhich.html">PEP_TARGET_REAL</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_target_real</span></code></p></td>
<td><p>Smallest <span class="math notranslate nohighlight">\(|\mathrm{Re}(\lambda-\tau)|\)</span></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPWhich.html">PEP_TARGET_IMAGINARY</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_target_imaginary</span></code></p></td>
<td><p>Smallest <span class="math notranslate nohighlight">\(|\mathrm{Im}(\lambda-\tau)|\)</span></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPWhich.html">PEP_ALL</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_all</span></code></p></td>
<td><p>All <span class="math notranslate nohighlight">\(\lambda\in[a,b]\)</span></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPWhich.html">PEP_WHICH_USER</a></span></code></p></td>
<td><p><code class="docutils notranslate"> </code></p></td>
<td><p><em>user-defined</em></p></td>
</tr>
</tbody>
</table>
</div>
</section>
<section id="selecting-the-solver">
<h2>Selecting the Solver<a class="headerlink" href="#selecting-the-solver" title="Link to this heading">#</a></h2>
<p>The solution method can be specified procedurally with:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/PEP/PEPSetType.html">PEPSetType</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w"> </span><span class="n">pep</span><span class="p">,</span><span class="n"><a href="../../manualpages/PEP/PEPType.html">PEPType</a></span><span class="w"> </span><span class="n">method</span><span class="p">);</span>
</pre></div>
</div>
<p>or via the options database command <code class="docutils notranslate"><span class="pre">-pep_type</span></code> followed by the name of the method. The methods currently available in <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code> are listed in table <a class="reference internal" href="#tab-solversp"><span class="std std-ref">Polynomial eigenvalue solvers available in the PEP module</span></a>. All solvers except <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPJD.html">PEPJD</a></span></code> are based on the linearization explained above, whereas <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPJD.html">PEPJD</a></span></code> performs a projection on the polynomial problem (without linearizing).</p>
<p>The default solver is <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPTOAR.html">PEPTOAR</a></span></code>. The Two-level Orthogonal Arnoldi (TOAR) method is a stable algorithm for building an Arnoldi factorization of the linearization <a class="reference internal" href="#equation-eq-firstcomp">(11)</a> without explicitly creating matrices <span class="math notranslate nohighlight">\(L_0,L_1\)</span>, and represents the Krylov basis in a compact way. Symmetric TOAR (STOAR) is a variant of TOAR that exploits symmetry (requires <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP_HERMITIAN.html">PEP_HERMITIAN</a></span></code> or <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP_HYPERBOLIC.html">PEP_HYPERBOLIC</a></span></code> problem types). Quadratic Arnoldi (Q-Arnoldi) is related to TOAR and follows a similar approach.</p>
<div class="pst-scrollable-table-container"><table class="table" id="tab-solversp">
<caption><span class="caption-text">Polynomial eigenvalue solvers available in the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code> module</span><a class="headerlink" href="#tab-solversp" title="Link to this table">#</a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>Method</p></th>
<th class="head"><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPType.html">PEPType</a></span></code></p></th>
<th class="head"><p>Options Database</p></th>
<th class="head"><p>Polynomial Degree</p></th>
<th class="head"><p>Polynomial Basis</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>TOAR</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPTOAR.html">PEPTOAR</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">toar</span></code></p></td>
<td><p>Arbitrary</p></td>
<td><p>Any</p></td>
</tr>
<tr class="row-odd"><td><p>Symmetric TOAR</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPSTOAR.html">PEPSTOAR</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">stoar</span></code></p></td>
<td><p>Quadratic</p></td>
<td><p>Monomial</p></td>
</tr>
<tr class="row-even"><td><p>Q-Arnoldi</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPQARNOLDI.html">PEPQARNOLDI</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">qarnoldi</span></code></p></td>
<td><p>Quadratic</p></td>
<td><p>Monomial</p></td>
</tr>
<tr class="row-odd"><td><p>Linearization via <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/EPS/EPS.html">EPS</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPLINEAR.html">PEPLINEAR</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">linear</span></code></p></td>
<td><p>Arbitrary</p></td>
<td><p>Any</p></td>
</tr>
<tr class="row-even"><td><p>Jacobi-Davidson</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPJD.html">PEPJD</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">jd</span></code></p></td>
<td><p>Arbitrary</p></td>
<td><p>Monomial</p></td>
</tr>
<tr class="row-odd"><td><p>Contour integral SS</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPCISS.html">PEPCISS</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">ciss</span></code></p></td>
<td><p>Arbitrary</p></td>
<td><p>Monomial</p></td>
</tr>
</tbody>
</table>
</div>
<p>The <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPLINEAR.html">PEPLINEAR</a></span></code> method carries out an explicit linearization of the polynomial eigenproblem, as described in section <a class="reference internal" href="#sec-pep"><span class="std std-ref">Overview of Polynomial Eigenproblems</span></a>, resulting in a generalized eigenvalue problem that is handled by an <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/EPS/EPS.html">EPS</a></span></code> object created internally. If required, this <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/EPS/EPS.html">EPS</a></span></code> object can be extracted with the operation:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/PEP/PEPLinearGetEPS.html">PEPLinearGetEPS</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w"> </span><span class="n">pep</span><span class="p">,</span><span class="n"><a href="../../manualpages/EPS/EPS.html">EPS</a></span><span class="w"> </span><span class="o">*</span><span class="n">eps</span><span class="p">);</span>
</pre></div>
</div>
<p>This allows the application programmer to set any of the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/EPS/EPS.html">EPS</a></span></code> options directly within the code. Also, it is possible to change the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/EPS/EPS.html">EPS</a></span></code> options through the command-line, simply by prefixing the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/EPS/EPS.html">EPS</a></span></code> options with <code class="docutils notranslate"><span class="pre">-pep_linear_</span></code>.</p>
<p>In <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPLINEAR.html">PEPLINEAR</a></span></code>, if the eigenproblem is quadratic, the expression used in the linearization is dictated by the problem type set with <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPProblemType.html">PEPProblemType</a></span></code>, which chooses from non-symmetric <a class="reference internal" href="#equation-eq-lingen">(5)</a>, symmetric <a class="reference internal" href="#equation-eq-linsym">(6)</a>, and Hamiltonian <a class="reference internal" href="#equation-eq-linham">(7)</a> linearizations. The parameters <span class="math notranslate nohighlight">\((\alpha,\beta)\)</span> of these linearizations can be set with:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/PEP/PEPLinearSetLinearization.html">PEPLinearSetLinearization</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w"> </span><span class="n">pep</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscReal/">PetscReal</a></span><span class="w"> </span><span class="n">alpha</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscReal/">PetscReal</a></span><span class="w"> </span><span class="n">beta</span><span class="p">);</span>
</pre></div>
</div>
<p>For polynomial eigenproblems with degree <span class="math notranslate nohighlight">\(d&gt;2\)</span> the linearization is the one described in section <a class="reference internal" href="#sec-pep1"><span class="std std-ref">Polynomials of Arbitrary Degree</span></a>.</p>
<p>Another option of the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPLINEAR.html">PEPLINEAR</a></span></code> solver is whether the matrices of the linearized problem are created explicitly or not. This is set with:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/PEP/PEPLinearSetExplicitMatrix.html">PEPLinearSetExplicitMatrix</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w"> </span><span class="n">pep</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscBool/">PetscBool</a></span><span class="w"> </span><span class="n">explicit</span><span class="p">);</span>
</pre></div>
</div>
<p>The explicit matrix option is available only for quadratic eigenproblems (higher degree polynomials are always handled implicitly). In the case of explicit creation, matrices <span class="math notranslate nohighlight">\(L_0\)</span> and <span class="math notranslate nohighlight">\(L_1\)</span> are created as true <a class="reference external" href="https://petsc.org/release/manualpages/Mat/Mat/" title="(in PETSc v3.24)"><span class="xref std std-doc">Mat</span></a>’s, with explicit storage, whereas the implicit option works with <em>shell</em> <a class="reference external" href="https://petsc.org/release/manualpages/Mat/Mat/" title="(in PETSc v3.24)"><span class="xref std std-doc">Mat</span></a>’s that operate only with the constituent blocks <span class="math notranslate nohighlight">\(M\)</span>, <span class="math notranslate nohighlight">\(C\)</span> and <span class="math notranslate nohighlight">\(K\)</span> (or <span class="math notranslate nohighlight">\(A_i\)</span> in the general case). The explicit case requires more memory but gives more flexibility, e.g., for choosing a preconditioner. Some examples of usage via the command line are shown at the end of next section.</p>
</section>
<section id="sec-qst">
<h2>Spectral Transformation for PEP<a class="headerlink" href="#sec-qst" title="Link to this heading">#</a></h2>
<p>For computing eigenvalues in the interior of the spectrum (closest to a target <span class="math notranslate nohighlight">\(\tau\)</span>), it is necessary to use a spectral transformation. In <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code> solvers this is handled via an <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/ST/ST.html">ST</a></span></code> object as in the case of linear eigensolvers. It is possible to proceed with no spectral transformation (shift) or with shift-and-invert. Every <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code> object has an <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/ST/ST.html">ST</a></span></code> object internally.</p>
<p>The spectral transformation can be applied either to the polynomial problem or its linearization. We illustrate it first for the quadratic case.</p>
<p>Given the quadratic eigenproblem in equation <a class="reference internal" href="#equation-eq-eigquad">(1)</a>, it is possible to define the transformed problem</p>
<div class="math notranslate nohighlight" id="equation-eq-sinvquad">
<span class="eqno">(14)<a class="headerlink" href="#equation-eq-sinvquad" title="Link to this equation">#</a></span>\[(K_\sigma+\theta C_\sigma+\theta^2M_\sigma)x=0,\]</div>
<p>where the coefficient matrices are</p>
<div class="math notranslate nohighlight" id="equation-eq-coef-matrices">
<span class="eqno">(15)<a class="headerlink" href="#equation-eq-coef-matrices" title="Link to this equation">#</a></span>\[\begin{split}K_\sigma&amp;= M,\\
C_\sigma&amp;= C+2\sigma M,\\
M_\sigma&amp;= \sigma^2 M+\sigma C+K,\end{split}\]</div>
<p>and the relation between the eigenvalue of the original eigenproblem, <span class="math notranslate nohighlight">\(\lambda\)</span>, and the transformed one, <span class="math notranslate nohighlight">\(\theta\)</span>, is <span class="math notranslate nohighlight">\(\theta=(\lambda-\sigma)^{-1}\)</span> as in the case of the linear eigenvalue problem. See chapter <a class="reference internal" href="st.html#ch-st"><span class="std std-ref">ST: Spectral Transformation</span></a> for additional details.</p>
<p>The polynomial eigenvalue problem of equation <a class="reference internal" href="#equation-eq-sinvquad">(14)</a> corresponds to the reversed form of the shifted polynomial, <span class="math notranslate nohighlight">\(\operatorname{rev} P(\theta)\)</span>. The extension to polynomial matrices of arbitrary degree is also possible, where the coefficients of <span class="math notranslate nohighlight">\(\operatorname{rev} P(\theta)\)</span> have the general form</p>
<div class="math notranslate nohighlight" id="equation-eq-sinvpep">
<span class="eqno">(16)<a class="headerlink" href="#equation-eq-sinvpep" title="Link to this equation">#</a></span>\[T_k=\sum_{j=0}^{d-k}\binom{j+k}{k}\sigma^{j}A_{j+k},\qquad k=0,\ldots,d.\]</div>
<p>The way this is implemented in SLEPc is that the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/ST/ST.html">ST</a></span></code> object is in charge of computing the <span class="math notranslate nohighlight">\(T_k\)</span> matrices, so that the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code> solver operates with these matrices as it would with the original <span class="math notranslate nohighlight">\(A_i\)</span> matrices, without changing its behavior. We say that <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/ST/ST.html">ST</a></span></code> performs the transformation.</p>
<p>An alternative would be to apply the shift-and-invert spectral transformation to the linearization <a class="reference internal" href="#equation-eq-firstcomp">(11)</a> in a smart way, making the polynomial eigensolver aware of this fact so that it can exploit the block structure of the linearization. Let <span class="math notranslate nohighlight">\(S_\sigma:=(L_0-\sigma L_1)^{-1}L_1\)</span>, then when the solver needs to extend the Arnoldi basis with an operation such as <span class="math notranslate nohighlight">\(z=S_\sigma w\)</span>, a linear solve is required with the form</p>
<div class="math notranslate nohighlight" id="equation-eq-sinvpeplin">
<span class="eqno">(17)<a class="headerlink" href="#equation-eq-sinvpeplin" title="Link to this equation">#</a></span>\[\begin{split}\begin{bmatrix}
  -\sigma I  &amp; I \\
  &amp; -\sigma I &amp; \ddots \\
  &amp; &amp; \ddots &amp; I \\
  &amp; &amp; &amp; -\sigma I &amp; I \\
  -A_0 &amp; -A_1 &amp; \cdots  &amp; -\tilde{A}_{d-2} &amp; -\tilde{A}_{d-1}
\end{bmatrix}
\begin{bmatrix}
  z^0\\z^1\\\vdots\\z^{d-2}\\z^{d-1}
\end{bmatrix}
  =
\begin{bmatrix}
  w^0\\w^1\\\vdots\\w^{d-2}\\A_dw^{d-1}
\end{bmatrix},\end{split}\]</div>
<p>with <span class="math notranslate nohighlight">\(\tilde{A}_{d-2}=A_{d-2}+\sigma I\)</span> and <span class="math notranslate nohighlight">\(\tilde{A}_{d-1}=A_{d-1}+\sigma A_d\)</span>. From the block LU factorization, it is possible to derive a simple recurrence to compute <span class="math notranslate nohighlight">\(z^i\)</span>, with one of the steps involving a linear solve with <span class="math notranslate nohighlight">\(P(\sigma)\)</span>.</p>
<p>Implementing the latter approach is more difficult (especially if different polynomial bases must be supported), and requires an intimate relation with the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code> solver. That is why it is only available currently in the default solver (TOAR) and in <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPLINEAR.html">PEPLINEAR</a></span></code> without explicit matrix. In order to choose between the two approaches, the user can set a flag with:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/ST/STSetTransform.html">STSetTransform</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/ST/ST.html">ST</a></span><span class="w"> </span><span class="n">st</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscBool/">PetscBool</a></span><span class="w"> </span><span class="n">flg</span><span class="p">);</span>
</pre></div>
</div>
<p>(or in the command line <code class="docutils notranslate"><span class="pre">-st_transform</span></code>) to activate the first one (<code class="docutils notranslate"><span class="pre"><a href="../../manualpages/ST/ST.html">ST</a></span></code> performs the transformation). Note that this flag belongs to <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/ST/ST.html">ST</a></span></code>, not <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code> (use <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPGetST.html">PEPGetST</a>()</span></code> to extract it).</p>
<p>In terms of overall computational cost, both approaches are roughly equivalent, but the advantage of the second one is not having to store the <span class="math notranslate nohighlight">\(T_k\)</span> matrices explicitly. It may also be slightly more accurate. Hence, the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/ST/STSetTransform.html">STSetTransform</a>()</span></code> flag is turned off by default.</p>
<p>A command line example would be:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./ex16<span class="w"> </span>-pep_nev<span class="w"> </span><span class="m">12</span><span class="w"> </span>-pep_type<span class="w"> </span>toar<span class="w"> </span>-pep_target<span class="w"> </span><span class="m">0</span><span class="w"> </span>-st_type<span class="w"> </span>sinvert
</pre></div>
</div>
<p>The example computes 12 eigenpairs closest to the origin with TOAR and shift-and-invert. The <code class="docutils notranslate"><span class="pre">-st_transform</span></code> could be added optionally to switch to <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/ST/ST.html">ST</a></span></code> being in charge of the transformation. The same example with Q-Arnoldi would be</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./ex16<span class="w"> </span>-pep_nev<span class="w"> </span><span class="m">12</span><span class="w"> </span>-pep_type<span class="w"> </span>qarnoldi<span class="w"> </span>-pep_target<span class="w"> </span><span class="m">0</span><span class="w"> </span>-st_type<span class="w"> </span>sinvert<span class="w"> </span>-st_transform
</pre></div>
</div>
<p>where in this case <code class="docutils notranslate"><span class="pre">-st_transform</span></code> would be set as default if not specified.</p>
<p>As a complete example of how to solve a quadratic eigenproblem via explicit linearization with explicit construction of the <span class="math notranslate nohighlight">\(L_0\)</span> and <span class="math notranslate nohighlight">\(L_1\)</span> matrices, consider the following command line:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./sleeper<span class="w"> </span>-pep_type<span class="w"> </span>linear<span class="w"> </span>-pep_target<span class="w"> </span>-10<span class="w"> </span>-pep_linear_st_type<span class="w"> </span>sinvert<span class="w"> </span>-pep_linear_st_ksp_type<span class="w"> </span>preonly<span class="w"> </span>-pep_linear_st_pc_type<span class="w"> </span>lu<span class="w"> </span>-pep_linear_st_pc_factor_mat_solver_type<span class="w"> </span>mumps<span class="w"> </span>-pep_linear_st_mat_mumps_icntl_14<span class="w"> </span><span class="m">100</span><span class="w"> </span>-pep_linear_explicitmatrix
</pre></div>
</div>
<p>This example uses MUMPS for solving the associated linear systems, see section <a class="reference internal" href="st.html#sec-lin"><span class="std std-ref">Solution of Linear Systems</span></a> for details. The following command line example illustrates how to solve the same problem without explicitly forming the matrices. Note that in this case the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/ST/ST.html">ST</a></span></code> options are not prefixed with <code class="docutils notranslate"><span class="pre">-pep_linear_</span></code> since now they do not refer to the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/ST/ST.html">ST</a></span></code> within the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPLINEAR.html">PEPLINEAR</a></span></code> solver but the general <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/ST/ST.html">ST</a></span></code> associated to <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code>.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./sleeper<span class="w"> </span>-pep_type<span class="w"> </span>linear<span class="w"> </span>-pep_target<span class="w"> </span>-10<span class="w"> </span>-st_type<span class="w"> </span>sinvert<span class="w"> </span>-st_ksp_type<span class="w"> </span>preonly<span class="w"> </span>-st_pc_type<span class="w"> </span>lu<span class="w"> </span>-st_pc_factor_mat_solver_type<span class="w"> </span>mumps<span class="w"> </span>-st_mat_mumps_icntl_14<span class="w"> </span><span class="m">100</span>
</pre></div>
</div>
<section id="sec-qslice">
<h3>Spectrum Slicing for PEP<a class="headerlink" href="#sec-qslice" title="Link to this heading">#</a></h3>
<p>Similarly to the spectrum slicing technique available in linear symmetric-definite eigenvalue problems (cf. <a class="reference internal" href="st.html#sec-slice"><span class="std std-ref">Spectrum Slicing</span></a>), it is possible to compute all eigenvalues in a given interval <span class="math notranslate nohighlight">\([a,b]\)</span> for the case of hyperbolic quadratic eigenvalue problems (<code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP_HYPERBOLIC.html">PEP_HYPERBOLIC</a></span></code>). In more general symmetric (or Hermitian) quadratic eigenproblems (<code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP_HERMITIAN.html">PEP_HERMITIAN</a></span></code>), it may also be possible to do spectrum slicing provided that computing inertia is feasible, which essentially means that all eigenvalues in the interval must be real and of the same definite type.</p>
<p>This computation is available only in the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPSTOAR.html">PEPSTOAR</a></span></code> solver. The spectrum slicing mechanism implemented in <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code> is very similar to the one described in section <a class="reference internal" href="st.html#sec-slice"><span class="std std-ref">Spectrum Slicing</span></a> for linear problems, except for the multi-communicator option which is not implemented yet.</p>
<p>A command line example is the following:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./spring<span class="w"> </span>-n<span class="w"> </span><span class="m">300</span><span class="w"> </span>-pep_hermitian<span class="w"> </span>-pep_interval<span class="w"> </span>-10.1,-9.5<span class="w"> </span>-pep_type<span class="w"> </span>stoar<span class="w"> </span>-st_type<span class="w"> </span>sinvert<span class="w"> </span>-st_ksp_type<span class="w"> </span>preonly<span class="w"> </span>-st_pc_type<span class="w"> </span>cholesky
</pre></div>
</div>
<p>In hyperbolic problems, where eigenvalues form two separate groups of <span class="math notranslate nohighlight">\(n\)</span> eigenvalues, it will be necessary to explicitly set the problem type to <code class="docutils notranslate"><span class="pre">-pep_hyperbolic</span></code> if the interval <span class="math notranslate nohighlight">\([a,b]\)</span> includes eigenvalues from both groups.</p>
<p>Additional details can be found in <span id="id6">[<a class="reference internal" href="../../manualpages/PEP/PEPSTOAR.html#id56" title="C. Campos and J. E. Roman. Inertia-based spectrum slicing for symmetric quadratic eigenvalue problems. Numer. Linear Algebra Appl., 27(4):e2293, 2020. doi:10.1002/nla.2293.">Campos and Roman, 2020</a>]</span>.</p>
</section>
</section>
<section id="retrieving-the-solution">
<h2>Retrieving the Solution<a class="headerlink" href="#retrieving-the-solution" title="Link to this heading">#</a></h2>
<p>After the call to <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPSolve.html">PEPSolve</a>()</span></code> has finished, the computed results are stored internally. The procedure for retrieving the computed solution is exactly the same as in the case of <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/EPS/EPS.html">EPS</a></span></code>. The user has to call <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPGetConverged.html">PEPGetConverged</a>()</span></code> first, to obtain the number of converged solutions, then call <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPGetEigenpair.html">PEPGetEigenpair</a>()</span></code> repeatedly within a loop, once per each eigenvalue-eigenvector pair. The same considerations relative to complex eigenvalues apply, see section <a class="reference internal" href="eps.html#sec-retrsol"><span class="std std-ref">Retrieving the Solution</span></a> for additional details.</p>
<p><strong>Controlling and Monitoring Convergence</strong>:
As in the case of <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/EPS/EPS.html">EPS</a></span></code>, in <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code> the number of iterations carried out by the solver can be determined with <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPGetIterationNumber.html">PEPGetIterationNumber</a>()</span></code>, and the tolerance and maximum number of iterations can be set with <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPSetTolerances.html">PEPSetTolerances</a>()</span></code>. Also, convergence can be monitored with command-line keys <code class="docutils notranslate"><span class="pre">-pep_monitor</span></code>, <code class="docutils notranslate"><span class="pre">-pep_monitor_all</span></code>, <code class="docutils notranslate"><span class="pre">-pep_monitor_conv</span></code>, <code class="docutils notranslate"><span class="pre">-pep_monitor</span> <span class="pre">draw::draw_lg</span></code>, or <code class="docutils notranslate"><span class="pre">-pep_monitor_all</span> <span class="pre">draw::draw_lg</span></code>. See section <a class="reference internal" href="eps.html#sec-monitor"><span class="std std-ref">Controlling and Monitoring Convergence</span></a> for additional details.</p>
<p><strong>Viewing the Solution</strong>:
Likewise to linear eigensolvers, there is support for various kinds of viewers for the solution. One can for instance use <code class="docutils notranslate"><span class="pre">-pep_view_values</span></code>, <code class="docutils notranslate"><span class="pre">-pep_view_vectors</span></code>, <code class="docutils notranslate"><span class="pre">-pep_error_relative</span></code>, or <code class="docutils notranslate"><span class="pre">-pep_converged_reason</span></code>. See description in section <a class="reference internal" href="eps.html#sec-epsviewers"><span class="std std-ref">Viewing the Solution</span></a>.</p>
<section id="reliability-of-the-computed-solution">
<h3>Reliability of the Computed Solution<a class="headerlink" href="#reliability-of-the-computed-solution" title="Link to this heading">#</a></h3>
<div class="pst-scrollable-table-container"><table class="table" id="tab-peperrors">
<caption><span class="caption-text">Possible expressions for computing error bounds</span><a class="headerlink" href="#tab-peperrors" title="Link to this table">#</a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>Error type</p></th>
<th class="head"><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPErrorType.html">PEPErrorType</a></span></code></p></th>
<th class="head"><p>Command line key</p></th>
<th class="head"><p>Error bound</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>Absolute error</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPErrorType.html">PEP_ERROR_ABSOLUTE</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_error_absolute</span></code></p></td>
<td><p><span class="math notranslate nohighlight">\(\|r\|\)</span></p></td>
</tr>
<tr class="row-odd"><td><p>Relative error</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPErrorType.html">PEP_ERROR_RELATIVE</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_error_relative</span></code></p></td>
<td><p><span class="math notranslate nohighlight">\(\|r\|/|\lambda|\)</span></p></td>
</tr>
<tr class="row-even"><td><p>Backward error</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPErrorType.html">PEP_ERROR_BACKWARD</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_error_backward</span></code></p></td>
<td><p><span class="math notranslate nohighlight">\(\|r\|/(\sum_j\|A_j\||\lambda_i|^j)\)</span></p></td>
</tr>
</tbody>
</table>
</div>
<p>As in the case of linear problems, the following function:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/PEP/PEPComputeError.html">PEPComputeError</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w"> </span><span class="n">pep</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscInt/">PetscInt</a></span><span class="w"> </span><span class="n">j</span><span class="p">,</span><span class="n"><a href="../../manualpages/PEP/PEPErrorType.html">PEPErrorType</a></span><span class="w"> </span><span class="n">type</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscReal/">PetscReal</a></span><span class="w"> </span><span class="o">*</span><span class="n">error</span><span class="p">);</span>
</pre></div>
</div>
<p>is available to assess the accuracy of the computed solutions. This error is based on the computation of the 2-norm of the residual vector, defined as</p>
<div class="math notranslate nohighlight" id="equation-eq-respol">
<span class="eqno">(18)<a class="headerlink" href="#equation-eq-respol" title="Link to this equation">#</a></span>\[r=P(\tilde{\lambda})\tilde{x},\]</div>
<p>where <span class="math notranslate nohighlight">\(\tilde{\lambda}\)</span> and <span class="math notranslate nohighlight">\(\tilde{x}\)</span> represent any of the <code class="docutils notranslate"><span class="pre">nconv</span></code> computed eigenpairs delivered by <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPGetEigenpair.html">PEPGetEigenpair</a>()</span></code>. From the residual norm, the error bound can be computed in different ways, see table <a class="reference internal" href="#tab-peperrors"><span class="std std-ref">Possible expressions for computing error bounds</span></a>. It is usually recommended to assess the accuracy of the solution using the backward error, defined as</p>
<div class="math notranslate nohighlight" id="equation-eq-backward">
<span class="eqno">(19)<a class="headerlink" href="#equation-eq-backward" title="Link to this equation">#</a></span>\[\eta(\tilde{\lambda},\tilde{x})=\frac{\|r\|}{\sum_{j=0}^d\|A_j\||\tilde\lambda|^j\|\tilde{x}\|},\]</div>
<p>where <span class="math notranslate nohighlight">\(d\)</span> is the degree of the polynomial. Note that the eigenvector is always assumed to have unit norm.</p>
<p>Similar expressions can be used in the convergence criterion used to accept converged eigenpairs internally by the solver. The convergence test can be set via the corresponding command-line switch (see table <a class="reference internal" href="#tab-pepconv"><span class="std std-ref">Available possibilities for the convergence criterion</span></a>) or with <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPSetConvergenceTest.html">PEPSetConvergenceTest</a>()</span></code>.</p>
<div class="pst-scrollable-table-container"><table class="table" id="tab-pepconv">
<caption><span class="caption-text">Available possibilities for the convergence criterion</span><a class="headerlink" href="#tab-pepconv" title="Link to this table">#</a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>Convergence criterion</p></th>
<th class="head"><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPConv.html">PEPConv</a></span></code></p></th>
<th class="head"><p>Command line key</p></th>
<th class="head"><p>Error bound</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>Absolute</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPConv.html">PEP_CONV_ABS</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_conv_abs</span></code></p></td>
<td><p><span class="math notranslate nohighlight">\(\|r\|\)</span></p></td>
</tr>
<tr class="row-odd"><td><p>Relative to eigenvalue</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPConv.html">PEP_CONV_REL</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_conv_rel</span></code></p></td>
<td><p><span class="math notranslate nohighlight">\(\|r\|/|\lambda|\)</span></p></td>
</tr>
<tr class="row-even"><td><p>Relative to matrix norms</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPConv.html">PEP_CONV_NORM</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_conv_norm</span></code></p></td>
<td><p><span class="math notranslate nohighlight">\(\|r\|/(\sum_j\|A_j\||\lambda|^j)\)</span></p></td>
</tr>
<tr class="row-odd"><td><p>User-defined</p></td>
<td><p><code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPConv.html">PEP_CONV_USER</a></span></code></p></td>
<td><p><code class="docutils notranslate"><span class="pre">-pep_conv_user</span></code></p></td>
<td><p><em>user function</em></p></td>
</tr>
</tbody>
</table>
</div>
</section>
<section id="sec-scaling">
<h3>Scaling<a class="headerlink" href="#sec-scaling" title="Link to this heading">#</a></h3>
<p>When solving a quadratic eigenproblem via linearization, an accurate solution of the generalized eigenproblem does not necessarily imply a similar level of accuracy for the quadratic problem. <span id="id7">Tisseur [<a class="reference internal" href="#id40" title="F. Tisseur. Backward error and condition of polynomial eigenvalue problems. Linear Algebra Appl., 309(1–3):339–361, 2000. doi:10.1016/S0024-3795(99)00063-4.">2000</a>]</span> shows that in the case of the linearization <a class="reference internal" href="#equation-eq-n1">(2)</a>, a small backward error in the generalized eigenproblem guarantees a small backward error in the quadratic eigenproblem. However, this holds only if <span class="math notranslate nohighlight">\(M\)</span>, <span class="math notranslate nohighlight">\(C\)</span> and <span class="math notranslate nohighlight">\(K\)</span> have a similar norm.</p>
<p>When the norm of <span class="math notranslate nohighlight">\(M\)</span>, <span class="math notranslate nohighlight">\(C\)</span> and <span class="math notranslate nohighlight">\(K\)</span> vary widely, <span id="id8">Tisseur [<a class="reference internal" href="#id40" title="F. Tisseur. Backward error and condition of polynomial eigenvalue problems. Linear Algebra Appl., 309(1–3):339–361, 2000. doi:10.1016/S0024-3795(99)00063-4.">2000</a>]</span> recommends to solve the scaled problem, defined as</p>
<div class="math notranslate nohighlight" id="equation-eq-scaled">
<span class="eqno">(20)<a class="headerlink" href="#equation-eq-scaled" title="Link to this equation">#</a></span>\[(\mu^2M_\alpha+\mu C_\alpha+K)x=0,\]</div>
<p>with <span class="math notranslate nohighlight">\(\mu=\lambda/\alpha\)</span>, <span class="math notranslate nohighlight">\(M_\alpha=\alpha^2M\)</span> and <span class="math notranslate nohighlight">\(C_\alpha=\alpha C\)</span>, where <span class="math notranslate nohighlight">\(\alpha\)</span> is a scaling factor. Ideally, <span class="math notranslate nohighlight">\(\alpha\)</span> should be chosen in such a way that the norms of <span class="math notranslate nohighlight">\(M_\alpha\)</span>, <span class="math notranslate nohighlight">\(C_\alpha\)</span> and <span class="math notranslate nohighlight">\(K\)</span> have similar magnitude. A tentative value would be <span class="math notranslate nohighlight">\(\alpha=\sqrt{\frac{\|K\|_\infty}{\|M\|_\infty}}\)</span>.</p>
<p>In the general case of polynomials of arbitrary degree, a similar scheme is also possible, but it is not clear how to choose <span class="math notranslate nohighlight">\(\alpha\)</span> to achieve the same goal. <span id="id9">Betcke [<a class="reference internal" href="#id47" title="T. Betcke. Optimal scaling of generalized and polynomial eigenvalue problems. SIAM J. Matrix Anal. Appl., 30(4):1320–1338, 2008. doi:10.1137/070704769.">2008</a>]</span> proposes such a scaling scheme as well as more general diagonal scalings <span class="math notranslate nohighlight">\(D_\ell P(\lambda)D_r\)</span>. In SLEPc, we provide these types of scalings, whose settings can be tuned with:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/PEP/PEPSetScale.html">PEPSetScale</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w"> </span><span class="n">pep</span><span class="p">,</span><span class="n"><a href="../../manualpages/PEP/PEPScale.html">PEPScale</a></span><span class="w"> </span><span class="n">scale</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscReal/">PetscReal</a></span><span class="w"> </span><span class="n">alpha</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Vec/Vec/">Vec</a></span><span class="w"> </span><span class="n">Dl</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Vec/Vec/">Vec</a></span><span class="w"> </span><span class="n">Dr</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscInt/">PetscInt</a></span><span class="w"> </span><span class="n">its</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscReal/">PetscReal</a></span><span class="w"> </span><span class="n">lambda</span><span class="p">);</span>
</pre></div>
</div>
<p>See the manual page for details and the description in <span id="id10">[<a class="reference internal" href="../../manualpages/PEP/PEPTOAR.html#id37" title="C. Campos and J. E. Roman. Parallel Krylov solvers for the polynomial eigenvalue problem in SLEPc. SIAM J. Sci. Comput., 38(5):S385–S411, 2016. doi:10.1137/15M1022458.">Campos and Roman, 2016</a>]</span>.</p>
</section>
<section id="sec-pepextr">
<h3>Extraction<a class="headerlink" href="#sec-pepextr" title="Link to this heading">#</a></h3>
<p>Some of the eigensolvers provided in the <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEP.html">PEP</a></span></code> package are based on solving the linearized eigenproblem of equation <a class="reference internal" href="#equation-eq-firstcompfull">(12)</a>. From the eigenvector <span class="math notranslate nohighlight">\(y\)</span> of the linearization, it is possible to extract the eigenvector <span class="math notranslate nohighlight">\(x\)</span> of the polynomial eigenproblem. The most straightforward way is to take the first block of <span class="math notranslate nohighlight">\(y\)</span>, but there are other, more elaborate extraction strategies. For instance, one may compute the norm of the residual <a class="reference internal" href="#equation-eq-respol">(18)</a> for every block of <span class="math notranslate nohighlight">\(y\)</span>, and take the one that gives the smallest residual. The different extraction techniques may be selected with:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/PEP/PEPSetExtract.html">PEPSetExtract</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w"> </span><span class="n">pep</span><span class="p">,</span><span class="n"><a href="../../manualpages/PEP/PEPExtract.html">PEPExtract</a></span><span class="w"> </span><span class="n">extract</span><span class="p">);</span>
</pre></div>
</div>
<p>For additional information, see <span id="id11">[<a class="reference internal" href="../../manualpages/PEP/PEPTOAR.html#id37" title="C. Campos and J. E. Roman. Parallel Krylov solvers for the polynomial eigenvalue problem in SLEPc. SIAM J. Sci. Comput., 38(5):S385–S411, 2016. doi:10.1137/15M1022458.">Campos and Roman, 2016</a>]</span>.</p>
</section>
<section id="sec-refine">
<h3>Iterative Refinement<a class="headerlink" href="#sec-refine" title="Link to this heading">#</a></h3>
<p>As mentioned above, scaling can sometimes improve the accuracy of the computed solution considerably, in the case that the coefficient matrices <span class="math notranslate nohighlight">\(A_i\)</span> are very different in norm. Still, even when the matrix norms are well balanced the accuracy can sometimes be unacceptably low. The reason is that methods based on linearization are not always backward stable, that is, even if the computation of the eigenpairs of the linearization is done in a stable way, there is no guarantee that the extracted polynomial eigenpairs satisfy the given tolerance.</p>
<p>If good accuracy is required, one possibility is to perform a few steps of iterative refinement on the solution computed by the polynomial eigensolver algorithm. Iterative refinement can be seen as the Newton method applied to a set of nonlinear equations related to the polynomial eigenvalue problem <span id="id12">[<a class="reference internal" href="#id42" title="T. Betcke and D. Kressner. Perturbation, extraction and refinement of invariant pairs for matrix polynomials. Linear Algebra Appl., 435(3):514–536, 2011. doi:10.1016/j.laa.2010.06.029.">Betcke and Kressner, 2011</a>]</span>. It is well known that global convergence of Newton’s iteration is guaranteed only if the initial guess is close enough to the exact solution, so we still need an eigensolver such as TOAR to compute this initial guess.</p>
<p>Iterative refinement can be very costly (sometimes a single refinement step is more expensive than the whole iteration to compute the initial guess with TOAR), that is why in SLEPc it is disabled by default. When the user activates it, the computation of Newton iterations will take place within <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPSolve.html">PEPSolve</a>()</span></code> as a final stage (identified as <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPRefine.html">PEPRefine</a>()</span></code> in the <code class="docutils notranslate"><span class="pre">-log_view</span></code> report).</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n"><a href="../../manualpages/PEP/PEPSetRefine.html">PEPSetRefine</a></span><span class="p">(</span><span class="n"><a href="../../manualpages/PEP/PEP.html">PEP</a></span><span class="w"> </span><span class="n">pep</span><span class="p">,</span><span class="n"><a href="../../manualpages/PEP/PEPRefine.html">PEPRefine</a></span><span class="w"> </span><span class="n">refine</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscInt/">PetscInt</a></span><span class="w"> </span><span class="n">npart</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscReal/">PetscReal</a></span><span class="w"> </span><span class="n">tol</span><span class="p">,</span><span class="n"><a href="https://petsc.org/release/manualpages/Sys/PetscInt/">PetscInt</a></span><span class="w"> </span><span class="n">its</span><span class="p">,</span><span class="n"><a href="../../manualpages/PEP/PEPRefineScheme.html">PEPRefineScheme</a></span><span class="w"> </span><span class="n">scheme</span><span class="p">);</span>
</pre></div>
</div>
<p>There are two types of refinement, identified as <em>simple</em> and <em>multiple</em>. The first one performs refinement on each eigenpair individually, while the second one considers the computed invariant pair as a whole. This latter approach is more costly but it is expected to be more robust in the presence of multiple eigenvalues.</p>
<p>In <code class="docutils notranslate"><span class="pre"><a href="../../manualpages/PEP/PEPSetRefine.html">PEPSetRefine</a>()</span></code>, the argument <code class="docutils notranslate"><span class="pre">npart</span></code> indicates the number of partitions in which the communicator must be split. This can sometimes improve the scalability when refining many eigenpairs.</p>
<p>Additional details can be found in <span id="id13">[<a class="reference internal" href="../../manualpages/NEP/NEPRefineScheme.html#id37" title="C. Campos and J. E. Roman. Parallel iterative refinement in polynomial eigenvalue problems. Numer. Linear Algebra Appl., 23(4):730–745, 2016. doi:10.1002/nla.2052.">Campos and Roman, 2016</a>]</span>.</p>
<p class="rubric">References</p>
<div class="docutils container" id="id14">
<div role="list" class="citation-list">
<div class="citation" id="id47" role="doc-biblioentry">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id9">Bet08</a><span class="fn-bracket">]</span></span>
<p>T. Betcke. Optimal scaling of generalized and polynomial eigenvalue problems. <em>SIAM J. Matrix Anal. Appl.</em>, 30(4):1320–1338, 2008. <a class="reference external" href="https://doi.org/10.1137/070704769">doi:10.1137/070704769</a>.</p>
</div>
<div class="citation" id="id42" role="doc-biblioentry">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id12">Bet11</a><span class="fn-bracket">]</span></span>
<p>T. Betcke and D. Kressner. Perturbation, extraction and refinement of invariant pairs for matrix polynomials. <em>Linear Algebra Appl.</em>, 435(3):514–536, 2011. <a class="reference external" href="https://doi.org/10.1016/j.laa.2010.06.029">doi:10.1016/j.laa.2010.06.029</a>.</p>
</div>
<div class="citation" id="id49" role="doc-biblioentry">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id13">Cam16b</a><span class="fn-bracket">]</span></span>
<p>C. Campos and J. E. Roman. Parallel iterative refinement in polynomial eigenvalue problems. <em>Numer. Linear Algebra Appl.</em>, 23(4):730–745, 2016. <a class="reference external" href="https://doi.org/10.1002/nla.2052">doi:10.1002/nla.2052</a>.</p>
</div>
<div class="citation" id="id48" role="doc-biblioentry">
<span class="label"><span class="fn-bracket">[</span>Cam16a<span class="fn-bracket">]</span></span>
<span class="backrefs">(<a role="doc-backlink" href="#id2">1</a>,<a role="doc-backlink" href="#id10">2</a>,<a role="doc-backlink" href="#id11">3</a>)</span>
<p>C. Campos and J. E. Roman. Parallel Krylov solvers for the polynomial eigenvalue problem in SLEPc. <em>SIAM J. Sci. Comput.</em>, 38(5):S385–S411, 2016. <a class="reference external" href="https://doi.org/10.1137/15M1022458">doi:10.1137/15M1022458</a>.</p>
</div>
<div class="citation" id="id55" role="doc-biblioentry">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id3">Cam20a</a><span class="fn-bracket">]</span></span>
<p>C. Campos and J. E. Roman. A polynomial Jacobi-Davidson solver with support for non-monomial bases and deflation. <em>BIT</em>, 60(2):295–318, 2020. <a class="reference external" href="https://doi.org/10.1007/s10543-019-00778-z">doi:10.1007/s10543-019-00778-z</a>.</p>
</div>
<div class="citation" id="id67" role="doc-biblioentry">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id6">Cam20b</a><span class="fn-bracket">]</span></span>
<p>C. Campos and J. E. Roman. Inertia-based spectrum slicing for symmetric quadratic eigenvalue problems. <em>Numer. Linear Algebra Appl.</em>, 27(4):e2293, 2020. <a class="reference external" href="https://doi.org/10.1002/nla.2293">doi:10.1002/nla.2293</a>.</p>
</div>
<div class="citation" id="id40" role="doc-biblioentry">
<span class="label"><span class="fn-bracket">[</span>Tis00<span class="fn-bracket">]</span></span>
<span class="backrefs">(<a role="doc-backlink" href="#id7">1</a>,<a role="doc-backlink" href="#id8">2</a>)</span>
<p>F. Tisseur. Backward error and condition of polynomial eigenvalue problems. <em>Linear Algebra Appl.</em>, 309(1–3):339–361, 2000. <a class="reference external" href="https://doi.org/10.1016/S0024-3795(99)00063-4">doi:10.1016/S0024-3795(99)00063-4</a>.</p>
</div>
<div class="citation" id="id39" role="doc-biblioentry">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id1">Tis01</a><span class="fn-bracket">]</span></span>
<p>F. Tisseur and K. Meerbergen. The quadratic eigenvalue problem. <em>SIAM Rev.</em>, 43(2):235–286, 2001. <a class="reference external" href="https://doi.org/10.1137/S0036144500381988">doi:10.1137/S0036144500381988</a>.</p>
</div>
</div>
</div>
<p class="rubric">Footnotes</p>
</section>
</section>
</section>
<hr class="footnotes docutils" />
<aside class="footnote-list brackets">
<aside class="footnote brackets" id="eps-real" role="doc-footnote">
<span class="label"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></span>
<span class="backrefs">(<a role="doc-backlink" href="#id4">1</a>,<a role="doc-backlink" href="#id5">2</a>)</span>
<p>If SLEPc is compiled for real scalars, then the absolute value of the imaginary part, <span class="math notranslate nohighlight">\(\|\mathrm{Im}(\lambda)\|\)</span>, is used for eigenvalue selection and sorting.</p>
</aside>
</aside>


                </article>
              
              
              
              
              
                <footer class="prev-next-footer d-print-none">
                  
<div class="prev-next-area">
    <a class="left-prev"
       href="svd.html"
       title="previous page">
      <i class="fa-solid fa-angle-left"></i>
      <div class="prev-next-info">
        <p class="prev-next-subtitle">previous</p>
        <p class="prev-next-title">SVD: Singular Value Decomposition</p>
      </div>
    </a>
    <a class="right-next"
       href="nep.html"
       title="next page">
      <div class="prev-next-info">
        <p class="prev-next-subtitle">next</p>
        <p class="prev-next-title">NEP: Nonlinear Eigenvalue Problems</p>
      </div>
      <i class="fa-solid fa-angle-right"></i>
    </a>
</div>
                </footer>
              
            </div>
            
            
              
                <dialog id="pst-secondary-sidebar-modal"></dialog>
                <div id="pst-secondary-sidebar" class="bd-sidebar-secondary bd-toc"><div class="sidebar-secondary-items sidebar-secondary__inner">


  <div class="sidebar-secondary-item">
<div
    id="pst-page-navigation-heading-2"
    class="page-toc tocsection onthispage">
    <i class="fa-solid fa-list"></i> On this page
  </div>
  <nav class="bd-toc-nav page-toc" aria-labelledby="pst-page-navigation-heading-2">
    <ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#sec-pep">Overview of Polynomial Eigenproblems</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#sec-qep">Quadratic Eigenvalue Problems</a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#problem-types">Problem Types</a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#sec-linearization">Linearization</a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#sec-pep1">Polynomials of Arbitrary Degree</a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#avoiding-the-linearization">Avoiding the Linearization</a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#basic-usage">Basic Usage</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#defining-the-problem">Defining the Problem</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#selecting-the-solver">Selecting the Solver</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#sec-qst">Spectral Transformation for PEP</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#sec-qslice">Spectrum Slicing for PEP</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#retrieving-the-solution">Retrieving the Solution</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#reliability-of-the-computed-solution">Reliability of the Computed Solution</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#sec-scaling">Scaling</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#sec-pepextr">Extraction</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#sec-refine">Iterative Refinement</a></li>
</ul>
</li>
</ul>
  </nav></div>

  <div class="sidebar-secondary-item">

  
  <div class="tocsection editthispage">
    <a href="https://gitlab.com/slepc/slepc/-/edit/release/doc/source/documentation/manual/pep.md">
      <i class="fa-solid fa-pencil"></i>
      
      
        
          Edit on GitLab
        
      
    </a>
  </div>
</div>

  <div class="sidebar-secondary-item">
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/documentation/manual/pep.md.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div></div>

</div></div>
              
            
          </div>
          <footer class="bd-footer-content">
            
          </footer>
        
      </main>
    </div>
  </div>
  
  <!-- Scripts loaded after <body> so the DOM is not blocked -->
  <script defer src="../../_static/scripts/bootstrap.js?digest=8878045cc6db502f8baf"></script>
<script defer src="../../_static/scripts/pydata-sphinx-theme.js?digest=8878045cc6db502f8baf"></script>

  <footer class="bd-footer">
<div class="bd-footer__inner bd-page-width">
  
    <div class="footer-items__start">
      
        <div class="footer-item">

  <p class="copyright">
    
      © Copyright 2002-2025, Universitat Politecnica de Valencia, Spain.
      <br/>
    
  </p>
</div>
      
        <div class="footer-item">

  <p class="sphinx-version">
    Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.3.7.
    <br/>
  </p>
</div>
      
    </div>
  
  
  
    <div class="footer-items__end">
      
        <div class="footer-item">
<p class="theme-version">
  <!-- # L10n: Setting the PST URL as an argument as this does not need to be localized -->
  Built with the <a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html">PyData Sphinx Theme</a> 0.16.1.
</p></div>
      
    </div>
  
</div>

  </footer>
  </body>
</html>