For now, refer to the examples folder on GitHub.
diff --git a/dev/examples/index.html b/dev/examples/index.html index 3cc1aa28..b6a73b23 100644 --- a/dev/examples/index.html +++ b/dev/examples/index.html @@ -1,2 +1,2 @@ -
For now, refer to the examples folder on GitHub.
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 17 May 2024. Using Julia version 1.10.3.
For now, refer to the examples folder on GitHub.
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 17 May 2024. Using Julia version 1.10.3.
Tools for working with projected entangled-pair states
It contracts, it optimizes, it may be broken at any point.
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 17 May 2024. Using Julia version 1.10.3.
[![docs][docs-dev-img]][docs-dev-url] ![CI][ci-url] [![codecov][codecov-img]][codecov-url]
[docs-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg [docs-dev-url]: https://quantumghent.github.io/PEPSKit.jl/dev/
[codecov-img]: https://codecov.io/gh/quantumghent/PEPSKit.jl/branch/master/graph/badge.svg [codecov-url]: https://codecov.io/gh/quantumghent/PEPSKit.jl
[ci-url]: https://github.com/quantumghent/PEPSKit.jl/workflows/CI/badge.svg
Tools for working with projected entangled-pair states
It contracts, it optimizes, it may break.
The package can be installed through the Julia general registry, via the package manager:
pkg> add PEPSKit
After following the installation process, it should now be possible to load the packages and start simulating. For example, in order to obtain the groundstate of the 2D Heisenberg model, we can use the following code:
using TensorKit, PEPSKit, KrylovKit, OptimKit
+
+# constructing the Hamiltonian:
+Jx, Jy, Jz = (-1, 1, -1) # sublattice rotation to obtain single-site unit cell
+physical_space = ComplexSpace(2)
+T = ComplexF64
+σx = TensorMap(T[0 1; 1 0], physical_space, physical_space)
+σy = TensorMap(T[0 im; -im 0], physical_space, physical_space)
+σz = TensorMap(T[1 0; 0 -1], physical_space, physical_space)
+H = (Jx * σx ⊗ σx) + (Jy * σy ⊗ σy) + (Jz * σz ⊗ σz)
+Heisenberg_hamiltonian = NLocalOperator{NearestNeighbor}(H / 4)
+
+# configuring the parameters
+D = 2
+chi = 20
+ctm_alg = CTMRG(; trscheme = truncdim(chi), tol=1e-20, miniter=4, maxiter=100, verbosity=1)
+opt_alg = PEPSOptimize(;
+ boundary_alg=ctm_alg,
+ optimizer=LBFGS(4; maxiter=100, gradtol=1e-4, verbosity=2),
+ gradient_alg=GMRES(; tol=1e-6, maxiter=100),
+ reuse_env=true,
+ verbosity=2,
+)
+
+# ground state search
+state = InfinitePEPS(2, D)
+ctm = leading_boundary(CTMRGEnv(state; Venv=ComplexSpace(chi)), state, ctm_alg)
+result = fixedpoint(state, Heisenberg_hamiltonian, opt_alg, ctm)
+
+@show result.E # -0.6625...
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 17 May 2024. Using Julia version 1.10.3.
PEPSKit.AbstractPEPO
— Typeabstract type AbstractPEPO end
Abstract supertype for a 2D projected entangled-pair operator.
PEPSKit.AbstractPEPS
— Typeabstract type AbstractPEPS end
Abstract supertype for a 2D projected entangled-pair state.
PEPSKit.CTMRG
— Typestruct CTMRG(; trscheme = TensorKit.notrunc(), tol = Defaults.ctmrg_tol,
+Library · PEPSKit.jl Library
PEPSKit.AbstractPEPO
— Typeabstract type AbstractPEPO end
Abstract supertype for a 2D projected entangled-pair operator.
sourcePEPSKit.AbstractPEPS
— Typeabstract type AbstractPEPS end
Abstract supertype for a 2D projected entangled-pair state.
sourcePEPSKit.CTMRG
— Typestruct CTMRG(; trscheme = TensorKit.notrunc(), tol = Defaults.ctmrg_tol,
maxiter = Defaults.ctmrg_maxiter, miniter = Defaults.ctmrg_miniter,
- verbosity = 0, fixedspace = false)
Algorithm struct that represents the CTMRG algorithm for contracting infinite PEPS. The projector bond dimensions are set via trscheme
which controls the truncation properties inside of TensorKit.tsvd
. Each CTMRG run is converged up to tol
where the singular value convergence of the corners as well as the norm is checked. The maximal and minimal number of CTMRG iterations is set with maxiter
and miniter
. Different levels of output information are printed depending on verbosity
(0, 1 or 2). Regardless of the truncation scheme, the space can be kept fixed with fixedspace
.
sourcePEPSKit.CTMRGEnv
— Typestruct CTMRGEnv{C,T}
Corner transfer-matrix environment containing unit-cell arrays of corner and edge tensors.
sourcePEPSKit.CTMRGEnv
— MethodCTMRGEnv(peps::InfinitePEPS{P}; Venv=oneunit(spacetype(P)))
Create a random CTMRG environment from a PEPS tensor. The environment bond dimension defaults to one and can be specified using the Venv
space.
sourcePEPSKit.GeomSum
— Typestruct GeomSum <: GradMode
Gradient mode for CTMRG using explicit evaluation of the geometric sum.
sourcePEPSKit.InfinitePEPO
— Typestruct InfinitePEPO{T<:PEPOTensor}
Represents an infinite projected entangled-pair operator (PEPO) on a 3D cubic lattice.
sourcePEPSKit.InfinitePEPO
— MethodInfinitePEPO(A; unitcell=(1, 1, 1))
Create an InfinitePEPO by specifying a tensor and unit cell.
sourcePEPSKit.InfinitePEPO
— MethodInfinitePEPO(A::AbstractArray{T, 3})
Allow users to pass in an array of tensors.
sourcePEPSKit.InfinitePEPO
— MethodInfinitePEPO(f=randn, T=ComplexF64, Pspaces, Nspaces, Espaces)
Allow users to pass in arrays of spaces.
sourcePEPSKit.InfinitePEPO
— MethodInfinitePEPO(f=randn, T=ComplexF64, Pspace, Nspace, [Espace]; unitcell=(1,1,1))
Create an InfinitePEPO by specifying its spaces and unit cell.
sourcePEPSKit.InfinitePEPS
— Typestruct InfinitePEPS{T<:PEPSTensor}
Represents an infinite projected entangled-pair state on a 2D square lattice.
sourcePEPSKit.InfinitePEPS
— MethodInfinitePEPS(A; unitcell=(1, 1))
Create an InfinitePEPS
by specifying a tensor and unit cell.
sourcePEPSKit.InfinitePEPS
— MethodInfinitePEPS(A::AbstractArray{T, 2})
Allow users to pass in an array of tensors.
sourcePEPSKit.InfinitePEPS
— MethodInfinitePEPS(f=randn, T=ComplexF64, Pspaces, Nspaces, Espaces)
Allow users to pass in arrays of spaces.
sourcePEPSKit.InfinitePEPS
— MethodInfinitePEPS(f=randn, T=ComplexF64, Pspace, Nspace, [Espace]; unitcell=(1,1))
Create an InfinitePEPS by specifying its spaces and unit cell. Spaces can be specified either via Int
or via ElementarySpace
.
sourcePEPSKit.InfiniteTransferPEPO
— TypeInfiniteTransferPEPO{T,O}
Represents an infinite transfer operator corresponding to a single row of a partition function which corresponds to the expectation value of an InfinitePEPO
between 'ket' and 'bra' InfinitePEPS
states.
sourcePEPSKit.InfiniteTransferPEPO
— MethodInfiniteTransferPEPO(T::InfinitePEPS, O::InfinitePEPO, dir, row)
Constructs a transfer operator corresponding to a single row of a partition function representing the expectation value of O
for the state T
. The partition function is first rotated such that the direction dir
faces north, after which its row
th row from the north is selected.
sourcePEPSKit.InfiniteTransferPEPS
— TypeInfiniteTransferPEPS{T}
Represents an infinite transfer operator corresponding to a single row of a partition function which corresponds to the overlap between 'ket' and 'bra' InfinitePEPS
states.
sourcePEPSKit.InfiniteTransferPEPS
— MethodInfiniteTransferPEPS(T::InfinitePEPS, dir, row)
Constructs a transfer operator corresponding to a single row of a partition function representing the norm of the state T
. The partition function is first rotated such that the direction dir
faces north, after which its row
th row from the north is selected.
sourcePEPSKit.ManualIter
— Typestruct ManualIter <: GradMode
Gradient mode for CTMRG using manual iteration to solve the linear problem.
sourcePEPSKit.NLocalOperator
— Typestruct NLocalOperator{I<:AbstractInteraction}
Operator in form of a AbstractTensorMap
which is parametrized by an interaction type. Mostly, this is used to define Hamiltonian terms and observables.
sourcePEPSKit.NaiveAD
— Typestruct NaiveAD <: GradMode
Gradient mode for CTMRG using AD.
sourcePEPSKit.NearestNeighbor
— Typestruct NearestNeighbor <: AbstractInteraction
Interaction representing nearest neighbor terms that act on two adjacent sites.
sourcePEPSKit.OnSite
— Typestruct OnSite <: AbstractInteraction
Trivial interaction representing terms that act on one isolated site.
sourcePEPSKit.PEPOTensor
— Typeconst PEPOTensor{S}
Default type for PEPO tensors with a single incoming and outgoing physical index, and 4 virtual indices, conventionally ordered as: O : P ⊗ P' ← N ⊗ E ⊗ S ⊗ W.
sourcePEPSKit.PEPSOptimize
— TypePEPSOptimize{G}(; boundary_alg = CTMRG(), optimizer::OptimKit.OptimizationAlgorithm = LBFGS()
- reuse_env::Bool = true, gradient_alg::G, verbosity::Int = 0)
Algorithm struct that represent PEPS ground-state optimization using AD. Set the algorithm to contract the infinite PEPS in boundary_alg
; currently only CTMRG
is supported. The optimizer
computes the gradient directions based on the CTMRG gradient and updates the PEPS parameters. In this optimization, the CTMRG runs can be started on the converged environments of the previous optimizer step by setting reuse_env
to true. Otherwise a random environment is used at each step. The CTMRG gradient itself is computed using the gradient_alg
algorithm. Different levels of output verbosity can be activated using verbosity
(0, 1 or 2).
sourcePEPSKit.PEPSTensor
— Typeconst PEPSTensor{S}
Default type for PEPS tensors with a single physical index, and 4 virtual indices, conventionally ordered as: T : P ← N ⊗ E ⊗ S ⊗ W.
sourcePEPSKit.PEPSTensor
— MethodPEPSTensor(f, ::Type{T}, Pspace::S, Nspace::S,
+ verbosity = 0, fixedspace = false)
Algorithm struct that represents the CTMRG algorithm for contracting infinite PEPS. The projector bond dimensions are set via trscheme
which controls the truncation properties inside of TensorKit.tsvd
. Each CTMRG run is converged up to tol
where the singular value convergence of the corners as well as the norm is checked. The maximal and minimal number of CTMRG iterations is set with maxiter
and miniter
. Different levels of output information are printed depending on verbosity
(0, 1 or 2). Regardless of the truncation scheme, the space can be kept fixed with fixedspace
.
sourcePEPSKit.CTMRGEnv
— Typestruct CTMRGEnv{C,T}
Corner transfer-matrix environment containing unit-cell arrays of corner and edge tensors.
sourcePEPSKit.CTMRGEnv
— MethodCTMRGEnv(peps::InfinitePEPS{P}; Venv=oneunit(spacetype(P)))
Create a random CTMRG environment from a PEPS tensor. The environment bond dimension defaults to one and can be specified using the Venv
space.
sourcePEPSKit.GeomSum
— Typestruct GeomSum <: GradMode
Gradient mode for CTMRG using explicit evaluation of the geometric sum.
sourcePEPSKit.InfinitePEPO
— Typestruct InfinitePEPO{T<:PEPOTensor}
Represents an infinite projected entangled-pair operator (PEPO) on a 3D cubic lattice.
sourcePEPSKit.InfinitePEPO
— MethodInfinitePEPO(A; unitcell=(1, 1, 1))
Create an InfinitePEPO by specifying a tensor and unit cell.
sourcePEPSKit.InfinitePEPO
— MethodInfinitePEPO(A::AbstractArray{T, 3})
Allow users to pass in an array of tensors.
sourcePEPSKit.InfinitePEPO
— MethodInfinitePEPO(f=randn, T=ComplexF64, Pspaces, Nspaces, Espaces)
Allow users to pass in arrays of spaces.
sourcePEPSKit.InfinitePEPO
— MethodInfinitePEPO(f=randn, T=ComplexF64, Pspace, Nspace, [Espace]; unitcell=(1,1,1))
Create an InfinitePEPO by specifying its spaces and unit cell.
sourcePEPSKit.InfinitePEPS
— Typestruct InfinitePEPS{T<:PEPSTensor}
Represents an infinite projected entangled-pair state on a 2D square lattice.
sourcePEPSKit.InfinitePEPS
— MethodInfinitePEPS(A; unitcell=(1, 1))
Create an InfinitePEPS
by specifying a tensor and unit cell.
sourcePEPSKit.InfinitePEPS
— MethodInfinitePEPS(A::AbstractArray{T, 2})
Allow users to pass in an array of tensors.
sourcePEPSKit.InfinitePEPS
— MethodInfinitePEPS(f=randn, T=ComplexF64, Pspaces, Nspaces, Espaces)
Allow users to pass in arrays of spaces.
sourcePEPSKit.InfinitePEPS
— MethodInfinitePEPS(f=randn, T=ComplexF64, Pspace, Nspace, [Espace]; unitcell=(1,1))
Create an InfinitePEPS by specifying its spaces and unit cell. Spaces can be specified either via Int
or via ElementarySpace
.
sourcePEPSKit.InfiniteTransferPEPO
— TypeInfiniteTransferPEPO{T,O}
Represents an infinite transfer operator corresponding to a single row of a partition function which corresponds to the expectation value of an InfinitePEPO
between 'ket' and 'bra' InfinitePEPS
states.
sourcePEPSKit.InfiniteTransferPEPO
— MethodInfiniteTransferPEPO(T::InfinitePEPS, O::InfinitePEPO, dir, row)
Constructs a transfer operator corresponding to a single row of a partition function representing the expectation value of O
for the state T
. The partition function is first rotated such that the direction dir
faces north, after which its row
th row from the north is selected.
sourcePEPSKit.InfiniteTransferPEPS
— TypeInfiniteTransferPEPS{T}
Represents an infinite transfer operator corresponding to a single row of a partition function which corresponds to the overlap between 'ket' and 'bra' InfinitePEPS
states.
sourcePEPSKit.InfiniteTransferPEPS
— MethodInfiniteTransferPEPS(T::InfinitePEPS, dir, row)
Constructs a transfer operator corresponding to a single row of a partition function representing the norm of the state T
. The partition function is first rotated such that the direction dir
faces north, after which its row
th row from the north is selected.
sourcePEPSKit.ManualIter
— Typestruct ManualIter <: GradMode
Gradient mode for CTMRG using manual iteration to solve the linear problem.
sourcePEPSKit.NLocalOperator
— Typestruct NLocalOperator{I<:AbstractInteraction}
Operator in form of a AbstractTensorMap
which is parametrized by an interaction type. Mostly, this is used to define Hamiltonian terms and observables.
sourcePEPSKit.NaiveAD
— Typestruct NaiveAD <: GradMode
Gradient mode for CTMRG using AD.
sourcePEPSKit.NearestNeighbor
— Typestruct NearestNeighbor <: AbstractInteraction
Interaction representing nearest neighbor terms that act on two adjacent sites.
sourcePEPSKit.OnSite
— Typestruct OnSite <: AbstractInteraction
Trivial interaction representing terms that act on one isolated site.
sourcePEPSKit.PEPOTensor
— Typeconst PEPOTensor{S}
Default type for PEPO tensors with a single incoming and outgoing physical index, and 4 virtual indices, conventionally ordered as: O : P ⊗ P' ← N ⊗ E ⊗ S ⊗ W.
sourcePEPSKit.PEPSOptimize
— TypePEPSOptimize{G}(; boundary_alg = CTMRG(), optimizer::OptimKit.OptimizationAlgorithm = LBFGS()
+ reuse_env::Bool = true, gradient_alg::G, verbosity::Int = 0)
Algorithm struct that represent PEPS ground-state optimization using AD. Set the algorithm to contract the infinite PEPS in boundary_alg
; currently only CTMRG
is supported. The optimizer
computes the gradient directions based on the CTMRG gradient and updates the PEPS parameters. In this optimization, the CTMRG runs can be started on the converged environments of the previous optimizer step by setting reuse_env
to true. Otherwise a random environment is used at each step. The CTMRG gradient itself is computed using the gradient_alg
algorithm. Different levels of output verbosity can be activated using verbosity
(0, 1 or 2).
sourcePEPSKit.PEPSTensor
— Typeconst PEPSTensor{S}
Default type for PEPS tensors with a single physical index, and 4 virtual indices, conventionally ordered as: T : P ← N ⊗ E ⊗ S ⊗ W.
sourcePEPSKit.PEPSTensor
— MethodPEPSTensor(f, ::Type{T}, Pspace::S, Nspace::S,
[Espace::S], [Sspace::S], [Wspace::S]) where {T,S<:ElementarySpace}
PEPSTensor(f, ::Type{T}, Pspace::Int, Nspace::Int,
- [Espace::Int], [Sspace::Int], [Wspace::Int]) where {T}
Construct a PEPS tensor based on the physical, north, east, west and south spaces. Alternatively, only the space dimensions can be provided and ℂ is assumed as the field. The tensor elements are generated based on f
and the element type is specified in T
.
sourcePEPSKit.TransferPEPOMultiline
— Typeconst TransferPEPOMultiline = MPSKit.Multiline{<:InfiniteTransferPEPO}
Type that represents a multi-line transfer operator, where each line each corresponds to a row of a partition function encoding the overlap of an InfinitePEPO
between 'ket' and 'bra' InfinitePEPS
states.
sourcePEPSKit.TransferPEPOMultiline
— MethodTransferPEPOMultiline(T::InfinitePEPS, O::InfinitePEPO, dir)
Construct a multi-row transfer operator corresponding to the partition function representing the expectation value of O
for the state T
. The partition function is first rotated such that the direction dir
faces north.
sourcePEPSKit.TransferPEPSMultiline
— Typeconst TransferPEPSMultiline = MPSKit.Multiline{<:InfiniteTransferPEPS}
Type that represents a multi-line transfer operator, where each line each corresponds to a row of a partition function encoding the overlap between 'ket' and 'bra' InfinitePEPS
states.
sourcePEPSKit.TransferPEPSMultiline
— MethodTransferPEPSMultiline(T::InfinitePEPS, dir)
Construct a multi-row transfer operator corresponding to the partition function representing the norm of the state T
. The partition function is first rotated such that the direction dir
faces north.
sourceMPSKit.expectation_value
— MethodMPSKit.expectation_value(st::InfiniteMPS, op::Union{InfiniteTransferPEPS,InfiniteTransferPEPO})
-MPSKit.expectation_value(st::MPSMultiline, op::Union{TransferPEPSMultiline,TransferPEPOMultiline})
Compute expectation value of the transfer operator op
for the state st
for each site in the unit cell.
sourceMPSKit.expectation_value
— MethodMPSKit.expectation_value(peps::InfinitePEPS, env, O::NLocalOperator)
Evaluate the expectation value of any NLocalOperator
on each unit-cell entry of peps
and env
.
sourceMPSKit.leading_boundary
— MethodMPSKit.leading_boundary(
+ [Espace::Int], [Sspace::Int], [Wspace::Int]) where {T}
Construct a PEPS tensor based on the physical, north, east, west and south spaces. Alternatively, only the space dimensions can be provided and ℂ is assumed as the field. The tensor elements are generated based on f
and the element type is specified in T
.
sourcePEPSKit.TransferPEPOMultiline
— Typeconst TransferPEPOMultiline = MPSKit.Multiline{<:InfiniteTransferPEPO}
Type that represents a multi-line transfer operator, where each line each corresponds to a row of a partition function encoding the overlap of an InfinitePEPO
between 'ket' and 'bra' InfinitePEPS
states.
sourcePEPSKit.TransferPEPOMultiline
— MethodTransferPEPOMultiline(T::InfinitePEPS, O::InfinitePEPO, dir)
Construct a multi-row transfer operator corresponding to the partition function representing the expectation value of O
for the state T
. The partition function is first rotated such that the direction dir
faces north.
sourcePEPSKit.TransferPEPSMultiline
— Typeconst TransferPEPSMultiline = MPSKit.Multiline{<:InfiniteTransferPEPS}
Type that represents a multi-line transfer operator, where each line each corresponds to a row of a partition function encoding the overlap between 'ket' and 'bra' InfinitePEPS
states.
sourcePEPSKit.TransferPEPSMultiline
— MethodTransferPEPSMultiline(T::InfinitePEPS, dir)
Construct a multi-row transfer operator corresponding to the partition function representing the norm of the state T
. The partition function is first rotated such that the direction dir
faces north.
sourceMPSKit.expectation_value
— MethodMPSKit.expectation_value(st::InfiniteMPS, op::Union{InfiniteTransferPEPS,InfiniteTransferPEPO})
+MPSKit.expectation_value(st::MPSMultiline, op::Union{TransferPEPSMultiline,TransferPEPOMultiline})
Compute expectation value of the transfer operator op
for the state st
for each site in the unit cell.
sourceMPSKit.expectation_value
— MethodMPSKit.expectation_value(peps::InfinitePEPS, env, O::NLocalOperator)
Evaluate the expectation value of any NLocalOperator
on each unit-cell entry of peps
and env
.
sourceMPSKit.leading_boundary
— MethodMPSKit.leading_boundary(
st::InfiniteMPS, op::Union{InfiniteTransferPEPS,InfiniteTransferPEPO}, alg, [envs]
)
MPSKit.leading_boundary(
st::MPSMulitline, op::Union{TransferPEPSMultiline,TransferPEPOMultiline}, alg, [envs]
-)
Approximate the leading boundary MPS eigenvector for the transfer operator op
using st
as initial guess.
sourceMPSKit.leading_boundary
— MethodMPSKit.leading_boundary([envinit], state, alg::CTMRG)
Contract state
using CTMRG and return the CTM environment. Per default, a random initial environment is used.
sourcePEPSKit._rrule
— Method_rrule(alg_rrule, config, f, args...; kwargs...) -> ∂f, ∂args...
Customize the pullback of a function f
. This function can specialize on its first argument in order to have multiple implementations for a pullback. If no specialization is needed, the default alg_rrule=nothing
results in the default AD pullback.
Warning No tangent is expected for the alg_rrule
argument
sourcePEPSKit.check_elementwise_convergence
— Methodcheck_elementwise_convergence(envfinal, envfix; atol=1e-6)
Check if the element-wise difference of the corner and edge tensors of the final and fixed CTMRG environments are below some tolerance.
sourcePEPSKit.costfun
— Methodcostfun(peps::InfinitePEPS, env, op::NLocalOperator{NearestNeighbor})
Compute the expectation value of a nearest-neighbor operator. This is used to evaluate and differentiate the energy in ground-state PEPS optimizations.
sourcePEPSKit.ctmrg_iter
— Methodctmrg_iter(state, env::CTMRGEnv{C,T}, alg::CTMRG) where {C,T}
Perform one iteration of CTMRG that maps the state
and env
to a new environment, and also return the truncation error. One CTMRG iteration consists of four left_move
calls and 90 degree rotations, such that the environment is grown and renormalized in all four directions.
sourcePEPSKit.fixedpoint
— Methodfixedpoint(ψ₀::InfinitePEPS{T}, H, alg::PEPSOptimize, [env₀::CTMRGEnv]) where {T}
Optimize ψ₀
with respect to the Hamiltonian H
according to the parameters supplied in alg
. The initial environment env₀
serves as an initial guess for the first CTMRG run. By default, a random initial environment is used.
sourcePEPSKit.fpgrad
— Functionfpgrad(∂F∂x, ∂f∂x, ∂f∂A, y0, alg)
Compute the gradient of the cost function for CTMRG by solving the following equation:
dx = ∑ₙ (∂f∂x)ⁿ ∂f∂A dA = (1 - ∂f∂x)⁻¹ ∂f∂A dA
where ∂F∂x
is the gradient of the cost function with respect to the PEPS tensors, ∂f∂x
is the partial gradient of the CTMRG iteration with respect to the environment tensors, ∂f∂A
is the partial gradient of the CTMRG iteration with respect to the PEPS tensors, and y0
is the initial guess for the fixed-point iteration. The function returns the gradient dx
of the fixed-point iteration.
sourcePEPSKit.gauge_fix
— Methodgauge_fix(envprev::CTMRGEnv{C,T}, envfinal::CTMRGEnv{C,T}) where {C,T}
Fix the gauge of envfinal
based on the previous environment envprev
. This assumes that the envfinal
is the result of one CTMRG iteration on envprev
. Given that the CTMRG run is converged, the returned environment will be element-wise converged to envprev
.
sourcePEPSKit.hook_pullback
— Methodhook_pullback(f, args...; alg_rrule=nothing, kwargs...)
Wrapper function to customize the pullback of a function f
. This function is equivalent to f(args...; kwargs...)
, but the pullback can be customized by implementing the following function:
_rrule(alg_rrule, config, f, args...; kwargs...) -> NoTangent(), ∂f, ∂args...
This function can specialize on its first argument in order to customize the pullback. If no specialization is needed, the default alg_rrule=nothing
results in the default AD pullback.
See also _rrule
.
sourcePEPSKit.initializeMPS
— MethodinitializeMPS(
+)
Approximate the leading boundary MPS eigenvector for the transfer operator op
using st
as initial guess.
sourceMPSKit.leading_boundary
— MethodMPSKit.leading_boundary([envinit], state, alg::CTMRG)
Contract state
using CTMRG and return the CTM environment. Per default, a random initial environment is used.
sourcePEPSKit._rrule
— Method_rrule(alg_rrule, config, f, args...; kwargs...) -> ∂f, ∂args...
Customize the pullback of a function f
. This function can specialize on its first argument in order to have multiple implementations for a pullback. If no specialization is needed, the default alg_rrule=nothing
results in the default AD pullback.
Warning No tangent is expected for the alg_rrule
argument
sourcePEPSKit.check_elementwise_convergence
— Methodcheck_elementwise_convergence(envfinal, envfix; atol=1e-6)
Check if the element-wise difference of the corner and edge tensors of the final and fixed CTMRG environments are below some tolerance.
sourcePEPSKit.costfun
— Methodcostfun(peps::InfinitePEPS, env, op::NLocalOperator{NearestNeighbor})
Compute the expectation value of a nearest-neighbor operator. This is used to evaluate and differentiate the energy in ground-state PEPS optimizations.
sourcePEPSKit.ctmrg_iter
— Methodctmrg_iter(state, env::CTMRGEnv{C,T}, alg::CTMRG) where {C,T}
Perform one iteration of CTMRG that maps the state
and env
to a new environment, and also return the truncation error. One CTMRG iteration consists of four left_move
calls and 90 degree rotations, such that the environment is grown and renormalized in all four directions.
sourcePEPSKit.fixedpoint
— Methodfixedpoint(ψ₀::InfinitePEPS{T}, H, alg::PEPSOptimize, [env₀::CTMRGEnv]) where {T}
Optimize ψ₀
with respect to the Hamiltonian H
according to the parameters supplied in alg
. The initial environment env₀
serves as an initial guess for the first CTMRG run. By default, a random initial environment is used.
sourcePEPSKit.fpgrad
— Functionfpgrad(∂F∂x, ∂f∂x, ∂f∂A, y0, alg)
Compute the gradient of the cost function for CTMRG by solving the following equation:
dx = ∑ₙ (∂f∂x)ⁿ ∂f∂A dA = (1 - ∂f∂x)⁻¹ ∂f∂A dA
where ∂F∂x
is the gradient of the cost function with respect to the PEPS tensors, ∂f∂x
is the partial gradient of the CTMRG iteration with respect to the environment tensors, ∂f∂A
is the partial gradient of the CTMRG iteration with respect to the PEPS tensors, and y0
is the initial guess for the fixed-point iteration. The function returns the gradient dx
of the fixed-point iteration.
sourcePEPSKit.gauge_fix
— Methodgauge_fix(envprev::CTMRGEnv{C,T}, envfinal::CTMRGEnv{C,T}) where {C,T}
Fix the gauge of envfinal
based on the previous environment envprev
. This assumes that the envfinal
is the result of one CTMRG iteration on envprev
. Given that the CTMRG run is converged, the returned environment will be element-wise converged to envprev
.
sourcePEPSKit.hook_pullback
— Methodhook_pullback(f, args...; alg_rrule=nothing, kwargs...)
Wrapper function to customize the pullback of a function f
. This function is equivalent to f(args...; kwargs...)
, but the pullback can be customized by implementing the following function:
_rrule(alg_rrule, config, f, args...; kwargs...) -> NoTangent(), ∂f, ∂args...
This function can specialize on its first argument in order to customize the pullback. If no specialization is needed, the default alg_rrule=nothing
results in the default AD pullback.
See also _rrule
.
sourcePEPSKit.initializeMPS
— MethodinitializeMPS(
O::Union{InfiniteTransferPEPS,InfiniteTransferPEPO},
virtualspaces::AbstractArray{<:ElementarySpace,1}
)
initializeMPS(
O::Union{TransferPEPSMultiline,TransferPEPOMultiline},
virtualspaces::AbstractArray{<:ElementarySpace,2}
-)
Inialize a boundary MPS for the transfer operator O
by specifying an array of virtual spaces consistent with the unit cell.
sourcePEPSKit.left_move
— Methodleft_move(state, env::CTMRGEnv{C,T}, alg::CTMRG) where {C,T}
Grow, project and renormalize the environment env
in west direction. Return the updated environment as well as the projectors and truncation error.
sourcePEPSKit.operator_env
— Functionoperator_env(peps::InfinitePEPS, env::CTMRGEnv, ::AbstractInteraction)
Contract a PEPS and a CTMRG environment to form an operator environment. The open bonds correspond to the indices of an operator with the specified AbstractInteraction
type.
sourcePEPSKit.projector_type
— Methodprojector_type(T::DataType, size)
Create two arrays of specified size
that contain undefined tensors representing left and right acting projectors, respectively. The projector types are inferred from the TensorMap type T
which avoids having to recompute transpose tensors.
sourcePEPSKit.rotate_north
— Methodrotate_north(t, dir)
Rotate north direction of t
to dir
by successive applications of rotl90
.
sourcePEPSKit.@diffset
— Macro@diffset assign
Helper macro which allows in-place operations in the forward-pass of Zygote, but resorts to non-mutating operations in the backwards-pass. The expression assign
should assign an object to an pre-existing AbstractArray
and the use of updating operators is also possible. This is especially needed when in-place assigning tensors to unit-cell arrays of environments.
sourcePEPSKit.@showtypeofgrad
— Macro@showtypeofgrad(x)
Macro utility to show to type of the gradient that is about to accumulate for x
.
See also Zygote.@showgrad
.
sourcePEPSKit.Defaults
— Modulemodule Defaults
+)
Inialize a boundary MPS for the transfer operator O
by specifying an array of virtual spaces consistent with the unit cell.
sourcePEPSKit.left_move
— Methodleft_move(state, env::CTMRGEnv{C,T}, alg::CTMRG) where {C,T}
Grow, project and renormalize the environment env
in west direction. Return the updated environment as well as the projectors and truncation error.
sourcePEPSKit.operator_env
— Functionoperator_env(peps::InfinitePEPS, env::CTMRGEnv, ::AbstractInteraction)
Contract a PEPS and a CTMRG environment to form an operator environment. The open bonds correspond to the indices of an operator with the specified AbstractInteraction
type.
sourcePEPSKit.projector_type
— Methodprojector_type(T::DataType, size)
Create two arrays of specified size
that contain undefined tensors representing left and right acting projectors, respectively. The projector types are inferred from the TensorMap type T
which avoids having to recompute transpose tensors.
sourcePEPSKit.rotate_north
— Methodrotate_north(t, dir)
Rotate north direction of t
to dir
by successive applications of rotl90
.
sourcePEPSKit.@diffset
— Macro@diffset assign
Helper macro which allows in-place operations in the forward-pass of Zygote, but resorts to non-mutating operations in the backwards-pass. The expression assign
should assign an object to an pre-existing AbstractArray
and the use of updating operators is also possible. This is especially needed when in-place assigning tensors to unit-cell arrays of environments.
sourcePEPSKit.@showtypeofgrad
— Macro@showtypeofgrad(x)
Macro utility to show to type of the gradient that is about to accumulate for x
.
See also Zygote.@showgrad
.
sourcePEPSKit.Defaults
— Modulemodule Defaults
const ctmrg_maxiter = 100
const ctmrg_miniter = 4
const ctmrg_tol = 1e-12
const fpgrad_maxiter = 100
const fpgrad_tol = 1e-6
-end
Module containing default values that represent typical algorithm parameters.
ctmrg_maxiter = 100
: Maximal number of CTMRG iterations per runctmrg_miniter = 4
: Minimal number of CTMRG carried outctmrg_tol = 1e-12
: Tolerance checking singular value and norm convergencefpgrad_maxiter = 100
: Maximal number of iterations for computing the CTMRG fixed-point gradientfpgrad_tol = 1e-6
: Convergence tolerance for the fixed-point gradient iteration
sourceSettings
This document was generated with Documenter.jl version 0.27.25 on Friday 17 May 2024. Using Julia version 1.10.3.
+end
Module containing default values that represent typical algorithm parameters.
ctmrg_maxiter = 100
: Maximal number of CTMRG iterations per runctmrg_miniter = 4
: Minimal number of CTMRG carried outctmrg_tol = 1e-12
: Tolerance checking singular value and norm convergencefpgrad_maxiter = 100
: Maximal number of iterations for computing the CTMRG fixed-point gradientfpgrad_tol = 1e-6
: Convergence tolerance for the fixed-point gradient iterationSettings
This document was generated with Documenter.jl version 0.27.25 on Friday 17 May 2024. Using Julia version 1.10.3.
Coming soon.
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 17 May 2024. Using Julia version 1.10.3.
Coming soon.
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 17 May 2024. Using Julia version 1.10.3.
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 17 May 2024. Using Julia version 1.10.3.
Settings
This document was generated with Documenter.jl version 0.27.25 on Friday 17 May 2024. Using Julia version 1.10.3.