File size: 2,691 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | import Mathlib
namespace OAI
section
section
noncomputable section
open scoped BigOperators Topology
open MeasureTheory ProbabilityTheory Filter
namespace SK
abbrev Config (n : β) := Fin n β Bool
abbrev Edge (n : β) := {p : Fin n Γ Fin n // p.1 < p.2}
abbrev Disorder (n : β) := Edge n β β
def spin (b : Bool) : β := if b then 1 else -1
def hamiltonian {n : β} (J : Disorder n) (x : Config n) : β :=
(β e : Edge n, J e * spin (x e.val.1) * spin (x e.val.2)) / Real.sqrt n
def partition {n : β} (Ξ² : β) (J : Disorder n) : β :=
β x : Config n, Real.exp (Ξ² * hamiltonian J x)
def gibbs {n : β} (Ξ² : β) (J : Disorder n) (x : Config n) : β :=
Real.exp (Ξ² * hamiltonian J x) / partition Ξ² J
def coupling {n : β} (J : Disorder n) (i j : Fin n) : β :=
if h : i < j then J β¨(i, j), hβ© else
if h : j < i then J β¨(j, i), hβ© else 0
def localField {n : β} (J : Disorder n) (x : Config n) (i : Fin n) : β :=
(β j : Fin n, coupling J i j * spin (x j)) / Real.sqrt n
def heatBath {n : β} (Ξ² : β) (J : Disorder n) (x y : Config n) : β :=
(β i : Fin n, if Function.update x i (y i) = y then
Real.exp (Ξ² * spin (y i) * localField J x i) /
(2 * Real.cosh (Ξ² * localField J x i)) else 0) / n
def discreteKernel {n : β} (Ξ² : β) (J : Disorder n) : β β Config n β Config n β β
| 0, x, y => if x = y then 1 else 0
| k + 1, x, y => β z : Config n, heatBath Ξ² J x z * discreteKernel Ξ² J k z y
def continuousKernel {n : β} (Ξ² : β) (J : Disorder n) (t : β)
(x y : Config n) : β :=
β' k : β, (Real.exp (-(n : β) * t) * ((n : β) * t) ^ k /
(Nat.factorial k : β)) * discreteKernel Ξ² J k x y
def discreteDistance {n : β} (Ξ² : β) (J : Disorder n)
(x : Config n) (k : β) : β :=
(1 / 2 : β) * β y : Config n, |discreteKernel Ξ² J k x y - gibbs Ξ² J y|
def continuousDistance {n : β} (Ξ² : β) (J : Disorder n)
(x : Config n) (t : β) : β :=
(1 / 2 : β) * β y : Config n, |continuousKernel Ξ² J t x y - gibbs Ξ² J y|
def disorderLaw (n : β) : Measure (Disorder n) :=
Measure.pi (fun _ : Edge n => gaussianReal 0 1)
def kappa : β := 1 / 10000
def timeScale (n : β) : β := Real.exp ((n : β) ^ kappa)
def continuousBadMass (Ξ² : β) (n : β) : β :=
β« J : Disorder n, (β x : Config n, if 1 / 4 < continuousDistance Ξ² J x (timeScale n)
then gibbs Ξ² J x else 0) βdisorderLaw n
def discreteBadMass (Ξ² : β) (n : β) : β :=
β« J : Disorder n, (β x : Config n, if 1 / 4 < discreteDistance Ξ² J x βtimeScale nββ
then gibbs Ξ² J x else 0) βdisorderLaw n
end SK
end
end
end
end OAI
|