@@ -78,7 +78,7 @@ If `Jx == Jy`, this returns the isotropic critical point `ising_βc`.
7878"""
7979function ising_anisotropic_βc (Jx:: Real , Jy:: Real )
8080 if Jx == Jy
81- return Float64 (ising_βc)
81+ return Float64 (ising_βc) / Jx
8282 end
8383 f (β) = sinh (2 β * Jx) * sinh (2 β * Jy) - 1.0
8484 β_max = Float64 (ising_βc) / min (Jx, Jy) * 5.0
@@ -100,14 +100,14 @@ with anisotropic couplings `Jx`, `Jy` is
100100where `Kx = β Jx`, `Ky = β Jy`.
101101"""
102102function f_onsager_anisotropic (β:: Real , Jx:: Real , Jy:: Real )
103- K1 = Float64 (β * Jx)
104- K2 = Float64 (β * Jy)
105- if Jx == Jy && abs (K1 - Float64 (ising_βc)) < 1.0e-14
103+ Kx, Ky = Float64 (β * Jx), Float64 (β * Jy )
104+ # Only use the high-precision constant at the isotropic critical point with J=1
105+ if Jx == 1 && Jy == 1 && abs (Kx - Float64 (ising_βc)) < 1.0e-14
106106 return Float64 (f_onsager)
107107 end
108108
109- c1, s1 = cosh (2 K1 ), sinh (2 K1 )
110- c2, s2 = cosh (2 K2 ), sinh (2 K2 )
109+ c1, s1 = cosh (2 Kx ), sinh (2 Kx )
110+ c2, s2 = cosh (2 Ky ), sinh (2 Ky )
111111 s2_sq = s2^ 2
112112
113113 # The 2D Onsager integral reduces to 1D after integrating out θ₂ analytically
@@ -143,27 +143,12 @@ Defaults to the isotropic case `Jx = Jy = 1.0`.
143143### Examples
144144```julia
145145 classical_ising() # default: ℤ₂ symmetric, isotropic at βc
146- classical_ising(Trivial, 0.5; h = 1.0) # no symmetry, with magnetic field
147- classical_ising(1.0; Jx = 1.0, Jy = 0.5) # anisotropic: Jx=1, Jy=0.5
146+ classical_ising(Trivial, 0.5; h = 1.0) # no symmetry, with magnetic field
147+ classical_ising(1.0; Jx = 1.0, Jy = 0.5) # anisotropic: Jx=1, Jy=0.5
148148 classical_ising(Trivial, 0.5; Jy = 0.8) # anisotropic without symmetry
149149
150150!!! info
151- When studying this model with impurities, the tensor without symmetry should be constructed,
152- as the impurity breaks the ℤ₂ symmetry.
153-
154- !!! note "Leg convention"
155- The tensor follows the standard TNRKit convention:
156-
157- ```
158- 3 (up, vertical, Jy)
159- |
160- 1 ←--+--← 4 (right, horizontal, Jx)
161- |
162- 2 (down, vertical, Jy)
163- ```
164-
165- Legs 1 and 4 are **horizontal** bonds (coupling `Jx`),
166- legs 2 and 3 are **vertical** bonds (coupling `Jy`).
151+ When studying this model with impurities, the tensor without symmetry should be constructed, as the impurity breaks the ℤ₂ symmetry.
167152
168153See also: [`classical_ising_3D`](@ref), [`ising_anisotropic_βc`](@ref).
169154"""
@@ -173,28 +158,24 @@ end
173158classical_ising (; kwargs... ) = classical_ising (ising_βc; kwargs... )
174159classical_ising (:: Type{Trivial} ; kwargs... ) = classical_ising (Trivial, ising_βc; kwargs... )
175160function classical_ising (:: Type{Trivial} , β:: Real ; T:: Type{<:Number} = Float64, h = 0.0 , Jx = 1.0 , Jy = 1.0 )
176- Kx = β * Jx
177- Ky = β * Jy
161+ Kx, Ky = β * Jx, β * Jy
178162 init = zeros (T, 2 , 2 , 2 , 2 )
179163 for (i, j, k, l) in Iterators. product ([1 : 2 for _ in 1 : 4 ]. .. )
180164 init[i, j, k, l] = mod (i + j + k + l, 2 ) == 0 ? cosh (h * β) : sinh (h * β)
181165 end
182166 init = TensorMap (init, ℂ^ 2 ⊗ ℂ^ 2 ← ℂ^ 2 ⊗ ℂ^ 2 )
183167
184- bond_tensor_x = ising_bond_tensor (Kx, T) # horizontal bonds (legs 1, 4)
185- bond_tensor_y = ising_bond_tensor (Ky, T) # vertical bonds (legs 2, 3)
186-
168+ bond_tensor_x = ising_bond_tensor (Kx, T)
169+ bond_tensor_y = ising_bond_tensor (Ky, T)
187170 @tensor T[- 1 - 2 ; - 3 - 4 ] := 2 * init[1 2 ; 3 4 ] * bond_tensor_x[- 1 ; 1 ] * bond_tensor_y[- 2 ; 2 ] * bond_tensor_y[3 ; - 3 ] * bond_tensor_x[4 ; - 4 ]
188171 return T
189172end
190173function classical_ising (:: Type{Z2Irrep} , β:: Real ; T:: Type{<:Number} = Float64, h = 0.0 , Jx = 1.0 , Jy = 1.0 )
191174 @assert h == 0.0 " External magnetic field is not compatible with ℤ₂ symmetry"
192- Kx = β * Jx
193- Ky = β * Jy
194-
195- xh, yh = cosh (Kx), sinh (Kx) # horizontal bonds (legs 1, 4)
196- xv, yv = cosh (Ky), sinh (Ky) # vertical bonds (legs 2, 3)
197- w = sqrt (xh * yh * xv * yv) # off-diagonal coupling √(cosh Kx sinh Kx cosh Ky sinh Ky)
175+ Kx, Ky = β * Jx, β * Jy
176+ xh, yh = cosh (Kx), sinh (Kx)
177+ xv, yv = cosh (Ky), sinh (Ky)
178+ w = sqrt (xh * yh * xv * yv)
198179
199180 S = ℤ₂Space (0 => 1 , 1 => 1 )
200181 t = zeros (T, S ⊗ S ← S ⊗ S)
@@ -213,9 +194,9 @@ with a magnetisation impurity. Compatible with no symmetry on each of its spaces
213194
214195### Examples
215196```julia
216- classical_ising_impurity() # default: isotropic at βc
217- classical_ising_impurity(0.5; h = 1.0) # with magnetic field
218- classical_ising_impurity(0.5; Jx = 1.0, Jy = 0.5) # anisotropic couplings
197+ classical_ising_impurity() # default: isotropic at βc
198+ classical_ising_impurity(0.5; h = 1.0) # with magnetic field
199+ classical_ising_impurity(0.5; Jx = 1.0, Jy = 0.5) # anisotropic couplings
219200```
220201!!! info
221202 When calculating the free energy with `free_energy()`, set the `initial_size` keyword argument to `2.0`.
@@ -228,16 +209,15 @@ function classical_ising_impurity(β::Real; kwargs...)
228209end
229210classical_ising_impurity (; kwargs... ) = classical_ising_impurity (ising_βc; kwargs... )
230211function classical_ising_impurity (:: Type{Trivial} , β:: Real ; T:: Type{<:Number} = Float64, h = 0.0 , Jx = 1.0 , Jy = 1.0 )
231- Kx = β * Jx
232- Ky = β * Jy
212+ Kx, Ky = β * Jx, β * Jy
233213 init = zeros (T, 2 , 2 , 2 , 2 )
234214 for (i, j, k, l) in Iterators. product ([1 : 2 for _ in 1 : 4 ]. .. )
235215 init[i, j, k, l] = mod (i + j + k + l, 2 ) == 0 ? sinh (h * β) : cosh (h * β)
236216 end
237217 init = TensorMap (init, ℂ^ 2 ⊗ ℂ^ 2 ← ℂ^ 2 ⊗ ℂ^ 2 )
238218
239- bond_tensor_x = ising_bond_tensor (Kx, T) # horizontal bonds (legs 1, 4)
240- bond_tensor_y = ising_bond_tensor (Ky, T) # vertical bonds (legs 2, 3)
219+ bond_tensor_x = ising_bond_tensor (Kx, T)
220+ bond_tensor_y = ising_bond_tensor (Ky, T)
241221
242222 @tensor t[- 1 - 2 ; - 3 - 4 ] := 2 * init[1 2 ; 3 4 ] * bond_tensor_x[- 1 ; 1 ] * bond_tensor_y[- 2 ; 2 ] * bond_tensor_y[3 ; - 3 ] * bond_tensor_x[4 ; - 4 ]
243223 return t
0 commit comments