├── .DS_Store ├── .gitignore ├── .lake ├── .DS_Store ├── lakefile.olean ├── lakefile.olean.lock ├── lakefile.olean.trace └── packages │ └── .DS_Store ├── Energy Data ├── lj200.csv ├── lj30.csv ├── lj400.csv └── lj800.csv ├── LICENSE ├── Lean-Installation.md ├── LeanLJ.lean ├── LeanLJ ├── .DS_Store ├── CSVParser.lean ├── Code_execution.lean ├── Function.lean ├── Instance.lean ├── Lennard_Jones_proof.lean ├── LongRangeCorrection.lean ├── MinImageDistance_PeriodicBC.lean ├── Pairs_Proof.lean └── base.lean ├── README.md ├── lake-manifest.json ├── lakefile.lean └── lean-toolchain /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATOMSLab/LeanLJ/11ce41063b96f5fc668e0d011d19db8a8fc33dd5/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.lean 3 | .lake/packages/mathlib/ 4 | .lake/packages/importGraph/ 5 | .lake/packages/Cli/ 6 | .lake/packages/proofwidgets/ 7 | .lake/packages/Qq/ 8 | .lake/packages/batteries/ 9 | -------------------------------------------------------------------------------- /.lake/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATOMSLab/LeanLJ/11ce41063b96f5fc668e0d011d19db8a8fc33dd5/.lake/.DS_Store -------------------------------------------------------------------------------- /.lake/lakefile.olean: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATOMSLab/LeanLJ/11ce41063b96f5fc668e0d011d19db8a8fc33dd5/.lake/lakefile.olean -------------------------------------------------------------------------------- /.lake/lakefile.olean.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATOMSLab/LeanLJ/11ce41063b96f5fc668e0d011d19db8a8fc33dd5/.lake/lakefile.olean.lock -------------------------------------------------------------------------------- /.lake/lakefile.olean.trace: -------------------------------------------------------------------------------- 1 | {"platform": "arm64-apple-darwin23.6.0", 2 | "options": {}, 3 | "leanHash": "0edf1bac392f7e2fe0266b28b51c498306363a84", 4 | "configHash": "5056787677364494812"} 5 | -------------------------------------------------------------------------------- /.lake/packages/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATOMSLab/LeanLJ/11ce41063b96f5fc668e0d011d19db8a8fc33dd5/.lake/packages/.DS_Store -------------------------------------------------------------------------------- /Energy Data/lj200.csv: -------------------------------------------------------------------------------- 1 | -0.789279080,-3.263959300,-0.144969070 2 | -1.325532000,-2.066279400,1.344570400 3 | -1.526297500,-2.902040900,0.582512100 4 | -2.111706700,-2.255237000,-0.111798040 5 | -0.561691510,-2.561705500,0.775606010 6 | -1.018490000,-3.722619900,1.086507000 7 | -1.070237700,-2.232399900,-0.667384590 8 | -1.355118000,-3.133237200,-1.240750500 9 | -1.267373900,-1.859116000,0.283956420 10 | -0.650241570,-2.174468600,2.124154800 11 | -0.767498250,-1.028368400,0.570934920 12 | -2.004453300,-1.075130100,0.916012240 13 | -1.019111500,-0.793161360,2.791177400 14 | -2.540525700,-1.982807300,1.345673000 15 | -0.544047190,1.620472700,1.152792900 16 | -0.974851360,0.464628250,0.093713015 17 | -0.348455110,-1.576962100,-1.218936700 18 | -1.094961800,-0.857683390,1.633995700 19 | -0.665329640,3.759865700,2.211237400 20 | -0.109111930,-2.639262100,-1.852993100 21 | -0.201279950,-1.971826000,-0.097957343 22 | -0.712819700,3.088994500,-1.850599600 23 | 0.984899400,3.628584300,-0.796308410 24 | -0.174703240,-3.608191100,-1.303370200 25 | -0.874390680,2.442901600,1.913577700 26 | -0.984787100,0.420964890,1.572820100 27 | 0.562880620,0.554317190,1.982060600 28 | -1.768897800,-3.607328400,-0.231705760 29 | 3.137858300,-2.655652300,-0.601317620 30 | -0.251227740,-3.788391900,-3.755093700 31 | -0.103796040,1.747605600,2.053235300 32 | 0.039639591,0.712704520,1.064361300 33 | 0.200938710,-0.261792860,1.383566900 34 | -0.080261694,3.897976400,-2.831103000 35 | 0.487530210,-2.327575400,0.625864480 36 | -0.862711040,2.999242000,0.809968750 37 | 0.481157510,3.262961700,2.398062300 38 | 0.475882980,1.815128400,0.887951700 39 | 0.227453910,-1.100251200,0.705281380 40 | 1.495922500,-0.592290370,0.737350730 41 | 0.385893610,-1.044312000,-0.450761290 42 | 2.743959600,2.696947800,-0.193694780 43 | 0.974731200,-1.860887100,-0.209361060 44 | 0.142043010,-3.905391900,-0.230589700 45 | 0.349321610,-2.810270300,-0.552701940 46 | 0.036356910,2.761266000,1.392847700 47 | -0.931193910,-0.848462540,-1.564418600 48 | -1.152146700,-2.696217300,-2.192715100 49 | 0.547322290,3.552200100,0.577838520 50 | 1.074938000,2.333894400,0.183744850 51 | 0.143258850,1.059829700,-1.696784300 52 | 1.055074600,-1.587041800,-1.281915000 53 | 1.657045300,2.593196400,-0.641530070 54 | 0.046400645,0.037778673,-0.843780920 55 | 0.050720158,2.914832500,-0.210796650 56 | -0.182772730,-2.231360900,3.684546200 57 | 3.000286600,1.399370800,-0.308995940 58 | -0.923548760,3.576947400,-0.463541510 59 | -2.412151900,-3.037237500,-1.338983000 60 | 1.317202400,-0.648630270,-0.808543200 61 | 0.389194140,-1.516142300,-2.164098000 62 | 0.969660160,0.465381660,-0.814998370 63 | 1.020062900,-1.210287400,1.594116800 64 | 1.132684500,1.196164100,0.161782670 65 | 1.679468200,0.085688872,-0.044239318 66 | 2.117862300,2.060867000,0.450461320 67 | 0.955829620,0.299809750,0.794412530 68 | 1.454844000,1.469211200,-1.374374500 69 | 0.561409150,-0.603840850,-1.585817600 70 | -1.752883500,-2.833908900,1.909254500 71 | 1.000072500,1.770163800,2.254089000 72 | -1.042441500,-1.602713000,3.638557300 73 | 0.817484210,0.309317100,-2.084943900 74 | -1.460125300,-2.492651500,3.179158300 75 | 2.932437700,0.857883360,-1.313412000 76 | -1.193372800,-3.333725600,-3.013480300 77 | 0.419010890,3.177578500,-1.619499300 78 | -0.285354490,2.395502400,-1.051702000 79 | 0.603996740,1.822355900,-0.602808910 80 | 1.334992500,-2.956194900,0.213680640 81 | -0.490890810,1.822833100,0.044024209 82 | -0.102770240,-2.726656300,-2.971819200 83 | 1.062320100,2.547162800,1.383773100 84 | 2.727600400,-1.868778500,0.038778456 85 | -2.452769800,-3.242101000,1.123091600 86 | -1.381465300,1.065574200,0.943968730 87 | -2.975287400,-1.483900000,0.130190410 88 | -1.445864900,-3.521404900,2.540588700 89 | -0.000174764,-0.182129240,0.294434120 90 | -1.034685100,-2.616170700,-3.774116400 91 | -1.595509700,-1.730412400,-2.249827400 92 | -0.618035320,-0.794960510,-0.508091380 93 | 2.430418300,1.751420700,-1.061849900 94 | -0.403562240,-3.017333600,2.859077400 95 | 2.904465900,-1.834333000,-1.106244000 96 | 1.550845100,2.485985100,-1.742990300 97 | -1.276462300,1.438334700,1.936945000 98 | -1.602521900,0.059586201,3.277552200 99 | 0.438332490,1.204482700,-2.761279700 100 | -0.550796940,1.383881000,-0.939589910 101 | 2.323703700,-0.736210670,-0.100220800 102 | 1.993210400,-1.493791600,-0.712031610 103 | -1.975897700,-2.097491700,-1.231128600 104 | -2.754796600,-3.176806700,0.157067590 105 | -3.932813700,-1.281745400,0.338170780 106 | 1.728523300,2.490127400,2.517227700 107 | 1.958538900,1.106162500,-0.469156830 108 | 2.715096500,0.379003240,-0.361165020 109 | 1.762394900,-2.649878000,-0.738145170 110 | 1.891977000,3.542204500,-1.421767900 111 | 0.633231140,-2.900063500,3.356285200 112 | -1.381077400,-3.619122900,3.631519300 113 | 1.500249900,-2.541370700,-1.908016000 114 | -3.809487100,-2.561868900,-0.107838580 115 | 1.464548000,3.467299300,3.036348000 116 | 2.400436100,-3.466842300,-1.217843500 117 | 1.955485200,-0.110580140,-1.608302600 118 | 0.120690920,1.937174200,3.370912600 119 | -1.738278400,-1.227820800,-0.554772890 120 | -1.545424300,3.768995900,-2.253842300 121 | -1.505293600,3.265537800,3.112788000 122 | -0.923062100,0.451127290,2.556900700 123 | 0.129180210,0.826164140,-0.213924130 124 | 1.758107800,3.043733000,-3.870784600 125 | 0.071158737,-0.322147730,-2.508876000 126 | 1.150383500,3.266899400,-2.401298900 127 | 1.377899100,-0.890395870,-2.087246100 128 | -0.098394829,3.158206500,-3.955559800 129 | -1.495791100,0.063967276,-0.828477520 130 | 1.281679300,1.860906400,3.187430600 131 | 0.791298960,2.787899700,3.404605300 132 | -0.611378940,3.793599800,3.304417900 133 | -0.970393840,3.673730900,-3.257244300 134 | -1.767302500,3.882349000,1.647898200 135 | 0.283959660,0.232099190,-3.480311700 136 | 0.951708240,2.392578500,-3.504507100 137 | -0.250412180,1.549688000,-3.636651800 138 | -1.859948200,1.226177200,-0.106214940 139 | 1.982575400,-2.293669200,0.718635250 140 | 0.470723230,3.904265200,3.244193100 141 | 0.293138330,-2.060727300,1.584146400 142 | -0.098237824,-1.506979900,2.996776200 143 | -1.641474900,1.091548200,3.268292900 144 | 0.725899480,1.292194400,3.989578500 145 | 2.310684900,-3.402970900,-2.449579300 146 | 0.165506710,2.648711400,-2.625242100 147 | -0.108748520,-0.786224860,-3.576865000 148 | 2.115126400,1.059753900,-2.114145900 149 | -1.623866100,2.118075800,2.977133100 150 | 1.772624200,1.916146700,-2.974248900 151 | 1.177252900,-1.357829100,-3.061414900 152 | 0.987765970,0.450088290,2.960569000 153 | 2.125303500,1.674342500,3.917755600 154 | 0.150867370,-3.354661000,0.712634140 155 | 2.657976200,2.710675400,-3.219389000 156 | 2.960471800,3.767730300,-2.506871400 157 | 0.227356080,-1.815012300,-3.491550800 158 | 3.056669800,1.778228700,-2.067219900 159 | 1.772354100,-0.005437032,-2.701254000 160 | -2.254299700,0.354203640,0.042071827 161 | -2.703695800,-0.170364410,1.003296000 162 | 2.132684200,0.194650350,0.847353550 163 | -2.212837900,-0.859620120,-1.551821100 164 | 3.480574000,0.282987920,0.543434980 165 | -3.313861100,-0.447175210,-0.425174060 166 | -1.282819600,1.880531100,-3.992742500 167 | -3.027522400,1.297405400,-3.263054300 168 | 0.555023210,-3.895645800,1.456546600 169 | -2.378378700,-3.440285900,2.757633100 170 | -0.286371120,-3.302242700,1.904111600 171 | -0.383121910,-0.075571486,3.287638200 172 | -2.177266200,3.434811200,0.018356014 173 | -1.221141600,2.183650600,-1.565794000 174 | 2.974629700,-2.873008600,0.649680110 175 | -3.978998700,-1.311868700,-0.753763820 176 | 3.666926800,2.418258200,-3.551070200 177 | 2.133073000,-2.971643600,-3.577039500 178 | 2.525854300,-1.888088600,-2.734172200 179 | -0.965029710,2.146711700,-3.016032100 180 | -1.198296200,-0.431947590,-3.806145200 181 | -3.640601700,-0.923961160,2.792775900 182 | -2.544141400,3.332901300,2.446750600 183 | -3.842800900,1.627156800,-2.481183800 184 | -2.297259500,2.828806400,-0.914277400 185 | 3.439075900,-2.617117800,-3.467059500 186 | -1.647714800,2.987492800,-3.871022600 187 | -3.500332300,-0.893956790,1.763979500 188 | 3.585305000,-3.684714500,-3.494657000 189 | -1.014204900,-1.410369900,-3.167839300 190 | -1.579893700,1.037030600,-1.453129600 191 | 2.776340900,2.646805000,3.469460300 192 | -2.855824600,1.247817000,-0.728552740 193 | -3.310317800,-2.747949900,1.564979000 194 | -2.244879400,-2.256537000,2.668940700 195 | -2.275794400,0.344157000,-1.639062600 196 | -2.844255100,1.892078200,-2.413561900 197 | -3.893129600,1.311927100,-1.126950600 198 | -2.793323500,3.551832500,1.158133100 199 | 2.448176200,-3.925793000,1.344163000 200 | -3.756097100,1.760741500,-0.198236100 201 | -------------------------------------------------------------------------------- /Energy Data/lj30.csv: -------------------------------------------------------------------------------- 1 | 1.07716991,-1.02098813,-1.34825945 2 | 0.18308846,-1.55769823,-1.78240549 3 | -2.06034619,3.92737828,3.88955512 4 | 1.93629805,0.71819733,3.71516908 5 | -0.75141390,-0.41841395,-3.25018363 6 | 2.25739131,-1.12657741,-2.29154291 7 | 0.12088687,-1.39561152,2.00370938 8 | 3.32742706,-1.47650287,3.39402390 9 | 2.13092733,-1.10682763,-0.19728964 10 | 2.11744202,-0.18447435,0.93016390 11 | -1.45937812,2.38288219,-3.78819940 12 | 2.43231342,-1.11853792,-1.22408826 13 | 2.41684537,1.84549905,2.90610700 14 | 2.51524791,0.03580977,-2.44559008 15 | 1.11358524,-2.47801134,-0.00809219 16 | 1.26166407,1.07543235,-2.75171575 17 | -0.58118735,-2.42937840,2.66899683 18 | -1.53318230,2.31969966,1.76242938 19 | 2.63994659,-0.78475156,2.25123325 20 | -1.92748638,-1.43272943,-2.43922638 21 | 0.92128014,-2.42792552,2.15002443 22 | 2.11417231,0.95865752,-1.79067808 23 | -0.73123803,-3.36615723,0.13765980 24 | 1.61256930,-0.92334158,2.03748477 25 | 3.96791181,0.20025090,2.65943218 26 | 1.18875119,-0.05955638,-0.73630704 27 | 3.78949770,1.57067433,0.72659184 28 | 2.78662577,-1.52416748,0.83581875 29 | -1.62936245,-1.13906153,-0.76540841 30 | 2.59265523,3.78633508,-1.25245213 31 | -------------------------------------------------------------------------------- /Energy Data/lj400.csv: -------------------------------------------------------------------------------- 1 | -0.686455542,-4.390290249,-3.403841396 2 | -1.28124099,4.528731208,-2.173372472 3 | -1.804476423,-0.308289938,-1.131084532 4 | -1.528960842,2.458929017,-0.778047965 5 | -4.055674901,-1.416627475,-2.47966125 6 | -3.063829666,2.656541529,-0.997651652 7 | -2.051067284,0.786442228,-0.797564233 8 | -1.407809846,3.229650237,-3.232984258 9 | -0.729159123,1.718205886,-2.424483648 10 | -4.795631704,3.253420235,3.673861011 11 | -4.314530179,2.815150399,4.648804135 12 | -1.66492316,3.376307696,-0.376094243 13 | -0.569660127,3.452113326,-1.220188857 14 | -3.454908923,-3.976451159,-1.55876547 15 | 4.394258477,1.300063859,1.839221791 16 | -4.39289891,2.204437477,0.556011459 17 | -2.408933346,2.771860741,-3.721346541 18 | -3.002730038,-4.923634623,-3.585734004 19 | 4.078362656,2.631120381,1.397988479 20 | 3.952116779,4.517157968,4.577328044 21 | 1.272181014,-3.126779104,-1.366506815 22 | -3.483868034,-2.689378486,-0.780600804 23 | 1.470104449,4.386675959,-0.589459208 24 | -3.032394142,2.407794374,-2.117797846 25 | 4.582175991,-2.764357537,-3.840922117 26 | 0.82824131,-2.924814823,-3.487755806 27 | 2.759252352,-1.80226362,-3.838020278 28 | -2.003681797,-4.711651861,-2.324736213 29 | 3.359646597,-2.846804303,-2.691720391 30 | 1.10486055,-1.689683872,-3.208187561 31 | -0.188493547,-2.592958113,-3.611641812 32 | -3.202387998,1.741955803,1.092165424 33 | -1.755434695,4.61017449,-3.198676951 34 | -1.429560182,3.533959544,-4.258580715 35 | 3.500405085,4.488230636,1.283927092 36 | 0.668830312,-2.749125874,-2.487970707 37 | 0.245975007,-2.297220031,1.934600059 38 | -2.548055598,-2.91222443,-1.558422756 39 | -3.016402494,0.524739057,1.056911603 40 | -3.914813652,0.682265971,0.127381794 41 | -2.461390558,1.851957681,-0.361059522 42 | 4.791735812,-3.575522011,-3.073510977 43 | -4.998825814,0.895732448,-0.181251182 44 | 3.13372065,3.364238535,1.707383038 45 | -3.647539498,-0.615214782,3.483100489 46 | 1.937745161,4.907304803,-1.521112663 47 | 3.840653719,-4.071537688,-2.461818585 48 | 3.396144225,3.527991254,4.674790042 49 | -2.313502367,1.061030028,-4.032512224 50 | -2.109895595,-2.312624721,-2.648747097 51 | 4.582777602,4.642311144,1.429485278 52 | 1.192880437,-4.159485176,-1.41926906 53 | 3.986435123,1.565646301,0.939357635 54 | -4.044174369,2.959079756,-0.898782892 55 | -4.392454022,-2.885145228,-2.815492214 56 | -4.740179355,1.96688034,3.712723049 57 | -0.281069335,-1.71802692,-2.364791719 58 | 4.65220983,-1.632617299,-2.04621049 59 | -2.462498933,-1.538634054,-1.775219689 60 | 1.348918359,-3.479695178,-2.388155458 61 | -3.52711667,-1.896208409,-1.475507441 62 | 0.073357365,-4.24625625,-4.059865372 63 | 4.234598006,3.657938288,1.671888342 64 | -1.513889506,1.547672782,-3.210313085 65 | -2.28917197,3.221409478,-1.363691859 66 | -1.560499833,-3.647965346,-2.680180971 67 | -4.375827122,-0.902692351,-3.738262283 68 | 0.246290187,3.759068198,-4.611559269 69 | -4.419278108,-2.183165147,-1.999134837 70 | -0.678051384,-3.774531807,-2.186297679 71 | -0.172170258,1.523595318,-3.698900068 72 | -1.239573586,1.778329881,0.108522075 73 | 0.004805008,-3.734872393,2.891480326 74 | 0.533049823,-4.181882016,-2.291867082 75 | 1.709431425,3.922309287,-1.38186028 76 | 0.602400342,2.725100541,0.115150591 77 | 4.570209545,-2.626385978,-2.713685088 78 | -4.789372075,-0.962802042,-1.552834288 79 | 4.358456661,3.84303818,3.592646766 80 | -0.774984559,2.508300408,-3.552147782 81 | 2.83842741,3.163812496,2.783589493 82 | -3.343319043,2.203640606,0.14100568 83 | 0.419159654,3.514465839,-3.40866059 84 | 2.28186561,4.42628728,-3.635856479 85 | -4.369630768,1.795597487,-0.520891975 86 | 1.201565507,4.233263486,-2.861428352 87 | 1.783132614,-1.058546782,-2.318250173 88 | -2.332652772,1.772375291,-1.409199248 89 | 3.516613234,3.261216101,-0.056587692 90 | 3.836086524,3.00417428,2.437412692 91 | -0.585326142,4.304571086,-3.124205016 92 | 4.375703302,1.993172168,2.992882976 93 | -4.508472904,3.846142059,-4.511598372 94 | -1.190525641,4.814674837,-4.137640713 95 | -0.44435278,3.166591033,-2.830400644 96 | 2.124032893,-4.229908368,-2.087297832 97 | -1.597759934,-1.48308579,0.184625609 98 | -1.444566133,-2.700667511,-1.748502847 99 | 3.184280623,1.962819987,2.182051675 100 | 1.71529581,-1.375122323,-0.440664701 101 | -0.114118858,4.926730172,-4.890728703 102 | 1.109482468,-4.635937031,-3.299699683 103 | 2.74190747,4.359842987,4.860111255 104 | 4.85866014,3.297779705,0.989092279 105 | -2.164070903,-1.164433083,-0.687773551 106 | -3.669192694,3.262657829,0.168874377 107 | 2.018685234,4.889413848,-4.471210561 108 | -4.5275581,4.907626592,-0.78170691 109 | 2.342871656,-0.565900353,0.184731366 110 | 3.675732453,4.728615596,2.595980642 111 | 3.899936696,4.799064017,-3.358608842 112 | 2.417550763,1.590507476,2.689623962 113 | 0.00943444,-0.812092386,-3.982194255 114 | 4.711891658,3.362423942,4.881448957 115 | 4.086876039,-3.954369592,-1.263454204 116 | -4.167935941,-0.74373829,-0.287140428 117 | -4.737984976,-3.85861311,-0.986708184 118 | 1.524206922,-2.279641126,0.761761695 119 | 2.5235241,-2.889882767,-2.089701139 120 | 3.027747414,-3.257645214,-1.055126192 121 | 0.503346961,-1.946218533,-4.115118893 122 | 0.305950202,2.684931687,-1.826727587 123 | -2.541228123,1.781425441,-3.288437959 124 | 3.062803673,-3.867664813,-0.041911854 125 | 0.911152875,2.125643548,-1.100560272 126 | -4.80239386,1.268346861,0.952906608 127 | -3.931655545,-1.143201851,4.961563249 128 | -2.730551111,-3.651721037,-2.761108588 129 | -3.143991084,1.313865965,-0.908795452 130 | 4.919389025,3.786625455,-3.535115784 131 | -1.152245341,-3.822652401,-1.042604393 132 | 4.332553636,2.3171939,4.025646747 133 | -3.856634806,0.004243166,2.545191 134 | 1.948247499,-3.494046397,-0.564768787 135 | -0.924289568,-4.408309632,-4.68473006 136 | -0.829496518,-2.950225479,-2.849504801 137 | -0.950029588,-3.177211965,-3.784103314 138 | 2.304204214,-4.40379155,-3.540947635 139 | -4.849850457,-1.82599985,-3.195978235 140 | -2.377455849,0.749998846,0.283870331 141 | -2.169601874,-3.852477573,-1.786032432 142 | 0.412035007,1.418538135,2.636009146 143 | -4.788288394,3.889783636,0.202496599 144 | -4.076168456,-2.737661616,4.628648817 145 | -1.379260396,0.601447816,-3.698078213 146 | 3.582768485,-2.123562674,-0.10440258 147 | -2.959946138,1.832646462,-4.603366143 148 | -4.15616939,1.528734368,1.729661804 149 | -3.182047557,4.201436237,0.112784714 150 | 4.959314411,-0.530626574,4.26067378 151 | 3.130708839,0.387603332,-0.106122893 152 | 3.752528204,-3.638244403,-3.595651895 153 | 3.090010419,-4.460101815,-1.872919465 154 | -1.195467594,2.405327945,4.621115593 155 | -2.433569894,-1.132744014,0.910320348 156 | 4.936615,-0.380004286,-4.651718352 157 | 2.8487848,-1.280979631,-2.520126104 158 | -2.67196153,3.216048507,-0.142908137 159 | -3.118754656,-0.624682948,-4.719594976 160 | 2.262168747,2.944055901,3.713543823 161 | -2.246834708,-4.823865146,-1.019872006 162 | 0.841725627,-1.514144057,-2.107765237 163 | 4.157452836,-2.564746937,-1.572793703 164 | -0.017038585,-3.907804643,4.003204601 165 | -3.749150718,-4.111055021,-0.105093035 166 | -2.124397067,-0.278919191,-3.503679598 167 | -1.042397809,-3.292176808,3.617985286 168 | 0.91401966,-4.540331336,3.771161056 169 | 1.22600036,-1.669113523,-4.894314474 170 | -2.974372008,-4.917055501,-0.35101331 171 | -1.546737755,-3.927497277,4.326319211 172 | 1.229585453,-3.419817499,3.007527362 173 | -1.214930042,0.204625743,3.635874263 174 | 4.571256978,1.454717472,-1.216290959 175 | -0.916281223,-1.658539092,-1.532176079 176 | -0.69314972,2.496368635,-1.71244309 177 | 4.090004867,3.869472276,-4.534527415 178 | -3.701936131,-2.261393208,-3.166661658 179 | -2.174697564,-3.754875073,-0.768417488 180 | -3.592409242,-3.072437888,-1.992771701 181 | 0.876736578,-4.782622342,-4.731504456 182 | -1.855381048,1.969917083,-4.129902367 183 | 1.04766254,-3.255819533,1.929712909 184 | 2.935964654,-2.203869448,1.04751084 185 | -4.055376412,4.724515816,0.144114519 186 | 1.687844382,-2.281772179,-3.979085042 187 | 3.249855263,-2.057509806,-1.182117923 188 | -0.613643796,3.523650542,4.90076999 189 | -4.377533038,-3.145152242,0.139882628 190 | 4.979911794,-3.336117279,-1.961199603 191 | 1.798728409,3.715453531,4.972510351 192 | -4.945279572,-1.414509243,4.752703746 193 | -0.376423132,-2.695843501,-1.723783731 194 | -2.030537638,3.405157725,0.761568462 195 | -3.609902265,4.224685753,-0.914522401 196 | 2.12648939,2.853347223,-4.432587964 197 | -1.239589051,1.232973833,-1.355542823 198 | -2.149863971,-2.69585852,0.420085959 199 | 2.496451223,-3.239525968,-3.321460629 200 | 1.624184574,-2.499439296,-2.753335901 201 | 0.080346752,-1.347245769,-4.971674686 202 | 4.270369103,0.062139582,-3.890804783 203 | -4.964809625,-4.376167153,0.26172621 204 | -4.914166867,4.215673203,4.391284454 205 | -1.632558441,4.025101751,1.486050418 206 | -1.856038565,1.064943975,1.967965782 207 | 0.236912414,4.223994079,-2.542792892 208 | 1.875669761,2.546968996,2.580134058 209 | 0.118112508,1.059243967,-0.98748975 210 | 2.128622933,-1.428440647,1.185910631 211 | 0.183631909,-3.818157032,-1.284127752 212 | 0.950768056,3.269223658,-2.349105249 213 | 0.162089138,2.593123672,-3.949557637 214 | -1.17884976,4.979506884,-1.131426539 215 | 1.885884487,0.647025717,2.702519609 216 | -2.733255326,-3.891354516,3.665329858 217 | -4.434290946,-2.098246427,-4.461036987 218 | 2.888100398,3.939498832,-1.736543984 219 | 4.704196479,-1.403426194,-4.046186722 220 | 3.969307612,-1.152235698,4.492107429 221 | 3.396718599,4.106515597,-0.714034313 222 | -4.426209126,0.852965545,-1.156082164 223 | -4.97656727,-4.616799424,-1.917715019 224 | -1.61213095,-2.464364775,4.784213988 225 | 1.822730016,-2.540411745,4.79683316 226 | -1.915302662,-2.327499904,-0.596621602 227 | -4.69818231,-2.331458481,-0.697760309 228 | -4.513169761,0.394747883,1.424924645 229 | 2.444588297,3.613284473,-0.261318714 230 | 3.210911008,-0.878338944,-0.677536983 231 | -1.25796033,-3.538211178,0.1232701 232 | 2.296802635,-2.398715565,-0.696127064 233 | -2.962991408,-3.267856672,-4.529838668 234 | 3.831496805,-2.017297159,-3.738536002 235 | -4.134450594,-0.128601588,-4.319899802 236 | -0.215959968,2.361292452,-0.608881898 237 | 2.929344413,2.348734404,-1.737850024 238 | -0.677257825,1.544760654,4.009284428 239 | -4.496897375,-3.121606503,-4.150159366 240 | 4.394816512,1.025660347,4.569717434 241 | -0.752230338,0.184278323,-0.854307397 242 | -4.899667547,4.833864844,-4.642858499 243 | -0.577217755,0.494173621,-2.521461876 244 | -0.751595584,4.557367636,2.051812396 245 | 1.070553528,2.62498667,3.258939409 246 | 0.773929938,-0.007746728,-1.026503948 247 | 0.911387138,1.145686052,1.512506623 248 | 0.667827907,2.01410513,0.881884775 249 | 1.6444739,2.982198842,0.252413708 250 | -2.183813217,-4.919942241,0.663561297 251 | 1.429096447,4.360122593,4.413941325 252 | -2.544030977,2.560163205,1.461649955 253 | -1.08482997,-0.968036774,-2.980059298 254 | 4.459609256,-3.58663287,3.413176922 255 | 1.014735104,2.061470463,2.10196076 256 | -4.278728142,-4.237931509,2.721802858 257 | 2.217905647,3.645737862,-2.719743661 258 | -2.159439096,-1.597971365,-3.476581585 259 | -2.266878267,2.018480482,2.548139699 260 | 4.168101525,-1.800844412,2.280882199 261 | 3.894517195,4.870406857,-1.88275652 262 | -1.952936093,0.056796248,0.974085985 263 | 4.239003767,3.910882114,0.410986507 264 | 2.967805667,0.709611392,2.157377842 265 | -2.171704316,-3.750905219,0.389304301 266 | 3.254644968,-4.684346991,0.431699144 267 | 4.618219786,0.163448979,-0.813696091 268 | 3.631476699,0.506268007,-1.295230361 269 | -3.828916365,2.628260001,1.35222153 270 | 1.664742115,-4.522664569,2.974205701 271 | 3.255343814,-1.394940812,1.781993358 272 | -0.900049945,3.070095096,0.915105243 273 | 2.878283251,-4.273130378,-4.542114936 274 | 3.370710706,-3.237335948,2.041451729 275 | 4.104774799,-1.499278056,-0.975519857 276 | 4.304001463,-2.732540068,1.790679931 277 | 1.991699021,-0.31307198,4.645237407 278 | -3.226711226,0.110518654,-3.574580755 279 | 4.344462164,-2.140666316,4.934342581 280 | -3.197344364,4.953211757,1.159796088 281 | -4.373487942,1.808335556,-1.689172114 282 | -3.927467471,3.808797582,-3.079211876 283 | -1.677301755,4.114333738,-1.180491422 284 | 0.101550707,-2.772976509,0.662938527 285 | -0.267813529,2.673597086,3.955597209 286 | -2.538000888,-3.790809501,4.649001108 287 | -3.180272254,3.798556526,1.377585134 288 | 2.45132909,4.325579592,1.924343018 289 | 0.91709787,4.480154441,-4.000316319 290 | 3.174226724,4.540565105,3.703802278 291 | -2.503680395,0.224188568,4.019584949 292 | 4.343649027,2.202441223,-1.97406754 293 | -1.44397945,-2.641872535,1.256884484 294 | 2.687008816,-0.025634247,-1.021751697 295 | 3.74207854,-2.907737129,3.039821796 296 | 2.105251214,-1.611476748,-1.39735114 297 | 4.310849204,0.281712846,2.446471182 298 | -0.982741942,0.631858802,0.712548066 299 | -3.414067198,-1.662549574,2.127393171 300 | 4.930801533,-3.721352012,1.995122114 301 | 2.810520571,-0.313712987,-4.180273781 302 | 3.214777495,-0.294884544,-2.881597288 303 | -3.632265266,-1.672398557,-0.314756063 304 | 1.750330683,-4.640315251,-0.003181873 305 | -1.395230013,-3.466194234,-4.610808816 306 | -1.641842901,3.374698885,3.440591545 307 | 3.358516695,1.619102456,-0.816354264 308 | 1.865141341,0.586764224,1.630219492 309 | -3.049014605,-3.205578982,0.082668443 310 | 1.924834426,2.270343931,1.498414202 311 | -4.914982222,1.413256794,2.804652781 312 | 2.698446631,0.457290837,-2.218714431 313 | 3.753886343,-4.602700868,-0.525558238 314 | 1.134614896,-4.97147694,-2.1671433 315 | 3.719836317,-4.059806177,2.669887707 316 | -3.049623658,-4.691853514,-2.263679888 317 | 4.012248255,3.798333706,-3.105458674 318 | -0.236539085,-4.85364585,-1.978436509 319 | 3.274012675,-4.343395479,3.495223035 320 | 0.356446662,-3.125549941,-4.913756318 321 | 4.933277815,3.13716851,-0.607343129 322 | -0.888470147,-0.300480787,0.264983701 323 | -2.421814388,-3.308869752,1.528453118 324 | 0.436808106,-1.160638747,1.492647127 325 | 0.446969262,1.583555088,-2.27594585 326 | -2.74111912,-1.849508631,0.310776484 327 | 1.008194301,-0.745217063,-4.499122969 328 | 0.239687004,-0.538616242,-0.110527613 329 | -1.642387543,1.271456116,4.090213882 330 | -4.287778843,-1.757887419,3.94173033 331 | 1.430500016,1.419457018,3.479089563 332 | -4.22057713,-4.610418639,1.499285991 333 | -3.471184812,1.114090136,-2.127631095 334 | -2.775266795,-2.819437879,-3.579466708 335 | 2.067705238,-1.085784001,-4.363860258 336 | -1.437228979,-1.430090532,1.496985047 337 | -0.277721231,1.958069342,-4.633787103 338 | -0.794383283,-0.603746487,2.84682687 339 | 1.30991724,-1.21739263,2.080154112 340 | 2.328665138,-3.053706475,3.322102124 341 | 3.719841368,-4.444890663,4.391531517 342 | 1.020398701,-0.178992849,1.510318441 343 | 3.212968444,-1.799023031,2.950361043 344 | 0.970275762,-0.720173398,4.395294776 345 | 1.49224963,-2.101152848,3.815843653 346 | -3.697530927,-3.886407641,3.934112306 347 | -3.831332443,4.604389426,2.170233011 348 | -1.002020597,-1.757237265,-3.863564094 349 | 0.693657848,4.23912722,-1.401498791 350 | 0.435189585,-2.751017905,3.819720672 351 | -3.854329396,3.196790876,-2.110037124 352 | -0.287716399,0.843439802,1.660015172 353 | 4.486868589,2.562149484,0.261029109 354 | -3.538282673,0.770885715,-4.595260398 355 | -4.871875231,4.478540753,-2.594088724 356 | 3.768354852,2.852529086,-0.956916519 357 | 3.76109307,-2.740441349,4.222314196 358 | -1.960538822,3.123678166,2.110753123 359 | 4.131612451,1.45537044,-0.110014231 360 | -2.02928772,0.761747908,3.228450915 361 | 0.247644285,0.656593591,-1.943640347 362 | -0.739721544,-2.161435528,0.449634605 363 | 4.574173039,4.401678694,-1.264706898 364 | -0.809306149,-1.786282837,2.663576335 365 | -0.286839689,-4.457871403,-0.232318759 366 | -4.81506016,-2.619715062,3.482385821 367 | 0.685668781,0.568596512,0.366099911 368 | 1.882670524,1.762653832,-1.563051029 369 | -4.532013213,-4.851040321,-3.645375901 370 | 2.339599938,-0.293111604,1.21640872 371 | 1.40237835,-2.3693916,1.80138437 372 | -3.431217407,-2.510293242,3.769195354 373 | -4.557276515,4.068537487,2.677713208 374 | -0.687249247,1.991858355,0.920980105 375 | -4.27709063,4.339183259,1.148673502 376 | 0.342089876,0.580421898,-3.943048511 377 | 4.162526973,-3.300498685,0.478770829 378 | -4.971063336,-4.656181203,4.072533425 379 | 0.932228908,-1.441838051,3.127003725 380 | -1.475045928,3.286684569,-2.140277506 381 | 2.222145801,2.502364142,-0.657509184 382 | 1.469263858,0.886563379,-1.233766791 383 | -1.833408904,-2.060210703,3.412350916 384 | -3.995485486,-0.046771709,-2.721486291 385 | -4.305185916,0.601440778,3.786861355 386 | 1.037642962,2.587188974,-4.36050419 387 | -2.141531012,4.334585013,-4.50689367 388 | -4.792539749,-2.836929465,2.368323629 389 | 4.397251547,-4.189042894,-4.661497639 390 | -3.874002062,1.762136966,-3.639604435 391 | -2.628640532,-3.187739667,2.576305432 392 | -3.613362141,2.805554799,-3.376780237 393 | 4.998376854,-0.485712311,0.234083792 394 | -2.646950511,3.932149214,3.456046823 395 | 0.368091555,3.91176036,2.836974667 396 | -0.350782445,-2.666699296,3.192006855 397 | -2.502900114,-0.509232752,-2.554809713 398 | -3.576224213,-3.977732003,-3.07411095 399 | 1.254403364,3.220959692,4.068063689 400 | -1.656744855,-3.002055613,2.297216607 401 | -------------------------------------------------------------------------------- /Energy Data/lj800.csv: -------------------------------------------------------------------------------- 1 | -0.11263630,1.38509300,-0.88420350 2 | -2.46371500,-1.37580300,0.83913360 3 | -3.04667400,1.65106300,4.39983500 4 | 4.77125800,3.27152400,2.80122600 5 | -1.89664600,4.33426400,4.46276000 6 | -3.65321000,-3.75185500,-0.91084070 7 | -4.43538400,0.96187810,3.37922200 8 | -3.92288000,0.09705790,4.20844600 9 | -4.73866300,-1.59471400,-1.44179200 10 | -4.09588700,3.33637300,-0.53396470 11 | -2.06836100,-0.62873520,4.91721900 12 | -1.46790500,3.75352500,1.72678000 13 | 2.08080600,3.34223500,3.54095500 14 | -2.37069700,-1.07580600,2.85245700 15 | 2.33697000,-4.57649800,-4.47568100 16 | 1.80309100,3.60621400,0.66250150 17 | -0.71609640,-1.33308700,-3.89254300 18 | 1.03465900,-2.73176600,1.11537500 19 | -3.42726400,2.49187300,-0.34583270 20 | -0.20981690,1.76919900,0.45620710 21 | 4.34428400,-1.45128000,3.97468400 22 | -1.85385800,-0.03304501,2.35216800 23 | 4.91714700,-4.98677400,4.48266400 24 | 2.22422800,1.44353600,2.87326100 25 | -4.36730200,-0.17378190,-1.50539900 26 | 4.16074400,-3.17738200,-3.79703000 27 | 4.37745800,-0.73997060,1.23515900 28 | 1.89908200,4.46217600,-2.87983100 29 | -0.20982820,1.73990200,-2.01820000 30 | 0.79505160,-3.08158300,4.62769700 31 | -1.01816900,4.49538600,3.71198900 32 | -4.42646100,4.58668300,1.29967900 33 | -3.88310900,-2.46078700,0.01214212 34 | -3.68480100,-1.78211900,3.67187700 35 | -3.67890000,-1.98630000,-4.30336700 36 | 4.17602500,-2.78596900,-4.76005800 37 | -3.46779300,2.61933600,2.05061600 38 | 2.76234100,2.99023200,-4.61060300 39 | 2.67231600,-2.17392500,4.15315300 40 | 3.90007300,-0.85558000,-3.54599700 41 | -2.92411200,-4.36293700,-4.93898200 42 | -2.58170300,0.46129500,1.90923100 43 | -2.33856900,3.50198800,-3.55041600 44 | -4.26768200,1.16937600,-1.72329300 45 | -1.36358300,-1.80740100,-0.57513810 46 | 0.98912780,2.73254300,1.75028600 47 | 4.20888300,-0.69118860,2.99488900 48 | -1.74682200,-1.41275500,-4.35080100 49 | -1.64578100,-0.74210660,-3.25945300 50 | -1.57700400,0.97055040,-4.23038800 51 | 1.33744700,-1.45967800,-4.57844200 52 | -3.99430000,1.15101600,4.24967400 53 | -0.63526410,-0.45129570,0.53608760 54 | 3.87609200,2.17018900,-2.36717200 55 | 4.85004400,4.40957300,-0.11262370 56 | 1.78411700,4.29486200,-0.98612640 57 | -4.73478000,-0.47455800,4.78300100 58 | 1.34251200,-3.47566100,-3.29326000 59 | 0.71097910,-3.29522800,-1.34598400 60 | -3.16074200,3.05923400,-2.71460400 61 | -2.99775900,-1.43525000,-0.05541519 62 | 4.96603700,-2.32683200,4.29714800 63 | -1.06799200,-0.95205670,3.48396000 64 | -2.37772900,4.03749900,-1.15176000 65 | -4.53876300,-0.58197470,2.05040500 66 | 0.56754990,0.83451000,1.64771800 67 | -3.94815800,4.86250800,2.80779400 68 | -1.76038200,2.78286200,-2.97850600 69 | -0.53642760,3.38005400,2.10345200 70 | 1.52428900,4.93417200,-4.95477000 71 | -2.77281800,-1.56590800,4.60091200 72 | 1.16087600,2.13129000,-0.51403270 73 | -3.07928000,-1.12647200,-2.62173400 74 | -4.23671500,-1.73693200,2.25361800 75 | 0.62672420,-3.36224700,-4.29661500 76 | -4.38924700,-4.50946200,-3.98568700 77 | -2.18122500,-1.97077300,2.44632000 78 | 1.60426500,-3.69947200,-1.14309700 79 | -1.52697100,-4.53730400,-3.38585000 80 | 3.53071700,-4.93835600,-1.51448200 81 | 4.91769600,4.63009700,-3.85272200 82 | -0.85071110,0.51479530,-0.86463310 83 | 2.61538800,4.29202000,-4.29447500 84 | 0.09871369,-3.18411200,-0.27773330 85 | 2.56668900,4.79346000,4.50039000 86 | 4.35870000,-1.18859900,-4.97633100 87 | 2.66474700,3.65084700,-0.11210750 88 | 4.20566300,-3.95581700,4.56917600 89 | 1.24900500,-0.95213600,-0.24489740 90 | 2.32822900,4.37004600,3.44904300 91 | 4.69250400,2.54705400,3.75554800 92 | 3.61547800,3.79260200,-1.61191300 93 | -3.22082600,-3.99751800,-3.48660300 94 | -0.48422590,-4.04084400,0.09792132 95 | 4.52224600,-0.94634110,-1.59136400 96 | -0.29017110,4.62005700,4.64748100 97 | -3.74936800,-3.41839200,1.59681200 98 | -1.11290400,-0.64188580,-4.70901500 99 | 0.02658273,3.49995200,4.01607100 100 | -3.25121000,1.53980400,1.69255700 101 | 2.40091400,-3.30511300,-2.88393700 102 | 1.80988900,2.70075100,-4.28557900 103 | -3.00132600,4.37700200,-1.95862300 104 | -2.18072200,-3.12213800,0.55850130 105 | 3.10093300,-4.04596800,-1.06000100 106 | -1.54633400,-1.08976500,2.33661900 107 | -3.86872900,-0.22001200,-4.19893700 108 | 1.35843900,3.81445700,2.19812400 109 | -2.89942000,0.92330510,-1.67067900 110 | 0.57347110,-4.22371900,-3.48497400 111 | 4.08187500,-3.81961700,-1.41970200 112 | -3.55232700,-0.97097450,2.39519100 113 | 2.26528400,0.78117190,-2.54844300 114 | -3.55337300,3.22480700,-1.72974900 115 | 1.66541900,1.99565400,-2.46522300 116 | 2.79734700,0.99777030,-4.91815200 117 | -3.15014200,0.61690060,3.81869000 118 | 1.30961800,-1.84506400,-1.94570000 119 | 1.52403500,-0.51145930,2.88309600 120 | 4.96871400,3.20675900,0.13385910 121 | 3.10899500,3.35600700,0.85866700 122 | 0.33812070,-1.59033200,-3.94681200 123 | -4.29690900,-1.60450300,-2.57358400 124 | 4.49486700,1.50618400,-4.05880200 125 | -0.20527410,-4.03533300,-4.95721400 126 | 0.02186142,0.71234580,-1.83814800 127 | -2.79095100,-3.09631300,-1.92531700 128 | 4.18745400,1.05066000,-1.93206000 129 | -2.09400900,-2.33803900,-1.42505500 130 | -0.31519960,3.72422400,0.88230760 131 | -2.95687600,2.30231900,1.20034600 132 | 1.44812900,-1.47065000,0.71307450 133 | -2.60962700,0.46943930,-2.61536400 134 | 4.10170800,4.96553300,-3.39757100 135 | 1.94975300,-2.57353600,0.51448710 136 | 4.01855900,-2.51104000,3.84106200 137 | -4.25954700,-0.63994930,3.50374100 138 | 1.62920200,-0.69845820,-2.62874700 139 | -0.19799100,-2.88852700,1.79615200 140 | -3.91082600,-2.80254900,2.64396000 141 | 4.74929200,2.22073200,2.02527400 142 | 0.02601193,1.36380500,-4.15480900 143 | -4.05075000,4.17595200,-2.15202500 144 | -1.21669200,4.94455200,1.38102200 145 | -0.19585830,-2.71690400,-1.22992600 146 | -4.35778300,1.95051400,1.43407900 147 | 0.28133970,-0.10363770,4.39411700 148 | 0.91522950,3.54304200,-2.68520300 149 | -0.84547990,0.28891940,2.54621600 150 | -3.09532300,1.63963800,-0.96492240 151 | -1.09773500,-3.03836200,-0.58072500 152 | -1.11082800,3.03888000,-3.91930700 153 | 2.03843700,-4.09338700,4.44897200 154 | 2.38171800,-4.97210400,1.07939400 155 | -0.48413190,0.28748230,3.76726300 156 | 4.66597100,-2.56971600,-3.04916900 157 | 3.84722900,4.25421000,-0.64239970 158 | -2.54878300,-4.51157500,-2.79101800 159 | 3.85385300,0.67693710,-1.05390200 160 | -4.87906600,1.85535700,3.11244000 161 | 1.42715400,-3.42930000,-2.17214600 162 | -2.92794100,-4.78710000,1.84180800 163 | 2.50139100,-4.74227800,-3.35628100 164 | 1.68217300,-1.70122500,-3.67609600 165 | 4.40445700,0.49024340,0.88201340 166 | 4.06466900,4.72811600,2.24840600 167 | 1.48766400,-0.68053710,-1.34113300 168 | 3.46902100,-0.32964860,1.58750400 169 | 2.26035600,-3.03875500,1.54486500 170 | -1.24851600,-2.49268900,-4.13970200 171 | 3.85616100,1.55110300,4.35274600 172 | -4.22707900,3.25118600,-2.66342500 173 | 3.99125600,3.50555100,0.02571134 174 | -1.14182800,1.21175400,0.90663820 175 | -4.57650100,-1.40778400,4.21268100 176 | -4.97569000,0.74926030,-1.11035200 177 | 4.44124900,3.80581600,0.90885300 178 | 2.55043000,0.44144130,2.74155000 179 | -2.49440900,-0.39432710,3.95375100 180 | -2.17655700,-0.48305300,-2.35418900 181 | -3.34779700,4.52309100,4.91813000 182 | 1.07640200,-3.37233200,0.11540540 183 | -2.66054200,3.76795200,-4.89398100 184 | -2.76013700,0.54535250,-4.41755400 185 | 4.40591900,2.97717900,-1.68791100 186 | -4.27162500,-2.93647400,-1.12305700 187 | -4.55613000,0.40688350,-0.21823620 188 | 3.27953500,4.46435900,0.58746710 189 | -4.89611700,0.75894800,2.03971800 190 | -1.89463000,3.22746800,4.40821400 191 | -2.10117600,1.08880000,0.14623860 192 | -3.98519900,-3.02045000,-2.60810200 193 | 3.87838100,2.67857400,2.62790100 194 | 3.41327600,-4.82070000,1.43493800 195 | 2.48541400,0.16522920,0.96707450 196 | 4.29610600,4.99557300,3.68632900 197 | -4.33274900,3.01127600,1.97690900 198 | -3.24129600,-0.65331170,3.27856500 199 | -1.28424200,-4.51308500,4.94333900 200 | -3.27868400,-3.89168900,2.81772700 201 | 1.73402100,-2.72441300,-1.56531800 202 | -3.85440500,-4.09671700,-2.69479400 203 | -2.10389900,2.56525300,-4.66305100 204 | 0.76855810,-3.03174800,2.39734100 205 | 0.79369500,3.08174800,-1.32841800 206 | -3.58459200,-4.76130600,-1.93220200 207 | 4.33883800,-2.00179300,-2.29326200 208 | -0.94103060,2.61032500,-1.83952300 209 | 2.29912500,-2.37297200,-2.44595800 210 | -0.55889660,4.18461100,-0.07184205 211 | -0.36322240,-3.33950900,-2.24089800 212 | -2.91435100,4.65001300,2.80197800 213 | 0.20553090,1.19167000,2.86175000 214 | -2.80182000,3.96489900,3.91254800 215 | -3.93535100,-4.00532200,0.73439630 216 | -4.47190600,-2.18505900,-3.46909900 217 | 0.24921700,4.98790500,-2.46071800 218 | -0.65746470,-4.06100900,-2.84990400 219 | 4.82807700,-4.61499700,1.28002400 220 | 3.21147000,0.53468330,-2.10011000 221 | -2.18757500,-3.94011200,3.27245900 222 | 1.20419000,1.44153700,0.54957050 223 | -3.35199100,1.42811500,3.23492800 224 | 3.24988200,3.51607000,3.52387000 225 | 4.85478900,-4.21260000,0.16861220 226 | 4.54784900,-0.14576340,2.14936500 227 | 4.47494200,-2.80718400,-1.28513100 228 | 2.95480200,-4.48201400,0.40348340 229 | 1.53960400,-1.79627600,3.51809800 230 | 2.28601700,-4.03984800,-2.25031900 231 | 1.02505200,-1.83569800,4.43474000 232 | -0.19419080,2.65188800,-4.13273600 233 | -1.99236400,2.91729800,-0.04802035 234 | -1.84645400,0.62598140,-1.93638100 235 | -1.40351000,3.94836800,0.58322710 236 | -1.40108000,0.25149960,4.88303100 237 | -2.93365200,4.35000500,-0.18228000 238 | 0.29772180,-3.20560600,-3.15462400 239 | 2.27040400,-3.76826300,-0.22639210 240 | 0.50944220,-0.67781390,0.51275020 241 | -0.63736490,1.27388400,1.90422100 242 | -0.18668480,-0.84916400,-4.60520600 243 | -0.43478670,-1.28720800,0.04964779 244 | -1.29828200,0.07585201,1.55095000 245 | 1.02445800,0.25008250,-2.04677800 246 | -4.04803300,4.47669800,4.06505400 247 | -4.40611400,4.14875300,-4.86344300 248 | 3.59576800,2.07042600,-4.36115600 249 | -4.19182000,3.73287300,2.86436200 250 | 3.32000000,-2.51512200,-1.67622800 251 | -3.78872000,3.51575200,3.95357300 252 | -2.15197300,1.64974600,-2.22052900 253 | 2.67991700,-4.87327200,2.22433700 254 | 1.95126400,1.24463400,4.23282100 255 | 4.39016300,1.60067300,1.06791500 256 | -3.07837200,-4.97650900,-1.06022800 257 | -4.77249700,-3.62737800,-1.95576000 258 | 3.32306200,-0.88498310,-1.41314000 259 | 3.20436600,-3.60727800,-2.16660000 260 | 0.91118870,-0.02701443,-3.06333200 261 | -2.29559000,3.56836300,-2.16409600 262 | -2.08920800,2.19907000,4.19748200 263 | 2.74942000,1.82733500,-2.11864300 264 | -2.74269500,-2.26420700,0.40529980 265 | 2.24396000,-0.83855160,-4.04017100 266 | -4.30345000,0.45853370,-3.37092600 267 | -2.66205400,-2.71718100,-0.53178000 268 | 1.62687300,-3.53656100,2.19115500 269 | -2.71317200,0.18403970,-0.45659230 270 | -0.77300410,-2.38961800,1.12991700 271 | 4.00312500,-1.83116700,-1.05279700 272 | -3.18253600,-3.03364600,-4.92288700 273 | 0.70780830,4.74197200,-0.56229340 274 | -4.57903600,0.41339620,-4.61984600 275 | -4.94535000,0.76076290,-2.61997700 276 | 0.95266320,2.95748400,3.87697600 277 | 1.53877400,4.34015700,1.38834200 278 | -0.52206520,-4.22705700,1.18724500 279 | 3.43589000,2.38661400,0.32424980 280 | -2.37461400,-3.84286500,2.04241100 281 | -1.14158700,-1.82210700,-2.99676600 282 | -4.84573400,2.17935300,0.35278120 283 | 4.47374000,-3.93322100,2.83732600 284 | -0.98839620,3.53941100,-2.73044600 285 | 1.33816800,-4.68605500,-2.67451200 286 | 0.34714240,4.53211300,2.49720700 287 | -4.51198700,4.34256500,-1.13234700 288 | 2.91341500,-0.11734770,-4.74482800 289 | 4.33169000,2.72613000,1.10804800 290 | -0.71623610,0.05513993,-4.05226200 291 | 3.65534700,-3.09277300,2.73068800 292 | 0.04883926,3.43562600,-2.07853300 293 | 4.27128300,-2.92896100,0.88818110 294 | -0.57618650,-3.58614800,2.92270100 295 | -2.64443500,-3.32674800,-2.87163300 296 | 1.86046500,3.04950400,-1.00388500 297 | 4.78984000,-0.25041790,-0.77422630 298 | -2.32464900,1.29668300,3.60858700 299 | -1.34672200,0.25538540,0.02502410 300 | 0.56702960,0.58333390,0.63770120 301 | -2.17280800,4.96218800,-0.30277420 302 | 1.38900100,-1.72265600,-0.95955590 303 | -1.26163400,3.93960200,-1.47062400 304 | -4.14716300,1.59669200,-0.25000390 305 | -2.97295900,3.42483600,1.51335800 306 | -4.28869200,-1.47757200,0.61783830 307 | 3.07207900,-1.50539200,3.32655900 308 | -3.53711100,-3.01957500,-3.65061700 309 | -2.71817900,-3.08487100,3.63302100 310 | -3.52185400,0.85303230,2.34746200 311 | -2.63383900,1.62722100,2.50755800 312 | -2.19770800,-0.52691510,0.24953320 313 | -1.21201300,1.57292300,-1.58763400 314 | 4.40283900,1.46151000,-3.03361800 315 | 3.67291400,-3.89758200,-4.34176400 316 | -1.68535900,-4.15234500,1.20148900 317 | -2.44906600,-3.23186800,-3.89619600 318 | -2.98742200,3.06784100,0.39008160 319 | -0.23122640,-4.65676900,2.51465500 320 | -0.00974490,2.64041200,1.46029300 321 | 2.30777000,2.67271500,0.37456510 322 | -2.49764200,-3.92528800,-0.59419680 323 | -4.89443800,-2.09292400,1.31985800 324 | 2.19325800,2.30511200,2.10474600 325 | -0.84125260,-2.97745800,-4.99063300 326 | -2.28374000,-4.13938400,-4.19087200 327 | -1.43699400,-2.59742400,4.15703600 328 | -2.84407400,3.27367400,-0.70354010 329 | 0.78484930,-0.15388760,1.53860800 330 | 3.73791000,-4.12559200,-0.24618360 331 | 3.75670000,-2.16989600,0.01550454 332 | 0.32939370,0.03391245,-4.33500600 333 | 2.02181600,4.98343600,-1.93633800 334 | -4.80628300,4.75852400,-2.82188300 335 | -2.92800900,3.55110400,2.65960000 336 | 1.35928000,2.69884600,2.87849800 337 | 1.38427300,-0.95479640,1.52202500 338 | 2.90758800,-0.11598460,-0.93864940 339 | -3.77364100,-1.17598600,-1.57087100 340 | 1.62344500,4.09800700,4.33371200 341 | 2.63117300,-3.03604900,-1.12113300 342 | -0.89721630,-3.79072800,-1.32430900 343 | 0.59064680,2.48273500,-2.58204500 344 | -3.62669900,4.79911100,-2.90469900 345 | -4.29632100,-2.86324900,3.68572400 346 | 4.00461600,4.05991000,4.13028100 347 | 3.63348100,3.31344500,-4.11391600 348 | -2.32008800,-3.75763800,4.57163300 349 | -3.23358700,-1.01192600,-4.50355700 350 | 1.82233200,2.82649900,4.49678900 351 | -1.96385600,-4.75327900,2.44196300 352 | 3.40068200,-1.22202700,2.16558000 353 | -1.20787600,-1.88010900,2.87726500 354 | -0.73147130,-1.24484000,-1.27337400 355 | -0.81003670,-4.92465800,-4.22304500 356 | 2.10846800,-2.94506300,3.62672400 357 | -1.38100000,2.07810600,-3.88440200 358 | 3.19230600,-1.09598600,-4.50313000 359 | 4.64358000,3.61824900,-4.69015600 360 | -0.39242920,-3.34358500,3.97120100 361 | -3.42519200,4.77302200,0.95988710 362 | 4.97905900,-0.57323970,0.29572160 363 | -1.64270000,-2.53918000,-2.34283000 364 | -3.94755700,0.89938640,1.28161500 365 | -2.81651300,1.08203700,0.91068490 366 | 2.09542200,4.47341900,0.21176930 367 | -0.16203830,-4.92211600,-3.39824500 368 | 0.40642380,-0.86064380,-2.49978500 369 | 3.98529600,1.75956000,3.31116400 370 | 4.00416700,4.22058600,-2.66921400 371 | -2.62488700,2.07066100,-3.16253400 372 | -1.65928900,-3.41374400,-4.55992200 373 | 4.88069800,-4.28632300,-3.11450200 374 | -3.42367800,-2.27673200,-1.95158800 375 | -2.02486800,1.21198300,-3.24651300 376 | 4.08755400,3.56134300,2.03372700 377 | -1.09335500,2.23997800,3.73970300 378 | 2.46327900,3.64202300,4.69799300 379 | -4.99447800,0.10452540,3.18404500 380 | 1.16918100,-0.82694310,3.89182800 381 | 0.57888910,-2.29708200,0.25680600 382 | -4.76137800,-2.48013600,0.39105300 383 | -0.31856790,3.95771000,3.05585000 384 | -4.81523900,2.96527500,4.73260400 385 | 2.29765400,1.72322500,-0.35464950 386 | -0.04628072,-4.42913300,-1.69233400 387 | -1.33201700,-0.63932040,-0.40741110 388 | 0.07919868,0.60714200,-3.34186400 389 | -2.82743700,-2.84020600,2.54405500 390 | 2.44517000,-0.41916970,0.12352220 391 | -3.49830400,-1.10008700,1.27816500 392 | -1.72650800,-4.58223000,-1.09095400 393 | 3.10758100,-4.35256900,4.61694200 394 | 2.44421500,-1.63085500,0.23903110 395 | -0.67963170,1.28343100,3.61260700 396 | 3.19133800,2.83172700,-1.86197600 397 | -4.43104100,-4.98005400,0.34075940 398 | 3.50515400,-0.41916170,-2.63168400 399 | 1.67436100,-2.07449100,1.45289700 400 | 3.18077600,-2.78971300,-4.01025700 401 | 2.80530900,-2.03082500,-3.39438600 402 | -0.22474460,-2.45382400,-4.02297300 403 | 4.65753900,-1.19689300,-0.49684400 404 | 1.94764700,0.03408581,1.90655800 405 | 1.18619200,2.66249400,0.60640080 406 | -1.41747400,-1.56946300,4.48551300 407 | 0.93029810,3.83933500,3.13310100 408 | -1.47379400,-4.00284700,-0.27371630 409 | 3.30257500,-3.89704900,-3.16634800 410 | -1.40112100,2.24335300,1.00358200 411 | -4.28642900,-0.10698010,0.94263350 412 | 0.70552890,2.17251400,-4.74414300 413 | 1.32812900,0.44448250,4.52238200 414 | -2.50473300,4.84181100,-3.54745400 415 | 2.09894900,-1.31471100,2.43928000 416 | 1.59885600,4.87061700,-3.84733500 417 | -1.74872800,-1.18284200,-1.52094800 418 | -1.04887200,1.53165200,-0.40428150 419 | -0.65611910,-1.88637600,-4.85585400 420 | 1.29628100,-2.50558400,-2.78278000 421 | -2.04283600,-1.56069800,-2.52100400 422 | 4.74073700,3.60025700,-0.88872960 423 | -0.07179821,2.15184800,3.41645700 424 | 2.75013800,-0.69735160,2.78086800 425 | 3.15566300,3.99065000,2.49119400 426 | -3.78481100,-2.34557300,1.38476900 427 | 4.27026900,0.71767420,3.61357500 428 | -3.27127100,1.73335700,-2.27207500 429 | -3.94567900,2.37637200,4.32741400 430 | 2.66333000,1.58881200,0.60087140 431 | -3.95907300,-4.54083700,1.88559400 432 | -1.45527200,-1.31543600,0.44930150 433 | -2.00756600,-2.14324200,-3.44346600 434 | 4.00906900,4.16290100,3.09800000 435 | 2.43278300,-1.66826100,-1.47284300 436 | 1.91829500,1.95888900,-1.47210000 437 | 0.67436070,-4.47763900,3.12386300 438 | 3.66026200,2.75351700,4.72712300 439 | -0.57021980,-4.72009500,-0.70187950 440 | -2.22445200,2.72722400,2.19053300 441 | 1.74047300,-3.89649700,3.11598500 442 | -4.67892800,2.08389200,-3.48081900 443 | -2.78954600,-2.22856900,-4.15291100 444 | -1.91256600,4.48687400,3.28895900 445 | -3.81934600,-0.21506060,-0.43169280 446 | 1.80963000,-3.36707900,-4.50862300 447 | 0.92775740,-2.54631000,-3.76338000 448 | 2.28111300,-1.03297200,-0.63373310 449 | -0.95117930,0.85170230,-2.42771300 450 | 1.81143900,-2.39462000,2.56716400 451 | 3.68674900,-1.81997500,1.37800300 452 | -2.97998000,-0.20318590,-3.49402400 453 | -0.33761570,1.94220600,4.49925900 454 | 0.02243021,-1.73582000,0.94068170 455 | -3.73386100,0.65928290,-4.95373100 456 | 0.87109390,-2.55630600,-0.73525710 457 | -4.73380300,-3.36981300,1.00724100 458 | 3.62440900,3.39321000,-2.90301600 459 | 2.77992700,2.17612300,4.57728100 460 | 0.18444860,0.19960970,2.39426900 461 | -0.10056280,3.44639000,-3.32838300 462 | 4.17275700,2.60018400,-0.45376610 463 | 0.89762320,-4.63240800,2.05356900 464 | -4.94949000,-0.70303390,-4.03984200 465 | -2.09931900,-2.39286100,4.97477800 466 | -4.21187100,-4.71226900,-0.79093230 467 | -3.61727700,1.62919400,0.62913800 468 | 3.58967200,-2.94309600,-0.65439510 469 | -1.81787700,-0.23870000,-1.21228200 470 | -4.91312500,0.43797230,4.20457700 471 | -4.73633500,-2.50751900,-1.96342200 472 | -3.99972600,-0.00870368,2.81081300 473 | 4.32505400,-2.49062000,2.00836100 474 | 2.64973100,1.20830100,-1.29295800 475 | 4.89440500,3.81185300,-2.31406600 476 | 0.57043940,4.18260600,0.23493500 477 | 3.73922800,2.22549800,-1.33949300 478 | -4.92037000,4.08009700,2.07169500 479 | 3.44596000,1.08978400,-3.94016500 480 | 0.76626910,1.79288200,1.39462600 481 | 1.23978400,-4.90841200,0.63370640 482 | 1.74056300,1.67347100,-4.80200700 483 | 2.51414200,-1.15650700,-3.02481300 484 | -0.29361920,-0.75273620,1.62639900 485 | 4.55368600,-3.07881100,-0.18286880 486 | -4.72853800,1.09669500,0.54962730 487 | 3.37914300,3.23102200,-0.83584480 488 | 2.46854100,-0.85625340,-1.96563000 489 | -1.91424200,-0.07873166,-4.10735800 490 | 2.54610700,-2.58690000,-0.22905660 491 | -0.84349490,-2.87664800,-3.10400300 492 | -1.15501300,1.83416800,-2.74544400 493 | -1.97071800,3.40474200,3.07881600 494 | 3.54638200,-4.10352300,2.42104500 495 | 1.19682100,1.73129300,-3.84236000 496 | 0.93441570,0.88362150,-4.39050400 497 | -0.47808980,-3.70119300,-3.81701100 498 | -0.54529800,-0.08918454,-2.79577300 499 | 4.31849200,2.58862000,-3.73320500 500 | -4.64808400,3.42569800,1.09592400 501 | -1.87488100,3.01958400,-1.35002000 502 | 3.68820800,1.21161100,0.49124580 503 | 1.02786700,-0.57377490,4.88886000 504 | -0.03015584,-1.90744900,-2.95023200 505 | -2.55202300,-1.24174700,-3.61046900 506 | -2.02011900,2.33641200,3.20953800 507 | -1.16211400,-4.64711400,3.15499700 508 | 3.16286200,3.04651800,1.85879300 509 | -0.21437910,-0.34778780,-0.47430700 510 | 0.03101280,-3.15403400,0.84153770 511 | -1.05386800,-2.84990700,2.40940000 512 | 2.13940600,2.98886300,1.36812700 513 | -4.30959300,2.33921400,-2.22865900 514 | 1.45823100,3.64943400,-4.75036100 515 | 3.83639800,-2.03486100,-3.57265100 516 | -1.18402300,-3.31443400,0.67860170 517 | 0.32640870,2.82755000,-0.12038430 518 | -4.89152600,-1.35560300,3.18811800 519 | 3.61761100,-1.91375300,4.77713300 520 | -1.00799400,-4.91465500,0.37090050 521 | 4.24247800,-4.78246000,-2.31379100 522 | -1.99567900,-1.26596700,3.76538600 523 | -2.32533500,0.70215110,4.49489000 524 | 4.42317800,1.37874000,2.32215200 525 | -1.35438000,-3.86894700,2.13761600 526 | -4.85368600,2.46567500,-0.67920870 527 | 3.68761800,0.34774120,2.62406500 528 | 2.72284300,3.07097900,-3.54017200 529 | 0.07103168,3.72388500,-0.76055680 530 | -3.96087200,1.35711500,-4.12059300 531 | 0.70276270,-0.83089370,2.40326900 532 | -3.84076600,2.34366700,-4.63011400 533 | 4.57792100,-1.54642700,0.47976550 534 | -1.09226000,3.33109500,3.70564300 535 | 4.72895900,-3.69886000,-4.64850000 536 | 1.13143900,1.99977500,4.31675000 537 | -0.59005030,-1.86604000,3.80812000 538 | -2.57594400,4.00988400,0.71382290 539 | -1.98655600,1.55541900,1.59729600 540 | 0.19234610,-0.58241650,-3.49261000 541 | 2.90951400,2.45866500,3.33795900 542 | -3.59613600,-0.82480090,4.28244700 543 | 2.76186500,-4.09231000,1.39933900 544 | 1.76840200,3.79648800,-2.04991800 545 | 0.84480360,4.43779200,-1.70078000 546 | 1.44757000,2.72695500,-3.14372400 547 | 1.40840700,1.01911400,-0.97928560 548 | -2.74590400,-4.23516900,-1.73976000 549 | 0.18612470,-1.10209000,4.46447400 550 | 2.03897700,-3.72144300,0.75155220 551 | 4.76011200,1.46118600,-0.46061410 552 | -1.85520600,-3.05178400,2.99265700 553 | 1.37992500,0.68518250,2.58159400 554 | 0.34812660,-4.18649400,-0.66087470 555 | -0.82931770,1.31747800,-3.54218400 556 | -3.48347300,4.06880400,-4.11588100 557 | -0.33786540,2.19866500,-3.12914700 558 | 3.19834300,-1.36191700,-0.56191960 559 | -0.34489880,-1.85023200,1.94410500 560 | -2.00535200,3.12739400,0.95973730 561 | -3.16634000,-4.63402000,-0.06531222 562 | 2.43655600,3.19896300,2.64236600 563 | -0.51765040,-2.45228200,0.06311047 564 | -0.71211510,2.92766800,0.27351280 565 | -3.06476300,1.09403800,-3.51164400 566 | 4.24620900,4.93623700,0.60054920 567 | -0.82487660,1.60506300,-4.63151300 568 | -1.82243300,4.37183000,-2.76043400 569 | 3.08027500,-4.95843900,-2.50159400 570 | -1.78707400,0.99161100,2.72157700 571 | 2.88700000,0.77735590,-0.25880700 572 | -0.89497550,4.80053000,-2.59951600 573 | 0.40746690,-1.64712000,3.58950900 574 | -1.61132800,-4.28731600,-2.08961000 575 | -4.36696100,-0.60970640,-2.88958500 576 | -4.87063300,-3.98536600,-1.01682300 577 | -3.00821100,2.86730300,4.08569400 578 | -3.80339800,3.76356400,0.46003960 579 | 2.44004400,-0.90092930,1.43673200 580 | -0.33754580,0.74076250,0.05836367 581 | 0.17377530,2.94311200,4.88859600 582 | 0.83225760,-0.10733990,-0.73373660 583 | -4.87621800,-4.74312100,2.34371700 584 | -2.61785900,-0.88389120,-0.91244060 585 | 2.14878200,1.03977200,-3.94224100 586 | 2.01745800,-2.66176800,-3.51179600 587 | 3.48031300,1.66751200,-0.50414680 588 | 4.68751700,0.42117060,-3.75926900 589 | 4.09760700,0.96979880,-4.79752800 590 | -4.87817500,-2.19181500,-0.63253090 591 | 2.77618800,3.94437600,-2.33585700 592 | -1.80421800,4.75794600,-4.56564900 593 | -3.89882400,0.48590890,-2.36781900 594 | -3.06304100,3.04532700,-4.17576000 595 | 3.07583600,-2.53258100,3.28107200 596 | -1.86776400,0.93868490,-0.90325370 597 | -1.89994100,-4.77328900,4.07538800 598 | -3.31087200,-3.52967100,0.17100830 599 | -3.59431200,0.74262620,0.13234350 600 | -0.80054970,-0.59692300,4.33414400 601 | 1.22924000,3.49079200,-0.44067150 602 | -0.72703120,4.24047600,-3.65013600 603 | -4.15133500,1.45197700,-2.89344900 604 | -1.70906900,-3.52089500,-3.28467300 605 | 0.88813280,-2.70067800,3.56004400 606 | 3.53056600,0.22453030,0.39984730 607 | 1.08798100,-0.75825650,-3.91779400 608 | 2.96418200,-3.20274700,4.16626800 609 | 3.52604100,-0.94925660,0.55776860 610 | -2.68871200,1.93432700,0.19945950 611 | 2.22766800,-0.70664020,3.65367600 612 | 4.38351100,-0.00708488,-1.73139200 613 | 4.78555600,2.65734500,-2.69619800 614 | 1.80447800,-2.77077500,4.51612300 615 | 4.81251800,-1.34874600,-3.30105700 616 | 0.45870710,4.92368300,-4.35160900 617 | -1.64461600,0.14266630,3.41485700 618 | -0.14307220,2.41802600,-1.05671500 619 | -4.85496800,4.18470100,3.50813200 620 | -3.09213200,-0.47993340,-1.81740000 621 | -0.27577300,-1.22334500,2.73047600 622 | 3.95248400,0.48579950,-2.90123400 623 | -0.99041700,-0.21478830,-1.84869900 624 | 1.63898100,3.68640700,-3.65921700 625 | -4.69903900,-4.68182800,-1.76512500 626 | 3.75913600,-3.91223200,3.62816400 627 | -3.33940700,-4.79413200,-4.10737600 628 | 1.97883500,-1.43912200,4.60371000 629 | -1.36652100,-3.88768100,3.91193700 630 | 2.49989300,0.96948920,1.78588600 631 | -1.92812900,3.88835800,-0.21576280 632 | 0.40947170,0.99552940,4.09736300 633 | -3.92459100,2.69310200,0.91797000 634 | 4.76664100,-3.33355700,3.70974000 635 | 0.90699490,0.18034410,3.61004800 636 | -4.22667900,2.68252000,3.21377700 637 | 3.27013900,-0.13015570,3.46270400 638 | 1.55838300,-4.85639700,3.62808900 639 | 3.24768600,4.98746200,3.13846200 640 | 4.93292500,1.53187800,4.08914700 641 | 2.58115100,-3.53153000,2.58296100 642 | 0.05165452,-3.92355700,1.99325900 643 | -3.68517700,-1.09395000,-3.56704300 644 | -0.24767180,4.49845600,-1.62132300 645 | 0.06629888,4.82832900,1.53416800 646 | -3.99242400,-2.45958100,4.64698800 647 | -2.03393900,0.43142920,0.88471400 648 | -4.52807700,3.21633100,-1.58126200 649 | 1.17920900,1.40236000,3.31160500 650 | -1.92797400,-3.47075500,-1.41055100 651 | 1.30297400,-0.15239430,0.64890240 652 | 2.12678800,0.38335550,-1.66165600 653 | 0.43536720,-2.66610300,-2.13537800 654 | -0.00232463,2.11243900,2.26692900 655 | 2.74104700,4.76496100,-0.77423030 656 | 3.48244000,0.71044140,1.46520900 657 | 4.41941400,4.45557600,-1.54961000 658 | -4.65991000,-3.32340800,2.12398100 659 | -1.82614900,-2.64424100,1.58758400 660 | 0.65175430,1.97823400,-1.50438300 661 | -1.09557800,1.75823300,2.82438100 662 | 0.07911974,-4.86677500,0.15955270 663 | -1.48962600,0.32322880,-3.13486300 664 | 2.40572000,4.17502900,1.81912900 665 | 0.75499820,4.34492300,-3.54921300 666 | 3.56495400,2.08854900,1.56522500 667 | -1.04248800,2.67102000,-0.72661780 668 | -2.03324500,4.77703600,-1.87205500 669 | 0.66803870,4.06314500,4.63254400 670 | 0.09492172,-0.33707460,-1.55250100 671 | -1.51520300,-2.37083400,0.31558460 672 | -3.78091600,-3.69771500,-4.47714100 673 | 1.01693300,-1.54461700,-2.92572300 674 | -0.69857950,-1.01667800,-2.39776400 675 | -1.30976900,4.51122900,-0.60517130 676 | 3.13361600,1.13177400,-2.92276600 677 | 2.76863700,-4.17181700,3.40855900 678 | -3.63040200,4.27963800,1.89554900 679 | 3.24381800,-4.89628300,-4.08658400 680 | -3.21037500,-1.92010300,2.75056100 681 | 4.06266800,-1.82906500,3.01813200 682 | 4.41495100,-3.69933600,1.84755000 683 | -1.18871700,-1.33050200,1.43948800 684 | 3.01296600,-2.23555700,2.16765800 685 | 1.89131000,0.00630056,-3.50102200 686 | 1.56829100,0.73529220,1.26375200 687 | -1.63764900,3.62212500,-4.60794200 688 | -0.06092353,-2.43515300,4.39784800 689 | -4.27472100,4.00369300,-3.40894900 690 | -3.14162200,-4.74574300,3.83804200 691 | -2.78835500,-2.05451000,1.58447000 692 | 0.28607410,4.57959000,3.62817800 693 | 1.16021600,-4.61596000,-1.48648900 694 | 0.70057770,-1.90510900,2.30301200 695 | 0.32382640,1.43685000,-2.88129500 696 | -4.97780000,-2.48656000,2.77278900 697 | 2.62536300,-2.19941000,-4.64830300 698 | 3.22003300,4.29869400,-3.35673200 699 | -3.77312500,2.57649100,-3.44555700 700 | -0.31197750,-2.37173200,2.90794200 701 | 4.81431600,1.88128100,-1.77550100 702 | -0.61107570,-2.18408400,-2.02127200 703 | -3.53817900,4.10437200,-1.00788200 704 | -3.45696700,-3.77357100,4.23602100 705 | 2.75462000,-3.38901700,-4.80662100 706 | -2.67245900,2.56205100,-2.03617000 707 | -3.49254300,-0.10159430,1.83959200 708 | 0.24428640,-1.55580700,-1.68030500 709 | 1.08511800,1.84358900,2.37603800 710 | 3.10978800,-0.87116250,4.43757600 711 | 0.62788750,-4.70884700,4.39583000 712 | 2.25654800,1.90545100,-3.35023100 713 | 3.79981100,-0.43071950,-0.34299580 714 | -4.32444100,-3.32339700,-0.25525270 715 | 0.10591280,3.94003600,-4.49742500 716 | -4.57473700,-4.28575200,3.48529800 717 | -3.74651600,0.69388550,-0.93462620 718 | 3.41450300,-3.20396100,1.58947400 719 | 3.96657900,4.33093900,-4.29207300 720 | 1.91232900,0.70014210,0.22046340 721 | 4.55603400,2.15698300,4.93575200 722 | 1.41125600,-4.49713600,-0.36051810 723 | -4.65649400,-3.12823100,-3.88847800 724 | 1.79842600,1.81122100,1.31740400 725 | -2.32665400,-0.43958150,1.55305300 726 | 2.13985500,0.35809200,3.72395700 727 | 3.47306600,4.12627000,1.50859700 728 | -3.09815900,-2.20024300,-2.97402700 729 | 3.73384800,4.74601600,4.86066400 730 | 0.63973430,1.07541200,-0.29224540 731 | 0.09354098,-1.79425100,-0.58986640 732 | -1.12556500,4.45917000,2.62196700 733 | -2.21529000,2.01681700,-0.78260530 734 | -4.11611300,-4.72889600,-4.92568700 735 | 4.73942200,3.71894400,-3.48179000 736 | -3.90215600,2.21622600,-1.32244400 737 | 0.28001030,3.09193400,2.77523300 738 | -4.25298000,-1.23999800,-0.40414420 739 | 1.66701000,-4.37300100,1.63721600 740 | -4.61939800,-1.48341300,-4.75923300 741 | 4.02595800,-0.12261900,-4.27360100 742 | 3.02573900,1.03651700,3.73697500 743 | 3.31061300,-1.65048200,-2.56699300 744 | -1.05851000,2.88108100,2.83274800 745 | 3.16947500,0.08285385,-3.66696100 746 | -2.77693300,0.20712200,2.91552900 747 | 0.44134270,-3.84392500,-2.48811200 748 | -3.04204100,-0.14733770,4.83866200 749 | 1.20054400,-4.16796500,-4.72794500 750 | 4.25030600,-3.41374400,-2.56696600 751 | 1.35114700,0.97151950,-3.07644300 752 | 0.60491970,-3.71009300,3.78568500 753 | 0.60943910,-2.31430400,-4.65667400 754 | 3.40973800,-2.90353700,-2.95963300 755 | 4.55510600,-0.44451210,-2.69264300 756 | 2.38595800,2.93178200,-2.43456100 757 | -2.34771800,4.35173600,1.73138200 758 | -3.22598500,-0.38594520,0.53996650 759 | -0.25845480,-4.44695400,3.57290100 760 | -3.61698600,3.30068300,4.91415000 761 | 4.74163400,-1.51700000,2.15896600 762 | 1.91955400,0.12113820,-0.63556260 763 | -4.72827800,-2.46426400,-4.69152800 764 | 1.01891000,1.28271700,-2.06978000 765 | -3.40369700,-1.94299900,-0.90062230 766 | -2.31554100,1.50656300,-4.86394400 767 | 4.16431500,-0.35948760,4.14464100 768 | 2.17338500,-0.21477180,4.55260400 769 | -0.05577375,-0.51654470,3.44474500 770 | 3.89413300,-4.06535700,0.93853950 771 | -2.73871700,-4.11302500,1.05734500 772 | 2.46020400,-3.68992200,-3.73809100 773 | -0.43716080,0.54240590,1.18279200 774 | -2.28086600,4.95265500,0.91947600 775 | 3.31543800,2.12844900,-3.40410900 776 | -1.24285600,2.29858100,2.02908700 777 | 4.34534400,-4.71293000,-4.37610100 778 | -4.49422800,-3.56619000,4.63878500 779 | 1.91229500,2.15255100,3.65483800 780 | -2.78870600,-3.11588700,1.31671400 781 | 4.40503600,-4.84990900,-0.62445560 782 | -0.38750560,0.48233810,-4.95970500 783 | 1.52986600,4.71306700,2.75114100 784 | -1.23379700,1.34280800,4.42784400 785 | 1.67277600,0.08815451,-4.60785400 786 | 3.13407200,-3.42222800,0.47487690 787 | 0.79965390,3.03438700,-3.86692400 788 | -0.82047390,3.60892200,4.81271600 789 | -4.61228600,1.47389600,-4.88107600 790 | 3.05361700,-2.41728900,0.94786290 791 | 0.68172950,-4.05168500,0.80935690 792 | -1.03466600,2.58732100,-4.99077500 793 | -4.25077700,3.23245500,-4.22241800 794 | -2.93218500,1.93016400,-4.13578600 795 | -3.89168300,1.85540400,2.51019300 796 | 4.51728500,0.61627750,-0.10467430 797 | 2.79727600,2.37874500,-0.98691340 798 | -3.10466300,2.46449200,3.04791700 799 | 3.17583900,1.66529200,2.52776500 800 | 3.49745600,0.37549250,4.39339900 801 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Lean-Installation.md: -------------------------------------------------------------------------------- 1 | ## LEAN 4 Installation 2 | ## Refer to [Setting Up Lean](https://lean-lang.org/lean4/doc/quickstart.html) -------------------------------------------------------------------------------- /LeanLJ.lean: -------------------------------------------------------------------------------- 1 | -- This module serves as the root of the `LeanLJ` library. 2 | -- Import modules here that should be built as part of the library. 3 | import LeanLJ.Basic 4 | -------------------------------------------------------------------------------- /LeanLJ/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATOMSLab/LeanLJ/11ce41063b96f5fc668e0d011d19db8a8fc33dd5/LeanLJ/.DS_Store -------------------------------------------------------------------------------- /LeanLJ/CSVParser.lean: -------------------------------------------------------------------------------- 1 | import Lean 2 | 3 | import LeanLJ 4 | namespace LeanLJ 5 | 6 | /-! 7 | ## CSV Parser for Atomic Positions and User Input 8 | -/ 9 | 10 | def parseFloat? (s : String) : Option Float := Id.run do 11 | let s := s.trim 12 | if s.isEmpty then return none 13 | let isNeg := s.startsWith "-" 14 | let s := if isNeg then s.drop 1 else s 15 | if s.isEmpty then return none 16 | let parts := s.splitOn "." 17 | match parts with 18 | | [intStr] => 19 | let some intVal ← intStr.toNat? | return none 20 | let val := intVal.toFloat 21 | return if isNeg then some (-val) else some val 22 | | [intStr, fracStr] => 23 | if intStr.isEmpty && fracStr.isEmpty then return none 24 | let intVal := (intStr.toNat?).getD 0 25 | let fracVal := (fracStr.toNat?).getD 0 26 | let fracPow := 10.0 ^ (fracStr.length.toFloat) 27 | let val := intVal.toFloat + (fracVal.toFloat / fracPow) 28 | return if isNeg then some (-val) else some val 29 | | _ => return none 30 | 31 | def stringToFloat (s : String) : Float := 32 | match parseFloat? s with 33 | | some f => f 34 | | none => 0.0 35 | 36 | def parseLineToFin3 (line : String) : Option (Fin 3 → Float) := 37 | match line.splitOn "," with 38 | | [x, y, z] => 39 | let values := [stringToFloat x, stringToFloat y, stringToFloat z] 40 | some (fun i => 41 | match i.val with 42 | | 0 => values.getD 0 0.0 43 | | 1 => values.getD 1 0.0 44 | | 2 => values.getD 2 0.0 45 | | _ => 0.0) 46 | | _ => none 47 | 48 | def parseCSVToFin3 (lines : Array String) : List (Fin 3 → Float) := 49 | lines.foldl (fun acc line => 50 | match parseLineToFin3 line with 51 | | some vec => vec :: acc 52 | | none => acc) [] |>.reverse 53 | 54 | def readSinglePositiveFloat (prompt : String) : IO Float := do 55 | let stdout ← IO.getStdout 56 | let stdin ← IO.getStdin 57 | let mut validInput := false 58 | let mut value := 0.0 59 | while !validInput do 60 | stdout.putStrLn prompt 61 | let input := (← stdin.getLine).trim 62 | let parsed := stringToFloat input 63 | if parsed > 0 && !input.contains ',' then 64 | validInput := true 65 | value := parsed 66 | else 67 | stdout.putStrLn "Invalid input. Please enter a single positive float value." 68 | return value 69 | 70 | def readBoxLength (prompt : String) : IO (Fin 3 → Float) := do 71 | let stdout ← IO.getStdout 72 | let stdin ← IO.getStdin 73 | let mut validInput := false 74 | let mut boxLength : Fin 3 → Float := fun _ => 0.0 75 | while !validInput do 76 | stdout.putStrLn prompt 77 | let input := (← stdin.getLine).trim 78 | let parts := input.splitOn "," 79 | if parts.length == 3 then 80 | let parsed := parts.map stringToFloat 81 | if parsed.all (· > 0) then 82 | validInput := true 83 | boxLength := fun i => 84 | match i.val with 85 | | 0 => parsed.getD 0 0.0 86 | | 1 => parsed.getD 1 0.0 87 | | 2 => parsed.getD 2 0.0 88 | | _ => 0.0 89 | else 90 | stdout.putStrLn "Invalid input. All box length values must be positive." 91 | else 92 | stdout.putStrLn "Invalid input. Please enter exactly three comma-separated positive float values." 93 | return boxLength 94 | 95 | end LeanLJ 96 | -------------------------------------------------------------------------------- /LeanLJ/Code_execution.lean: -------------------------------------------------------------------------------- 1 | import Mathlib 2 | import LeanLJ 3 | import LeanLJ.CSVParser 4 | import LeanLJ.Function 5 | import LeanLJ.Instance 6 | 7 | open LeanLJ 8 | 9 | def main : IO Unit := do 10 | let stdout ← IO.getStdout 11 | let stdin ← IO.getStdin 12 | 13 | stdout.putStrLn "Enter the path to the CSV file containing positions:" 14 | let filePath ← stdin.getLine 15 | let input ← IO.FS.readFile filePath.trim 16 | let lines := input.splitOn "\n" |>.toArray 17 | 18 | let positions := parseCSVToFin3 lines 19 | if positions.isEmpty then 20 | stdout.putStrLn "Error: No valid positions found in the CSV file." 21 | else 22 | let cutoff ← readSinglePositiveFloat "Enter the cutoff distance (e.g., 3.0):" 23 | let epsilon ← readSinglePositiveFloat "Enter epsilon value (e.g., 1.0):" 24 | let sigma ← readSinglePositiveFloat "Enter sigma value (e.g., 1.0):" 25 | let box_length ← readBoxLength "Enter box length (comma-separated, e.g., 8.0,8.0,8.0):" 26 | let totalEnergy := total_energy_pairs positions box_length cutoff epsilon sigma 27 | let numAtoms := positions.length 28 | 29 | let boxSide := box_length ⟨0, by decide⟩ 30 | let density := rho numAtoms.toFloat boxSide 31 | let Ulrc := numAtoms.toFloat * U_LRC density pi epsilon sigma cutoff 32 | 33 | stdout.putStrLn s!"The internal energy is: {totalEnergy}" 34 | 35 | match getNISTEnergy numAtoms with 36 | | some nist => 37 | stdout.putStrLn s!"NIST reference internal energy: {nist}" 38 | let error := totalEnergy - nist 39 | stdout.putStrLn s!"Absolute error: {Float.abs error}" 40 | | none => 41 | stdout.putStrLn s!"No NIST value found for {numAtoms} atoms." 42 | 43 | stdout.putStrLn "" 44 | 45 | 46 | stdout.putStrLn s!"The long range correction energy contribution is: {Ulrc}" 47 | 48 | match getNISTEnergy_LRC numAtoms with 49 | | some nist => 50 | stdout.putStrLn s!"NIST reference long range correction: {nist}" 51 | let error := Ulrc - nist 52 | stdout.putStrLn s!"Absolute error: {Float.abs error}" 53 | | none => 54 | stdout.putStrLn s!"No NIST value found for {numAtoms} atoms." 55 | 56 | stdout.putStrLn "" 57 | 58 | stdout.putStrLn s!"Number of atoms parsed: {numAtoms}" 59 | stdout.putStrLn s!"The total internal energy including long-range correction is: {totalEnergy + Ulrc}" 60 | 61 | 62 | --lake env lean --run LeanLJ/Execution.lean 63 | -------------------------------------------------------------------------------- /LeanLJ/Function.lean: -------------------------------------------------------------------------------- 1 | import Mathlib 2 | import LeanLJ 3 | import LeanLJ.Instance 4 | open LeanLJ 5 | namespace LeanLJ 6 | 7 | def pbc {α} [RealLike α] (x L : α) : α := x - L * (HasRound.pround (x / L) : α) 8 | def pbc_Float (position boxLength : Float) : Float := position - boxLength * Float.round (position / boxLength) 9 | noncomputable def pbc_Real (position boxLength : ℝ) : ℝ := position - boxLength * round (position / boxLength) 10 | 11 | noncomputable def squaredminImageDistance_Real ( posA posB boxLength : Fin 3 → ℝ) : ℝ := 12 | let dx := pbc_Real (posB (0:Fin 3) - posA (0: Fin 3)) (boxLength (0: Fin 3)) 13 | let dy := pbc_Real (posB (1:Fin 3) - posA (1: Fin 3)) (boxLength (1: Fin 3)) 14 | let dz := pbc_Real (posB (2:Fin 3) - posA (2: Fin 3)) (boxLength (2: Fin 3)) 15 | dx^2 + dy^2 + dz^2 16 | 17 | 18 | noncomputable def minImageDistance_Real ( posA posB boxLength : Fin 3 → ℝ) : ℝ := 19 | (squaredminImageDistance_Real posA posB boxLength).sqrt 20 | 21 | 22 | def minImageDistance {α : Type } [RealLike α] 23 | (posA posB : Fin 3 → α) (boxLength : Fin 3 → α) : α := 24 | let dx := pbc (posB (0:Fin 3) - posA (0: Fin 3)) (boxLength (0: Fin 3)) 25 | let dy := pbc (posB (1:Fin 3) - posA (1:Fin 3)) (boxLength (1:Fin 3)) 26 | let dz := pbc (posB (2:Fin 3) - posA (2:Fin 3)) (boxLength (2:Fin 3)) 27 | HasSqrt.sqrt (dx ^ (2 : Nat) + dy ^ (2 : Nat) + dz ^ (2 : Nat)) 28 | 29 | /- 30 | noncomputable def minImageDistance_real (posA posB : Fin 3 → ℝ) (boxLength : Fin 3 → ℝ) : ℝ := 31 | let dx := pbc_real (posB (0:Fin 3) - posA (0: Fin 3)) (boxLength (0: Fin 3)) 32 | let dy := pbc_real (posB (1:Fin 3) - posA (1:Fin 3)) (boxLength (1:Fin 3)) 33 | let dz := pbc_real (posB (2:Fin 3) - posA (2:Fin 3)) (boxLength (2:Fin 3)) 34 | HasSqrt.sqrt (dx ^ (2 : Nat) + dy ^ (2 : Nat) + dz ^ (2 : Nat)) 35 | -/ 36 | 37 | def minImageDistance_Float (posA posB : Fin 3 → Float) (boxLength : Fin 3 → Float) : Float := 38 | let dx := pbc_Float (posB (0:Fin 3) - posA (0: Fin 3)) (boxLength (0: Fin 3)) 39 | let dy := pbc_Float (posB (1:Fin 3) - posA (1:Fin 3)) (boxLength (1:Fin 3)) 40 | let dz := pbc_Float (posB (2:Fin 3) - posA (2:Fin 3)) (boxLength (2:Fin 3)) 41 | Float.sqrt (dx ^ (2 : Nat) + dy ^ (2 : Nat) + dz ^ (2 : Nat)) 42 | 43 | 44 | def lj_p {α : Type} [RealLike α] (r r_c ε σ : α) : α := 45 | if r ≤ r_c then 46 | let r3 := (σ / r) ^ (3 : Nat) 47 | let r6 := r3 * r3 48 | let r12 := r6 * r6 49 | 4 * ε * (r12 - r6) 50 | else 51 | 0 52 | 53 | 54 | noncomputable def lj_Real (r r_c ε σ : ℝ) : ℝ := 55 | if r ≤ r_c then 56 | let r3 := (σ / r) ^ (3 : Nat) 57 | let r6 := r3 * r3 58 | let r12 := r6 * r6 59 | 4 * ε * (r12 - r6) 60 | else 61 | 0 62 | 63 | def lj_Float (r r_c ε σ : Float) : Float := 64 | if r ≤ r_c then 65 | let r3 := (σ / r) ^ (3 : Nat) 66 | let r6 := r3 * r3 67 | let r12 := r6 * r6 68 | 4 * ε * (r12 - r6) 69 | else 70 | 0 71 | 72 | 73 | def pi : Float := 3.141592653589793 74 | 75 | def rho (N boxlength : Float) : Float := N / (boxlength)^3 76 | 77 | 78 | def U_LRC {α : Type} [RealLike α] 79 | (ρ pi ε σ rc : α) : α := 80 | (8 * pi * ρ * ε) * 81 | ((1 / (9 : α)) * (σ ^ (12 : Nat) / rc ^ (9 : Nat)) 82 | - (1 / (3 : α)) * (σ ^ (6 : Nat) / rc ^ (3 : Nat))) 83 | 84 | 85 | def U_LRC_Float (rho pi ε σ rc : Float) : Float := 86 | (8 * rho * pi * ε) * ((1/9) * (σ ^ 12 / rc ^ 9) - (1/3) * (σ ^ 6 / rc ^ 3)) 87 | 88 | 89 | noncomputable def U_LRC_Real (ρ ε σ rc : ℝ) : ℝ := 90 | (8 * Real.pi * ρ * ε) * ((1/9) * (σ ^ 12 / rc ^ 9) - (1/3) * (σ ^ 6 / rc ^ 3)) 91 | 92 | 93 | noncomputable def lj (r r_c ε σ : ℝ) : ℝ := 94 | if r ≤ r_c then 95 | 4 * ε * ((σ / r) ^ 12 - (σ / r) ^ 6) 96 | else 97 | 0 98 | 99 | 100 | def pairs (n : Nat) : List (Nat × Nat) := 101 | (List.range n).flatMap fun i => 102 | (List.range' (i + 1) (n - (i + 1))).map fun j => (i, j) 103 | 104 | 105 | def total_energy_pairs (positions : List (Fin 3 → Float)) 106 | (boxLength : Fin 3 → Float) 107 | (cutoff ε σ : Float) : Float := 108 | let n := positions.length 109 | let indexPairs := pairs n 110 | indexPairs.foldl (fun acc (i, j) => 111 | let r := minImageDistance_Float positions[i]! positions[j]! boxLength 112 | acc + lj_Float r cutoff ε σ 113 | ) 0.0 114 | 115 | 116 | def total_energy_loop (positions : List (Fin 3 → Float)) 117 | (boxLength : Fin 3 → Float) (cutoff ε σ : Float) : Float := 118 | Id.run do 119 | let mut energy := 0.0 120 | for i in [0 : positions.length] do 121 | for j in [i+1 : positions.length] do 122 | let r := minImageDistance_Float positions[i]! positions[j]! boxLength 123 | let e := lj_Float r cutoff ε σ 124 | energy := energy + e 125 | return energy 126 | 127 | 128 | def total_energy_recursive (positions : List (Fin 3 → Float)) (box_length : Fin 3 → Float) 129 | (cutoff ε σ : Float) : Float := 130 | let num_atoms := positions.length 131 | let rec energy (i j : Nat) (acc : Float) : Float := 132 | if i = 0 then acc 133 | else if j = 0 then energy (i - 1) (i - 2) acc 134 | else 135 | let r := minImageDistance_Float (positions[i - 1]!) (positions[j - 1]!) box_length 136 | let e := lj_Float r cutoff ε σ 137 | energy i (j - 1) (acc + e) 138 | energy num_atoms (num_atoms - 1) 0.0 139 | 140 | 141 | def computeTotal_Energy (positions : List (Fin 3 → Float)) 142 | (boxLength : Fin 3 → Float) (cutoff ε σ : Float) : Float := 143 | let numAtoms := positions.length 144 | let rec energy : Nat → Nat → Float → Float 145 | | 0, _, acc => acc 146 | | i+1, 0, acc => energy i (i - 1) acc 147 | | i+1, j+1, acc => 148 | let r := minImageDistance_Float positions[i]! positions[j]! boxLength 149 | let e := lj_Float r cutoff ε σ 150 | energy (i+1) j (acc + e) 151 | energy numAtoms (numAtoms - 1) 0.0 152 | 153 | 154 | def getNISTEnergy (n : Nat) : Option Float := 155 | match n with 156 | | 30 => some (-16.790) 157 | | 200 => some (-690.000) 158 | | 400 => some (-1146.700) 159 | | 800 => some (-4351.500) 160 | | _ => none 161 | 162 | 163 | def getNISTEnergy_LRC (n : Nat) : Option Float := 164 | match n with 165 | | 30 => some (-0.54517) 166 | | 200 => some (-24.230) 167 | | 400 => some (-49.622) 168 | | 800 => some (-198.49) 169 | | _ => none 170 | 171 | 172 | end LeanLJ 173 | -------------------------------------------------------------------------------- /LeanLJ/Instance.lean: -------------------------------------------------------------------------------- 1 | import Mathlib 2 | namespace LeanLJ 3 | 4 | class HasSqrt (α : Type) where 5 | sqrt : α → α 6 | 7 | instance : HasSqrt Float where 8 | sqrt := Float.sqrt 9 | 10 | instance : HasSqrt ℕ where 11 | sqrt := Nat.sqrt 12 | 13 | instance : HasSqrt ℤ where 14 | sqrt := Int.sqrt 15 | 16 | instance : HasSqrt ℚ where 17 | sqrt := Rat.sqrt 18 | 19 | noncomputable instance : HasSqrt ℝ where 20 | sqrt := Real.sqrt 21 | 22 | 23 | class HasRound (α : Type) where 24 | pround : α → α 25 | 26 | instance : HasRound Float where 27 | pround := Float.round 28 | 29 | class RealLike (α : Type) extends HasRound α, HasSqrt α where 30 | add : α → α → α 31 | sub : α → α → α 32 | mul : α → α → α 33 | div : α → α → α 34 | neg : α → α 35 | pow : α → Nat → α 36 | le : α → α → Bool 37 | lt : α → α → Bool 38 | zero : α 39 | one : α 40 | ofNat : Nat → α 41 | ofInt : Int → α 42 | 43 | instance {α : Type} [RealLike α] : Add α where 44 | add := RealLike.add 45 | 46 | instance {α : Type} [RealLike α] : Sub α where 47 | sub := RealLike.sub 48 | 49 | instance {α : Type} [RealLike α] : Mul α where 50 | mul := RealLike.mul 51 | 52 | instance {α : Type} [RealLike α] : Div α where 53 | div := RealLike.div 54 | 55 | instance {α : Type} [RealLike α] : Neg α where 56 | neg := RealLike.neg 57 | 58 | instance {α : Type} [RealLike α] : Pow α Nat where 59 | pow := RealLike.pow 60 | 61 | -- Helper functions for comparison that return Bool 62 | def compLe {α : Type} [RealLike α] (a b : α) : Bool := 63 | RealLike.le a b 64 | 65 | def compLt {α : Type} [RealLike α] (a b : α) : Bool := 66 | RealLike.lt a b 67 | 68 | instance {α : Type} [RealLike α] {n : Nat} : OfNat α n where 69 | ofNat := RealLike.ofNat n 70 | 71 | -- Provide a Coe instance for literals 72 | instance {α : Type} [RealLike α] : Coe Nat α where 73 | coe := RealLike.ofNat 74 | 75 | -- Float instance 76 | instance : RealLike Float where 77 | pround := Float.round 78 | sqrt := Float.sqrt 79 | add := Float.add 80 | sub := Float.sub 81 | mul := Float.mul 82 | div := Float.div 83 | neg := Float.neg 84 | pow := fun x n => 85 | let rec go (x : Float) (n : Nat) : Float := 86 | match n with 87 | | 0 => 1.0 88 | | k + 1 => x * go x k 89 | go x n 90 | le a b := a ≤ b 91 | lt a b := a < b 92 | zero := 0.0 93 | one := 1.0 94 | ofNat n := Float.ofNat n 95 | ofInt n := Float.ofInt n 96 | 97 | -- Int instance (for completeness) 98 | instance : RealLike Int where 99 | pround := fun x => x 100 | sqrt := fun x => x 101 | add := Int.add 102 | sub := Int.sub 103 | mul := Int.mul 104 | div a b := if b == 0 then 0 else a / b -- Simple integer division 105 | neg := Int.neg 106 | pow a n := 107 | let rec go (a : Int) (n : Nat) : Int := 108 | match n with 109 | | 0 => 1 110 | | k + 1 => a * go a k 111 | go a n 112 | le a b := a ≤ b 113 | lt a b := a < b 114 | zero := 0 115 | one := 1 116 | ofNat := Int.ofNat 117 | ofInt n := n 118 | /- 119 | instance {α : Type} [ComputableReal α] : LE α where 120 | le a b := ComputableReal.le a b -/ 121 | 122 | instance {α : Type} [RealLike α] : LT α where 123 | lt a b := RealLike.lt a b = true 124 | 125 | 126 | -- Define LT instance for ComputableReal 127 | instance {α : Type} [RealLike α] : DecidableRel (@LT.lt α _) := 128 | fun a b => 129 | if h : RealLike.lt a b = true then 130 | isTrue h 131 | else 132 | isFalse (by intro h'; contradiction) 133 | 134 | 135 | -- Define LE instance for ComputableReal 136 | instance {α : Type} [RealLike α] : LE α where 137 | le a b := RealLike.le a b = true 138 | 139 | -- Define DecidableRel instance for LE.le 140 | instance {α : Type} [RealLike α] : DecidableRel (@LE.le α _) := 141 | fun a b => 142 | if h : RealLike.le a b = true then 143 | isTrue h 144 | else 145 | isFalse (by intro h'; contradiction) 146 | 147 | 148 | end LeanLJ 149 | -------------------------------------------------------------------------------- /LeanLJ/Lennard_Jones_proof.lean: -------------------------------------------------------------------------------- 1 | import Mathlib 2 | import LeanLJ 3 | import LeanLJ.Instance 4 | import LeanLJ.Function 5 | open LeanLJ 6 | namespace LeanLJ 7 | 8 | lemma lj_pow_12' (σ r : ℝ) (h : r ≠ 0): deriv (fun r => σ^12 * r ^ (- 12:ℤ) ) r = σ^12 * (-12:ℤ) * r ^ (-13 : ℤ) := by 9 | rw [deriv_const_mul] 10 | rw [deriv_zpow] 11 | rw [show (-12 - 1) = (- 13: ℤ ) by ring] 12 | ring 13 | apply DifferentiableAt.zpow 14 | · apply differentiable_id 15 | · apply Or.inl 16 | exact h 17 | 18 | lemma lj_pow_6' (σ r : ℝ) (h : r ≠ 0): deriv (fun r => σ^6 * r ^ (- 6:ℤ) ) r = σ^6 * (-6:ℤ) * r ^ (-7 : ℤ) := by 19 | rw [deriv_const_mul] 20 | rw [deriv_zpow] 21 | rw [show (-6 - 1) = (- 7: ℤ ) by ring] 22 | ring 23 | apply DifferentiableAt.zpow 24 | · apply differentiable_id 25 | · apply Or.inl 26 | exact h 27 | 28 | lemma scale_continuous (ε σ : ℝ) : 29 | ContinuousOn (fun r => 4 * ε * ((σ / r) ^ 12 - (σ / r) ^ 6)) {r | r > 0} := by 30 | apply ContinuousOn.mul 31 | · exact continuous_const.continuousOn 32 | · apply ContinuousOn.sub <;> 33 | · apply ContinuousOn.pow 34 | apply ContinuousOn.div 35 | · exact continuous_const.continuousOn 36 | · exact continuous_id.continuousOn 37 | · exact fun x a => Ne.symm (ne_of_lt a) 38 | 39 | theorem cutoff_behavior (r r_c ε σ : ℝ) 40 | (h : r > r_c) : lj_Real r r_c ε σ = 0 := by 41 | unfold lj_Real 42 | simp [if_neg (not_le_of_gt h)] 43 | 44 | 45 | theorem ljp_zero_on_tail (r_c ε σ : ℝ) : 46 | ∀ r, r > r_c → lj_Real r r_c ε σ = 0 := by 47 | intro r h 48 | unfold lj_Real 49 | simp only [if_neg (not_le_of_gt h)] 50 | 51 | 52 | theorem ljp_eq_le {r_c ε σ : ℝ} : 53 | ∀ r ∈ {r | r > 0 ∧ r ≤ r_c }, lj_Real r r_c ε σ = 4 * ε * ((σ / r)^12 - (σ / r)^6) := by 54 | intro r hr 55 | have h_r_le_rc : r ≤ r_c := hr.2 56 | unfold lj_Real 57 | rw [if_pos h_r_le_rc] 58 | ring 59 | 60 | theorem ljp_eq_gt (r_c ε σ : ℝ) : ∀ r ∈ {r | r > r_c ∧ r > 0}, lj_Real r r_c ε σ = 0 := by 61 | intro r hr 62 | have h_r_gt_rc : r > r_c := hr.1 63 | have h_r_pos : r > 0 := hr.2 64 | unfold lj_Real 65 | rw [if_neg (not_le_of_gt h_r_gt_rc)] 66 | 67 | 68 | theorem ljp_continuous_closed_domain (r_c ε σ : ℝ) : 69 | ContinuousOn (fun r => if r ≤ r_c then 4 * ε * (((σ / r) ^ 6) ^ 2 - (σ / r) ^ 6) else 0) 70 | {r | 0 < r ∧ r ≤ r_c} := by 71 | have subset_pos : {r | 0 < r ∧ r ≤ r_c} ⊆ {r | r > 0} := by 72 | intro r hr 73 | exact hr.1 74 | have base := (scale_continuous ε σ).mono subset_pos 75 | apply ContinuousOn.congr base 76 | intro r hr 77 | simp [if_pos hr.2] 78 | left 79 | ring 80 | 81 | theorem ljp_continuous_piecewise (r_c ε σ : ℝ) : 82 | ContinuousOn (fun r => if r ≤ r_c then 4 * ε * (((σ / r) ^ 6) ^ 2 - (σ / r) ^ 6) else 0) 83 | {r | 0 < r ∧ r < r_c} := by 84 | have subset_pos : {r | 0 < r ∧ r < r_c} ⊆ {r | r > 0} := by 85 | intro r hr 86 | exact hr.1 87 | have base := (scale_continuous ε σ).mono subset_pos 88 | apply ContinuousOn.congr base 89 | intro r hr 90 | simp [if_pos (le_of_lt hr.2)] 91 | left 92 | ring 93 | 94 | theorem ljp_differentiable (r_c ε σ : ℝ) : 95 | DifferentiableOn ℝ (fun r => if r ≤ r_c then 4 * ε * (((σ / r) ^ 6) ^ 2 - (σ / r) ^ 6) else 0) 96 | {r | 0 < r ∧ r ≤ r_c} := by 97 | have subset_pos : {r | 0 < r ∧ r ≤ r_c} ⊆ {r | r > 0} := by 98 | intro r hr 99 | exact hr.1 100 | have base : DifferentiableOn ℝ (fun r => 4 * ε * (((σ / r) ^ 6) ^ 2 - (σ / r) ^ 6)) {r | r > 0} := by 101 | apply DifferentiableOn.mul 102 | · intro r hr 103 | simp only [gt_iff_lt] 104 | apply differentiableOn_const 105 | exact hr 106 | · apply DifferentiableOn.sub 107 | · apply DifferentiableOn.pow 108 | · apply DifferentiableOn.pow 109 | · apply DifferentiableOn.div 110 | · exact (differentiable_const σ).differentiableOn 111 | · exact differentiable_id.differentiableOn 112 | · intro x hx 113 | exact ne_of_gt hx 114 | · apply DifferentiableOn.pow 115 | apply DifferentiableOn.div 116 | · exact (differentiable_const σ).differentiableOn 117 | · exact differentiable_id.differentiableOn 118 | · intro x hx 119 | exact ne_of_gt hx 120 | apply DifferentiableOn.congr (base.mono subset_pos) 121 | · intro r hr 122 | simp [if_pos hr.2] 123 | 124 | 125 | theorem ljp_second_derivative (r_c ε σ : ℝ) : 126 | DifferentiableOn ℝ (fun r => 4 * ε * (156 * σ^12 * r^(-14:ℤ ) - 42 * σ^6 * r^(-8:ℤ))) {r | 0 < r ∧ r ≤ r_c} := by 127 | apply DifferentiableOn.mul 128 | · exact (differentiable_const (4 * ε)).differentiableOn 129 | · apply DifferentiableOn.sub 130 | · apply DifferentiableOn.const_mul 131 | apply DifferentiableOn.zpow 132 | · exact differentiable_id.differentiableOn 133 | · apply Or.inl 134 | intro x hx 135 | exact ne_of_gt hx.1 136 | · apply DifferentiableOn.const_mul 137 | apply DifferentiableOn.zpow 138 | · exact differentiable_id.differentiableOn 139 | · apply Or.inl 140 | intro x hx 141 | exact ne_of_gt hx.1 142 | 143 | end LeanLJ 144 | -------------------------------------------------------------------------------- /LeanLJ/LongRangeCorrection.lean: -------------------------------------------------------------------------------- 1 | import Mathlib 2 | import LeanLJ 3 | import LeanLJ.Instance 4 | import LeanLJ.Function 5 | open LeanLJ 6 | 7 | open Real MeasureTheory 8 | namespace LeanLJ 9 | 10 | 11 | theorem long_range_correction_equality (rc ρ ε σ : ℝ) (hr : 0 < rc) : 12 | (2 * π * ρ) * ∫ (r : ℝ) in Set.Ioi rc, 4 * ε * (r ^ 2 * (((σ / r) ^ 12) - 13 | ((σ / r) ^ 6))) = (8 * π * ρ * ε) * ((1/9) * (σ ^ 12 / rc ^ 9) - 14 | (1/3) * (σ ^ 6 / rc ^ 3)) := by 15 | by_cases hρ : ρ = 0 16 | · simp only [hρ, mul_zero, zero_mul] 17 | · by_cases hε : ε = 0 18 | · simp only [hε, mul_zero, zero_mul, integral_zero, mul_zero] 19 | · calc 20 | 2 * π * ρ * ∫ (r : ℝ) in Set.Ioi rc, 4 * ε * (r ^ 2 * ((σ / r) ^ 12 - 21 | (σ / r) ^ 6)) = 22 | (2 * π * ρ) * (∫ (r : ℝ) in Set.Ioi rc, ((r ^ 2 * 23 | ((σ / r) ^ 12 - (σ / r) ^ 6)) • (4 * ε))) := by 24 | field_simp 25 | congr with x 26 | ring 27 | _ = (8 * π * ρ * ε) * ∫ (r : ℝ) in Set.Ioi rc, (r ^ 2 * 28 | ((σ / r) ^ 12 - (σ / r) ^ 6)) := by 29 | rw [integral_smul_const, smul_eq_mul] 30 | ring 31 | rw [mul_eq_mul_left_iff] 32 | left 33 | calc 34 | ∫ (r : ℝ) in Set.Ioi rc, r ^ 2 * ((σ / r) ^ 12 - (σ / r) ^ 6) = 35 | ∫ (r : ℝ) in Set.Ioi rc, (σ ^ 12 / r ^ 10 + - σ ^ 6 / r ^ 4) := by 36 | congr with r 37 | by_cases hr : r = 0 38 | · rw [hr] 39 | simp only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, zero_mul, 40 | div_zero, sub_self, add_zero] 41 | · field_simp 42 | ring 43 | _ = (∫ (a : ℝ) in Set.Ioi rc, (σ ^ 12 / a ^ 10)) + ∫ (a : ℝ) in Set.Ioi rc, 44 | (- σ ^ 6 / a ^ 4) := by 45 | rw [← integral_add] 46 | · apply Integrable.const_mul 47 | rw [← IntegrableOn] 48 | have heq : Set.EqOn (fun x ↦ x ^ (-10 : ℝ)) (fun x ↦ (x ^ 10)⁻¹) (Set.Ioi rc) := by 49 | intro x hx 50 | simp_rw [Real.rpow_neg (hr.trans hx).le, ← Real.rpow_natCast, Nat.cast_ofNat] 51 | refine IntegrableOn.congr_fun ?_ heq (by measurability) 52 | exact integrableOn_Ioi_rpow_of_lt (by norm_num) hr 53 | · apply Integrable.const_mul 54 | rw [← IntegrableOn] 55 | have heq : Set.EqOn (fun x ↦ x ^ (-4 : ℝ)) (fun x ↦ (x ^ 4)⁻¹) (Set.Ioi rc) := by 56 | intro x hx 57 | simp_rw [Real.rpow_neg (hr.trans hx).le, ← Real.rpow_natCast, Nat.cast_ofNat] 58 | refine IntegrableOn.congr_fun ?_ heq (by measurability) 59 | exact integrableOn_Ioi_rpow_of_lt (by norm_num) hr 60 | _ = σ ^ 12 * (∫ (a : ℝ) in Set.Ioi rc, (1 / a ^ 10)) + (- σ ^ 6) * ∫ (a : ℝ) in Set.Ioi rc, 61 | (1 / a ^ 4) := by 62 | rw [mul_comm, ← smul_eq_mul, ← integral_smul_const, eq_comm, add_comm, eq_comm, 63 | mul_comm, ← smul_eq_mul, ← integral_smul_const, show σ ^ 12 = σ ^ 12 * 1 by 64 | rw [mul_one], show σ ^ 6 = σ ^ 6 * 1 by rw [mul_one], add_comm] 65 | simp_rw [smul_eq_mul] 66 | congr with x <;> ring 67 | _ = σ ^ 12 * (∫ (a : ℝ) in Set.Ioi rc, (a ^ (-10:ℝ))) + (- σ ^ 6) * ∫ (a : ℝ) in Set.Ioi rc, 68 | (a ^ (-4:ℝ)) := by 69 | congr with x <;> norm_cast <;> simp only [one_div, Int.reduceNegSucc, zpow_neg, 70 | inv_inj] <;> norm_cast 71 | _ = 1 / 9 * (σ ^ 12 * rc ^ (-9:ℝ)) - 1 / 3 * (σ ^ 6 * rc ^ (-3:ℝ)):= by 72 | repeat rw [integral_Ioi_rpow_of_lt (by nlinarith) hr] 73 | norm_num 74 | ring_nf 75 | _ = ((1/9) * (σ ^ 12 / rc ^ 9) - (1/3) * (σ ^ 6 / rc ^ 3)) := by 76 | congr <;> norm_cast 77 | 78 | theorem long_range_correction_equality' (rc ρ ε σ : ℝ) (hr : 0 < rc) : 79 | (2 * π * ρ) * ∫ (r : ℝ) in Set.Ioi rc, 4 * ε * (r ^ 2 * (((σ / r) ^ 12) - 80 | ((σ / r) ^ 6))) = U_LRC_Real ρ ε σ rc := by 81 | rw [U_LRC_Real] 82 | exact long_range_correction_equality rc ρ ε σ hr 83 | -------------------------------------------------------------------------------- /LeanLJ/MinImageDistance_PeriodicBC.lean: -------------------------------------------------------------------------------- 1 | 2 | import Mathlib 3 | 4 | noncomputable def pbc_real (position box_length : ℝ) : ℝ := position - box_length * round (position / box_length) 5 | 6 | noncomputable def squaredminImageDistance_real ( posA posB box_length : Fin 3 → ℝ) : ℝ := 7 | let dx := pbc_real (posB (0:Fin 3) - posA (0: Fin 3)) (box_length (0: Fin 3)) 8 | let dy := pbc_real (posB (1:Fin 3) - posA (1: Fin 3)) (box_length (1: Fin 3)) 9 | let dz := pbc_real (posB (2:Fin 3) - posA (2: Fin 3)) (box_length (2: Fin 3)) 10 | dx^2 + dy^2 + dz^2 11 | 12 | 13 | noncomputable def minImageDistance_real ( posA posB box_length : Fin 3 → ℝ) : ℝ := 14 | (squaredminImageDistance_real posA posB box_length).sqrt 15 | 16 | 17 | theorem minImageDistance_real_self (pos box_length : Fin 3 → ℝ) : 18 | minImageDistance_real pos pos box_length = 0 := by 19 | unfold minImageDistance_real squaredminImageDistance_real 20 | have h0 : pbc_real (pos (0:Fin 3) - pos (0: Fin 3)) (box_length (0: Fin 3)) = 0 := by 21 | simp [pbc_real, sub_self, zero_div, round_zero, mul_zero, sub_zero] 22 | have h1 : pbc_real (pos (1:Fin 3) - pos (1:Fin 3)) (box_length (1:Fin 3)) = 0 := by 23 | simp [pbc_real, sub_self, zero_div, round_zero, mul_zero, sub_zero] 24 | have h2 : pbc_real (pos (2:Fin 3) - pos (2:Fin 3)) (box_length (2:Fin 3)) = 0 := by 25 | simp [pbc_real, sub_self, zero_div, round_zero, mul_zero, sub_zero] 26 | rw [h0, h1, h2] 27 | simp 28 | 29 | theorem minImageDistance_real_nonneg ( posA posB box_length : Fin 3 → ℝ) : 30 | 0 ≤ minImageDistance_real posA posB box_length := by 31 | unfold minImageDistance_real 32 | apply Real.sqrt_nonneg 33 | 34 | /-- Alternate way of defining the minimum image distance function -/ 35 | noncomputable def minImageDist (box_length posA posB : Fin n → ℝ) : ℝ := 36 | let dist := fun i => pbc_real (posB i - posA i) (box_length i) 37 | (Finset.univ.sum (fun i => (dist i) ^ 2)).sqrt 38 | 39 | 40 | /-! Basic Math Theorems on `round` function. -/ 41 | variable [LinearOrderedField α] [FloorRing α] 42 | 43 | theorem round_sub_one_le_x (x : α) : round x - 1 ≤ x := by 44 | rw [round_eq x] 45 | have h1 : ↑⌊x + 1/2⌋ ≤ x + 1/2 := Int.floor_le (x + 1/2) 46 | have h2 : ↑⌊x + 1/2⌋ - 1 ≤ (x + 1/2) - 1 := by linarith 47 | have h3 : (x + 1/2) - 1 = x - 1/2 := by ring 48 | rw [h3] at h2 49 | have h4 : x - 1/2 ≤ x := by linarith 50 | exact le_trans h2 h4 51 | 52 | theorem abs_diff_round_le_half (x : α) : |x - round x| ≤ 1 / 2 := by 53 | rw [round_eq] 54 | have h1 : x - 1/2 < ↑⌊x + 1/2⌋ := by 55 | have h1a : x + 1/2 < ↑⌊x + 1/2⌋ + 1 := by apply Int.lt_floor_add_one 56 | linarith 57 | have h2 : ↑⌊x + 1/2⌋ ≤ x + 1/2 := Int.floor_le (x + 1/2) 58 | have h3 : -(1/2) ≤ x - ↑⌊x + 1/2⌋ ∧ x - ↑⌊x + 1/2⌋ ≤ 1/2 := by 59 | constructor 60 | · linarith 61 | · linarith 62 | exact abs_le.mpr h3 63 | 64 | theorem abs_pbc_le (x L : ℝ) (hL : 0 < L) : |pbc_real x L| ≤ L / 2 := by 65 | dsimp only [pbc_real] 66 | have : |(x / L) - round (x / L)| ≤ 1 / 2 := abs_diff_round_le_half (x / L) 67 | calc 68 | |x - L * round (x / L)| = |L * ((x / L) - round (x / L))| := by field_simp 69 | _ = |L| * |(x / L) - round (x / L)| := by rw [abs_mul] 70 | _ = L * |(x / L) - round (x / L)| := by rw [abs_of_pos hL] 71 | _ ≤ L * (1 / 2) := mul_le_mul_of_nonneg_left this (by linarith) 72 | _ = L / 2 := by ring 73 | 74 | 75 | -- # The Periodic Boundary Conditions guarantee periodic behavior 76 | theorem pbc_periodic (x L : ℝ) (k : ℤ) (hL : L ≠ 0) : pbc_real (x - k * L) L = pbc_real x L := by 77 | dsimp only [pbc_real] 78 | have : round ((x - k * L) / L) = round (x / L - k) := by 79 | congr 80 | field_simp [mul_comm] 81 | rw [this, round_sub_intCast, Int.cast_sub, mul_sub] 82 | ring 83 | 84 | 85 | --# The minImageDistance is bounded above by the diagonal of the simulation cell. 86 | theorem minImageDistance_bounded 87 | (box_length posA posB : Fin n → ℝ) (hbox : ∀ i, 0 < box_length i) : 88 | minImageDist box_length posA posB 89 | ≤ (Finset.univ.sum fun i => (box_length i / 2) ^ 2).sqrt := by 90 | dsimp only [minImageDist] 91 | apply Real.sqrt_le_sqrt 92 | apply Finset.sum_le_sum 93 | intro i _ 94 | have bound : |pbc_real (posB i - posA i) (box_length i)| ≤ box_length i / 2 := 95 | abs_pbc_le (posB i - posA i) (box_length i) (hbox i) 96 | calc 97 | (pbc_real (posB i - posA i) (box_length i))^2 98 | = |pbc_real (posB i - posA i) (box_length i)|^2 := by rw [sq_abs] 99 | _ ≤ (box_length i / 2)^2 := by 100 | apply pow_le_pow_left₀ 101 | · exact abs_nonneg (pbc_real (posB i - posA i) (box_length i)) 102 | · bound 103 | 104 | 105 | --# The minimum image distance is invariant under periodic translations. 106 | theorem minImageDistance_real_periodic 107 | (box_length posA posB : Fin n → ℝ) (k : Fin n → ℤ) 108 | (hbox : ∀ i, box_length i ≠ 0) : 109 | minImageDist box_length posA posB = 110 | minImageDist box_length (fun i => posA i + (k i : ℝ) * box_length i) posB := by 111 | dsimp [minImageDist] 112 | have h_dist : ∀ i, 113 | pbc_real (posB i - (posA i + (k i : ℝ) * box_length i)) (box_length i) 114 | = pbc_real (posB i - posA i) (box_length i) := by 115 | intro i 116 | rw [sub_add_eq_sub_sub] 117 | exact pbc_periodic (posB i - posA i) (box_length i) (k i) (hbox i) 118 | simp_rw [h_dist] 119 | 120 | 121 | --# The minimum image distance between any two points is non-negative 122 | theorem minImageDist_nonneg (box_length posA posB : Fin n → ℝ) : 123 | 0 ≤ minImageDist box_length posA posB := by 124 | unfold minImageDist 125 | apply Real.sqrt_nonneg 126 | 127 | 128 | --# The minimum image distance between two identical points is zero. 129 | theorem minImageDist_self (box_length pos : Fin n → ℝ) : 130 | minImageDist box_length pos pos = 0 := by 131 | unfold minImageDist 132 | have h_dist : ∀ i, pbc_real (pos i - pos i) (box_length i) = 0 := by 133 | intro i 134 | simp [pbc_real] 135 | simp_rw [h_dist] 136 | simp only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, Finset.sum_const_zero, Real.sqrt_zero] 137 | 138 | lemma apply_pbc_sub (a b L : ℝ) : 139 | pbc_real (a - b) L = (a - b) - L * round ((a - b) / L) := by rfl 140 | 141 | 142 | lemma apply_pbc_nested (a b L : ℝ) (hL : L ≠ 0) : 143 | pbc_real (pbc_real a L - pbc_real b L) L = (a - b) - L * round ((a - b) / L) := by 144 | calc 145 | pbc_real (pbc_real a L - pbc_real b L) L 146 | = pbc_real ((a - L * round (a / L)) - (b - L * round (b / L))) L := by rfl 147 | _ = pbc_real ((a - b) - L * (round (a / L) - round (b / L))) L := by ring_nf 148 | _ = (a - b) - L * (round (a / L) - round (b / L)) 149 | - L * round (((a - b) - L * (round (a / L) - round (b / L))) / L) := by rw [pbc_real] 150 | _ = (a - b) - L * (round (a / L) - round (b / L)) 151 | - L * round ((a - b) / L - (round (a / L) - round (b / L))) := by 152 | have h_div : ((a - b) - L * (round (a / L) - round (b / L))) / L = 153 | (a - b) / L - (round (a / L) - round (b / L)) := by field_simp [hL] 154 | rw [h_div] 155 | _ = (a - b) - L * round ((a - b) / L) := by 156 | rw [← Int.cast_sub, round_sub_intCast, sub_sub, ← mul_add, ← Int.cast_add, add_sub_cancel] 157 | 158 | 159 | --# Theorem to show that applying PBC to each position individually gives the same squared distance 160 | /- 161 | This theorem asserts that the minimum image distance between two positions posA and posB in a periodic box 162 | can be calculated equivalently in two ways: 163 | By directly computing the minimum image distance for the box size, or 164 | By first applying periodic boundary conditions (PBC) to both positions and then computing the minimum image 165 | distance. In other words, the order of applying PBC—either before or during the computation of distances— 166 | does not affect the final result. 167 | -/ 168 | 169 | theorem squaredminImageDistance_theorem (box_length posA posB : Fin 3 → ℝ) (hL : ∀ i, box_length i ≠ 0) : 170 | squaredminImageDistance_real box_length posA posB = 171 | squaredminImageDistance_real box_length 172 | (λ i => pbc_real (posA i) (box_length i)) 173 | (λ i => pbc_real (posB i) (box_length i)) := by 174 | unfold squaredminImageDistance_real 175 | have h0 : pbc_real (pbc_real (posB ⟨0, by decide⟩) (box_length ⟨0, by decide⟩) - 176 | pbc_real (posA ⟨0, by decide⟩) (box_length ⟨0, by decide⟩)) (box_length ⟨0, by decide⟩) = 177 | pbc_real (posB ⟨0, by decide⟩ - posA ⟨0, by decide⟩) (box_length ⟨0, by decide⟩) := by 178 | apply apply_pbc_nested 179 | exact hL ⟨0, by decide⟩ 180 | have h1 : pbc_real (pbc_real (posB ⟨1, by decide⟩) (box_length ⟨1, by decide⟩) - 181 | pbc_real (posA ⟨1, by decide⟩) (box_length ⟨1, by decide⟩)) (box_length ⟨1, by decide⟩) = 182 | pbc_real (posB ⟨1, by decide⟩ - posA ⟨1, by decide⟩) (box_length ⟨1, by decide⟩) := by 183 | apply apply_pbc_nested 184 | exact hL ⟨1, by decide⟩ 185 | have h2 : pbc_real (pbc_real (posB ⟨2, by decide⟩) (box_length ⟨2, by decide⟩) - 186 | pbc_real (posA ⟨2, by decide⟩) (box_length ⟨2, by decide⟩)) (box_length ⟨2, by decide⟩) = 187 | pbc_real (posB ⟨2, by decide⟩ - posA ⟨2, by decide⟩) (box_length ⟨2, by decide⟩) := by 188 | apply apply_pbc_nested 189 | exact hL ⟨2, by decide⟩ 190 | simp only [Function.const_apply] 191 | -------------------------------------------------------------------------------- /LeanLJ/Pairs_Proof.lean: -------------------------------------------------------------------------------- 1 | import Mathlib 2 | 3 | open List 4 | open scoped BigOperators 5 | 6 | def pairs (n : Nat) : List (Nat × Nat) := 7 | (List.range n).flatMap fun i => 8 | (List.range' (i + 1) (n - (i + 1))).map fun j => (i, j) 9 | 10 | lemma list_sum_map_range (n : Nat) (f : Nat → Nat) : 11 | ((List.range n).map f).sum = ∑ i ∈ Finset.range n, f i := by 12 | induction n with 13 | | zero => 14 | simp 15 | | succ n ih => 16 | rw [List.range_succ, List.map_append, List.sum_append] 17 | simp only [List.map, List.sum_cons, List.sum_nil] 18 | rw [ih, Finset.sum_range_succ] 19 | rfl 20 | 21 | lemma list_sum_range_eq_finset (n : Nat) : 22 | (List.range n).sum = ∑ i ∈ Finset.range n, i := by 23 | rw [←list_sum_map_range n (fun i => i)] 24 | rw [@map_id'] 25 | 26 | 27 | theorem pairs_length_eq (n : Nat) : 28 | (pairs n).length = n * (n - 1) / 2 := by 29 | 30 | have h : 31 | (List.range n).map 32 | (length ∘ fun i => 33 | List.map (fun j => (i, j)) 34 | (List.range' (i + 1) (n - (i + 1)))) = 35 | (List.range n).map (fun i => n - (i + 1)) := by 36 | apply List.map_congr_left 37 | intro i _ 38 | simp [Function.comp, List.length_map, List.length_range'] 39 | 40 | have h₀ : 41 | (pairs n).length = 42 | ((List.range n).map (fun i => 43 | (List.range' (i + 1) (n - (i + 1))).length)).sum := by 44 | simp [pairs, List.length_flatMap, List.length_map] 45 | 46 | have h₁ : 47 | ((List.range n).map (fun i => 48 | (List.range' (i + 1) (n - (i + 1))).length)).sum 49 | = 50 | ((List.range n).map (fun i => n - 1 - i)).sum := by 51 | have h_list : 52 | (List.range n).map 53 | (fun i => 54 | (List.map (fun j => (i, j)) 55 | (List.range' (i + 1) (n - (i + 1)))).length) 56 | = 57 | (List.range n).map (fun i => n - 1 - i) := by 58 | apply List.map_congr_left 59 | intro i _ 60 | simp [List.length_map, List.length_range', 61 | Nat.sub_sub, add_comm, add_left_comm, add_assoc] 62 | simpa using congrArg List.sum h_list 63 | 64 | have h₂ : 65 | ((List.range n).map (fun i => n - 1 - i)).sum 66 | = (List.range n).sum := by 67 | have h_left : 68 | ((List.range n).map (fun i => n - 1 - i)).sum 69 | = ∑ i ∈ Finset.range n, (n - 1 - i) := by 70 | exact list_sum_map_range n (fun i => n - 1 - i) 71 | have h_right : 72 | (List.range n).sum = ∑ i ∈ Finset.range n, i := by 73 | exact list_sum_range_eq_finset n 74 | have h_reflect : 75 | (∑ i ∈ Finset.range n, (n - 1 - i)) 76 | = ∑ i ∈ Finset.range n, i := by 77 | exact Finset.sum_range_reflect (fun i : Nat => i) n 78 | rw [h_left, h_reflect, ←h_right] 79 | 80 | have h_chain : 81 | (pairs n).length = (List.range n).sum := by 82 | rw [h₀, h₁, h₂] 83 | 84 | have h_sum : 85 | (List.range n).sum = n * (n - 1) / 2 := by 86 | rw [list_sum_range_eq_finset n, Finset.sum_range_id] 87 | 88 | rw [h_chain, h_sum] 89 | -------------------------------------------------------------------------------- /LeanLJ/base.lean: -------------------------------------------------------------------------------- 1 | import Lean.Data.Parsec 2 | 3 | open Lean Parsec 4 | 5 | /-- Define a CSV field as a string -/ 6 | abbrev Field_CSV := String 7 | 8 | /-- Define a record (row) in the CSV as an array of fields -/ 9 | abbrev Record := Array Field_CSV 10 | 11 | /-- Define a CSV file as an array of records -/ 12 | abbrev Csv := Array Record 13 | 14 | /-- Parser to match a comma-separated value -/ 15 | def comma : Parsec Char := pchar ',' 16 | 17 | /-- Parser to match a newline (CRLF, LF, or CR) -/ 18 | def crlf : Parsec String := pstring "\r\n" <|> pstring "\n" <|> pstring "\r" 19 | 20 | /-- Parser to match the data within a field, including negative signs, digits, and decimals -/ 21 | def textData : Parsec Char := satisfy fun c => 22 | c.isDigit || c == '.' || c == '-' || c == 'e' || c == 'E' 23 | 24 | /-- Parser for non-escaped fields (i.e., fields without quotes) -/ 25 | def nonEscaped : Parsec String := manyChars textData 26 | 27 | /-- Parser for a field, assuming all fields are non-escaped for simplicity -/ 28 | def field : Parsec Field_CSV := nonEscaped 29 | 30 | /-- Parser for a record (row) of fields separated by commas -/ 31 | def manySep (p : Parsec α) (s : Parsec β) : Parsec $ Array α := do 32 | manyCore (attempt (s *> p)) #[←p] 33 | 34 | def record : Parsec Record := manySep field comma 35 | 36 | /-- Parser for the entire CSV file consisting of multiple records separated by newlines -/ 37 | def file : Parsec Csv := manySep record crlf 38 | 39 | /-- Function to parse a CSV string into a structured data format -/ 40 | def parse (s : String) : Except String Csv := 41 | match file s.mkIterator with 42 | | Parsec.ParseResult.success _ res => Except.ok res 43 | | Parsec.ParseResult.error it err => Except.error s!"offset {it.i.byteIdx}: {err}" 44 | 45 | def float_parsing (str: String) : Option Float := 46 | let parts := str.split (· == '.') 47 | match parts with 48 | | [intPart, fracPart] => 49 | let fullnum := (intPart ++ fracPart).toNat! 50 | let plc := fracPart 51 | some (Float.ofScientific fullnum true plc.length) 52 | | _ => none 53 | 54 | /-- Convert a parsed CSV to a list of lists of floats -/ 55 | def parseCsvToFloatLists (csvContent : String) : Option (List (List Float)) := 56 | match parse csvContent with 57 | | Except.ok rows => 58 | some (rows.toList.map (fun row => 59 | row.toList.map (fun field => 60 | match float_parsing field with 61 | | some f => f 62 | | none => 0.0 63 | ))) 64 | | Except.error _ => none 65 | 66 | 67 | set_option maxHeartbeats 10000000 68 | 69 | def ListDiv (L1 : List Float) (L2 : List Float) : List Float := 70 | match L1, L2 with 71 | | [], [] => [] 72 | | L1h :: L1t, L2h :: L2t => (L1h / L2h) :: (ListDiv L1t L2t) 73 | | _, _ => [] 74 | 75 | def ListProd (L1 : List Float) (L2 : List Float) : List Float := 76 | match L1, L2 with 77 | | [], [] => [] 78 | | L1h :: L1t, L2h :: L2t => (L1h * L2h) :: (ListProd L1t L2t) 79 | | _, _ => [] 80 | 81 | def listSub (L1 : List Float) (L2 : List Float) : List Float := 82 | match L1, L2 with 83 | | [], [] => [] 84 | | L1h :: L1t, L2h :: L2t => (L1h - L2h) :: (listSub L1t L2t) 85 | | _, _ => [] 86 | 87 | def apply_pbc (position : List Float) (cell_length : List Float) : List Float := 88 | let div_result := ListDiv position cell_length 89 | let round_result := div_result.map (λ x => Float.round x) 90 | let prod_result := ListProd cell_length round_result 91 | listSub position prod_result 92 | 93 | 94 | def minimum_image_distance (r_ij : List Float) (cell_length : List Float) : List Float := 95 | let div_result := ListDiv r_ij cell_length 96 | let round_result := div_result.map (λ x => Float.round x) 97 | let prod_result := ListProd cell_length round_result 98 | let result := listSub r_ij prod_result 99 | result 100 | 101 | def vectorNorm (vector : List Float) : Float := 102 | (vector.foldr (λ x acc => x ^ 2 + acc) 0.0).sqrt 103 | 104 | def lennard_jones_potential (r : Float) (cutoff : Float) : Float := 105 | if r < cutoff then 106 | let epsilon := 1.0 107 | let sigma := 1.0 108 | let r6 := (sigma / r) ^ 6 109 | let r12 := r6 * r6 110 | 4 * epsilon * (r12 - r6) 111 | else 112 | 0.0 113 | 114 | def energy (positions : List (List Float)) (cell_length : List Float) (cutoff : Float) (i j : Nat) (accumulated_energy : Float) : Float := 115 | if i = 0 then 116 | accumulated_energy 117 | else if j = 0 then 118 | energy positions cell_length cutoff (i - 1) (i - 2) accumulated_energy 119 | else 120 | let r_ij := listSub (positions[i - 1]!) (positions[j - 1]!) 121 | let r_ij1 := apply_pbc r_ij cell_length 122 | let r_ij2 := minimum_image_distance r_ij1 cell_length 123 | let distance := vectorNorm r_ij2 124 | let energy_contrib := lennard_jones_potential distance cutoff 125 | energy positions cell_length cutoff i (j - 1) (accumulated_energy + energy_contrib) 126 | 127 | def compute_energy (positions : List (List Float)) (cell_length : List Float) (cutoff : Float := 3.0) : Float := 128 | let num_atoms := positions.length 129 | energy positions cell_length cutoff num_atoms (num_atoms - 1) 0.0 130 | 131 | def positions : IO (List (List Float)) := do 132 | let fileContent ← IO.FS.readFile "data_for_LJC.csv" 133 | match parseCsvToFloatLists fileContent with 134 | | some pos => return pos 135 | | none => return [] 136 | 137 | 138 | def cell_length : List Float := [8.0, 8.0, 8.0] 139 | 140 | def goal : IO Unit := do 141 | let position ← positions 142 | IO.println position 143 | let energy := compute_energy position cell_length 144 | IO.println s!"Total Energy: {energy}" 145 | 146 | #eval goal 147 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LeanLJ 2 | 3 | LeanLJ stands for Lean Lennard-Jones. It is a project that brings mathematical accuracy and reliability to molecular simulations, and is the first steps toward formalizing molecular dynamics (MD) and Monte Carlo (MC) simulations. 4 | It is built using the Lean 4 programming language and theorem prover. LeanLJ aims to make scientific software provable by ensuring every 5 | calculation and simulation step is grounded in proven mathematics. Our vision is to help scientists and researchers run simulations 6 | they can fully trust, knowing that each part has been rigorously checked for correctness. 7 | 8 | ## Goals of LeanLJ 9 | + ***Mathematically Verified Simulations:*** LeanLJ’s eventual goal is on verifying every calculation involved in MD simulations, including foundational 10 | equations like Newton's laws of motion and energy conservation. Unlike conventional simulations, which rely on humans to check correctness, we can formalize these 11 | equations in Lean, ensuring each step adheres strictly to mathematical principles. This precision greatly reduces the risk of software errors, leading 12 | to more reliable simulation results. 13 | 14 | + ***Provable Scientific Computing:*** LeanLJ provides a framework to prevent errors arising from coding bugs or oversight. 15 | Inspired by the precise methods used in fields like chip manufacturing, LeanLJ’s system checks each step of the calculation for correctness, for 16 | simulations that are as free from errors as possible. This is particularly valuable for complex molecular systems where accuracy is essential. 17 | 18 | + ***Supporting Education and Research:*** LeanLJ isn’t just a tool -- it’s also a resource for students and researchers learning about the importance of 19 | verified computing. Through its open-source library, LeanLJ offers access to verified scientific theorems that anyone can use and learn from. This educational focus helps expand Lean’s impact, encouraging a culture of learning and collaboration among researchers and students alike. 20 | 21 | + ***Automation with AI:*** Looking to the future, LeanMD plans to incorporate AI tools, such as large language models (LLMs), to help automate some of the more complex proof steps. This addition could make it faster and easier to explore new scientific theories, validate findings, and possibly even generate new insights automatically. By integrating AI, LeanMD aims to keep up with the latest advancements, making proof generation and validation quicker and more efficient. 22 | 23 | ## Impact and Vision 24 | LeanLJ sets a new standard in molecular simulations by ensuring that each calculation is backed by solid, error-free mathematics. In the future, LeanMD aims to improve the 25 | quality and reliability of scientific software, paving the way for discoveries grounded in accurate, proven calculations. 26 | 27 | ## Project Installation 28 | 29 | ### Prerequisite 30 | - Lean 4 (Lean version 4.16.0-rc2) 31 | 32 | - Mathlib Library (at commit e1a3d4c) 33 | 34 | ## Setup 35 | 36 | 1 - Install Lean Dependencies and Mathlib 37 | [HERE](https://lean-lang.org/lean4/doc/quickstart.html) 38 | 39 | 2 - Clone the repository 40 | ```bash 41 | git clone https://github.com/ATOMSLab/LeanLJ.git 42 | ``` 43 | 44 | ## License 45 | [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0) 46 | 47 | This project is licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /lake-manifest.json: -------------------------------------------------------------------------------- 1 | {"version": "1.1.0", 2 | "packagesDir": ".lake/packages", 3 | "packages": 4 | [{"url": "https://github.com/leanprover-community/batteries", 5 | "type": "git", 6 | "subDir": null, 7 | "scope": "leanprover-community", 8 | "rev": "a975dea2c4d8258a55b4f9861c537e2bb0f9ef63", 9 | "name": "batteries", 10 | "manifestFile": "lake-manifest.json", 11 | "inputRev": "main", 12 | "inherited": true, 13 | "configFile": "lakefile.lean"}, 14 | {"url": "https://github.com/leanprover-community/quote4", 15 | "type": "git", 16 | "subDir": null, 17 | "scope": "leanprover-community", 18 | "rev": "71f54425e6fe0fa75f3aef33a2813a7898392222", 19 | "name": "Qq", 20 | "manifestFile": "lake-manifest.json", 21 | "inputRev": "master", 22 | "inherited": true, 23 | "configFile": "lakefile.lean"}, 24 | {"url": "https://github.com/leanprover-community/aesop", 25 | "type": "git", 26 | "subDir": null, 27 | "scope": "leanprover-community", 28 | "rev": "776a5a8f9c789395796e442d78a9d4cb9c4c9d03", 29 | "name": "aesop", 30 | "manifestFile": "lake-manifest.json", 31 | "inputRev": "master", 32 | "inherited": true, 33 | "configFile": "lakefile.toml"}, 34 | {"url": "https://github.com/leanprover-community/ProofWidgets4", 35 | "type": "git", 36 | "subDir": null, 37 | "scope": "leanprover-community", 38 | "rev": "a96aee5245720f588876021b6a0aa73efee49c76", 39 | "name": "proofwidgets", 40 | "manifestFile": "lake-manifest.json", 41 | "inputRev": "v0.0.41", 42 | "inherited": true, 43 | "configFile": "lakefile.lean"}, 44 | {"url": "https://github.com/leanprover/lean4-cli", 45 | "type": "git", 46 | "subDir": null, 47 | "scope": "", 48 | "rev": "2cf1030dc2ae6b3632c84a09350b675ef3e347d0", 49 | "name": "Cli", 50 | "manifestFile": "lake-manifest.json", 51 | "inputRev": "main", 52 | "inherited": true, 53 | "configFile": "lakefile.toml"}, 54 | {"url": "https://github.com/leanprover-community/import-graph", 55 | "type": "git", 56 | "subDir": null, 57 | "scope": "leanprover-community", 58 | "rev": "57bd2065f1dbea5e9235646fb836c7cea9ab03b6", 59 | "name": "importGraph", 60 | "manifestFile": "lake-manifest.json", 61 | "inputRev": "main", 62 | "inherited": true, 63 | "configFile": "lakefile.toml"}, 64 | {"url": "https://github.com/leanprover-community/mathlib4", 65 | "type": "git", 66 | "subDir": null, 67 | "scope": "leanprover-community", 68 | "rev": "35c50a55b4e1b6c43f1122d26a842a3003793797", 69 | "name": "mathlib", 70 | "manifestFile": "lake-manifest.json", 71 | "inputRev": "master", 72 | "inherited": false, 73 | "configFile": "lakefile.lean"}], 74 | "name": "LeanMD", 75 | "lakeDir": ".lake"} 76 | -------------------------------------------------------------------------------- /lakefile.lean: -------------------------------------------------------------------------------- 1 | import Lake 2 | open Lake DSL 3 | 4 | package "LeanLJ" where 5 | -- Settings applied to both builds and interactive editing 6 | leanOptions := #[ 7 | ⟨`pp.unicode.fun, true⟩ -- pretty-prints `fun a ↦ b` 8 | ] 9 | 10 | -- add any additional package configuration options here{ 11 | 12 | -- add any additional package configuration options here 13 | require "leanprover-community" / "mathlib" 14 | 15 | 16 | @[default_target] 17 | lean_lib «LeanLJ» where 18 | -- add any library configuration options here 19 | -------------------------------------------------------------------------------- /lean-toolchain: -------------------------------------------------------------------------------- 1 | leanprover/lean4:v4.16.0-rc2 2 | --------------------------------------------------------------------------------