Skip to content

Commit a52f0fc

Browse files
authored
Rename algorithm symbols (#376)
* Rename all algorithm symbols with correct capitalization according to their structs * Rename `:iterative` to `:GKL`
1 parent 8a097b1 commit a52f0fc

53 files changed

Lines changed: 241 additions & 240 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/src/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ When releasing a new version, move the "Unreleased" changes to a new version sec
5252
### Changed
5353

5454
- A unified interface for Trotter-based time evolution algorithms. The old `su_iter`, `simpleupdate` functions should be replaced by `timestep`, `time_evolve` respectively
55-
- Default fixed-point gradient algorithm changed to `:eigsolver`
55+
- Default fixed-point gradient algorithm changed to `:EigSolver`
5656
- BoundaryMPS methods now have their own custom transfer functions, avoiding a double conjugation and twist issues for fermions
5757
- `physicalspace` and related functions now correctly handle periodic indexing for infinite networks
5858
- Updated compatibility with TensorKit v0.15

docs/src/examples/bose_hubbard/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ optimization framework in the usual way to find the ground state. So, we first s
9999
algorithms and their tolerances:
100100

101101
````julia
102-
boundary_alg = (; tol = 1.0e-8, alg = :simultaneous, trunc = (; alg = :fixedspace))
103-
gradient_alg = (; tol = 1.0e-6, maxiter = 10, alg = :linsolver, iterscheme = :fixed)
104-
optimizer_alg = (; tol = 1.0e-4, alg = :lbfgs, maxiter = 150, ls_maxiter = 2, ls_maxfg = 2);
102+
boundary_alg = (; tol = 1.0e-8, alg = :SimultaneousCTMRG, trunc = (; alg = :FixedSpaceTruncation))
103+
gradient_alg = (; tol = 1.0e-6, maxiter = 10, alg = :LinSolver, iterscheme = :fixed)
104+
optimizer_alg = (; tol = 1.0e-4, alg = :LBFGS, maxiter = 150, ls_maxiter = 2, ls_maxfg = 2);
105105
````
106106

107107
!!! note
@@ -110,7 +110,7 @@ optimizer_alg = (; tol = 1.0e-4, alg = :lbfgs, maxiter = 150, ls_maxiter = 2, ls
110110
the `boundary_alg`, `gradient_alg` and `optimizer_alg` settings. There rarely is a
111111
general-purpose set of settings which will always work, so instead one has to adjust
112112
the simulation settings for each specific application. For example, it might help to
113-
switch between the CTMRG flavors `alg=:simultaneous` and `alg=:sequential` to
113+
switch between the CTMRG flavors `alg=:SimultaneousCTMRG` and `alg=:SequentialCTMRG` to
114114
improve convergence. Of course the tolerances of the algorithms and their subalgorithms
115115
also have to be compatible. For more details on the available options, see the
116116
[`fixedpoint`](@ref) docstring.

docs/src/examples/bose_hubbard/main.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@
156156
"metadata": {},
157157
"outputs": [],
158158
"source": [
159-
"boundary_alg = (; tol = 1.0e-8, alg = :simultaneous, trunc = (; alg = :fixedspace))\n",
160-
"gradient_alg = (; tol = 1.0e-6, maxiter = 10, alg = :linsolver, iterscheme = :fixed)\n",
161-
"optimizer_alg = (; tol = 1.0e-4, alg = :lbfgs, maxiter = 150, ls_maxiter = 2, ls_maxfg = 2);"
159+
"boundary_alg = (; tol = 1.0e-8, alg = :SimultaneousCTMRG, trunc = (; alg = :FixedSpaceTruncation))\n",
160+
"gradient_alg = (; tol = 1.0e-6, maxiter = 10, alg = :LinSolver, iterscheme = :fixed)\n",
161+
"optimizer_alg = (; tol = 1.0e-4, alg = :LBFGS, maxiter = 150, ls_maxiter = 2, ls_maxfg = 2);"
162162
]
163163
},
164164
{
@@ -171,7 +171,7 @@
171171
" the `boundary_alg`, `gradient_alg` and `optimizer_alg` settings. There rarely is a\n",
172172
" general-purpose set of settings which will always work, so instead one has to adjust\n",
173173
" the simulation settings for each specific application. For example, it might help to\n",
174-
" switch between the CTMRG flavors `alg=:simultaneous` and `alg=:sequential` to\n",
174+
" switch between the CTMRG flavors `alg=:SimultaneousCTMRG` and `alg=:SequentialCTMRG` to\n",
175175
" improve convergence. Of course the tolerances of the algorithms and their subalgorithms\n",
176176
" also have to be compatible. For more details on the available options, see the\n",
177177
" [`fixedpoint`](@ref) docstring.\n",

docs/src/examples/c4v_ctmrg/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ env_random_c4v = initialize_random_c4v_env(peps₀, ComplexSpace(χ));
8787
````
8888

8989
Then contracting the PEPS using $C_{4v}$ CTMRG is as easy as just calling [`leading_boundary`](@ref)
90-
but passing the initial PEPS and environment as well as the `alg = :c4v` keyword argument:
90+
but passing the initial PEPS and environment as well as the `alg = :C4vCTMRG` keyword argument:
9191

9292
````julia
93-
env₀, = leading_boundary(env_random_c4v, peps₀; alg = :c4v, tol = 1.0e-10);
93+
env₀, = leading_boundary(env_random_c4v, peps₀; alg = :C4vCTMRG, tol = 1.0e-10);
9494
````
9595

9696
````
@@ -103,13 +103,13 @@ env₀, = leading_boundary(env_random_c4v, peps₀; alg = :c4v, tol = 1.0e-10);
103103

104104
We now take `peps₀` and `env₀` as a starting point for a gradient-based energy
105105
minimization where we contract using $C_{4v}$ CTMRG such that the energy gradient will also
106-
exhibit $C_{4v}$ symmetry. For that, we call `fixedpoint` and specify `alg = :c4v`
106+
exhibit $C_{4v}$ symmetry. For that, we call `fixedpoint` and specify `alg = :C4vCTMRG`
107107
as the boundary contraction algorithm:
108108

109109
````julia
110110
H = real(heisenberg_XYZ_c4v(InfiniteSquare())) # make Hamiltonian real-valued
111111
peps, env, E, = fixedpoint(
112-
H, peps₀, env₀; optimizer_alg = (; tol = 1.0e-4), boundary_alg = (; alg = :c4v),
112+
H, peps₀, env₀; optimizer_alg = (; tol = 1.0e-4), boundary_alg = (; alg = :C4vCTMRG),
113113
);
114114
````
115115

@@ -184,13 +184,13 @@ and optimization times, and also has vastly improved GPU performance. Notably, i
184184
that QR-CTMRG converges to the same fixed point as regular $C_{4v}$ CTMRG.
185185

186186
In PEPSKit terms, using QR-CTMRG just amounts to switching out the projector algorithm that is
187-
used by the [`C4vCTMRG`](@ref) algorithm to `projector_alg = :c4v_qr` (as opposed to `:c4v_eigh`).
187+
used by the [`C4vCTMRG`](@ref) algorithm to `projector_alg = :C4vQRProjector` (as opposed to `:C4vEighProjector`).
188188
QR-CTMRG tends to need significantly more iterations to converge while still being much faster,
189189
hence we need to increase `maxiter`:
190190

191191
````julia
192192
env_qr₀, = leading_boundary(
193-
env_random_c4v, peps; alg = :c4v, projector_alg = :c4v_qr, maxiter = 500,
193+
env_random_c4v, peps; alg = :C4vCTMRG, projector_alg = :C4vQRProjector, maxiter = 500,
194194
);
195195
````
196196

@@ -201,7 +201,7 @@ env_qr₀, = leading_boundary(
201201
202202
````
203203

204-
To optimize using QR-CTMRG we proceed analogously by specifiying `projector_alg = :c4v_qr` and
204+
To optimize using QR-CTMRG we proceed analogously by specifiying `projector_alg = :C4vQRProjector` and
205205
increasing the `maxiter` when setting the boundary algorithm parameters. We make sure to supply
206206
the `env_qr₀` initial environment because it does not use `DiagonalTensorMap`s as its corner
207207
type (only regular `eigh`-based $C_{4v}$ CTMRG produces diagonal corners):
@@ -210,8 +210,8 @@ type (only regular `eigh`-based $C_{4v}$ CTMRG produces diagonal corners):
210210
peps_qr, env_qr, E_qr, = fixedpoint(
211211
H, peps₀, env_qr₀;
212212
optimizer_alg = (; tol = 1.0e-4),
213-
boundary_alg = (; alg = :c4v, projector_alg = :c4v_qr, maxiter = 500),
214-
gradient_alg = (; alg = :linsolver)
213+
boundary_alg = (; alg = :C4vCTMRG, projector_alg = :C4vQRProjector, maxiter = 500),
214+
gradient_alg = (; alg = :LinSolver)
215215
);
216216
@show (E_qr - E_ref) / E_ref;
217217
````

docs/src/examples/c4v_ctmrg/main.ipynb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@
132132
"cell_type": "markdown",
133133
"source": [
134134
"Then contracting the PEPS using $C_{4v}$ CTMRG is as easy as just calling `leading_boundary`\n",
135-
"but passing the initial PEPS and environment as well as the `alg = :c4v` keyword argument:"
135+
"but passing the initial PEPS and environment as well as the `alg = :C4vCTMRG` keyword argument:"
136136
],
137137
"metadata": {}
138138
},
139139
{
140140
"outputs": [],
141141
"cell_type": "code",
142142
"source": [
143-
"env₀, = leading_boundary(env_random_c4v, peps₀; alg = :c4v, tol = 1.0e-10);"
143+
"env₀, = leading_boundary(env_random_c4v, peps₀; alg = :C4vCTMRG, tol = 1.0e-10);"
144144
],
145145
"metadata": {},
146146
"execution_count": null
@@ -152,7 +152,7 @@
152152
"\n",
153153
"We now take `peps₀` and `env₀` as a starting point for a gradient-based energy\n",
154154
"minimization where we contract using $C_{4v}$ CTMRG such that the energy gradient will also\n",
155-
"exhibit $C_{4v}$ symmetry. For that, we call `fixedpoint` and specify `alg = :c4v`\n",
155+
"exhibit $C_{4v}$ symmetry. For that, we call `fixedpoint` and specify `alg = :C4vCTMRG`\n",
156156
"as the boundary contraction algorithm:"
157157
],
158158
"metadata": {}
@@ -163,7 +163,7 @@
163163
"source": [
164164
"H = real(heisenberg_XYZ_c4v(InfiniteSquare())) # make Hamiltonian real-valued\n",
165165
"peps, env, E, = fixedpoint(\n",
166-
" H, peps₀, env₀; optimizer_alg = (; tol = 1.0e-4), boundary_alg = (; alg = :c4v),\n",
166+
" H, peps₀, env₀; optimizer_alg = (; tol = 1.0e-4), boundary_alg = (; alg = :C4vCTMRG),\n",
167167
");"
168168
],
169169
"metadata": {},
@@ -226,7 +226,7 @@
226226
"that QR-CTMRG converges to the same fixed point as regular $C_{4v}$ CTMRG.\n",
227227
"\n",
228228
"In PEPSKit terms, using QR-CTMRG just amounts to switching out the projector algorithm that is\n",
229-
"used by the `C4vCTMRG` algorithm to `projector_alg = :c4v_qr` (as opposed to `:c4v_eigh`).\n",
229+
"used by the `C4vCTMRG` algorithm to `projector_alg = :C4vQRProjector` (as opposed to `:C4vEighProjector`).\n",
230230
"QR-CTMRG tends to need significantly more iterations to converge while still being much faster,\n",
231231
"hence we need to increase `maxiter`:"
232232
],
@@ -237,7 +237,7 @@
237237
"cell_type": "code",
238238
"source": [
239239
"env_qr₀, = leading_boundary(\n",
240-
" env_random_c4v, peps; alg = :c4v, projector_alg = :c4v_qr, maxiter = 500,\n",
240+
" env_random_c4v, peps; alg = :C4vCTMRG, projector_alg = :C4vQRProjector, maxiter = 500,\n",
241241
");"
242242
],
243243
"metadata": {},
@@ -246,7 +246,7 @@
246246
{
247247
"cell_type": "markdown",
248248
"source": [
249-
"To optimize using QR-CTMRG we proceed analogously by specifiying `projector_alg = :c4v_qr` and\n",
249+
"To optimize using QR-CTMRG we proceed analogously by specifiying `projector_alg = :C4vQRProjector` and\n",
250250
"increasing the `maxiter` when setting the boundary algorithm parameters. We make sure to supply\n",
251251
"the `env_qr₀` initial environment because it does not use `DiagonalTensorMap`s as its corner\n",
252252
"type (only regular `eigh`-based $C_{4v}$ CTMRG produces diagonal corners):"
@@ -260,8 +260,8 @@
260260
"peps_qr, env_qr, E_qr, = fixedpoint(\n",
261261
" H, peps₀, env_qr₀;\n",
262262
" optimizer_alg = (; tol = 1.0e-4),\n",
263-
" boundary_alg = (; alg = :c4v, projector_alg = :c4v_qr, maxiter = 500),\n",
264-
" gradient_alg = (; alg = :linsolver)\n",
263+
" boundary_alg = (; alg = :C4vCTMRG, projector_alg = :C4vQRProjector, maxiter = 500),\n",
264+
" gradient_alg = (; alg = :LinSolver)\n",
265265
");\n",
266266
"@show (E_qr - E_ref) / E_ref;"
267267
],

docs/src/examples/fermi_hubbard/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ Again, the procedure of ground state optimization is very similar to before. Fir
8181
define all algorithmic parameters:
8282

8383
````julia
84-
boundary_alg = (; tol = 1.0e-8, alg = :simultaneous, trunc = (; alg = :fixedspace))
85-
gradient_alg = (; tol = 1.0e-6, alg = :eigsolver, maxiter = 10, iterscheme = :fixed)
86-
optimizer_alg = (; tol = 1.0e-4, alg = :lbfgs, maxiter = 80, ls_maxiter = 3, ls_maxfg = 3)
84+
boundary_alg = (; tol = 1.0e-8, alg = :SimultaneousCTMRG, trunc = (; alg = :FixedSpaceTruncation))
85+
gradient_alg = (; tol = 1.0e-6, alg = :EigSolver, maxiter = 10, iterscheme = :fixed)
86+
optimizer_alg = (; tol = 1.0e-4, alg = :LBFGS, maxiter = 80, ls_maxiter = 3, ls_maxfg = 3)
8787
````
8888

8989
````
90-
(tol = 0.0001, alg = :lbfgs, maxiter = 80, ls_maxiter = 3, ls_maxfg = 3)
90+
(tol = 0.0001, alg = :LBFGS, maxiter = 80, ls_maxiter = 3, ls_maxfg = 3)
9191
````
9292

9393
Second, we initialize a PEPS state and environment (which we converge) constructed from

docs/src/examples/fermi_hubbard/main.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@
129129
"metadata": {},
130130
"outputs": [],
131131
"source": [
132-
"boundary_alg = (; tol = 1.0e-8, alg = :simultaneous, trunc = (; alg = :fixedspace))\n",
133-
"gradient_alg = (; tol = 1.0e-6, alg = :eigsolver, maxiter = 10, iterscheme = :fixed)\n",
134-
"optimizer_alg = (; tol = 1.0e-4, alg = :lbfgs, maxiter = 80, ls_maxiter = 3, ls_maxfg = 3)"
132+
"boundary_alg = (; tol = 1.0e-8, alg = :SimultaneousCTMRG, trunc = (; alg = :FixedSpaceTruncation))\n",
133+
"gradient_alg = (; tol = 1.0e-6, alg = :EigSolver, maxiter = 10, iterscheme = :fixed)\n",
134+
"optimizer_alg = (; tol = 1.0e-4, alg = :LBFGS, maxiter = 80, ls_maxiter = 3, ls_maxfg = 3)"
135135
]
136136
},
137137
{

docs/src/examples/heisenberg/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ arguments. To see a description of all arguments, see the docstring of
7474
specific tolerance and during the CTMRG run keep all index dimensions fixed:
7575

7676
````julia
77-
boundary_alg = (; tol = 1.0e-10, trunc = (; alg = :fixedspace));
77+
boundary_alg = (; tol = 1.0e-10, trunc = (; alg = :FixedSpaceTruncation));
7878
````
7979

8080
Let us also configure the optimizer algorithm. We are going to optimize the PEPS using the
@@ -83,7 +83,7 @@ the convergence tolerance (for the gradient norm) as well as the maximal number
8383
and the BFGS memory size (which is used to approximate the Hessian):
8484

8585
````julia
86-
optimizer_alg = (; alg = :lbfgs, tol = 1.0e-4, maxiter = 100, lbfgs_memory = 16);
86+
optimizer_alg = (; alg = :LBFGS, tol = 1.0e-4, maxiter = 100, lbfgs_memory = 16);
8787
````
8888

8989
Additionally, during optimization, we want to reuse the previous CTMRG environment to

docs/src/examples/heisenberg/main.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
"outputs": [],
121121
"cell_type": "code",
122122
"source": [
123-
"boundary_alg = (; tol = 1.0e-10, trunc = (; alg = :fixedspace));"
123+
"boundary_alg = (; tol = 1.0e-10, trunc = (; alg = :FixedSpaceTruncation));"
124124
],
125125
"metadata": {},
126126
"execution_count": null
@@ -139,7 +139,7 @@
139139
"outputs": [],
140140
"cell_type": "code",
141141
"source": [
142-
"optimizer_alg = (; alg = :lbfgs, tol = 1.0e-4, maxiter = 100, lbfgs_memory = 16);"
142+
"optimizer_alg = (; alg = :LBFGS, tol = 1.0e-4, maxiter = 100, lbfgs_memory = 16);"
143143
],
144144
"metadata": {},
145145
"execution_count": null

docs/src/examples/heisenberg_su/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ trunc_env = truncerror(; atol = 1.0e-10) & truncrank(χenv)
142142
env, = leading_boundary(
143143
env₀,
144144
peps;
145-
alg = :sequential,
146-
projector_alg = :fullinfinite,
145+
alg = :SequentialCTMRG,
146+
projector_alg = :FullInfiniteProjector,
147147
tol = 1.0e-10,
148148
trunc = trunc_env,
149149
);

0 commit comments

Comments
 (0)