-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc_hybmat.py
More file actions
executable file
·1237 lines (1185 loc) · 42.7 KB
/
c_hybmat.py
File metadata and controls
executable file
·1237 lines (1185 loc) · 42.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
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
#!/usr/bin/python
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import sys
from numpy import linalg as LA
from hjl_common import *
import basislabel
import argparse
parser = argparse.ArgumentParser(description="Plot ldos with j-basis")
parser.add_argument( "mak", type=str, help="Data path or filename" )
#parser.add_argument( "Ecluster", type=str, help="Data path or filename" )
parser.add_argument("-t", "--transpose", action="store_true", help="Plot the transposed data" )
parser.add_argument("--oldsoc", action="store_true" , help="SOC strength is in a old-format and multiplied by 2./3." )
parser.add_argument("-y", "--yrange", type=str, help="set yrange e.g. _y0_y1" )
parser.add_argument("-x", "--xxrange", type=str, help="set xrange e.g. _x0_x1" )
parser.add_argument("--decomp", action="store_true" , help="Plot mak with decomposition into t2g (default) or j." )
parser.add_argument("--decompbath", action="store_true" , help="Plot mak with decomposition into t2g (default) or j in each bath." )
parser.add_argument("--basis", type=str , help="Set the basis.")
parser.add_argument("--t2g", action="store_true" , help="Set the basis as t2g.")
parser.add_argument("--toj", "--convj", action="store_true" , help="Transform to jeff-basis" )
parser.add_argument("--toleff", "--convleff", action="store_true" , help="Transform to leff-basis" )
parser.add_argument("--tot2g", "--convt", action="store_true" , help="Transform to t2g-basis" )
parser.add_argument("--ton", "--convn", action="store_true" , help="Transform to natural-basis" )
parser.add_argument("--tojfromn", "--convjfromn", action="store_true" , help="Transform to jeff-basis from natural-basis" )
parser.add_argument("--nosum", action="store_true" , help="Remove the plot of sum." )
parser.add_argument("-n", "--noshow", action="store_true" , help="Do not show the plot." )
parser.add_argument("-w", "--write", action="store_true" , help="Write the new mak." )
parser.add_argument("--shownumer", "--shown", action="store_true" , help="Show the Deltanumersum." )
parser.add_argument("--showbathftn", "--showb", action="store_true" , help="Show the Bathftn." )
parser.add_argument("--diagbathftn", "--diagb", action="store_true" , help="Diagonalize the Bathftn." )
parser.add_argument("--comp", "--complex", action="store_true" , help="Show the complex-components." )
parser.add_argument("--c4rot", "--c4", action="store_true" , help="Perform the C4-rotation on the Vml." )
parser.add_argument("--c4rotwrite", "--c4write", action="store_true" , help="Write the new mak of c4rot." )
parser.add_argument("-M", "--Matrix", type=str, help="Show the hybridization function at w(i)." )
parser.add_argument("--iw", "--matsu", action="store_true" , help="Using imaginary freq.")
parser.add_argument("--nmax", type=int , help="Set Nmax for iwn." )
parser.add_argument("--beta", type=int , help="Set beta for iwn." )
parser.add_argument("--cnnz", "--checknnzHyb", action="store_true" , help="Check Hyb function for rea/imag frequency." )
parser.add_argument("--printnnz", "--pnz", action="store_true", help="Print the nnz-information for each freq." )
parser.add_argument("--printnnzmat", "--pnzm", "--pnzmat", action="store_true", help="Print the nnz-matrix for each freq." )
parser.add_argument("--showe", "--showecluster", action="store_true", help="Print the ecluster." )
parser.add_argument("--count", type=int , help="Choose the data of the i-th iteration." )
parser.add_argument("--sphase", "--checkphasesel", action="store_true", help="Check the relative phase of symmetry partner of t2g in the selective way.")
parser.add_argument("--cphase", "--checkphase", "--cp", action="store_true", help="Check the relative phase of symmetry partner in t2g.")
parser.add_argument("--cphaset2g", "--checkphaset2g", action="store_true", help="Check the relative phase of symmetry partner in t2g.")
parser.add_argument("--cphasenosoc", "--checkphaset2gnosoc", "--cpns", action="store_true", help="Check the relative phase of symmetry partner in t2g-case without SOC.")
parser.add_argument("--makesym", "--maksym", action="store_true", help="Make .mak file invariant under time-rev. and C4-rotation based on the input .mak file." )
parser.add_argument("--makesymnew", "--maksymnew", action="store_true", help="Make a new .mak file invariant under time-rev. and C4-rotation." )
parser.add_argument("--makephase", "--makphase", "--makph", action="store_true", help="Make .mak file from changing '-1'*[0,4,5]-basis-phases of the input .mak file." )
parser.add_argument("--makeconverge", "--makconv", "--makc", action="store_true", help="Save Make .mak file from converged data with sorting ." )
parser.add_argument("--unsort", "--usort", action="store_true", help="Show the unsorted original data." )
parser.add_argument("--nojeff", "--noj", action="store_true", help="Do not display the sorted data." )
parser.add_argument("--t2gph", "--tp", "--tph", action="store_true" , help="Change T to Taramod.")
parser.add_argument("--factor", "--fact", type=str, help="Multiply a factor to e_l and V_{mu,l}.")
parser.add_argument("--extractandsave", "--extsave", "--extractsave", action="store_true" , help="Extract and save the raw data.")
args = parser.parse_args()
#ndat = len(sys.argv) - 1
#x = [""] * ndat
#y = [""] * ndat
print "\n"
nbasis = 6
basis = "j"
if args.basis : basis = args.basis
if basis == "e" : nbasis = 4
if args.t2g : basis = "t2g"
if args.t2gph :
matT = np.matrix( [
[ 0., 0., -np.sqrt(1./2.), 0., -np.sqrt(1./2.)*1j , 0. ],
[ np.sqrt(2./3.), 0., 0., -1./np.sqrt(6.), 0., -1/np.sqrt(6.)*1j ],
[ 0., np.sqrt(2./3.), 1./np.sqrt(6.), 0., -1./np.sqrt(6.)*1j, 0. ],
[ 0., 0., 0., 1./np.sqrt(2.), 0., -1./np.sqrt(2.)*1j ],
[-1./np.sqrt(3.), 0., 0., -1./np.sqrt(3.), 0., -1./np.sqrt(3.)*1j ],
[ 0., 1./np.sqrt(3.), -1./np.sqrt(3.), 0., 1./np.sqrt(3.)*1j, 0. ]] )
matTlefft2g = np.matrix( [
[ np.sqrt(2), 0., 0., 0., 0., 0. ],
[ 0., np.sqrt(2), 0., 0., 0., 0. ],
[ 0., 0., -1., 0., -1j, 0. ],
[ 0., 0., 0., -1., 0., -1j ],
[ 0., 0., 1., 0., -1j, 0. ],
[ 0., 0., 0., 1., 0., -1j ]] ) / np.sqrt(2.)
else :
matT = np.matrix( [
[ 0., 0., np.sqrt(1./2.), 0., np.sqrt(1./2.)*1j , 0. ],
[ np.sqrt(2./3.), 0., 0., -1./np.sqrt(6.), 0., -1/np.sqrt(6.)*1j ],
[ 0., np.sqrt(2./3.), 1./np.sqrt(6.), 0., -1./np.sqrt(6.)*1j, 0. ],
[ 0., 0., 0., 1./np.sqrt(2.), 0., -1./np.sqrt(2.)*1j ],
[ 1./np.sqrt(3.), 0., 0., 1./np.sqrt(3.), 0., 1./np.sqrt(3.)*1j ],
[ 0., -1./np.sqrt(3.), 1./np.sqrt(3.), 0., -1./np.sqrt(3.)*1j, 0. ]] )
matTlefft2g = np.matrix( [
[ 1., 0., 0., 0., 0., 0. ],
[ 0., 1., 0., 0., 0., 0. ],
[ 0., 0., 1., 0., 1j, 0. ],
[ 0., 0., 0., 1., 0., 1j ],
[ 0., 0., 1., 0., -1j, 0. ],
[ 0., 0., 0., 1., 0., -1j ]] ) / np.sqrt(2.)
matTjeffleff = np.dot( np.conjugate(matT), matTlefft2g.transpose() )
a = 0.980031
b = 0.198847
matTjnat = np.matrix( [
[ 1, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 1, 0, 0 ],
[ 0,-a, 0, 0,-b, 0 ],
[ 0, 0, a, 0, 0,-b ],
[ 0,-b, 0, 0, a, 0 ],
[ 0, 0, b, 0, 0, a ]
] )
#for i in range( len(dataset) ) :
dat = args.mak
print "arg : ", dat
if( dat.find('.mak') > -1 ) :
datfile = dat
print "d : ", datfile
if dat.find("Dir") > -1 :
hobj = headobj( dat.split("/")[-2] )
try :
hobj.readParameters()
except :
pass
try :
hobj.readEcluster()
matTjnat = hobj.returnNatTransf()
except : pass
mclass = makclass( datfile , basis=basis )
if args.t2gph : mclass.setTt2gjeff( matT )
[ eldat , valdat ] = mclass.returnarr()
else :
datfile = "{}/next.mak".format(dat)
hobj = headobj( dat )
try :
hobj.readParameters()
except :
pass
try :
hobj.readEcluster()
matTjnat = hobj.returnNatTransf()
except : pass
if args.count :
count = int(args.count)
datfile = "{}/u{:.2f}_{}th.mak".format(dat, hobj.UF, count )
print "d : ", datfile
mclass = makclass( datfile,basis=basis )
if args.t2gph : mclass.setTt2gjeff( matT )
[ eldat , valdat ] = mclass.returnarr()
mclass.convnparray()
mclass.showNelpn()
vml = mclass.npvmldat ; vl=vml
el = mclass.npeldat
[eln,elp] = [ mclass.neln, mclass.nelp ]
if basis =="e" :
pass
else :
deltanumersum = mclass.returnDeltanumersum()
print "vl ", np.shape(vl), " :"
#print vl
print "el ", np.shape(el), " :"
#print el
if args.extractandsave :
print "vl ", np.shape(vl), " :"
print vl
print "el ", np.shape(el), " :"
print el
fname_param_save = hobj.tdir + "/D{:g}_vml.dat".format(hobj.D) ; print "Saving : ", fname_param_save
np.savetxt( fname_param_save, vl )
dumdat = np.loadtxt( fname_param_save, dtype=complex )
print "cheking :: ", np.abs( vl - dumdat )
fname_param_save = hobj.tdir + "/D{:g}_el.dat".format(hobj.D) ; print "Saving : ", fname_param_save
np.savetxt( fname_param_save, el )
dumdat = np.loadtxt( fname_param_save )
print "cheking :: ", np.abs( el - dumdat )
exit(1)
if args.shownumer :
#print "Deltanumersum in jeff's (before rotation) : "
#print deltanumersum
#print "Deltanumersum in t2g's (after rotation) : "
#print deltanumersumt2g
deltanumersumt2g = transfMjefftot2g( deltanumersum, matT )
deltanumersumnat = transfMt2gtojeff( deltanumersum, matTjnat )
print "deltanumersum " ; printArrMat( deltanumersum )
print "deltanumersumt2g" ; printArrMat( deltanumersumt2g )
print "deltanumersumnat" ; printArrMat( deltanumersumnat )
#def printArrMat( arrMat ) :
# for i in range(nbasis) :
# for j in range(nbasis) :
# print "{:17.5f} ".format(arrMat[i][j]),
# print ""
#def printArrMat( arrMat ) :
# for i in range(nbasis) :
# for j in range(nbasis) :
# print "{:17.5f} ".format(arrMat[i][j]),
# print ""
#deltawn = mclass.returnCalcDelta( -6 )
#print "deltawn" ; printArrMat( deltawn )
def printCompVmlel( vl, el ) :
for j in range(len(vl[0])) :
for i in range(nbasis) :
print "{:19.6f} ".format( vl[i][j] ),
print "| {:9.6f}".format( el[j] )
def printAbsVmlel( vl, el ) :
for j in range(len(vl[0])) :
for i in range(nbasis) :
print "{:9.6f} ".format( np.abs(vl[i][j]) ),
print "| {:9.6f}".format( el[j] )
def printAbsVmlelnpmat( vl, el ) :
for j in range(np.shape(vl)[1]) :
for i in range(nbasis) :
print "{:9.6f} ".format( np.abs(vl[i,j]) ),
print "| {:9.6f}".format( el[j] )
def printAbsSumVmlel( vl, el ) :
for j in range(len(vl[0])) :
for i in range(nbasis) :
print "{:9.6f} ".format( np.abs(vl[i][j]) ),
print "| {:9.6f} | ".format( el[j] ),
dumsum = 0
for i in range(nbasis/2) :
print "{:9.6f} ".format( np.abs(vl[2*i][j]) + np.abs(vl[2*i+1][j]) ),
dumsum += np.abs(vl[2*i][j]) + np.abs(vl[2*i+1][j])
print "| ",
print "{:9.6f} ".format( dumsum )
if args.unsort :
print "Vml | el (unsorted,read) : " ; printAbsVmlel(vml,el)
if args.comp :
printCompVmlel( mclass.npvmldat ,el )
wrtag = ""
if args.factor :
fact = float(args.factor)
mclass.npvmldat *= fact
vml = mclass.npvmldat ; vl=vml
mclass.npeldat *= fact
el = mclass.npeldat
wrtag = "_fact{}".format(args.factor)
#print "Vjl | el : " ; printAbsVmlel(vl,el)
#vlsort , elsort = sortVmlel( vl, el )
vlsort , elsort = mclass.sortVmlel( )
if args.nojeff or args.tot2g : pass
else : print "Vml | el (sorted,read) : " ; printAbsVmlel(vlsort,elsort)
if args.comp :
printCompVmlel( mclass.npvmlsort ,elsort)
#print "Vml | el (sorted,read) : " ; printAbsSumVmlel(vlsort,elsort)
#
if args.tot2g :
mclass.toVtl()
mclass.toVtlusort()
if args.unsort :
print "Vtl | el (unsorted): " ; printAbsVmlel( mclass.npvtldatusort ,el )
else :
print "Vtl | el (sorted): " ; printAbsVmlel( mclass.npvtldat ,elsort)
if args.comp :
if args.unsort :
printCompVmlel( mclass.npvtldatusort ,el )
else :
printCompVmlel( mclass.npvtldat ,elsort)
a = np.abs( mclass.npvtldat[0][0] )
b = np.abs( mclass.npvtldat[1][0] )
c = mclass.npvtldat[1][0] / mclass.npvtldat[1][1]
#print "c : ", c
#print "0 : ", ["{:19.6f}".format( mclass.npvtldat[0][0] ) , "{:19.6f}".format( mclass.npvtldat[1][0] ) ]
#print "1 : ", ["{:19.6f}".format( mclass.npvtldat[0][1] ) , "{:19.6f}".format( mclass.npvtldat[1][1] ) ]
#print "0' : ", ["{:19.6f}".format( mclass.npvtldat[0][0] - mclass.npvtldat[0][1]*c ) , "{:19.6f}".format( mclass.npvtldat[1][0] - mclass.npvtldat[1][1]*c ) ]
#print "1' : ", ["{:19.6f}".format( mclass.npvtldat[0][0]*np.conj(c) + mclass.npvtldat[0][1] ) , "{:19.6f}".format( mclass.npvtldat[1][0]*np.conj(c) + mclass.npvtldat[1][1] ) ]
if args.write :
mclass.writemaksort( "npvtldat" , "_t2g"+wrtag )
if args.toj :
print "T : "
printNpMat( mclass.Tt2gjeff )
print ""
mclass.toVjl()
print "Vjl | el (sorted,read) : " ; printAbsVmlel(mclass.npvjldat,elsort)
if args.comp :
print "Vjl | el (sorted,read,complex) : " ; printCompVmlel(mclass.npvjldat,el)
if args.write :
mclass.writemaksort( "npvjldat" , "_jeff"+wrtag )
if args.ton :
mclass.toVnl()
#print "Vnl | el : " ; printAbsVmlel(mclass.npvnldat,el)
mclass.npvnldat , mclass.npeldat = sortVmlel( mclass.npvnldat, el )
print "Vnl | el (sorted): " ; printAbsVmlel( mclass.npvnldat ,elsort)
if args.comp :
printCompVmlel( mclass.npvnldat ,elsort)
if args.write :
mclass.writemaksort( "npvnldat" , "_nat"+wrtag )
if args.tojfromn :
mclass.toVjlfromnat()
if args.comp :
printCompVmlel( mclass.npvjldat ,elsort)
if args.write :
mclass.writemaksort( "npvjldat" , "_jefffromnat"+wrtag )
if args.toleff :
mclass.toVfromjeff( matTjeffleff )
if args.comp :
printCompVmlel( mclass.npvfromjeff ,el )
if args.write :
mclass.writemak( "npvleff" , "_lefffromjeff"+wrtag )
print "Vleffl | el (unsorted): " ; printAbsVmlel( mclass.npvfromjeff ,el )
if args.write :
mclass.sortVmlel()
mclass.writemaksort( "npvmlsort" , "_sort"+wrtag )
def dotArrNpmat( Arr, N , dim ) :
resArr = np.zeros( (dim,dim) , dtype=complex)
for mu in range(dim) :
for nu in range(dim) :
for lu in range(dim) :
resArr[mu][nu] += Arr[mu][lu] * N[lu,nu]
return resArr
def dotArrArr( Arr, Arr2 , dim ) :
resArr = np.zeros( (dim,dim) , dtype=complex)
for mu in range(dim) :
for nu in range(dim) :
for lu in range(dim) :
resArr[mu][nu] += Arr[mu][lu] * Arr2[lu][nu]
return resArr
if args.mak.find("Dir")>-1 :
try :
Eclusterjeff= hobj.readEclustersoc()
Eclustert2g = hobj.readEclustersoct2g()
except : pass
if args.showe :
print "Ecluster : " ; printArrMat( Eclusterjeff )
if args.tot2g :
print "Eclustert2g : " ; printArrMat( Eclustert2g )
if args.toj :
print "Eclusterjeff : " ; printArrMat( Eclusterjeff )
if args.ton :
Eclusternat = hobj.readEclustersocnat()
print "Eclusternat : " ; printArrMat( Eclusternat )
if args.toleff :
Eclusterleff = dotArrArr( matTjeffleff.transpose() , dotArrArr(Eclusternat,np.conjugate(matTjeffleff)) )
print "Eclusterleff : " ; printArrMat( Eclusterleff )
bathftn = mclass.returnBathftn()
if args.showbathftn :
print "Bathftn : "
printAbsArrMatdim( bathftn , len(bathftn) )
if args.diagbathftn :
w, v = LA.eig( np.matrix(bathftn) )
print "w : \n", w.real
vmldiagb = np.dot( np.matrix(vlsort) , v )
#testdiagb = np.dot( v.transpose().conjugate() , np.dot( np.matrix(bathftn) , v ) ) ; print np.diag( testdiagb ).real
elsortmat = np.diag( np.array(elsort) )
elsortdiagb = np.dot( v.transpose().conjugate(), np.dot( elsortmat , v ) )
print "elsortdiagb : \n", elsortdiagb[0]
if args.c4rot :
c4VmlMat = c4rotVml( mclass.npvmlsort, "j" )
#print "c4VmlMat : ", c4VmlMat
print "c4VmlMat : "
printAbsVmlelnpmat( c4VmlMat,elsort)
if args.comp :
printCompVmlelnp( c4VmlMat, elsort )
if args.tot2g :
c4VmlMatt2g = c4rotVml( mclass.npvtldat, "t" )
print "c4VmlMatt2g : "
printAbsVmlelnpmat( c4VmlMatt2g,elsort)
if args.comp :
printCompVmlelnp( c4VmlMatt2g, elsort )
if args.c4rotwrite :
setattr( mclass , "c4VmlMat" , c4VmlMat )
mclass.writenpmaksort( "c4VmlMat" , "_c4rot"+wrtag )
if args.mak.find("Dir")>-1 : hobj = headobj( args.mak.split("/")[0] ) ; hobj.readParameters() ; nmax = hobj.Nmax ; beta = hobj.beta
else : nmax = 512 ; beta=128
if args.nmax : nmax = args.nmax
if args.beta : beta = args.beta
print "beta : ", beta
print "nmax : ", nmax
if args.Matrix :
#printCompVmlel( mclass.npvmldat ,mclass.npeldat)
if args.iw :
a = int( args.Matrix )
wi = 1./beta * (2*a+1) * np.pi
print "wi ; ", wi
print "Deltaiw {}".format( int(args.Matrix) ) ; printArrMat( mclass.returnDeltaiw(wi) )
else :
a = int( args.Matrix )
wn = np.linspace(-6,6,1025)
print "wi ; ", wn[a]
print "Deltaw {}".format( int(args.Matrix) ) ; printArrMat( mclass.returnDeltaw(wn[a]) )
checkcomparr = [ #for purely 2-4 block-diagonal in jeff
[0,1], [0,2], [0,4], [0,5],
[1,3],
[2,3],
[3,4], [3,5],
]
def checknnz( Mcomp, nzind, nnz, nzMat , a ) :
for ij in checkcomparr :
i = ij[0]
j = ij[1]
nnz = 0
d = Mcomp[i][j]
t = Mcomp[j][i]
nzind = ""
if abs(d.real)> 1e-4 :
nzMat[i][j] += d.real
nzind += "[r{}{}] ".format(i,j)
nnz+=1
if abs(d.imag)> 1e-4 :
nzMat[i][j] += d.imag
nzind += "[i{}{}] ".format(i,j)
nnz+=1
if abs(t.real)> 1e-4 :
nzMat[j][i] += t.real
nzind += "[r{}{}] ".format(j,i)
nnz+=1
if abs(t.imag)> 1e-4 :
nzMat[j][i] += t.imag
nzind += "[i{}{}] ".format(j,i)
nnz+=1
if nnz > 0 :
nzind2 = ""
nzind2 = "i{}; ".format(a) + nzind2
nzind2 += "absij={}; ".format(abs(d))
nzind2 += "absji={};".format(abs(t))
nzind2 += "nnz={};\t".format(nnz)
nzind = nzind2+nzind
if args.printnnz :
print nzind
if args.printnnzmat :
printArrMatdim( Mcomp, nbasis )
if args.cnnz :
nnzsum = 0
nzMat = np.array( [ [ 0 for i in range(6) ] for j in range(6) ] , dtype=complex)
hybw = []
if args.iw :
nplot = nmax
ii = range(nplot)
wi = range(nplot)
for a in ii :
wi[a] = 1./beta * (2*a+1) * np.pi
Diw = mclass.returnDeltaiw(wi[a])
nzind = "" ; nnz=0 ;
checknnz( Diw, nzind, nnz, nzMat , a) ; nnzsum += nnz
print "iwn : {} to {} ".format( wi[0] , wi[-1] )
wn = wi
else :
nplot = 1025
ii = range(nplot)
wn = np.linspace(-6,6,nplot)
for a in ii :
Dw = mclass.returnDeltaw(wn[a])
nzind = "" ; nnz=0 ;
checknnz( Dw, nzind, nnz, nzMat , a) ; nnzsum += nnz
#hybw.append( Dw[0][0].real )
print "wn : {} to {} ".format( wn[0], wn[-1] )
#print "hybw : ", len(hybw)
#fig, ax = plt.subplots()
#ax.plot( hybw, wn, 'k-o' , ms=2 )
#ax.set_ylim( -2,2)
#plt.show()
#print "(nzMat)" ; printArrMat( nzMat )
def pp(aa) :
if aa==np.nan :
print "{:30}".format(aa),
elif np.abs(aa.real)<1e-15 and np.abs(aa.imag)<1e-15 :
print "{:>30}".format("."),
else :
print "{:>30.8g}".format(aa),
def ppr(aa) :
if aa==np.nan :
print "{:22}".format(aa),
else :
print "{:19.8f}".format(aa),
def convRadianinpi( z ) :
try :
return np.angle(z) / np.pi
except :
return np.nan
def relativeangle( v, mu1, l1, mu2, l2 , p="") :
try :
v2=v[mu2][l2]
if np.abs(v2)<1e-6 :
dd=np.nan
else :
dd= convRadianinpi( v[mu1][l1]/v[mu2][l2] )
if p.find("print") >-1 :
pp(dd)
return dd
except :
if p.find("print") >-1 :
print np.nan,
return np.nan
def printrelativeangle( v, mu1, l1, mu2, l2 ) :
try :
v2=v[mu2][l2]
if np.abs(v2)<1e-6 :
dd=np.nan
else :
dd = convRadianinpi( v[mu1][l1] / v[mu2][l2] )
pp(dd)
return dd
except :
return np.nan
def relativeconjangle( v, mu1, l1, mu2, l2 , p="" ) :
try :
v2=v[mu2][l2]
if np.abs(v2)<1e-6 :
dd=np.nan
else :
dd = convRadianinpi( v[mu1][l1] / (v[mu2][l2].conjugate()) )
if p.find("print") >-1 :
pp(dd)
return dd
except :
if p.find("print") >-1 :
print np.nan,
return np.nan
def printrelativeconjangle( v, mu1, l1, mu2, l2 ) :
try :
v2=v[mu2][l2]
if np.abs(v2)<1e-6 :
dd=np.nan
else :
dd = convRadianinpi( v[mu1][l1] / (v[mu2][l2].conjugate()) )
pp(dd)
return dd
except :
return np.nan
def printdiffangleC4( v, mu1, l1, mu2, l2 ) :
try :
th1 = convRadianinpi( v[mu1][l1] / (v[mu2][l2]) )
th2 = convRadianinpi( v[mu2][l1] / (v[mu1][l2]) )
pp(th1-th2)
return th1-th2
except :
return np.nan
def printdiffconjangleTrev( v, mu1, l1, mu2, l2 ) :
try :
th1 = convRadianinpi( v[mu1][l1] / (v[mu2][l2].conjugate()) )
th2 = convRadianinpi( v[mu2][l1] / (v[mu1][l2].conjugate()) )
pp(th1-th2)
return th1-th2
except :
return np.nan
def ratio( v, mu1, l1, mu2, l2 , p="" ) :
try :
if np.abs( v[mu1][l1] ) < 1e-3 or np.abs( v[mu2][l2] ) < 1e-3 :
dd = np.nan
else :
dd = v[mu1][l1] / v[mu2][l2]
if p.find("print")>-1 :
ppr(dd)
return dd
except :
return np.nan
def conjratio( v, mu1, l1, mu2, l2 , p="" ) :
try :
if np.abs( v[mu1][l1] ) < 1e-3 or np.abs( v[mu2][l2] ) < 1e-3 :
dd = np.nan
else :
dd = v[mu1][l1] / (v[mu2][l2].conjugate())
if p.find("print")>-1 :
ppr(dd)
return dd
except :
return np.nan
def printratio( v, mu1, l1, mu2, l2 ) :
try :
if np.abs( v[mu1][l1] ) < 1e-3 or np.abs( v[mu2][l2] ) < 1e-3 :
dd = np.nan
else :
dd = v[mu1][l1] / v[mu2][l2]
ppr(dd)
return dd
except :
return np.nan
def printratioabs( v, mu1, l1, mu2, l2 ) :
try :
if np.abs( v[mu1][l1] ) < 1e-3 or np.abs( v[mu2][l2] ) < 1e-3 :
dd = np.nan
else :
dd = np.abs( v[mu1][l1] / v[mu2][l2] )
pp(dd)
return dd
except :
return np.nan
def tf( val1, val2 ) :
dd = np.abs(val1-val2)
if dd <1e-4 :
print "{:10}".format("True"),
else :
print "{:10}".format("False"),
def pairsum(v, mu, nu, l ) :
return v[mu][l] * v[nu][l].conjugate() + v[mu][l+1] * v[nu][l+1].conjugate()
def printpairsum(v, mu, nu, l ) :
dd = v[mu][l] * (v[nu][l].conjugate()) + v[mu][l+1] * (v[nu][l+1].conjugate())
ppr(dd)
return dd
def lsum( v, mu,nu, larr ) :
lsum = 0.
for ll in larr :
lsum += v[mu][ll] * v[nu][ll].conjugate()
return lsum
def cphaseftnselectivet2g( v , elsort ) :
print "Time-reversal condition :: cross-difference of relative-conjugate angle (pi pi pi)"
for l in range(nbath/2) :
print "{:9.6f} {:5d} : ".format(elsort[2*l],2*l) ,
trat0 = [ printrelativeconjangle( v, 0, 2*l, 1, 2*l+1 ) , printrelativeconjangle( v, 0, 2*l+1, 1, 2*l ) ]
trat1 = [ printrelativeconjangle( v, 2, 2*l, 3, 2*l+1 ) , printrelativeconjangle( v, 2, 2*l+1, 3, 2*l ) ]
trat2 = [ printrelativeconjangle( v, 4, 2*l, 5, 2*l+1 ) , printrelativeconjangle( v, 4, 2*l+1, 5, 2*l ) ]
print "|",
pp( trat0[0] - trat0[1] )
pp( trat1[0] - trat1[1] )
pp( trat2[0] - trat2[1] )
print ""
print "Time-reversal condition :: ratio of bath up-dn (-D* D D -D* D -D*)"
for l in range(nbath/2) :
print "{:9.6f} {:5d} : ".format(elsort[2*l],2*l) ,
a0=ratio( v, 0, 2*l, 0, 2*l+1 ,p="print")
b0=ratio( v, 1, 2*l+1, 1, 2*l ,p="print")
a1=ratio( v, 2, 2*l+1, 2, 2*l ,p="print")
b1=ratio( v, 3, 2*l, 3, 2*l+1 ,p="print")
a2=ratio( v, 4, 2*l+1, 4, 2*l ,p="print")
b2=ratio( v, 5, 2*l, 5, 2*l+1 ,p="print")
if np.abs(a0)>1e-4 : D = -a0.conjugate()
elif np.abs(a1)>1e-4 : D = a1
tf( D, -a0.conjugate() )
tf( D, b0 )
tf( D, a1 )
tf( D, -b1.conjugate() )
tf( D, a2 )
tf( D, -b2.conjugate() )
print ""
print "Time-reversal condition :: ratio of orbital up-dn (-D* D* D*)"
for l in range(nbath) :
print "{:9.6f} {:5d} : ".format(elsort[l],l) ,
a0=conjratio( v, 0, l, 1, l ,p="print")
a1=conjratio( v, 3, l, 2, l ,p="print")
a2=conjratio( v, 5, l, 4, l ,p="print")
if np.abs(a0)>1e-4 : D = a0
elif np.abs(a1)>1e-4 : D = -a1
tf( D, a0 )
tf( D, -a1 )
tf( D, -a2 )
print ""
print "C4-rotation condition :: angle of (yz sigma / zx sigma) "
for l in range(nbath) :
print "{:9.6f} {:5d} : ".format(elsort[l],l) ,
printrelativeangle( v, 2, l, 4, l )
printrelativeangle( v, 3, l, 5, l )
print ""
print "C4-rotation condition :: sum_l(pair) of Vmul x Vnul^* (0 for all) :: [0,1], [2,3], [4,5], [0,2], [2,5], [3,4]"
for l in range(nbath/2) :
print "{:9.6f} {:5d} : ".format(elsort[2*l],2*l) ,
sumpair = [ [0,1], [2,3], [4,5], [0,2], [2,5], [3,4] ]
[
printpairsum( v, munu[0], munu[1], 2*l )
for munu in sumpair
]
print ""
print "C4-rotation condition :: exchanging ratio and argument between bath-orbs :: [mu1,ll1;mu2;ll2] , [+1,0;+1,0], [0,+1;0,+1], [+1,+1;+1,+1]"
Nsym = 3
tNC = 6
for l in range(Nsym) :
mu1 = 2
mu2 = 4
ll1 = tNC*l + mu1 ;
ll2 = tNC*l + mu2 ;
print "{:9.6f} {:5d} : ".format(elsort[ll1],ll1) ,
printratio( v, mu1 , ll1 , mu2 , ll2 )
printratio( v, mu1+1, ll1 , mu2+1, ll2 )
printratio( v, mu1 , ll1+1, mu2 , ll2+1 )
printratio( v, mu1+1, ll1+1, mu2+1, ll2+1 )
printrelativeangle( v, mu1 , ll1 , mu2 , ll2 )
printrelativeangle( v, mu1+1, ll1 , mu2+1, ll2 )
printrelativeangle( v, mu1 , ll1+1, mu2 , ll2+1 )
printrelativeangle( v, mu1+1, ll1+1, mu2+1, ll2+1 )
print ""
print "C4-rotation condition :: orbital up-dn ratio and argument in parallel bath-orbs :: [mu1,ll1;mu2;ll1] , [+1,0;+1,0], [0,+1;0,+1], [+1,+1;+1,+1]"
for l in range(Nsym) :
mu1 = 2
mu2 = 4
ll1 = tNC*l + mu1 ;
ll2 = tNC*l + mu2 ;
pairarr = [ [mu1, ll1, mu2, ll1 ],
[mu1+1, ll1, mu2+1, ll1 ],
[mu1 , ll2, mu2, ll2 ],
[mu1+1, ll2, mu2+1, ll2 ] ]
print "{:9.6f} {:5d} : ".format(elsort[ll1],ll1) ,
[ printratio( v, pa[0], pa[1] , pa[2], pa[3] ) for pa in pairarr ]
[ printrelativeangle( v, pa[0], pa[1] , pa[2], pa[3] ) for pa in pairarr ]
print ""
print "C4-rotation condition :: ratio and argument between parallel bath-orbs in each orbital :: [mu1,ll1;mu1;ll2] , [+1,0;+1,0], [0,+1;0,+1], [+1,+1;+1,+1]"
for l in range(Nsym) :
mu1 = 2
mu2 = 4
ll1 = tNC*l + mu1 ;
ll2 = tNC*l + mu2 ;
pairarr = [ [mu1, ll1, mu1, ll2 ],
[mu1+1, ll1, mu1+1, ll2 ],
[mu2 , ll1, mu2, ll2 ],
[mu2+1, ll1, mu2+1, ll2 ] ]
print "{:9.6f} {:5d} : ".format(elsort[ll1],ll1) ,
[ printratio( v, pa[0], pa[1] , pa[2], pa[3] ) for pa in pairarr ]
[ printrelativeangle( v, pa[0], pa[1] , pa[2], pa[3] ) for pa in pairarr ]
print ""
print "C4-rotation condition :: 2nd part of exchanging ratio and argument between bath-orbs :: [mu1,ll2;mu1;ll1] , [+1,0;+1,0], [0,+1;0,+1], [+1,+1;+1,+1]"
Nsym = 3
tNC = 6
for l in range(Nsym) :
mu1 = 2
mu2 = 4
ll1 = tNC*l + mu1 ;
ll2 = tNC*l + mu2 ;
print "{:9.6f} {:5d} : ".format(elsort[ll1],ll1) ,
printratio( v, mu1 , ll2 , mu2 , ll1 )
printratio( v, mu1+1, ll2 , mu2+1, ll1 )
printratio( v, mu1 , ll2+1, mu2 , ll1+1 )
printratio( v, mu1+1, ll2+1, mu2+1, ll1+1 )
printrelativeangle( v, mu1 , ll2 , mu2 , ll1 )
printrelativeangle( v, mu1+1, ll2 , mu2+1, ll1 )
printrelativeangle( v, mu1 , ll2+1, mu2 , ll1+1 )
printrelativeangle( v, mu1+1, ll2+1, mu2+1, ll1+1 )
print ""
def cphaseftnselectivejeff( v , elsort ) :
print "Time-reversal condition :: cross-difference of relative-conjugate angle (pi pi pi)"
for l in range(nbath/2) :
print "{:9.6f} {:5d} : ".format(elsort[2*l],2*l) ,
trevpair = [ [0,3],[1,2],[4,5] ]
[
pp( relativeconjangle( v, munu[0], 2*l, munu[1], 2*l+1 ) - relativeconjangle( v, munu[0], 2*l+1, munu[1], 2*l ) )
for munu in trevpair
]
print ""
print "C4-rotation condition :: ratio of orbital up-dn (S* -S* S*)"
for l in range(nbath) :
print "{:9.6f} {:5d} : ".format(elsort[l],l) ,
a0=conjratio( v, 3, l, 0, l ,p="print")
a1=conjratio( v, 1, l, 2, l ,p="print")
a2=conjratio( v, 4, l, 5, l ,p="print")
if np.abs(a0)>1e-4 : S = a0.conjugate()
elif np.abs(a1)>1e-4 : S = -a1.conjugate()
tf( S, a0.conjugate() )
tf( S, -a1.conjugate() )
tf( S, a2.conjugate() )
print ""
print "C4-rotation condition :: ratio of bath up-dn (S -S* S -S* -S* S)"
for l in range(nbath/2) :
print "{:9.6f} {:5d} : ".format(elsort[2*l],2*l) ,
a0=ratio( v, 0, 2*l+1, 0, 2*l ,p="print")
a1=ratio( v, 1, 2*l , 1, 2*l+1 ,p="print")
b0=ratio( v, 2, 2*l+1, 2, 2*l ,p="print")
b1=ratio( v, 3, 2*l , 3, 2*l+1 ,p="print")
a2=ratio( v, 4, 2*l , 4, 2*l+1 ,p="print")
b2=ratio( v, 5, 2*l+1, 5, 2*l ,p="print")
if np.abs(a0)>1e-4 : S = a0
elif np.abs(a1)>1e-4 : S = -a1.conjugate()
tf( S, a0 )
tf( S, -a1.conjugate() )
tf( S, b0 )
tf( S, -b1.conjugate() )
tf( S, -a2.conjugate() )
tf( S, b2 )
print ""
print "C4-rotation condition :: sum_l(pair) of Vmul x Vnul^* (0 for all)"
for l in range(nbath/2) :
print "{:9.6f} {:5d} : ".format(elsort[2*l],2*l) ,
sumpair = [ [0,3],[1,2],[4,5], [1,5], [0,1],[0,4], [3,5],[2,3] ]
[
printpairsum( v, munu[0], munu[1], 2*l )
for munu in sumpair
]
print ""
def cphaseftnNoSOC( v , elsort ) :
print "\tr(xyu,l/xyd,l+1), r(yzu,l/yzd,l+1), r(zxu,l/zxd,l+1)"
for l in range(nbath/2) :
print "{:9.6f} {:5d} : ".format(elsort[2*l],2*l) ,
printrelativeangle( v, 0, 2*l, 1, 2*l+1 )
printrelativeangle( v, 2, 2*l, 3, 2*l+1 )
printrelativeangle( v, 4, 2*l, 5, 2*l+1 )
print ""
print "\tr(yzu,l/zxu,l), r(yzu,l/yzu,l+2), r(yzu,l/zxu,l+2)"
for l in range(nbath/6) :
ll1 = l*6+2
ll2 = l*6+4
print "{:9.6f} {:5d} : ".format(elsort[ll1],ll1)
print "{:9.6f} {:5d} : ".format(elsort[ll2],ll2) ,
printrelativeangle( v, 2, ll1, 4, ll1 )
printrelativeangle( v, 2, ll1, 2, ll2 )
printrelativeangle( v, 2, ll1, 4, ll2 )
print ""
print "\t sum_l V(mu,l)V(nu,l)^*"
for l in range(nbath/6) :
ll0 = l*6
ll1 = l*6+2
ll2 = l*6+4
print "{:9.6f} {:5d} : ".format(elsort[ll0],ll0)
for mu in range(2) :
print "\t",
for nu in range(2) :
pp( lsum( v, mu, nu, [ll0,ll0+1] ) )
print ""
print "{:9.6f} {:5d} : ".format(elsort[ll1],ll1)
print "{:9.6f} {:5d} : ".format(elsort[ll2],ll2)
for mu in range(4) :
print "\t",
for nu in range(4) :
pp( lsum( v, mu+2, nu+2, [ll1,ll1+1,ll2,ll2+1] ) )
print ""
def cphaseftn( v , elsort ) :
print "\tr(xyu/xyd), r(yzu/yzd), r(yzu/zxu), r(yzu/zxd), r(yzd/zxd), r(zxu/zxd) | anglediff24-35"
for l in range(nbath) :
print "{:9.6f} {:5d} : ".format(elsort[l],l) ,
printrelativeangle( v, 0, l, 1, l )
printrelativeangle( v, 2, l, 3, l )
printrelativeangle( v, 2, l, 4, l )
printrelativeangle( v, 2, l, 5, l )
printrelativeangle( v, 3, l, 5, l )
printrelativeangle( v, 4, l, 5, l )
print "|",
print "{:10.4f}".format( relativeangle( v, 2, l, 4, l ) - relativeangle( v, 3, l, 5, l ) ),
print ""
print "\tr(xyu,l/xyu,l+1), (xyd,l/xyd,l+1), (xyu,l/xyd,l+1 *), (xyd,l/xyu,l+1 *) | crossconjdiff01, 23, 45"
for l in range(nbath/2) :
print "{:9.6f} {:5d} : ".format(elsort[2*l],2*l) ,
printrelativeangle( v, 0, 2*l, 0, 2*l+1 )
printrelativeangle( v, 1, 2*l, 1, 2*l+1 )
printrelativeconjangle( v, 0, 2*l, 1, 2*l+1 )
printrelativeconjangle( v, 1, 2*l, 0, 2*l+1 )
print "|",
printdiffconjangleTrev( v, 0, 2*l, 1, 2*l+1 )
printdiffconjangleTrev( v, 2, 2*l, 3, 2*l+1 )
printdiffconjangleTrev( v, 4, 2*l, 5, 2*l+1 )
print ""
print "\trat(xyu,l/xyu,l+1), (yzu,l+1/yzu,l), (zxu,l+1/zxu,l), (xyd,l/xyd,l+1), (yzd,l+1/yzd,l), (zxd,l+1/zxd,l), (yzu,l/yzu,l+1), (yzd,l/yzd,l+1) "
for l in range(nbath/2) :
print "{:9.6f} {:5d} : ".format(elsort[2*l],2*l) ,
printratio( v, 0, 2*l, 0, 2*l+1 )
printratio( v, 2, 2*l+1, 2, 2*l )
printratio( v, 4, 2*l+1, 4, 2*l )
printratio( v, 1, 2*l, 1, 2*l+1 )
printratio( v, 3, 2*l+1, 3, 2*l )
printratio( v, 5, 2*l+1, 5, 2*l )
printratio( v, 2, 2*l, 2, 2*l+1 )
printratio( v, 3, 2*l, 3, 2*l+1 )
print ""
print "\trat(xyu,xyd), (yzu,yzd), (zxu,zxd), (xyu/yzu), (yzu/zxu), (xyd/yzd), (yzd/zxd)"
for l in range(nbath) :
print "{:9.6f} {:5d} : ".format(elsort[l],l) ,
printratio( v, 0, l, 1, l )
printratio( v, 2, l, 3, l )
printratio( v, 4, l, 5, l )
printratio( v, 0, l, 2, l )
printratio( v, 2, l, 4, l )
printratio( v, 1, l, 3, l )
printratio( v, 3, l, 5, l )
print ""
print "e1-e2"
print " xyu0/xyd0 xyu1/xyd1 xyu0/xyu1 xyd0/xyd1 xyu0/xyd1 xyd0/xyu1"
aa = [
printrelativeangle( v, 0, 0, 1, 0 ) ,
printrelativeangle( v, 0, 1, 1, 1 ) ,
printrelativeangle( v, 0, 0, 0, 1 ) ,
printrelativeangle( v, 1, 0, 1, 1 ) ,
printrelativeangle( v, 0, 0, 1, 1 ) ,
printrelativeangle( v, 1, 0, 0, 1 ) ]
print "|",
[ pp( aa[i]-aa[i+1] ) for i in [0,2,4] ]
[ pp( aa[i]+aa[i+1] ) for i in [0,2,4] ]
print ""
aa = [
printrelativeconjangle( v, 0, 0, 1, 0 ) ,
printrelativeconjangle( v, 0, 1, 1, 1 ) ,
printrelativeconjangle( v, 0, 0, 0, 1 ) ,
printrelativeconjangle( v, 1, 0, 1, 1 ) ,
printrelativeconjangle( v, 0, 0, 1, 1 ) ,
printrelativeconjangle( v, 1, 0, 0, 1 ) ]
print "|",
[ pp( aa[i]-aa[i+1] ) for i in [0,2,4] ]
[ pp( aa[i]+aa[i+1] ) for i in [0,2,4] ]
print ""
print " yzu2/yzd2 yzu3/yzd3 yzu2/yzu3 yzd2/yzd3 yzu2/yzd3 yzd2/yzu3"
aa = [
printrelativeangle( v, 2, 2, 3, 2 ) ,
printrelativeangle( v, 2, 3, 3, 3 ) ,
printrelativeangle( v, 2, 2, 2, 3 ) ,
printrelativeangle( v, 3, 2, 3, 3 ) ,
printrelativeangle( v, 2, 2, 3, 3 ) ,
printrelativeangle( v, 3, 2, 2, 3 ) ]
print "|",
[ pp( aa[i]-aa[i+1] ) for i in [0,2,4] ]
[ pp( aa[i]+aa[i+1] ) for i in [0,2,4] ]
print ""
aa = [
printrelativeconjangle( v, 2, 2, 3, 2 ) ,
printrelativeconjangle( v, 2, 3, 3, 3 ) ,
printrelativeconjangle( v, 2, 2, 2, 3 ) ,
printrelativeconjangle( v, 3, 2, 3, 3 ) ,
printrelativeconjangle( v, 2, 2, 3, 3 ) ,
printrelativeconjangle( v, 3, 2, 2, 3 ) ]
print "|",
[ pp( aa[i]-aa[i+1] ) for i in [0,2,4] ]
[ pp( aa[i]+aa[i+1] ) for i in [0,2,4] ]
print ""
print " zxu4/zxd4 zxu5/zxd5 zxu4/zxu5 zxd4/zxd5 zxu4/zxd5 zxd4/zxu5"
aa = [
printrelativeangle( v, 4, 4, 5, 4 ) ,
printrelativeangle( v, 4, 5, 5, 5 ) ,
printrelativeangle( v, 4, 4, 4, 5 ) ,
printrelativeangle( v, 5, 4, 5, 5 ) ,
printrelativeangle( v, 4, 4, 5, 5 ) ,
printrelativeangle( v, 5, 4, 4, 5 ) ]
print "|",
[ pp( aa[i]-aa[i+1] ) for i in [0,2,4] ]
[ pp( aa[i]+aa[i+1] ) for i in [0,2,4] ]
print ""
aa = [
printrelativeconjangle( v, 4, 4, 5, 4 ) ,
printrelativeconjangle( v, 4, 5, 5, 5 ) ,
printrelativeconjangle( v, 4, 4, 4, 5 ) ,
printrelativeconjangle( v, 5, 4, 5, 5 ) ,
printrelativeconjangle( v, 4, 4, 5, 5 ) ,
printrelativeconjangle( v, 5, 4, 4, 5 ) ]
print "|",
[ pp( aa[i]-aa[i+1] ) for i in [0,2,4] ]
[ pp( aa[i]+aa[i+1] ) for i in [0,2,4] ]
print ""
def cphaseftnjeff( v , elsort ) :
# print "T(qq+/qq-), T(qd+/qd-), T(d+/d-)"
# for l in range(nbath/2) :
# print "{:9.6f} {:5d} : ".format(elsort[2*l],2*l) ,
# printdiffconjangleTrev( v, 0, 2*l, 3, 2*l+1 )
# printdiffconjangleTrev( v, 1, 2*l, 2, 2*l+1 )
# printdiffconjangleTrev( v, 4, 2*l, 5, 2*l+1 )
# print ""
# print "\trat(qq+,l/qq+,l+1), (qd+,l+1/qd+,l), (dd+,l+1/dd+,l), (qq-,l/qq-,l+1), (qd-,l+1/qd-,l), (dd-,l+1/dd-,l)"
# for l in range(nbath/2) :
# print "{:9.6f} {:5d} : ".format(elsort[2*l],2*l) ,
# printratio( v, 0, 2*l, 0, 2*l+1 )
# printratio( v, 1, 2*l, 1, 2*l+1 )
# printratio( v, 4, 2*l, 4, 2*l+1 )
# printratio( v, 3, 2*l+1, 3, 2*l )
# printratio( v, 2, 2*l+1, 2, 2*l )
# printratio( v, 5, 2*l+1, 5, 2*l )
# print ""
print "\t sum_l V(mu,l)V(nu,l)^* (mu,nu of {alpha=q3/2,gamma=q1/2,beta=d1/2})"
for l in range(nbath/6) :
ll0 = l*6
ll1 = l*6+2
ll2 = l*6+4
print "{:9.6f} {:5d} : ".format(elsort[ll0],ll0)
indalphagammabeta = [0,3,1,2,4,5]
for mu in indalphagammabeta :
print "\t",
for nu in indalphagammabeta :
pp( lsum( v, mu, nu, [ll0,ll0+1] ) )
print ""
print "{:9.6f} {:5d} : ".format(elsort[ll1],ll1)
print "{:9.6f} {:5d} : ".format(elsort[ll2],ll2)
for mu in indalphagammabeta :
print "\t",
for nu in indalphagammabeta :
pp( lsum( v, mu, nu, [ll1,ll1+1,ll2,ll2+1] ) )
print ""
if (args.cphase and args.tot2g) :
print type(mclass.npvtldat) , np.shape(mclass.npvtldat)
nbath = np.shape(mclass.npvtldat)[1]
if args.unsort :
v = mclass.npvtldatusort
dumel = el
else :
v = mclass.npvtldat
dumel = elsort
cphaseftn( v, dumel )
elif args.cphasenosoc and args.tot2g :
print type(mclass.npvtldat) , np.shape(mclass.npvtldat)
nbath = np.shape(mclass.npvtldat)[1]
if args.unsort :
v = mclass.npvtldatusort
dumel = el