forked from ghwatson/casini_corners
-
Notifications
You must be signed in to change notification settings - Fork 0
/
2dlatticebosons.nb
771 lines (761 loc) · 37 KB
/
2dlatticebosons.nb
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
(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 9.0' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 157, 7]
NotebookDataLength[ 37680, 762]
NotebookOptionsPosition[ 37325, 746]
NotebookOutlinePosition[ 37751, 763]
CellTagsIndexPosition[ 37708, 760]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[
RowBox[{
RowBox[{"(*", " ",
RowBox[{
"This", " ", "code", " ", "computes", " ", "the", " ", "Renyi", " ",
"Entanglement", " ", "Entropy", " ", "for", " ", "2", "d", " ", "lattice",
" ", "bosons", " ", "in", " ", "various", " ",
RowBox[{
RowBox[{"Torus", "/", "Cylinder"}], "/", "Rectangle"}], " ",
"geometries"}], " ", "*)"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"Tri", " ", "=", "False"}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"perx", "=", "True"}], ";",
RowBox[{"pery", "=", "True"}], ";"}], " ",
RowBox[{"(*", " ",
RowBox[{
"PBC", " ", "or", " ", "not", " ", "along", " ", "the", " ", "x", " ",
"and", " ", "y", " ", "direction"}], " ", "*)"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"massterm", "=", "0.001"}], ";",
RowBox[{"renyi", "=", "2"}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"four", "=", "4."}], ";",
RowBox[{"one", "=", "1."}], ";",
RowBox[{"two", "=", "2."}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"For", "[",
RowBox[{
RowBox[{"L", "=", "104"}], ",",
RowBox[{"L", "\[LessEqual]", "104"}], ",", " ",
RowBox[{"L", "+=", "8"}], ",", "\[IndentingNewLine]",
RowBox[{
RowBox[{"ti", "=",
RowBox[{"SessionTime", "[", "]"}]}], ";", "\[IndentingNewLine]",
RowBox[{"Lx", "=", "L"}], ";",
RowBox[{"Ly", "=", "L"}], ";",
RowBox[{"Ns", "=",
RowBox[{"Lx", "*", "Ly"}]}], ";", "\[IndentingNewLine]",
RowBox[{
RowBox[{"site", "[",
RowBox[{"x_", ",", "y_"}], "]"}], ":=",
RowBox[{"x", "+",
RowBox[{
RowBox[{"(",
RowBox[{"y", "-", "1"}], ")"}], "*", "Lx"}]}]}], ";",
"\[IndentingNewLine]",
RowBox[{"(*", " ",
RowBox[{
RowBox[{"Hopping", " ", "K", " ", "matrix"}], ",", " ",
RowBox[{"as", " ", "in", " ",
RowBox[{"Casini", "/", "Huerta"}]}], ",", " ",
RowBox[{
"JPhysA", " ", "entanglement", " ", "entropy", " ", "special", " ",
"issue"}]}], " ", "*)"}], "\[IndentingNewLine]",
RowBox[{"K", "=",
RowBox[{"Table", "[",
RowBox[{"0", ",",
RowBox[{"{",
RowBox[{"i", ",", "1", ",", "Ns"}], "}"}], ",",
RowBox[{"{",
RowBox[{"j", ",", "1", ",", "Ns"}], "}"}]}], "]"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"For", "[",
RowBox[{
RowBox[{"x", "=", "1"}], ",",
RowBox[{"x", "\[LessEqual]", "Lx"}], ",",
RowBox[{"x", "++"}], ",", "\[IndentingNewLine]",
RowBox[{
RowBox[{"For", "[",
RowBox[{
RowBox[{"y", "=", "1"}], ",",
RowBox[{"y", "\[LessEqual]", "Ly"}], ",",
RowBox[{"y", "++"}], ",", "\[IndentingNewLine]",
RowBox[{
RowBox[{"If", "[",
RowBox[{"Tri", ",",
RowBox[{
RowBox[{
RowBox[{"K", "[",
RowBox[{"[",
RowBox[{
RowBox[{"site", "[",
RowBox[{"x", ",", "y"}], "]"}], ",",
RowBox[{"site", "[",
RowBox[{"x", ",", "y"}], "]"}]}], "]"}], "]"}], "=",
RowBox[{"four", "+", "two", "+",
RowBox[{"massterm", "^", "2"}]}]}], ";"}], ",", " ",
RowBox[{
RowBox[{
RowBox[{"K", "[",
RowBox[{"[",
RowBox[{
RowBox[{"site", "[",
RowBox[{"x", ",", "y"}], "]"}], ",",
RowBox[{"site", "[",
RowBox[{"x", ",", "y"}], "]"}]}], "]"}], "]"}], "=",
RowBox[{"four", "+",
RowBox[{"massterm", "^", "2"}]}]}], ";"}]}], "]"}], ";",
"\[IndentingNewLine]",
RowBox[{"xp", "=",
RowBox[{"Mod", "[",
RowBox[{
RowBox[{"x", "+", "1"}], ",", "Lx", ",", "1"}], "]"}]}], ";",
RowBox[{"yp", "=",
RowBox[{"Mod", "[",
RowBox[{
RowBox[{"y", "+", "1"}], ",", "Ly", ",", "1"}], "]"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"xd", "=",
RowBox[{"Mod", "[",
RowBox[{
RowBox[{"x", "+",
RowBox[{"(",
RowBox[{
RowBox[{"(",
RowBox[{"-", "1"}], ")"}], "^",
RowBox[{"(", "yp", ")"}]}], ")"}]}], ",", "Lx", ",", "1"}],
"]"}]}], ";", "\[IndentingNewLine]",
RowBox[{"If", "[",
RowBox[{
RowBox[{
RowBox[{"xp", ">", "x"}], " ", "||", " ", "perx"}], ",",
RowBox[{
RowBox[{
RowBox[{"K", "[",
RowBox[{"[",
RowBox[{
RowBox[{"site", "[",
RowBox[{"xp", ",", "y"}], "]"}], ",",
RowBox[{"site", "[",
RowBox[{"x", ",", "y"}], "]"}]}], "]"}], "]"}], "=",
RowBox[{"-", "one"}]}], ";",
RowBox[{
RowBox[{"K", "[",
RowBox[{"[",
RowBox[{
RowBox[{"site", "[",
RowBox[{"x", ",", "y"}], "]"}], ",",
RowBox[{"site", "[",
RowBox[{"xp", ",", "y"}], "]"}]}], "]"}], "]"}], "=",
RowBox[{"-", "one"}]}], ";"}]}], "]"}], ";",
"\[IndentingNewLine]",
RowBox[{"If", "[",
RowBox[{
RowBox[{
RowBox[{"yp", ">", "y"}], " ", "||", " ", "pery"}], ",",
RowBox[{
RowBox[{
RowBox[{"K", "[",
RowBox[{"[",
RowBox[{
RowBox[{"site", "[",
RowBox[{"x", ",", "yp"}], "]"}], ",",
RowBox[{"site", "[",
RowBox[{"x", ",", "y"}], "]"}]}], "]"}], "]"}], "=",
RowBox[{"-", "one"}]}], ";",
RowBox[{
RowBox[{"K", "[",
RowBox[{"[",
RowBox[{
RowBox[{"site", "[",
RowBox[{"x", ",", "y"}], "]"}], ",",
RowBox[{"site", "[",
RowBox[{"x", ",", "yp"}], "]"}]}], "]"}], "]"}], "=",
RowBox[{"-", "one"}]}], ";"}]}], "]"}], ";",
"\[IndentingNewLine]",
RowBox[{"If", "[",
RowBox[{
RowBox[{"Tri", "&&",
RowBox[{"(",
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"xp", ">", "x"}], " ", "&&", " ",
RowBox[{"yp", ">", "y"}]}], ")"}], "||",
RowBox[{"(",
RowBox[{"perx", " ", "&&", "pery"}], ")"}]}], ")"}]}], ",",
RowBox[{
RowBox[{
RowBox[{"K", "[",
RowBox[{"[",
RowBox[{
RowBox[{"site", "[",
RowBox[{"xd", ",", "yp"}], "]"}], ",",
RowBox[{"site", "[",
RowBox[{"x", ",", "y"}], "]"}]}], "]"}], "]"}], "=",
RowBox[{"-", "one"}]}], ";",
RowBox[{
RowBox[{"K", "[",
RowBox[{"[",
RowBox[{
RowBox[{"site", "[",
RowBox[{"x", ",", "y"}], "]"}], ",",
RowBox[{"site", "[",
RowBox[{"xd", ",", "yp"}], "]"}]}], "]"}], "]"}], "=",
RowBox[{"-", "one"}]}], " ", ";"}]}], " ", "]"}], ";"}]}],
"\[IndentingNewLine]", "]"}], ";"}]}], "\[IndentingNewLine]",
"]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{"If", "[",
RowBox[{
RowBox[{"(",
RowBox[{"Tri", "&&", "pery", "&&",
RowBox[{"!", "perx"}]}], ")"}], ",", "\[IndentingNewLine]",
RowBox[{
RowBox[{"y", "=", "Ly"}], ";",
RowBox[{"Print", "[", "y", "]"}], ";", "\[IndentingNewLine]",
RowBox[{"For", "[",
RowBox[{
RowBox[{"x", "=", "1"}], ",",
RowBox[{"x", "<", "Lx"}], ",",
RowBox[{"x", "++"}], ",", "\[IndentingNewLine]",
RowBox[{
RowBox[{"xp", "=",
RowBox[{"Mod", "[",
RowBox[{
RowBox[{"x", "+", "1"}], ",", "Lx", ",", "1"}], "]"}]}], ";",
RowBox[{"yp", "=", "1"}], ";", "\[IndentingNewLine]",
RowBox[{"xd", "=",
RowBox[{"Mod", "[",
RowBox[{
RowBox[{"x", "+",
RowBox[{"(",
RowBox[{
RowBox[{"(",
RowBox[{"-", "1"}], ")"}], "^",
RowBox[{"(", "yp", ")"}]}], ")"}]}], ",", "Lx", ",", "1"}],
"]"}]}], ";", "\[IndentingNewLine]",
RowBox[{
RowBox[{"K", "[",
RowBox[{"[",
RowBox[{
RowBox[{"site", "[",
RowBox[{"xd", ",", "yp"}], "]"}], ",",
RowBox[{"site", "[",
RowBox[{"x", ",", "y"}], "]"}]}], "]"}], "]"}], "=",
RowBox[{"-", "one"}]}], ";",
RowBox[{
RowBox[{"K", "[",
RowBox[{"[",
RowBox[{
RowBox[{"site", "[",
RowBox[{"x", ",", "y"}], "]"}], ",",
RowBox[{"site", "[",
RowBox[{"xd", ",", "yp"}], "]"}]}], "]"}], "]"}], "=",
RowBox[{"-", "one"}]}], " ", ";"}]}], " ", "]"}], ";"}]}],
"\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]",
"\[IndentingNewLine]",
RowBox[{"(*", " ",
RowBox[{"Diagonalization", ",", " ",
RowBox[{
"to", " ", "obtain", " ", "the", " ", "full", " ", "X", " ", "and",
" ", "P", " ", "correlators"}]}], " ", "*)"}],
"\[IndentingNewLine]",
RowBox[{"Evec", "=",
RowBox[{"Eigenvectors", "[", "K", "]"}]}], ";",
RowBox[{"Eval", "=",
RowBox[{"Eigenvalues", "[", "K", "]"}]}], ";", "\[IndentingNewLine]",
RowBox[{"P", "=",
RowBox[{
RowBox[{"1", "/", "2"}], "*",
RowBox[{
RowBox[{"Transpose", "[", "Evec", "]"}], ".",
RowBox[{"DiagonalMatrix", "[",
RowBox[{"Sqrt", "[", "Eval", "]"}], "]"}], ".", "Evec"}]}]}], ";",
"\[IndentingNewLine]",
RowBox[{"X", "=",
RowBox[{
RowBox[{"1", "/", "2"}], "*",
RowBox[{
RowBox[{"Transpose", "[", "Evec", "]"}], ".",
RowBox[{"DiagonalMatrix", "[",
RowBox[{"1", "/",
RowBox[{"Sqrt", "[", "Eval", "]"}]}], "]"}], ".", "Evec"}]}]}],
";", "\[IndentingNewLine]",
RowBox[{"(*", " ",
RowBox[{"Sizes", " ", "of", " ", "the", " ", "subsystem"}], " ",
"*)"}], "\[IndentingNewLine]",
RowBox[{"For", "[",
RowBox[{
RowBox[{"k", "=", "1"}], ",",
RowBox[{"k", "\[LessEqual]", "13"}], ",", " ",
RowBox[{"k", "++"}], ",", "\[IndentingNewLine]",
RowBox[{
RowBox[{"LxA", "=",
RowBox[{"Lx", "/", "2"}]}], ";",
RowBox[{"LyA", "=",
RowBox[{
RowBox[{"Ly", "/", "26"}], "*", "k"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"(*",
RowBox[{
RowBox[{"Abeginx", " ", "=", "1"}], ";",
RowBox[{"Aendx", "=",
RowBox[{"Abeginx", "+", "LxA", "-", "1"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"Abeginy", "=", "1"}], ";",
RowBox[{"Aendy", "=",
RowBox[{"Abeginy", "+", "LyA", "-", "1"}]}], ";"}], "*)"}],
"\[IndentingNewLine]",
RowBox[{"(*", " ",
RowBox[{
RowBox[{
"Now", " ", "we", " ", "generate", " ", "the", " ", "sites", " ",
"in", " ", "subsystem", " ", "A"}], ",", " ",
RowBox[{
"and", " ", "the", " ", "corresponding", " ", "reduced", " ", "X",
" ", "and", " ", "P", " ", "matrices"}]}], " ", "*)"}],
"\[IndentingNewLine]",
RowBox[{"sitesA", "=",
RowBox[{"{", "}"}]}], ";", "\[IndentingNewLine]",
RowBox[{"index", "=", "0"}], ";", "\[IndentingNewLine]",
RowBox[{"For", "[",
RowBox[{
RowBox[{"y", "=", "1"}], ",",
RowBox[{"y", "<=", "LyA"}], ",",
RowBox[{"y", "++"}], ",", "\[IndentingNewLine]",
RowBox[{"(*",
RowBox[{
RowBox[{"index", " ", "=", " ",
RowBox[{"index", "+",
RowBox[{"Mod", "[",
RowBox[{"y", ",", "2"}], "]"}]}]}], ";", " ",
RowBox[{"used", " ", "if", " ", "triangle"}]}], " ", "*)"}],
"\[IndentingNewLine]",
RowBox[{"For", "[",
RowBox[{
RowBox[{"x", "=",
RowBox[{"(",
RowBox[{"1", "+", "index"}], ")"}]}], ",",
RowBox[{"x", "<=",
RowBox[{"(",
RowBox[{"LxA", "+", "index"}], ")"}]}], ",",
RowBox[{"x", "++"}], ",", "\[IndentingNewLine]",
RowBox[{
RowBox[{"sitesA", "=",
RowBox[{"Union", "[",
RowBox[{"sitesA", ",",
RowBox[{"{",
RowBox[{"site", "[",
RowBox[{"x", ",", "y"}], "]"}], "}"}]}], "]"}]}], ";"}]}],
" ", "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]",
RowBox[{"(*",
RowBox[{
RowBox[{"Abeginy", "+=",
RowBox[{"Mod", "[",
RowBox[{
RowBox[{"x", "+", "1"}], ",", "2"}], "]"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"Aendy", "+=",
RowBox[{"Mod", "[",
RowBox[{"x", ",", "2"}], "]"}]}], ";", " ",
RowBox[{
"This", " ", "is", " ", "a", " ", "try", " ", "to", " ", "do",
" ", "square", " ", "in", " ", "triangular", " ", "lattice"}]}],
"*)"}], "\[IndentingNewLine]",
RowBox[{"(*",
RowBox[{
RowBox[{"index", "=",
RowBox[{"index", "+", "1"}]}], ";", " ",
RowBox[{"llgm", " ", "in", " ", "sq", " ", "lattice"}]}], "*)"}],
"\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]",
RowBox[{"NsA", "=",
RowBox[{"Length", "[", "sitesA", "]"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"Pred", "=",
RowBox[{"Table", "[",
RowBox[{
RowBox[{"P", "[",
RowBox[{"[",
RowBox[{
RowBox[{"sitesA", "[",
RowBox[{"[", "i", "]"}], "]"}], ",",
RowBox[{"sitesA", "[",
RowBox[{"[", "j", "]"}], "]"}]}], "]"}], "]"}], ",",
RowBox[{"{",
RowBox[{"i", ",", "1", ",", "NsA"}], "}"}], ",",
RowBox[{"{",
RowBox[{"j", ",", "1", ",", "NsA"}], "}"}]}], "]"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"Xred", "=",
RowBox[{"Table", "[",
RowBox[{
RowBox[{"X", "[",
RowBox[{"[",
RowBox[{
RowBox[{"sitesA", "[",
RowBox[{"[", "i", "]"}], "]"}], ",",
RowBox[{"sitesA", "[",
RowBox[{"[", "j", "]"}], "]"}]}], "]"}], "]"}], ",",
RowBox[{"{",
RowBox[{"i", ",", "1", ",", "NsA"}], "}"}], ",",
RowBox[{"{",
RowBox[{"j", ",", "1", ",", "NsA"}], "}"}]}], "]"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"Csquared", "=",
RowBox[{"Xred", ".", "Pred"}]}], ";", "\[IndentingNewLine]",
RowBox[{"Ev", "=",
RowBox[{"Sqrt", "[",
RowBox[{"Eigenvalues", "[", "Csquared", "]"}], "]"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"Sn", "=",
RowBox[{
RowBox[{
RowBox[{"1", "/",
RowBox[{"(",
RowBox[{"1", "-", "renyi"}], ")"}]}], "*",
RowBox[{"Sum", "[",
RowBox[{
RowBox[{"-",
RowBox[{"Log", "[",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"Ev", "[",
RowBox[{"[", "i", "]"}], "]"}], "+",
RowBox[{"1", "/", "2"}]}], ")"}], "^", "renyi"}], "-",
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"Ev", "[",
RowBox[{"[", "i", "]"}], "]"}], "-",
RowBox[{"1", "/", "2"}]}], ")"}], "^", "renyi"}]}],
"]"}]}], ",",
RowBox[{"{",
RowBox[{"i", ",", "1", ",", "NsA"}], "}"}]}], "]"}]}], "-",
RowBox[{"N", "[",
RowBox[{
RowBox[{
RowBox[{"Log", "[",
RowBox[{"1", "/",
RowBox[{"(",
RowBox[{"massterm", "*", "Lx"}], ")"}]}], "]"}], "/", "2"}],
",", "100"}], "]"}]}]}], ";", " ",
RowBox[{"(*",
RowBox[{
"This", " ", "is", " ", "used", " ", "when", " ", "m", " ", "is",
" ", "not", " ", "0"}], "*)"}], "\[IndentingNewLine]",
RowBox[{"SvN", "=", "0"}], ";", "\[IndentingNewLine]",
RowBox[{"For", "[",
RowBox[{
RowBox[{"i", "=", "1"}], ",",
RowBox[{"i", "\[LessEqual]", "NsA"}], ",",
RowBox[{"i", "++"}], ",", "\[IndentingNewLine]",
RowBox[{
RowBox[{"If", "[",
RowBox[{
RowBox[{
RowBox[{"Ev", "[",
RowBox[{"[", "i", "]"}], "]"}], ">", "0.5"}], ",",
RowBox[{"SvN", "+=",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"Ev", "[",
RowBox[{"[", "i", "]"}], "]"}], "+",
RowBox[{"1", "/", "2"}]}], ")"}], "*",
RowBox[{"Log", "[",
RowBox[{"Abs", "[",
RowBox[{"(",
RowBox[{
RowBox[{"Ev", "[",
RowBox[{"[", "i", "]"}], "]"}], "+",
RowBox[{"1", "/", "2"}]}], ")"}], "]"}], "]"}]}], "-",
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"Ev", "[",
RowBox[{"[", "i", "]"}], "]"}], "-",
RowBox[{"1", "/", "2"}]}], ")"}], "*",
RowBox[{"Log", "[",
RowBox[{"Abs", "[",
RowBox[{"(",
RowBox[{
RowBox[{"Ev", "[",
RowBox[{"[", "i", "]"}], "]"}], "-",
RowBox[{"1", "/", "2"}]}], ")"}], "]"}], "]"}]}]}]}]}],
"]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";",
"\[IndentingNewLine]",
RowBox[{"SvN", " ", "=", " ",
RowBox[{"SvN", " ", "-", " ",
RowBox[{"N", "[",
RowBox[{
RowBox[{
RowBox[{"Log", "[",
RowBox[{"1", "/",
RowBox[{"(",
RowBox[{"massterm", "*", "Lx"}], ")"}]}], "]"}], "/", "2"}],
",", "100"}], "]"}]}]}], ";",
RowBox[{"(*",
RowBox[{
"This", " ", "is", " ", "used", " ", "when", " ", "m", " ", "is",
" ", "not", " ", "0"}], "*)"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[",
RowBox[{
"LxA", ",", "\"\<\\t\>\"", ",", "LyA", " ", ",", "\"\<\\t\>\"",
",", "Sn", ",", "\"\<\\t\>\"", ",", "SvN", ",", "\"\<\\t\>\"",
",",
RowBox[{
RowBox[{"SessionTime", "[", "]"}], "-", "ti"}], ",",
"\"\<s\>\""}], "]"}], "\[IndentingNewLine]",
RowBox[{"ClearAll", "[",
RowBox[{"Xred", ",", "Pred", ",", " ", "sitesA"}], "]"}]}]}]}],
"]"}], ";", "\[IndentingNewLine]",
RowBox[{"ClearAll", "[", "K", "]"}]}]}], "]"}], ";"}]}]}]], "Input",
InitializationCell->True,
CellChangeTimes->{{3.612008514837935*^9, 3.612008535001589*^9}, {
3.6120085780582047`*^9, 3.6120086038508043`*^9}, {3.612008716428104*^9,
3.6120087396135063`*^9}, {3.61200887351782*^9, 3.612008902784122*^9}, {
3.612009020192615*^9, 3.6120090772508297`*^9}, {3.612009116117968*^9,
3.6120091582106953`*^9}, {3.612009218417897*^9, 3.6120092436078043`*^9}, {
3.612009412198431*^9, 3.6120094349532433`*^9}, {3.612009517484947*^9,
3.61200956714209*^9}, {3.6120096507335*^9, 3.612009741941764*^9}, {
3.6120098067083263`*^9, 3.612009811591092*^9}, {3.6120098597165737`*^9,
3.612010035592968*^9}, {3.612010265273058*^9, 3.612010269895542*^9}, {
3.612010384363476*^9, 3.6120103847475967`*^9}, {3.612010656655505*^9,
3.612010656863888*^9}, {3.612010714734846*^9, 3.612010715177644*^9},
3.6120111724981537`*^9, {3.612011305138804*^9, 3.612011307462489*^9}, {
3.612011591601116*^9, 3.612011591726925*^9}, {3.612011668404204*^9,
3.612011697016062*^9}, {3.6120119541473293`*^9, 3.6120119873857822`*^9}, {
3.6120121441800013`*^9, 3.612012146048874*^9}, {3.612012242381075*^9,
3.612012246308853*^9}, {3.612012460104895*^9, 3.6120124616693697`*^9}, {
3.61201286084684*^9, 3.612012892009182*^9}, {3.612012957590293*^9,
3.612012962260045*^9}, {3.612013022843216*^9, 3.6120130255407457`*^9},
3.612018190089963*^9, {3.612018386746173*^9, 3.612018403879377*^9}, {
3.61201843924789*^9, 3.6120184762720127`*^9}, {3.612018562269328*^9,
3.612018605533113*^9}, {3.6120186554710073`*^9, 3.6120186571313057`*^9}, {
3.612018695737479*^9, 3.61201872486209*^9}, {3.612018764748674*^9,
3.612018791852703*^9}, {3.612018884190565*^9, 3.612018997377709*^9}, {
3.6120190618552094`*^9, 3.61201912988972*^9}, {3.612019299041108*^9,
3.612019306336426*^9}, {3.612019416517866*^9, 3.612019447800647*^9}, {
3.612019501949444*^9, 3.612019573509831*^9}, {3.612019616083548*^9,
3.612019653573358*^9}, {3.612019705043717*^9, 3.612019840477723*^9}, {
3.6120200646510983`*^9, 3.612020246712652*^9}, {3.612020386631915*^9,
3.61202043610669*^9}, {3.612020469834531*^9, 3.6120204751965923`*^9}, {
3.612020578245232*^9, 3.612020632535984*^9}, {3.6120207163995*^9,
3.612020732802698*^9}, {3.612020773358706*^9, 3.61202085614611*^9}, {
3.612020905836529*^9, 3.612020943042295*^9}, {3.612021074127404*^9,
3.612021077178372*^9}, {3.612021783555056*^9, 3.6120219019979486`*^9}, {
3.6120222438277407`*^9, 3.6120222787485743`*^9}, {3.612022451524774*^9,
3.6120224752941513`*^9}, 3.612022739829755*^9, 3.612022780640518*^9, {
3.6120228294801893`*^9, 3.612022947407215*^9}, {3.612023052101763*^9,
3.6120230792610598`*^9}, {3.6120236723054132`*^9,
3.6120236745121737`*^9}, {3.612095298071981*^9, 3.612095299056196*^9}, {
3.612095385015546*^9, 3.612095385496339*^9}, {3.612095652115554*^9,
3.612095652911088*^9}, {3.612095706933311*^9, 3.61209571490796*^9}, {
3.6120957646007013`*^9, 3.6120957984946833`*^9}, {3.612095887858411*^9,
3.612095929306697*^9}, 3.6120960819077272`*^9, {3.612096979312797*^9,
3.612097049611018*^9}, {3.6120972123945436`*^9, 3.612097241710105*^9}, {
3.612103490710548*^9, 3.61210349701578*^9}, {3.61210355159651*^9,
3.61210355377987*^9}, {3.612109097381268*^9, 3.612109128722372*^9}, {
3.612120989954842*^9, 3.612121160215995*^9}, {3.6121214463045893`*^9,
3.612121526209834*^9}, {3.612121596023633*^9, 3.6121216445725107`*^9},
3.6121788002989683`*^9, {3.612179022794352*^9, 3.612179022946537*^9},
3.612179082816128*^9, {3.612180141587538*^9, 3.612180164151464*^9}, {
3.612180202544941*^9, 3.612180202698227*^9}, {3.612180427027487*^9,
3.61218050320826*^9}, {3.612180581800148*^9, 3.612180589485484*^9}, {
3.6121807624352407`*^9, 3.6121807630424223`*^9}, {3.612182831527363*^9,
3.612182901351469*^9}, {3.6121830214834414`*^9, 3.612183051159498*^9}, {
3.612614599478094*^9, 3.612614658148082*^9}, {3.6126211703952837`*^9,
3.612621178824985*^9}, {3.612623859538409*^9, 3.612623864449761*^9}, {
3.612624443409783*^9, 3.6126244795855513`*^9}, {3.612627033725915*^9,
3.612627078982944*^9}, {3.612627184722859*^9, 3.612627395060008*^9}, {
3.612627560695038*^9, 3.612627566236367*^9}, {3.612644776936729*^9,
3.612644796742934*^9}, {3.612648410404994*^9, 3.612648411550386*^9}, {
3.612652816152685*^9, 3.6126528384068823`*^9}, {3.612652874682744*^9,
3.6126528761118917`*^9}, {3.6126605073315783`*^9,
3.6126605405051613`*^9}, {3.612662951998273*^9, 3.612662952500594*^9}, {
3.613131848448495*^9, 3.613131857072427*^9}, {3.6131319326695213`*^9,
3.613131933548458*^9}, {3.613132139393054*^9, 3.613132139991536*^9},
3.613137047694623*^9, {3.6131372019560204`*^9, 3.613137216346785*^9}, {
3.613142950133258*^9, 3.613142950915699*^9}, {3.61315280592162*^9,
3.6131528162962513`*^9}, {3.61374104243675*^9, 3.613741052484701*^9}, {
3.613987384928198*^9, 3.6139874631187267`*^9}, {3.6139877026495733`*^9,
3.613987703750018*^9}, {3.6139878067858543`*^9, 3.6139878119076242`*^9}, {
3.613987916449988*^9, 3.613987952405553*^9}, {3.613989178252866*^9,
3.613989238173819*^9}, {3.613989268422364*^9, 3.613989291888134*^9},
3.613989325769046*^9, {3.613989357041316*^9, 3.613989427857197*^9}, {
3.613989494940331*^9, 3.613989496707601*^9}, {3.613990154301655*^9,
3.613990167463649*^9}, {3.613990239833692*^9, 3.6139902759092484`*^9}, {
3.614011314609817*^9, 3.614011344904132*^9}, 3.614012909502165*^9, {
3.614013186414934*^9, 3.6140132089246597`*^9}, {3.614013253410228*^9,
3.61401325371914*^9}, {3.614013455789618*^9, 3.6140134700568323`*^9}, {
3.6140151606616783`*^9, 3.614015221674885*^9}, {3.6140175382147093`*^9,
3.614017539855096*^9}, {3.6140177564321337`*^9, 3.614017759070509*^9}, {
3.614019811216668*^9, 3.6140198162970133`*^9}, {3.614019878602364*^9,
3.6140198792738047`*^9}, {3.6140199615482388`*^9, 3.6140199801568327`*^9},
3.6140323379141273`*^9, {3.6140329159364367`*^9, 3.614032946514956*^9}, {
3.6140330655283213`*^9, 3.61403309204758*^9}, {3.614033177440826*^9,
3.6140331783958473`*^9}, {3.614035339351935*^9, 3.614035349541894*^9}, {
3.614035614058013*^9, 3.614035632589299*^9}, {3.614075540637096*^9,
3.6140755427891912`*^9}, {3.614086564964712*^9, 3.61408660889847*^9}, {
3.6140866406270647`*^9, 3.614086642909917*^9}, 3.61408667561191*^9, {
3.614089765775372*^9, 3.614089768549404*^9}, {3.6140898008450623`*^9,
3.614089807273253*^9}, {3.614089893551077*^9, 3.614089893874009*^9}, {
3.614089937619928*^9, 3.6140900119800777`*^9}, {3.614090043454772*^9,
3.61409006829246*^9}, {3.614090107522422*^9, 3.614090184189885*^9}, {
3.614090258275968*^9, 3.614090273873445*^9}, {3.614090306143873*^9,
3.61409036132961*^9}, 3.6140904343123913`*^9, {3.6140905125546207`*^9,
3.614090570879758*^9}, {3.6140906150094976`*^9, 3.614090620076532*^9}, {
3.614100621668599*^9, 3.614100623856662*^9}, {3.614102932021555*^9,
3.6141029322834272`*^9}, {3.6141030814742537`*^9,
3.6141030959019413`*^9}, {3.614103210632964*^9, 3.614103217524843*^9}, {
3.614103257215376*^9, 3.6141032681803493`*^9}, {3.614103340179315*^9,
3.61410337540044*^9}, {3.614103489797434*^9, 3.614103493830574*^9}, {
3.614103571931422*^9, 3.614103575901724*^9}, {3.614103627355928*^9,
3.614103628169483*^9}, {3.614104052634845*^9, 3.6141040844661837`*^9}, {
3.614104146825796*^9, 3.614104234933078*^9}, 3.614104273488409*^9, {
3.61410436733825*^9, 3.61410438606837*^9}, {3.614104609849916*^9,
3.614104637201146*^9}, {3.6141047798207083`*^9, 3.614104796223078*^9}, {
3.614104885907793*^9, 3.614104893534444*^9}, {3.614110980854574*^9,
3.614110984834804*^9}, {3.6141110346405077`*^9, 3.6141110391038933`*^9}, {
3.614210322303252*^9, 3.61421032550918*^9}, {3.614212209909768*^9,
3.6142122162229156`*^9}, {3.614259381189687*^9, 3.6142593839799223`*^9}, {
3.614259423397496*^9, 3.6142594243651323`*^9}, {3.614259465693137*^9,
3.614259468141165*^9}, 3.61425954940057*^9, {3.614292472069762*^9,
3.614292475744152*^9}, {3.614295511825432*^9, 3.614295533948144*^9}, {
3.6142958622330303`*^9, 3.614295863066421*^9}, {3.614295925872032*^9,
3.614295958282378*^9}, {3.614296153791848*^9, 3.6142961628861227`*^9}, {
3.614296227559054*^9, 3.614296273758706*^9}, {3.614296482004829*^9,
3.6142965541818132`*^9}, {3.614296873678358*^9, 3.6142969014223967`*^9}, {
3.614297272600943*^9, 3.6142972749375753`*^9}, {3.6142973087113247`*^9,
3.614297341318166*^9}, {3.614297389199051*^9, 3.614297471379828*^9}, {
3.614297510442288*^9, 3.6142975879228687`*^9}, {3.614297671256226*^9,
3.6142976750627947`*^9}, {3.614297811081925*^9, 3.6142978467166986`*^9}, {
3.614297947636127*^9, 3.6142979809851103`*^9}, {3.614341358583605*^9,
3.614341419894099*^9}, {3.614341458607089*^9, 3.614341459830102*^9}, {
3.614341508629264*^9, 3.614341512403599*^9}, {3.614341563170931*^9,
3.6143416482315073`*^9}, {3.614345784937595*^9, 3.61434579227183*^9}, {
3.6143525211057367`*^9, 3.614352542088913*^9}, {3.614355189965074*^9,
3.614355225748108*^9}, {3.614355263162607*^9, 3.614355273467504*^9}, {
3.614358838847314*^9, 3.614358853615142*^9}, {3.6143600052025557`*^9,
3.6143600330747423`*^9}, {3.614386702160454*^9, 3.61438671179397*^9}, {
3.614409969130101*^9, 3.6144099915262823`*^9}, {3.614410284310656*^9,
3.6144102879920263`*^9}, {3.614410336290279*^9, 3.614410340036539*^9}, {
3.614410451939115*^9, 3.614410469287972*^9}, 3.6144106057958927`*^9, {
3.614410694746748*^9, 3.614410715734665*^9}, {3.6144155629579144`*^9,
3.614415571568164*^9}, {3.61441565031306*^9, 3.6144157016758137`*^9}, {
3.614415803627542*^9, 3.614415806274456*^9}, {3.614415914937801*^9,
3.614415958870816*^9}, {3.6144160266947193`*^9, 3.614416032829075*^9}, {
3.61443192734372*^9, 3.614431962444003*^9}, {3.614432007587308*^9,
3.614432053095278*^9}, {3.614432342455723*^9, 3.614432345204977*^9}, {
3.614432410969109*^9, 3.6144324399128838`*^9}, {3.6144325089373417`*^9,
3.614432514481168*^9}, {3.6144334268148327`*^9, 3.614433499100984*^9}, {
3.6144335292323837`*^9, 3.614433626817225*^9}, {3.614433677743726*^9,
3.614433681360465*^9}, {3.6144339601981363`*^9, 3.614433978996776*^9}, {
3.6144340249289618`*^9, 3.61443403873039*^9}, 3.614434334634616*^9,
3.6144344307400007`*^9, {3.614439253114081*^9, 3.614439267209503*^9}, {
3.614439430908369*^9, 3.61443946528517*^9}, {3.614439858530058*^9,
3.614439920636586*^9}, 3.614440003088125*^9, {3.614440062043633*^9,
3.614440068897328*^9}, {3.6145195480069437`*^9, 3.614519556583942*^9}, {
3.6149526287825727`*^9, 3.6149527575904713`*^9}, {3.614952824638772*^9,
3.614952928717379*^9}, 3.615110449922014*^9, {3.6151104873517227`*^9,
3.615110508704089*^9}, {3.615110778125023*^9, 3.615110827985416*^9}, {
3.6151203847119617`*^9, 3.6151204125298777`*^9}, {3.615125083305744*^9,
3.615125085755344*^9}, {3.615125505834531*^9, 3.6151255064404593`*^9}, {
3.61512564204174*^9, 3.615125684223675*^9}, {3.615125715394203*^9,
3.615125778386623*^9}, {3.6151261653262177`*^9, 3.615126198185731*^9}, {
3.615126248647423*^9, 3.615126250766286*^9}, {3.615126285540132*^9,
3.6151262896464243`*^9}, {3.615126471412327*^9, 3.6151264735472193`*^9}, {
3.615130631918312*^9, 3.6151306516969147`*^9}, {3.615130720090362*^9,
3.615130720770952*^9}, {3.615130962620904*^9, 3.615130990625186*^9}, {
3.6151310945805187`*^9, 3.615131102363153*^9}, {3.615131159062676*^9,
3.615131164510254*^9}, {3.615131233079473*^9, 3.615131243917119*^9}, {
3.615131406473997*^9, 3.6151314384145813`*^9}, {3.615133323568301*^9,
3.61513335821323*^9}, {3.615133476738327*^9, 3.615133488931025*^9}, {
3.61513416145716*^9, 3.615134161738461*^9}, {3.615193960453712*^9,
3.6151939676185083`*^9}, {3.615196790331317*^9, 3.615196792131534*^9}, {
3.615196894944104*^9, 3.615196906750609*^9}, {3.6151973903724337`*^9,
3.61519744952752*^9}, 3.615197488476241*^9, {3.61520543566582*^9,
3.6152054382886066`*^9}, {3.615205469520612*^9, 3.61520549091109*^9}, {
3.615215563406815*^9, 3.615215567869228*^9}, {3.615215631379334*^9,
3.615215635658046*^9}, {3.615236720358479*^9, 3.615236724882421*^9},
3.6152369192386513`*^9, {3.615237023146267*^9, 3.6152370311700287`*^9}, {
3.615241523353244*^9, 3.615241582306985*^9}, {3.615247684794656*^9,
3.615247695494923*^9}, {3.615250813649118*^9, 3.615250824365192*^9}, {
3.615280583942916*^9, 3.615280633204987*^9}, {3.615280755033781*^9,
3.615280759206739*^9}, {3.615282414358006*^9, 3.6152824189885902`*^9}, {
3.615283771097992*^9, 3.615283771966566*^9}, {3.615283840999557*^9,
3.615283892266285*^9}, {3.616145821421184*^9, 3.616145824967823*^9}, {
3.616145974083061*^9, 3.616145980726425*^9}, {3.616184623903191*^9,
3.616184624951749*^9}, {3.61618470978833*^9, 3.616184717566758*^9}, {
3.616184788821445*^9, 3.616184868981579*^9}, {3.616184924263769*^9,
3.616184973399362*^9}, {3.616185030625947*^9, 3.6161850424480247`*^9}, {
3.616185075717577*^9, 3.616185084003808*^9}, {3.616185122527362*^9,
3.616185151289199*^9}, {3.616248516730782*^9, 3.616248524833766*^9}, {
3.6162485613916693`*^9, 3.6162485724287577`*^9}, {3.616248635670465*^9,
3.616248671717458*^9}, {3.616248712788275*^9, 3.6162487153711977`*^9}, {
3.616322245994116*^9, 3.6163223035563927`*^9}, {3.616771441335909*^9,
3.6167714493917923`*^9}, {3.61677156954955*^9, 3.6167716107757597`*^9}, {
3.616860900958663*^9, 3.616860904948639*^9}, {3.6169349248048677`*^9,
3.616934926709656*^9}, {3.616934974951127*^9, 3.616934979813006*^9}, {
3.617119181293412*^9, 3.617119183648994*^9}, 3.617119483539783*^9,
3.617372645508546*^9, {3.617373282637108*^9, 3.617373282905974*^9}, {
3.6173733629821997`*^9, 3.617373418483487*^9}, {3.61747259640908*^9,
3.6174725981998253`*^9}, {3.617473850696548*^9, 3.6174738734549427`*^9}, {
3.617526205708911*^9, 3.617526223885523*^9}, {3.617526379181678*^9,
3.617526387451545*^9}, {3.617527136596044*^9, 3.617527151234332*^9}, {
3.617527263071991*^9, 3.61752726778047*^9}, {3.6175277942532988`*^9,
3.617527826073979*^9}, {3.618167346577126*^9, 3.618167400500245*^9}, {
3.61936949040307*^9, 3.619369526054491*^9}, {3.6199493712860413`*^9,
3.6199493786129923`*^9}, {3.6199494306892233`*^9,
3.6199494931867933`*^9}, {3.6199506473607883`*^9, 3.619950673462181*^9},
3.619950827170558*^9, {3.6203873765225687`*^9, 3.620387388280314*^9}, {
3.620387458163784*^9, 3.6203874587143297`*^9}, {3.620466056201541*^9,
3.620466110069364*^9}, {3.6204719901880083`*^9, 3.620471996957106*^9}, {
3.62068915638838*^9, 3.620689276679235*^9}, {3.6206893116201143`*^9,
3.6206893152883043`*^9}, {3.624843870266852*^9, 3.6248438708366117`*^9}, {
3.6248441181726093`*^9, 3.6248441231876163`*^9}, {3.62484418895748*^9,
3.624844200698082*^9}, {3.624844254959146*^9, 3.6248442607331457`*^9}, {
3.624844320590331*^9, 3.624844323695236*^9}, {3.638545507815548*^9,
3.638545626339302*^9}, {3.6385457140880737`*^9, 3.638545732872561*^9}, {
3.638545769064268*^9, 3.638545869968684*^9}, {3.638546107408223*^9,
3.638546109047986*^9}, {3.638546178877981*^9, 3.638546182740818*^9}, {
3.638546359711773*^9, 3.6385463865695333`*^9}, {3.6385464470962343`*^9,
3.638546460973119*^9}, {3.638546523550652*^9, 3.638546523853272*^9}, {
3.638546695525299*^9, 3.638546719409299*^9}}]
},
WindowSize->{1375, 849},
WindowMargins->{{0, Automatic}, {Automatic, 0}},
FrontEndVersion->"9.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (January 25, \
2013)",
StyleDefinitions->FrontEnd`FileName[{"Report"}, "StandardReport.nb",
CharacterEncoding -> "UTF-8"]
]
(* End of Notebook Content *)
(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[557, 20, 36764, 724, 1126, "Input",
InitializationCell->True]
}
]
*)
(* End of internal cache information *)