Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/src/examples/2d_ising_partition_function/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Since we later want to compute the magnetization and energy to check our results
the appropriate rank-4 tensors here as well while we're at it.

````julia
function classical_ising(; beta=log(1 + sqrt(2)) / 2, J=1.0)
function classical_ising(; beta = log(1 + sqrt(2)) / 2, J = 1.0)
K = beta * J

# Boltzmann weights
Expand Down Expand Up @@ -119,12 +119,12 @@ settings:
````julia
Venv = ℂ^20
env₀ = CTMRGEnv(Z, Venv)
env, = leading_boundary(env₀, Z; tol=1e-8, maxiter=500);
env, = leading_boundary(env₀, Z; tol = 1.0e-8, maxiter = 500);
````

````
[ Info: CTMRG init: obj = +1.784252138312e+00 -1.557258880375e+00im err = 1.0000e+00
[ Info: CTMRG conv 63: obj = +3.353928644031e+00 err = 4.5903314811e-09 time = 8.12 sec
[ Info: CTMRG conv 63: obj = +3.353928644031e+00 err = 4.6032264022e-09 time = 5.74 sec

````

Expand Down Expand Up @@ -159,9 +159,9 @@ e = expectation_value(Z, (1, 1) => E, env)
````

````
λ = 3.3539286440313782 - 5.873212040152551e-16im
m = 0.9736086674403001 + 1.8262157316829647e-17im
e = -1.8637796145082437 - 1.4609725853463717e-16im
λ = 3.353928644031378 + 7.047583922370844e-16im
m = 0.9736086674403002 + 0.0im
e = -1.8637796145082448 + 1.4610281815259345e-16im

````

Expand All @@ -174,7 +174,7 @@ magnetization and energy per site (where we use `quadgk` to perform integrals of
auxiliary variable from $0$ to $\pi/2$):

````julia
function classical_ising_exact(; beta=log(1 + sqrt(2)) / 2, J=1.0)
function classical_ising_exact(; beta = log(1 + sqrt(2)) / 2, J = 1.0)
K = beta * J

k = 1 / sinh(2 * K)^2
Expand Down Expand Up @@ -205,9 +205,9 @@ extrapolation):
````

````
(-(log(λ)) / beta - f_exact) / f_exact = -6.605563039765528e-16 - 1.447068124555315e-16im
(abs(m) - abs(m_exact)) / abs(m_exact) = -4.561270094458082e-16
(e - e_exact) / e_exact = -0.023732068099090543 + 7.652732508485748e-17im
(-(log(λ)) / beta - f_exact) / f_exact = -8.807417386354037e-16 + 1.736415096112634e-16im
(abs(m) - abs(m_exact)) / abs(m_exact) = -3.420952570843561e-16
(e - e_exact) / e_exact = -0.02373206809908996 - 7.653023727290916e-17im

````

Expand Down
6 changes: 3 additions & 3 deletions docs/src/examples/2d_ising_partition_function/main.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"outputs": [],
"cell_type": "code",
"source": [
"function classical_ising(; beta=log(1 + sqrt(2)) / 2, J=1.0)\n",
"function classical_ising(; beta = log(1 + sqrt(2)) / 2, J = 1.0)\n",
" K = beta * J\n",
"\n",
" # Boltzmann weights\n",
Expand Down Expand Up @@ -139,7 +139,7 @@
"source": [
"Venv = ℂ^20\n",
"env₀ = CTMRGEnv(Z, Venv)\n",
"env, = leading_boundary(env₀, Z; tol=1e-8, maxiter=500);"
"env, = leading_boundary(env₀, Z; tol = 1.0e-8, maxiter = 500);"
],
"metadata": {},
"execution_count": null
Expand Down Expand Up @@ -202,7 +202,7 @@
"outputs": [],
"cell_type": "code",
"source": [
"function classical_ising_exact(; beta=log(1 + sqrt(2)) / 2, J=1.0)\n",
"function classical_ising_exact(; beta = log(1 + sqrt(2)) / 2, J = 1.0)\n",
" K = beta * J\n",
"\n",
" k = 1 / sinh(2 * K)^2\n",
Expand Down
190 changes: 94 additions & 96 deletions docs/src/examples/3d_ising_partition_function/index.md

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions docs/src/examples/3d_ising_partition_function/main.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"outputs": [],
"cell_type": "code",
"source": [
"function three_dimensional_classical_ising(; beta, J=1.0)\n",
"function three_dimensional_classical_ising(; beta, J = 1.0)\n",
" K = beta * J\n",
"\n",
" # Boltzmann weights\n",
Expand Down Expand Up @@ -197,9 +197,9 @@
"outputs": [],
"cell_type": "code",
"source": [
"boundary_alg = SimultaneousCTMRG(; maxiter=150, tol=1e-8, verbosity=1)\n",
"boundary_alg = SimultaneousCTMRG(; maxiter = 150, tol = 1.0e-8, verbosity = 1)\n",
"rrule_alg = EigSolver(;\n",
" solver_alg=KrylovKit.Arnoldi(; maxiter=30, tol=1e-6, eager=true), iterscheme=:diffgauge\n",
" solver_alg = KrylovKit.Arnoldi(; maxiter = 30, tol = 1.0e-6, eager = true), iterscheme = :diffgauge\n",
")\n",
"T = InfinitePEPO(O)\n",
"\n",
Expand All @@ -214,7 +214,7 @@
" env_double_layer,\n",
" n_double_layer,\n",
" boundary_alg;\n",
" alg_rrule=rrule_alg,\n",
" alg_rrule = rrule_alg,\n",
" )\n",
" # construct the PEPS-PEPO-PEPS overlap network\n",
" n_triple_layer = InfiniteSquareNetwork(ψ, T)\n",
Expand All @@ -224,7 +224,7 @@
" env_triple_layer,\n",
" n_triple_layer,\n",
" boundary_alg;\n",
" alg_rrule=rrule_alg,\n",
" alg_rrule = rrule_alg,\n",
" )\n",
" # update the environments for reuse\n",
" PEPSKit.ignore_derivatives() do\n",
Expand Down Expand Up @@ -299,12 +299,12 @@
" return (peps´, env_double_layer´, env_triple_layer´), ξ\n",
"end\n",
"function pepo_transport!(\n",
" ξ,\n",
" (peps, env_double_layer, env_triple_layer),\n",
" η,\n",
" α,\n",
" (peps´, env_double_layer´, env_triple_layer´),\n",
")\n",
" ξ,\n",
" (peps, env_double_layer, env_triple_layer),\n",
" η,\n",
" α,\n",
" (peps´, env_double_layer´, env_triple_layer´),\n",
" )\n",
" return PEPSKit.peps_transport!(\n",
" ξ, (peps, env_double_layer), η, α, (peps´, env_double_layer´)\n",
" )\n",
Expand Down Expand Up @@ -335,15 +335,15 @@
"env2_0 = CTMRGEnv(InfiniteSquareNetwork(psi0), Venv)\n",
"env3_0 = CTMRGEnv(InfiniteSquareNetwork(psi0, T), Venv)\n",
"\n",
"optimizer_alg = LBFGS(32; maxiter=100, gradtol=1e-5, verbosity=3)\n",
"optimizer_alg = LBFGS(32; maxiter = 100, gradtol = 1.0e-5, verbosity = 3)\n",
"\n",
"(psi_final, env2_final, env3_final), f, = optimize(\n",
" pepo_costfun,\n",
" (psi0, env2_0, env3_0),\n",
" optimizer_alg;\n",
" inner=PEPSKit.real_inner,\n",
" retract=pepo_retract,\n",
" (transport!)=(pepo_transport!),\n",
" inner = PEPSKit.real_inner,\n",
" retract = pepo_retract,\n",
" (transport!) = (pepo_transport!),\n",
");"
],
"metadata": {},
Expand Down Expand Up @@ -409,11 +409,11 @@
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.10.4"
"version": "1.11.5"
},
"kernelspec": {
"name": "julia-1.10",
"display_name": "Julia 1.10.4",
"name": "julia-1.11",
"display_name": "Julia 1.11.5",
"language": "julia"
}
},
Expand Down
Loading
Loading