Library
PEPSKit.ALSTruncation — Type
struct ALSTruncation{T<:MatrixAlgebraKit.TruncationStrategy}Algorithm struct for the alternating least square (ALS) optimization of a bond.
Fields
trunc::MatrixAlgebraKit.TruncationStrategymaxiter::Int64tol::Float64check_interval::Int64
Constructors
ALSTruncation(; kwargs...)The truncation algorithm can be constructed from the following keyword arguments:
trunc::TruncationStrategy: SVD truncation strategy when initilizing the truncated tensors connected by the bond.maxiter::Int=50: Maximal number of ALS iterations.tol::Float64=1e-9: ALS converges when the relative change in bond SVD spectrum between two iterations is smaller thantol.check_interval::Int=0: Set number of iterations to print information. Output is suppressed whencheck_interval <= 0.
PEPSKit.ApplicationInitialization — Type
struct ApplicationInitialization{F} <: PEPSKit.InitializationStyleInitialize a contraction environment by applying a single iteration of a contraction algorithm to a given environment.
Constructors
ApplicationInitialization(f = ones)Contructs an application initialization strategy, where by default the starting environment is initialized using a ProductStateInitialization(f) strategy.
PEPSKit.BPEnv — Type
struct BPEnv{T}Belief propagation (BP) environment for a square lattice norm network, containing a 4 x rows x cols array of message tensors, defined for each oriented nearest neighbor bond in the network.
The message tensors connect to the network tensors P at site [r,c] in the unit cell as:
m[1,r-1,c]
|
m[4,r,c-1]------P[r,c]------m[2,r,c+1]
|
m[3,r+1,c][1,r-1,c]: message fromP[r-1,c]toP[r,c](axis order: ket ← bra)[2,r,c+1]: message fromP[r,c+1]toP[r,c](axis order: ket ← bra)[3,r+1,c]: message fromP[r+1,c]toP[r,c](axis order: bra ← ket)[4,r,c-1]: message fromP[r,c-1]toP[r,c](axis order: bra ← ket)
Fields
messages::Array{T, 3} where T: 4 x rows x cols array of message tensors, where the first dimension specifies the spatial direction
PEPSKit.BPEnv — Method
BPEnv([f=isomorphism, T=ComplexF64], network::InfiniteSquareNetwork; posdef::Bool = true)Construct a BP environment by specifying a corresponding InfiniteSquareNetwork.
PEPSKit.BPEnv — Method
BPEnv(wts::SUWeight)Convert fixed point weights wts of trivial simple update to a belief propagation environment.
PEPSKit.BPEnv — Method
BPEnv(
[f=isomorphism, T=ComplexF64], Ds_north::A, Ds_east::A; posdef::Bool = true
) where {A <: AbstractMatrix{<:ProductSpace}}Construct a BP environment by specifying matrices of north and east virtual spaces of the corresponding InfiniteSquareNetwork. Each matrix entry corresponds to a site in the unit cell.
When posdef is true, all messages will be made semi-positive definite (when interpreted as a bra ← ket TensorMap).
Each entry of the Ds_north and Ds_east matrices corresponds to an effective local space of the network, and can be represented as a ProductSpace (e.g. for the case of a network representing overlaps of PEPSs).
PEPSKit.BPEnv — Method
BPEnv(
[f=isomorphism, T=ComplexF64], D_north::P, D_east::P;
unitcell::Tuple{Int, Int} = (1, 1), posdef::Bool = true
) where {P <: ProductSpace}Construct a BP environment by specifying the north and east virtual spaces of the corresponding InfiniteSquareNetwork. The network unit cell can be specified by the unitcell keyword argument.
PEPSKit.BPGauge — Type
struct BPGaugeAlgorithm for gauging PEPS with belief propagation fixed point messages.
PEPSKit.BeliefPropagation — Type
struct BeliefPropagationAlgorithm for computing the belief propagation fixed point messages.
Fields
tol::Float64: Stopping criterion for the BP iterations in relative trace norm differenceminiter::Int64: Minimal number of BP iterationsmaxiter::Int64: Maximal number of BP iterationsproject_hermitian::Bool: Toggle for projecting messages onto the hermitian subspace immediately after update through BP equationbipartite::Bool: When true, preserve bipartite structure of BPEnv inherited from input networkverbosity::Int64: Output verbosity level
PEPSKit.C4vCTMRG — Type
struct C4vCTMRG{P<:PEPSKit.ProjectorAlgorithm} <: PEPSKit.CTMRGAlgorithmCTMRG algorithm assuming a C₄ᵥ-symmetric PEPS, i.e. invariance under 90° spatial rotation and Hermitian reflection. This requires a single-site unit cell. The projector is obtained from eigh decomposing the Hermitian enlarged corner.
Fields
tol::Float64maxiter::Int64miniter::Int64verbosity::Int64projector_alg::PEPSKit.ProjectorAlgorithm
Constructors
C4vCTMRG(; kwargs...)Construct a C₄ᵥ CTMRG algorithm struct based on keyword arguments. For a full description, see leading_boundary. The supported keywords are:
tol::Real=1.0e-8maxiter::Int=100miniter::Int=4verbosity::Int=2trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:FixedSpaceTruncation)decomposition_alg::Union{NamedTuple,<:EighAdjoint,<:QRAdjoint}=(;)projector_alg::Symbol=:C4vEighProjector
PEPSKit.C4vEighProjector — Type
struct C4vEighProjector{S<:EighAdjoint, T} <: PEPSKit.ProjectorAlgorithmProjector algorithm implementing the eigh decomposition of a Hermitian enlarged corner.
Fields
decomposition_alg::EighAdjointtrunc::Anyverbosity::Int64
Constructors
C4vEighProjector(; kwargs...)Construct the C₄ᵥ eigh-based projector algorithm based on the following keyword arguments:
decomposition_alg::Union{<:EighAdjoint,NamedTuple}=EighAdjoint():eighalgorithm including the reverse rule. SeeEighAdjoint.trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:FixedSpaceTruncation): Truncation strategy for the projector computation, which controls the resulting virtual spaces. Here,algcan be one of the following::FixedSpaceTruncation: Keep virtual spaces fixed during projection:notrunc: No singular values are truncated and the performed SVDs are exact:truncerror: Additionally supply error thresholdη; truncate to the maximal virtual dimension ofη:truncrank: Additionally supply truncation dimensionη; truncate such that the 2-norm of the truncated values is smaller thanη:truncspace: Additionally supply truncation spaceη; truncate according to the supplied vector space:trunctol: Additionally supply singular value cutoffη; truncate such that every retained singular value is larger thanη
verbosity::Int=0: Projector output verbosity which can be:- Suppress output information
- Print singular value degeneracy warnings
PEPSKit.C4vQRProjector — Type
struct C4vQRProjector{S} <: PEPSKit.ProjectorAlgorithmProjector algorithm implementing the qr decomposition of a column-enlarged corner.
Fields
decomposition_alg::Any
Constructors
C4vQRProjector(; kwargs...)Construct the C₄ᵥ qr-based projector algorithm based on the following keyword arguments:
decomposition_alg=QRAdjoint():left_orthalgorithm including the reverse rule. SeeQRAdjoint.
PEPSKit.CTMRGAlgorithm — Type
abstract type CTMRGAlgorithmAbstract super type for the corner transfer matrix renormalization group (CTMRG) algorithm for contracting infinite PEPS.
PEPSKit.CTMRGAlgorithm — Method
CTMRGAlgorithm(; kwargs...)Keyword argument parser returning the appropriate CTMRGAlgorithm algorithm struct.
PEPSKit.CTMRGEnv — Type
struct CTMRGEnv{C, T}Corner transfer-matrix environment containing unit-cell arrays of corner and edge tensors. The last two indices of the arrays correspond to the row and column indices of the unit cell, whereas the first index corresponds to the direction of the corner or edge tensor. The directions are labeled in clockwise direction, starting from the north-west corner and north edge respectively.
Given arrays of corners c and edges t, they connect to the network tensors P at site (r, c) in the unit cell as:
c[1,r-1,c-1]---t[1,r-1,c]----c[2,r-1,c+1]
| | |
t[4,r,c-1]-----P[r,c]--------t[2,r,c+1]
| | |
c[4,r+1,c-1]---t[3,r+1,c]----c[3,r+1,c+1]Here P represents an effective local constituent tensor. This can either be a single rank-4 tensor, a pair of PEPS tensors, or a stack of PEPS-PEPO-PEPS tensors depending on the network being contracted.
Fields
corners::Array{C, 3} where C: 4 x rows x cols array of corner tensors, where the first dimension specifies the spatial directionedges::Array{T, 3} where T: 4 x rows x cols array of edge tensors, where the first dimension specifies the spatial direction
PEPSKit.CTMRGEnv — Method
CTMRGEnv(
[f=randn, T=ComplexF64], network::InfiniteSquareNetwork, chis_north::A, [chis_east::A], [chis_south::A], [chis_west::A]
) where {A<:Union{AbstractMatrix{<:ElementarySpace}, ElementarySpace}}Construct a CTMRG environment by specifying a corresponding InfiniteSquareNetwork, and the north, east, south and west virtual spaces of the environment. The virtual spaces can either be specified as matrices of ElementarySpaces, or as individual ElementarySpaces which are then filled to match the size of the unit cell. Each respective matrix entry corresponds to a site in the unit cell. By default, the virtual spaces for all directions are taken to be the same.
The environment virtual spaces for each site correspond to the north or east virtual space of the corresponding edge tensor for each direction. Specifically, for a given site (r, c), chis_north[r, c] corresponds to the east space of the north edge tensor, chis_east[r, c] corresponds to the north space of the east edge tensor, chis_south[r, c] corresponds to the east space of the south edge tensor, and chis_west[r, c] corresponds to the north space of the west edge tensor.
PEPSKit.CTMRGEnv — Method
CTMRGEnv(bp_env::BPEnv)Construct a CTMRG environment with bond dimension χ = 1 from the belief propagation environment bp_env.
PEPSKit.CTMRGEnv — Method
CTMRGEnv(prod_env::ProductStateEnv)Construct a CTMRG environment with a trivial virtual space of bond dimension χ = 1 from the product state environment prod_env.
PEPSKit.CTMRGEnv — Method
CTMRGEnv(wts::SUWeight)Construct a CTMRG environment with a trivial environment space (bond dimension χ = 1) from SUWeight wts, which has the same real scalartype as `wts.
PEPSKit.CTMRGEnv — Method
CTMRGEnv(
[f=randn, T=ComplexF64], Ds_north::A, Ds_east::A, chis_north::B, [chis_east::B], [chis_south::B], [chis_west::B]
) where {A<:AbstractMatrix{<:VectorSpace}, B<:AbstractMatrix{<:ElementarySpace}}Construct a CTMRG environment by specifying matrices of north and east virtual spaces of the corresponding partition function and the north, east, south and west virtual spaces of the environment. Each respective matrix entry corresponds to a site in the unit cell. By default, the virtual environment spaces for all directions are taken to be the same.
The environment virtual spaces for each site correspond to the north or east virtual space of the corresponding edge tensor for each direction. Specifically, for a given site (r, c), chis_north[r, c] corresponds to the east space of the north edge tensor, chis_east[r, c] corresponds to the north space of the east edge tensor, chis_south[r, c] corresponds to the east space of the south edge tensor, and chis_west[r, c] corresponds to the north space of the west edge tensor.
Each entry of the Ds_north and Ds_east matrices corresponds to an effective local space of the partition function, and can be represented as an ElementarySpace (e.g. for the case of a partition function defined in terms of local rank-4 tensors) or a ProductSpace (e.g. for the case of a network representing overlaps of PEPSs and PEPOs).
PEPSKit.CTMRGEnv — Method
CTMRGEnv(
[f=randn, T=ComplexF64], D_north::P, D_east::P, chi_north::S, [chi_east::S], [chi_south::S], [chi_west::S];
unitcell::Tuple{Int,Int}=(1, 1),
) where {P<:VectorSpace,S<:ElementarySpace}Construct a CTMRG environment by specifying the north and east virtual spaces of the corresponding InfiniteSquareNetwork and the north, east, south and west virtual spaces of the environment. The network unit cell can be specified by the unitcell keyword argument. By default, the virtual environment spaces for all directions are taken to be the same.
The environment virtual spaces for each site correspond to virtual space of the corresponding edge tensor for each direction.
PEPSKit.ColumnEnlargedCorner — Type
struct ColumnEnlargedCorner{TC, TE}Column-enlarged CTMRG corner tensor storage.
Constructors
ColumnEnlargedCorner(env, coordinates)Construct a column-enlarged corner with the correct row and column indices based on the given coordinates which are of the form (dir, row, col).
[NORTHWEST,r,c] [NORTHEAST,r,c]
c-1 c c c+1
r C₁--←--E₁--←-- --←--E₂--←--C₂ r
↓ | | ↑
↓ | | ↑
r C₄--→--E₃--→-- --→--E₃--→--C₃ r
c-1 c c c+1
[SOUTHWEST,r,c] [SOUTHEAST,r,c]PEPSKit.EighAdjoint — Type
struct EighAdjoint{F, R}Wrapper for a eigenvalue decomposition algorithm fwd_alg with a defined reverse rule rrule_alg.
Fields
fwd_alg::Anyrrule_alg::Any
Constructors
EighAdjoint(; kwargs...)Construct a EighAdjoint algorithm struct based on the following keyword arguments:
fwd_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=DefaultAlgorithm): Eigh algorithm of the forward pass which can either be passed as anAlgorithminstance or aNamedTuplewhere the algorithm is specified by thealgkeyword. The available Eigh algorithms can be divided into two categories:- "Dense" Eigh algorithms which compute a truncated Eigh through the truncation of a full
MatrixAlgebraKit.eigh_full!decomposition. Available algorithms are::DefaultAlgorithm: MatrixAlgebraKit's default Eigh algorithm for a given matrix type.:DivideAndConquer: MatrixAlgebraKit'sDivideAndConquer:QRIteration: MatrixAlgebraKit'sQRIteration:Bisection: MatrixAlgebraKit'sBisection:Jacobi: MatrixAlgebraKit'sJacobi:RobustRepresentations: MatrixAlgebraKit'sRobustRepresentations
- "Sparse" Eigh algorithms which directly compute a truncated Eigh without access to the full decomposition. Available algorithms are:
:Lanczos: Lanczos algorithm for symmetric/Hermitian matrices, seeKrylovKit.Lanczos:BlockLanczos: Block version of:Lanczosfor repeated extremal eigenvalues, seeKrylovKit.BlockLanczos
- "Dense" Eigh algorithms which compute a truncated Eigh through the truncation of a full
rrule_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=FullPullback): Reverse-rule algorithm for differentiating the eigenvalue decomposition. Can be supplied by anAlgorithminstance directly or as aNamedTuplewherealgis one of the following::FullPullback: MatrixAlgebraKit'seigh_pullback!that requires access to the full spectrum:TruncPullback: MatrixAlgebraKit'seigh_trunc_pullback!solving a Sylvester equation on the truncated subspace
PEPSKit.EnlargedCorner — Type
struct EnlargedCorner{TC, TE, TA}Enlarged CTMRG corner tensor storage.
Constructors
EnlargedCorner(network::InfiniteSquareNetwork, env, coordinates)Construct an enlarged corner with the correct row and column indices based on the given coordinates which are of the form (dir, row, col).
PEPSKit.FixedPointGradient — Type
struct FixedPointGradient{A} <: PEPSKit.GradientAlgorithm{A}Gradient algorithm for computing the gradient of a fixed-point problem through implicit fixed-point differentiation.
Fields
solver_alg::Any
Constructors
FixedPointGradient(; kwargs...)Construct a fixed-point gradient algorithm struct based on keyword arguments. The supported keywords are:
tol::Real=1.0e-6maxiter::Int=30verbosity::Int=-1solver_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=:Arnoldi): solver algorithm for theFixedPointGradientgradient algorithm.:GMRES: GMRES iterative linear solver, seeKrylovKit.GMRESfor details:BiCGStab: BiCGStab iterative linear solver, seeKrylovKit.BiCGStabfor details:Arnoldi: Arnoldi Krylov algorithm, seeKrylovKit.Arnoldifor details:GeomSum: Geometric sum approximation of the Neumann series of the inverse Jacobian, seePEPSKit.GeomSumfor details:ManualIter: Manual fixed-point iteration, seePEPSKit.ManualIterfor details
PEPSKit.FixedSpaceTruncation — Type
struct FixedSpaceTruncation <: MatrixAlgebraKit.TruncationStrategySVD truncation strategy which preserves the CTMRGEnv environment virtual spaces, or InfinitePEPS, InfinitePEPO virtual spaces.
PEPSKit.FullEnvTruncation — Type
struct FullEnvTruncation{T<:MatrixAlgebraKit.TruncationStrategy}Algorithm struct for the full environment truncation (FET).
Fields
trunc::MatrixAlgebraKit.TruncationStrategymaxiter::Int64tol::Float64trunc_init::Boolcheck_interval::Int64
Constructors
FullEnvTruncation(; kwargs...)The truncation algorithm can be constructed from the following keyword arguments:
trunc::TruncationStrategy: SVD truncation strategy when optimizing the new bond matrix.maxiter::Int=50: Maximal number of FET iterations.tol::Float64=1e-9: FET converges when the relative change in bond SVD spectrum between two FET iterations is smaller thantol.trunc_init::Bool=true: Controls whether the initialization of the new bond matrix is obtained from truncated SVD of the old bond matrix.check_interval::Int=0: Set number of iterations to print information. Output is suppressed whencheck_interval <= 0.
References
PEPSKit.FullInfiniteEnv — Type
struct FullInfiniteEnv{TC, TE, TA}Full-infinite CTMRG environment tensor storage.
Fields
C_1C_2C_3C_4E_1E_2E_3E_4E_5E_6E_7E_8A_1A_2A_3A_4A_1rA_2rA_3rA_4rdir
Constructors
FullInfiniteEnv(
quadrant1::E, quadrant2::E, quadrant3::E, quadrant4::E
) where {E<:EnlargedCorner}Construct sparse full-infinite environment based on four sparse enlarged corners (quadrants).
PEPSKit.FullInfiniteEnv — Method
(env::FullInfiniteEnv)(x, ::Val{false})
(env::FullInfiniteEnv)(x, ::Val{true})Contract full-infinite environment with a vector x, such that the environment acts as a linear map or adjoint linear map on x if Val(true) or Val(false) is passed, respectively.
PEPSKit.FullInfiniteProjector — Type
struct FullInfiniteProjector{S<:SVDAdjoint, T} <: PEPSKit.ProjectorAlgorithmProjector algorithm implementing projectors from SVDing the full 4x4 CTMRG environment.
Fields
decomposition_alg::SVDAdjointtrunc::Anyverbosity::Int64
Constructors
FullInfiniteProjector(; kwargs...)Construct the full-infinite projector algorithm based on the following keyword arguments:
decomposition_alg::Union{<:SVDAdjoint,NamedTuple}=SVDAdjoint(): SVD algorithm including the reverse rule. SeeSVDAdjoint.trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:FixedSpaceTruncation): Truncation scheme for the projector computation, which controls the resulting virtual spaces. Here,algcan be one of the following::FixedSpaceTruncation: Keep virtual spaces fixed during projection:notrunc: No singular values are truncated and the performed SVDs are exact:truncerror: Additionally supply error thresholdη; truncate to the maximal virtual dimension ofη:truncrank: Additionally supply truncation dimensionη; truncate such that the 2-norm of the truncated values is smaller thanη:truncspace: Additionally supply truncation spaceη; truncate according to the supplied vector space:trunctol: Additionally supply singular value cutoffη; truncate such that every retained singular value is larger thanη
verbosity::Int=0: Projector output verbosity which can be:- Suppress output information
- Print singular value degeneracy warnings
PEPSKit.FullPullback — Type
struct FullPullbackReverse-rule algorithm which wraps MatrixAlgebraKit's full pullback methods, see eigh_pullback!, svd_pullback!, qr_pullback!.
Fields
degeneracy_atol::Realverbosity::Int64
Constructors
FullPullback(; kwargs...)Construct a FullPullback algorithm struct from the following keyword arguments:
degeneracy_atol::Real=1.0e-13: Absolute tolerance for idendifying degenerate subspaces.verbosity::Int=0: Suppresses all output if≤0, prints gauge dependency warnings if1, and always prints gauge dependency if≥2.
PEPSKit.GeomSum — Type
struct GeomSumAlgorithm for solving the fixed-point gradient linear problem as a geometric sum.
Fields
tol::Realmaxiter::Int64verbosity::Int64
Constructors
GeomSum(; kwargs...)Construct the GeomSum algorithm struct based on the following keyword arguments:
tol::Real=1.0e-6: Convergence tolerance for the difference of norms of two consecutive summands in the geometric sum.maxiter::Int=30: Maximal number of gradient iterations.verbosity::Int=-1: Output information verbosity that can be one of the following:- Suppress output information
- Print convergence warnings
- Information at each gradient iteration
PEPSKit.GradientAlgorithm — Method
GradientAlgorithm(; kwargs...)Keyword argument parser returning the appropriate GradientAlgorithm algorithm struct.
PEPSKit.HalfInfiniteEnv — Type
struct HalfInfiniteEnv{TC, TE, TA}Half-infinite CTMRG environment tensor storage.
Fields
C_1C_2E_1E_2E_3E_4A_1A_2A_1rA_2rdir
Constructors
HalfInfiniteEnv(quadrant1::EnlargedCorner, quadrant2::EnlargedCorner)Construct sparse half-infinite environment based on two sparse enlarged corners (quadrants).
PEPSKit.HalfInfiniteEnv — Method
(env::HalfInfiniteEnv)(x, ::Val{false})
(env::HalfInfiniteEnv)(x, ::Val{true})Contract half-infinite environment with a vector x, such that the environment acts as a linear map or adjoint linear map on x if Val(true) or Val(false) is passed, respectively.
PEPSKit.HalfInfiniteProjector — Type
struct HalfInfiniteProjector{S<:SVDAdjoint, T} <: PEPSKit.ProjectorAlgorithmProjector algorithm implementing projectors from SVDing the half-infinite CTMRG environment.
Fields
decomposition_alg::SVDAdjointtrunc::Anyverbosity::Int64
Constructors
HalfInfiniteProjector(; kwargs...)Construct the half-infinite projector algorithm based on the following keyword arguments:
decomposition_alg::Union{<:SVDAdjoint,NamedTuple}=SVDAdjoint(): SVD algorithm including the reverse rule. SeeSVDAdjoint.trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:FixedSpaceTruncation): Truncation strategy for the projector computation, which controls the resulting virtual spaces. Here,algcan be one of the following::FixedSpaceTruncation: Keep virtual spaces fixed during projection:notrunc: No singular values are truncated and the performed SVDs are exact:truncerror: Additionally supply error thresholdη; truncate to the maximal virtual dimension ofη:truncrank: Additionally supply truncation dimensionη; truncate such that the 2-norm of the truncated values is smaller thanη:truncspace: Additionally supply truncation spaceη; truncate according to the supplied vector space:trunctol: Additionally supply singular value cutoffη; truncate such that every retained singular value is larger thanη
verbosity::Int=0: Projector output verbosity which can be:- Suppress output information
- Print singular value degeneracy warnings
PEPSKit.IdentityInitialization — Type
struct IdentityInitialization <: PEPSKit.InitializationStyleInitialize a contraction environment
Only works in very specific cases.
PEPSKit.InfinitePEPO — Type
struct InfinitePEPO{T<:PEPOTensor}Represents an infinite projected entangled-pair operator (PEPO) on a 3D cubic lattice.
Fields
A::Array{T, 3} where T<:(TensorKit.AbstractTensorMap{<:Any, S, 2, 4} where S<:TensorKit.ElementarySpace)
PEPSKit.InfinitePEPO — Method
InfinitePEPO(A::PEPOTensor; unitcell=(1, 1, 1))Create an InfinitePEPO by specifying a tensor which is repeated across the unit cell.
PEPSKit.InfinitePEPO — Method
InfinitePEPO(A::AbstractArray{T, 3})Allow users to pass in an array of tensors.
PEPSKit.InfinitePEPO — Method
InfinitePEPO([f=randn, T=ComplexF64,] Pspaces, Nspaces, Espaces)Allow users to pass in arrays of spaces.
PEPSKit.InfinitePEPO — Method
InfinitePEPO([f=randn, T=ComplexF64,] Pspace::S, Nspace::S, [Espace::S]; unitcell=(1,1,1)) where {S<:ElementarySpace}Create an InfinitePEPO by specifying its spaces and unit cell.
PEPSKit.InfinitePEPS — Type
struct InfinitePEPS{T<:PEPSTensor}Represents an infinite projected entangled-pair state on a 2D square lattice.
Fields
A::Matrix{T} where T<:(TensorKit.AbstractTensorMap{<:Any, S, 1, 4} where S<:TensorKit.ElementarySpace)
PEPSKit.InfinitePEPS — Method
InfinitePEPS(A::AbstractMatrix{T})Create an InfinitePEPS by specifying a matrix containing the PEPS tensors at each site in the unit cell.
PEPSKit.InfinitePEPS — Method
InfinitePEPS(A::PEPSTensor; unitcell=(1, 1))Create an InfinitePEPS by specifying a tensor and unit cell.
The unit cell is labeled as a matrix which means that any tensor in the unit cell, regardless if PEPS tensor or environment tensor, is obtained by shifting the row and column index [r, c] by one, respectively:
| | |
---C[r-1,c-1]---T[r-1,c]---T[r-1,c+1]---
| || ||
---T[r,c-1]=====AA[r,c]====AA[r,c+1]====
| || ||
---T[r+1,c-1]===AA[r+1,c]==AA[r+1,c+1]==
| || ||The unit cell has periodic boundary conditions, so [r, c] is indexed modulo the size of the unit cell.
PEPSKit.InfinitePEPS — Method
InfinitePEPS([f=randn, T=ComplexF64,] Pspaces::A, Nspaces::A, [Espaces::A]) where {A<:AbstractMatrix{ElementarySpace}}Create an InfinitePEPS by specifying the physical, north virtual and east virtual spaces of the PEPS tensor at each site in the unit cell as a matrix.
PEPSKit.InfinitePEPS — Method
InfinitePEPS([f=randn, T=ComplexF64,] Pspace, Nspace, [Espace]; unitcell=(1,1))Create an InfinitePEPS by specifying its physical, north and east spaces and unit cell.
PEPSKit.InfinitePartitionFunction — Type
struct InfinitePartitionFunction{T<:PartitionFunctionTensor}Represents an infinite partition function on a 2D square lattice.
Fields
A::Matrix{T} where T<:(TensorKit.AbstractTensorMap{<:Any, S, 2, 2} where S<:TensorKit.ElementarySpace)
PEPSKit.InfinitePartitionFunction — Method
InfinitePartitionFunction(A; unitcell=(1, 1))Create an InfinitePartitionFunction by specifying a tensor and unit cell.
The unit cell is labeled as a matrix which means that any tensor in the unit cell, regardless if partition function tensor or environment tensor, is obtained by shifting the row and column index [r, c] by one, respectively:
| | |
---C[r-1,c-1]---T[r-1,c]---T[r-1,c+1]---
| | |
---T[r,c-1]-----AA[r,c]----AA[r,c+1]----
| | |
---T[r+1,c-1]---AA[r+1,c]--AA[r+1,c+1]--
| | |The unit cell has periodic boundary conditions, so [r, c] is indexed modulo the size of the unit cell.
PEPSKit.InfinitePartitionFunction — Method
InfinitePartitionFunction(A::AbstractMatrix{T})Create an InfinitePartitionFunction by specifying a matrix containing the PEPS tensors at each site in the unit cell.
PEPSKit.InfinitePartitionFunction — Method
InfinitePartitionFunction(
[f=randn, T=ComplexF64,] Pspaces::A, Nspaces::A, [Espaces::A]
) where {A<:AbstractMatrix{<:Union{Int,ElementarySpace}}}Create an InfinitePartitionFunction by specifying the physical, north virtual and east virtual spaces of the PEPS tensor at each site in the unit cell as a matrix. Each individual space can be specified as either an Int or an ElementarySpace.
PEPSKit.InfinitePartitionFunction — Method
InfinitePartitionFunction(
[f=randn, T=ComplexF64,] Pspace::S, Nspace::S, [Espace::S]; unitcell=(1,1)
) where {S<:ElementarySpace}Create an InfinitePartitionFunction by specifying its physical, north and east spaces and unit cell. Spaces can be specified either via Int or via ElementarySpace.
PEPSKit.InfiniteSquare — Type
struct InfiniteSquare <: MPSKitModels.AbstractLattice{2}Infinite square lattice with a unit cell of size (Nrows, Ncols).
Fields
Nrows::Int64Ncols::Int64
Constructor
InfiniteSquare([Nrows=1, Ncols=1])By default, an infinite square with a (1, 1)-unitcell is constructed.
PEPSKit.InfiniteSquareNetwork — Type
struct InfiniteSquareNetwork{O}Contractible square network. Wraps a matrix of 'rank-4-tensor-like' objects.
Fields
A::Matrix
PEPSKit.InfiniteTransferPEPO — Type
InfiniteTransferPEPO{H,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.
PEPSKit.InfiniteTransferPEPO — Method
InfiniteTransferPEPO(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 rowth row from the north is selected.
PEPSKit.InfiniteTransferPEPS — Type
InfiniteTransferPEPS{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.
PEPSKit.InfiniteTransferPEPS — Method
InfiniteTransferPEPS(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 rowth row from the north is selected.
PEPSKit.InitializationStyle — Type
abstract type InitializationStyleAbstract super type for different initialization strategies for contraction environments.
PEPSKit.IterEigh — Type
struct IterEighIterative eigenvalue solver based on KrylovKit's eigsolve, adapted to (symmetric) tensors. The number of targeted eigenvalues is set via the truncspace in ProjectorAlg. In particular, this makes it possible to specify the targeted eigenvalues block-wise. In case the symmetry block is too small as compared to the number of singular values, or the iterative decomposition didn't converge, the algorithm falls back to a dense eigh/eigh.
Fields
alg::Anyfallback_threshold::Float64start_vector::Any
Constructors
IterEigh(; kwargs...)Construct an IterEigh algorithm struct based on the following keyword arguments:
alg=KrylovKit.Lanczos(; tol=1e-14, krylovdim=25): KrylovKit algorithm struct for iterative eigenvalue decomposition.fallback_threshold::Float64=Inf: Threshold forhowmany / minimum(size(block))above which (if the block is too small) the algorithm falls back to a dense decomposition.start_vector=deterministic_start_vector: Function providing the initial vector for the iterative algorithm.
PEPSKit.IterSVD — Type
struct IterSVDIterative SVD solver based on KrylovKit's GKL algorithm, adapted to (symmetric) tensors. The number of targeted singular values is set via the truncspace in ProjectorAlg. In particular, this make it possible to specify the targeted singular values block-wise. In case the symmetry block is too small as compared to the number of singular values, or the iterative SVD didn't converge, the algorithm falls back to a dense SVD.
Fields
alg::KrylovKit.GKLfallback_threshold::Float64start_vector::Any
Constructors
IterSVD(; kwargs...)Construct an IterSVD algorithm struct based on the following keyword arguments:
alg::KrylovKit.GKL=KrylovKit.GKL(; tol=1e-14, krylovdim=25): GKL algorithm struct for block-wise iterative SVD.fallback_threshold::Float64=Inf: Threshold forhowmany / minimum(size(block))above which (if the block is too small) the algorithm falls back to TensorKit's dense SVD.start_vector=deterministic_start_vector: Function providing the initial vector for the iterative SVD algorithm.
PEPSKit.LocalCircuit — Type
struct LocalCircuit{O, S}Circuit consisting of local gates and MPOs.
Fields
lattice::Matrix: lattice of physical spaces on which the gates actgates::Array{Pair{Vector{CartesianIndex{2}}, O}, 1} where O: list ofsites => gatepairs that make up the circuit.sitesis not required to be sorted.
PEPSKit.LocalOperator — Type
struct LocalOperator{O, S}A sum of local operators acting on a lattice. The lattice is stored as a matrix of vector spaces, and the terms are stored as a Dict of indices mapping to operators.
Fields
lattice::Matrix: lattice of physical spaces on which the gates actterms::Dict{Vector{CartesianIndex{2}}}: list ofsites => termpairs that make up the operator
lattice::Matrix{S}: The lattice on which the operator acts.terms::Dict{Vector{CartesianIndex{2}}, O}: The terms of the operator, mapping coordinates to operators
Constructors
LocalOperator(lattice::Matrix{S}, terms::Pair...)
LocalOperator{T, S}(lattice::Matrix{S}, terms::T) where {T,S}Examples
lattice = fill(ℂ^2, 1, 1) # single-site unitcell
O1 = LocalOperator(lattice, [(1, 1),] => σx, [(1, 1), (1, 2)] => σx ⊗ σx, [(1, 1), (2, 1)] => σx ⊗ σx)PEPSKit.LocalTruncation — Type
struct LocalTruncationAlgorithm to truncate virtual bonds of a two-layer network with projectors that minimizes the local cost function, which is the 2-norm of (e.g. for two layers of iPEPO)
↓ ╱ ↓ ╱ ↓ ╱ ↓ ╱
----A2---←---B2--- ----A2-←-|╲ ╱|--←-B2---
╱ | ╱ | ╱ | | ╲ ╱ | ╱ |
↓ ↓ - ↓ |P1├-←-┤P2| ↓
| ╱ | ╱ | ╱ | ╱ ╲ | | ╱
----A1---←---B1--- ----A1-←-|╱ ╲|--←-B1---
╱ ↓ ╱ ↓ ╱ ↓ ╱ ↓on each bond of the network.
PEPSKit.ManualIter — Type
struct ManualIterAlgorithm for solving the fixed-point gradient linear problem using manual iteration.
Fields
tol::Realmaxiter::Int64verbosity::Int64
Constructors
ManualIter(; kwargs...)Construct the ManualIter algorithm struct based on the following keyword arguments:
tol::Real=1.0e-6: Convergence tolerance for the norm difference of two consecutivedxcontributions.maxiter::Int=30: Maximal number of gradient iterations.verbosity::Int=-1: Output information verbosity that can be one of the following:- Suppress output information
- Print convergence warnings
- Information at each gradient iteration
PEPSKit.MultilineTransferPEPO — Type
const MultilineTransferPEPO = 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.
PEPSKit.MultilineTransferPEPO — Method
MultilineTransferPEPO(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.
PEPSKit.MultilineTransferPEPS — Type
const MultilineTransferPEPS = 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.
PEPSKit.MultilineTransferPEPS — Method
MultilineTransferPEPS(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.
PEPSKit.PEPOTensor — Type
const PEPOTensor{S}Default type for PEPO tensors with a single incoming and outgoing physical index, and 4 virtual indices, conventionally ordered as: $T : P ⊗ P´ ← N ⊗ E ⊗ S ⊗ W$. Here, $P´$ and $P$ denote the incoming and outgoing physical space respectively, encoding the physical mapping from $P´'$ to $P$ where $P´'$ corresponds to a physical PEPS index. $N$, $E$, $S$ and $W$ denote the physics, north, east, south and west spaces, respectively.
P´ N
| ╱
|╱
W---- ----E
╱|
╱ |
S PPEPSKit.PEPSOptimize — Type
struct PEPSOptimize{B, G}Algorithm struct for PEPS ground-state optimization using AD. See fixedpoint for details.
Fields
boundary_alg::Anygradient_alg::Anyoptimizer_alg::OptimKit.OptimizationAlgorithmreuse_env::Boolsymmetrization::Union{Nothing, PEPSKit.SymmetrizationStyle}
Constructors
PEPSOptimize(; kwargs...)Construct a PEPS optimization algorithm struct based on keyword arguments. For a full description, see fixedpoint. The supported keywords are:
boundary_alg::Union{NamedTuple,<:CTMRGAlgorithm,...}gradient_alg::Union{NamedTuple,Nothing,<:GradientAlgorithm}optimizer_alg::Union{NamedTuple,<:OptimKit.OptimizationAlgorithm}reuse_env::Bool=truesymmetrization::Union{Nothing,SymmetrizationStyle}=nothing
PEPSKit.PEPSTensor — Type
const 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$. Here, $P$ denotes the physical space and $N$, $E$, $S$ and $W$ denote the north, east, south and west virtual spaces, respectively.
N
╱
╱
W---- ----E
╱|
╱ |
S PPEPSKit.PEPSTensor — Method
PEPSTensor(f, ::Type{T}, Pspace::S, Nspace::S,
[Espace::S], [Sspace::S], [Wspace::S]) where {T,S<:Union{Int,ElementarySpace}}Construct a PEPS tensor based on the physical, north, east, south and west spaces. The tensor elements are generated based on f and the element type is specified in T.
PEPSKit.PEPSWeight — Type
const PEPSWeightDefault type for PEPS bond weights with 2 virtual indices.
PEPSKit.PartitionFunctionTensor — Type
const PartitionFunctionTensor{S}Default type for partition function tensors with 4 virtual indices, conventionally ordered as: $T : W ⊗ S ← N ⊗ E$. Here, $N$, $E$, $S$ and $W$ denote the north, east, south and west spaces, respectively.
N
╱
╱
W---- ----E
╱
╱
S PEPSKit.PartitionFunctionTensor — Method
PartitionFunctionTensor(f, ::Type{T}, Pspace::S, Nspace::S,
[Espace::S], [Sspace::S], [Wspace::S]) where {T,S<:Union{Int,ElementarySpace}}Construct a PartitionFunctionTensor tensor based on the north, east, west and south spaces. The tensor elements are generated based on f and the element type is specified in T.
PEPSKit.ProductStateEnv — Type
struct ProductStateEnv{T}Tensor product environment for an infinite square network, containing a 4 x rows x cols array of tensors, defined for each nearest neighbor bond in the network.
The product state tensors p connect to the network tensors P at site [r,c] in the unit cell as:
p[1,r-1,c]
|
p[4,r,c-1]------P[r,c]------p[2,r,c+1]
|
p[3,r+1,c]Fields
edges::Array{T, 3} where T: 4 x rows x cols array of edge tensors making up a product state environment, where the first dimension specifies the spatial direction
PEPSKit.ProductStateEnv — Method
ProductStateEnv([f=randn, T=ComplexF64], network::InfiniteSquareNetwork)Construct a product state environment by specifying a corresponding InfiniteSquareNetwork.
PEPSKit.ProductStateEnv — Method
ProductStateEnv(
[f=randn, T=ComplexF64], Ds_north::A, Ds_east::A
) where {A <: AbstractMatrix{<:ProductSpace}}Construct a product state environment by specifying matrices of north and east virtual spaces of the corresponding InfiniteSquareNetwork. Each matrix entry corresponds to a site in the unit cell.
Each entry of the Ds_north and Ds_east matrices corresponds to an effective local space of the network, and can be represented as a ProductSpace (e.g. for the case of a network representing overlaps of PEPSs).
PEPSKit.ProductStateInitialization — Type
struct ProductStateInitialization{F} <: PEPSKit.InitializationStyleInitialize a contraction environment from a product state made up of (N, 0) tensors.
Constructors
ProductStateInitialization(f = ones)Contructs a product state initialization strategy, where the product state tensors are initialized by the function f as f(T::Type{<:Number}, V::ProductSpace).
PEPSKit.ProjectorAlgorithm — Type
abstract type ProjectorAlgorithmAbstract super type for all CTMRG projector algorithms.
PEPSKit.ProjectorAlgorithm — Method
ProjectorAlgorithm(; kwargs...)Keyword argument parser returning the appropriate ProjectorAlgorithm algorithm struct.
PEPSKit.QRAdjoint — Type
struct QRAdjoint{F, R}Wrapper for a QR decomposition algorithm fwd_alg with a defined reverse rule rrule_alg.
Fields
fwd_alg::Anyrrule_alg::Any
Constructors
QRAdjoint(; kwargs...)Construct a QRAdjoint algorithm struct based on the following keyword arguments:
fwd_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=DefaultAlgorithm): QR algorithm of the forward pass which can either be passed as anAlgorithminstance or aNamedTuplewhere the algorithm is specified by thealgkeyword. The available algorithms are provided through MatrixAlgebraKit and include::DefaultAlgorithm: MatrixAlgebraKit's default QR algorithm for a given matrix type.:Householder: MatrixAlgebraKit'sHouseholder
rrule_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=FullPullback): Reverse-rule algorithm for differentiating the eigenvalue decomposition. Can be supplied by anAlgorithminstance directly or as aNamedTuplewherealgis one of the following::FullPullback: MatrixAlgebraKit'sqr_pullback!
PEPSKit.RandomInitialization — Type
struct RandomInitialization{F} <: PEPSKit.InitializationStyleInitialize a fully random contraction environment.
Constructors
RandomInitialization(f = randn)Contructs a random initialization strategy, where the environment tensors are initialized by the function f as f(T::Type{<:Number}, V::HomSpace).
PEPSKit.ReflectDepth — Type
struct ReflectDepth <: PEPSKit.SymmetrizationStyleReflection symmmetrization along the horizontal axis, such that north and south are mirrored.
PEPSKit.ReflectWidth — Type
struct ReflectWidth <: PEPSKit.SymmetrizationStyleReflection symmmetrization along the vertical axis, such that east and west are mirrored.
PEPSKit.Rotate — Type
struct Rotate <: PEPSKit.SymmetrizationStyleRotation symmmetrization leaving the object invariant under π/2 rotations.
PEPSKit.RotateReflect — Type
struct RotateReflect <: PEPSKit.SymmetrizationStyleFull reflection and rotation symmmetrization, such that reflection along the horizontal and vertical axis as well as π/2 rotations leave the object invariant.
PEPSKit.SUGauge — Type
struct SUGaugeAlgorithm for fixing gauge of an iPEPS using trivial simple update (with identity gates).
Fields
tol::Float64: Stopping criterion for the trivial SU iterations in weight differenceminiter::Int64: Minimal number of SU iterationsmaxiter::Int64: Maximal number of SU iterations
PEPSKit.SUState — Type
Internal state of simple update algorithm
PEPSKit.SUWeight — Type
struct SUWeight{E<:PEPSWeight}Schmidt bond weights used in simple/cluster update. Each weight is a real and semi-positive definite DiagonalTensorMap, with the same codomain and domain.
On the square lattice,
wt[1,r,c]is on the x-bond between[r,c]and[r,c+1];wt[2,r,c]is on the y-bond between[r,c]and[r-1,c].
Axis order of each weight matrix is
x-weights: y-weights:
1 - x - 2 2
|
y
|
1Fields
data::Array{E, 3} where E<:(TensorKit.AbstractTensorMap{T, S, 1, 1} where {T, S})
Constructors
SUWeight(wts_mats::AbstractMatrix{E}...) where {E<:PEPSWeight}PEPSKit.SUWeight — Method
SUWeight(env::BPEnv)Construct SUWeight from belief propagation fixed point environment env.
PEPSKit.SUWeight — Method
SUWeight(pepo::InfinitePEPO)Create a trivial SUWeight for a given one-layer InfinitePEPO.
PEPSKit.SUWeight — Method
SUWeight(peps::InfinitePEPS)Create a trivial SUWeight for a given InfinitePEPS.
PEPSKit.SUWeight — Method
SUWeight(Nspaces::M, [Espaces::M]) where {M<:AbstractMatrix{<:ElementarySpace}}Create a trivial SUWeight by specifying the vertical (north) or horizontal (east) virtual bond spaces.
PEPSKit.SUWeight — Method
SUWeight(Nspace::S, Espace::S=Nspace; unitcell::Tuple{Int,Int}=(1, 1)) where {S<:ElementarySpace}Create a trivial SUWeight by specifying its vertical (north) and horizontal (east) as ElementarySpaces) and unit cell size.
PEPSKit.SVDAdjoint — Type
struct SVDAdjoint{F, R}Wrapper for a SVD algorithm fwd_alg with a defined reverse rule rrule_alg.
Fields
fwd_alg::Anyrrule_alg::Any
Constructors
SVDAdjoint(; kwargs...)Construct a SVDAdjoint algorithm struct based on the following keyword arguments:
fwd_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=DefaultAlgorithm): SVD algorithm of the forward pass which can either be passed as anAlgorithminstance or aNamedTuplewhere the algorithm is specified by thealgkeyword. The available SVD algorithms can be divided into two categories:- "Dense" SVD algorithms which compute a truncated SVD through the truncation of a full
MatrixAlgebraKit.svd_compact!decomposition. Available algorithms are::DefaultAlgorithm: MatrixAlgebraKit's default SVD algorithm for a given matrix type.:DivideAndConquer: MatrixAlgebraKit'sDivideAndConquer:QRIteration: MatrixAlgebraKit'sQRIteration:Bisection: MatrixAlgebraKit'sBisection:Jacobi: MatrixAlgebraKit'sJacobi:SVDViaPolar: MatrixAlgebraKit'sSVDViaPolar:SafeDivideAndConquer: MatrixAlgebraKit'sSafeDivideAndConquer
- "Sparse" SVD algorithms which directly compute a truncated SVD without access to the full decomposition. Available algorithms are:
:GKL: Iterative Krylov-based SVD only computing the specifed number of singular values and vectors, seeIterSVD
- "Dense" SVD algorithms which compute a truncated SVD through the truncation of a full
rrule_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=:FullPullback): Reverse-rule algorithm for differentiating the SVD. Can be supplied by anAlgorithminstance directly or as aNamedTuplewherealgis one of the following::FullPullback: MatrixAlgebraKit'ssvd_pullback!that requires access to the full spectrum:TruncPullback: MatrixAlgebraKit'ssvd_trunc_pullback!solving a Sylvester equation on the truncated subspace:GMRES: GMRES iterative linear solver, seeKrylovKit.GMRES:BiCGStab: BiCGStab iterative linear solver, seeKrylovKit.BiCGStab:Arnoldi: Arnoldi Krylov algorithm, see theKrylovKit.Arnoldi
PEPSKit.ScramblingEnvGauge — Type
struct ScramblingEnvGaugeCTMRG environment gauge fixing algorithm implementing the "general" technique from https://arxiv.org/abs/2311.11894. This works by constructing a transfer matrix consisting of an edge tensor and a random MPS, thus scrambling potential degeneracies, and then performing a QR decomposition to extract the gauge signs. This is adapted accordingly for asymmetric CTMRG algorithms using multi-site unit cell transfer matrices.
PEPSKit.ScramblingEnvGaugeC4v — Type
struct ScramblingEnvGaugeC4vC4v-symmetric equivalent of the ScramblingEnvGauge` environment gauge fixing algorithm.
PEPSKit.SequentialCTMRG — Type
struct SequentialCTMRG <: CTMRGAlgorithmCTMRG algorithm where the expansions and renormalization is performed sequentially column-wise. This is implemented as a growing and projecting step to the left, followed by a clockwise rotation (performed four times).
Fields
tol::Float64maxiter::Int64miniter::Int64verbosity::Int64projector_alg::PEPSKit.ProjectorAlgorithm
Constructors
SequentialCTMRG(; kwargs...)Construct a sequential CTMRG algorithm struct based on keyword arguments. For a full description, see leading_boundary. The supported keywords are:
tol::Real=1.0e-8maxiter::Int=100miniter::Int=4verbosity::Int=2trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:FixedSpaceTruncation)decomposition_alg::Union{<:SVDAdjoint,NamedTuple}projector_alg::Symbol=:HalfInfiniteProjector
PEPSKit.SimpleUpdate — Type
struct SimpleUpdate{T<:MatrixAlgebraKit.TruncationStrategy} <: PEPSKit.TimeEvolutionAlgorithm struct for simple update (SU) of InfinitePEPS or InfinitePEPO.
Fields
trunc::MatrixAlgebraKit.TruncationStrategy: Truncation strategy for bonds updated by Trotter gatesimaginary_time::Bool: When true (or false), the Trotter gate isexp(-H dt)(orexp(-iH dt))force_mpo::Bool: When true, force decomposition of nearest neighbor gates to MPOs.bipartite::Bool: When true, assume bipartite unit cell structurepurified::Bool: (Only applicable to InfinitePEPO) When true, the PEPO is regarded as a purified PEPS, and updated as|ρ(t + dt)⟩ = exp(-H dt/2) |ρ(t)⟩. When false, the PEPO is updated asρ(t + dt) = exp(-H dt/2) ρ(t) exp(-H dt/2).
PEPSKit.SimultaneousCTMRG — Type
struct SimultaneousCTMRG{P<:PEPSKit.ProjectorAlgorithm} <: PEPSKit.CTMRGAlgorithmCTMRG algorithm where all sides are grown and renormalized at the same time. In particular, the projectors are applied to the corners from two sides simultaneously.
Fields
tol::Float64maxiter::Int64miniter::Int64verbosity::Int64projector_alg::PEPSKit.ProjectorAlgorithm
Constructors
SimultaneousCTMRG(; kwargs...)Construct a simultaneous CTMRG algorithm struct based on keyword arguments. For a full description, see leading_boundary. The supported keywords are:
tol::Real=1.0e-8maxiter::Int=100miniter::Int=4verbosity::Int=2trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:FixedSpaceTruncation)decomposition_alg::Union{<:SVDAdjoint,NamedTuple}projector_alg::Symbol=:HalfInfiniteProjector
PEPSKit.SiteDependentTruncation — Type
struct SiteDependentTruncation{T<:MatrixAlgebraKit.TruncationStrategy} <: MatrixAlgebraKit.TruncationStrategySVD truncation strategy specified for each nearest neighbor bond in InfinitePEPS, InfinitePEPO:
trunc[1, r, c]applies to the x-bond between[r, c]and[r, c+1]. If it is aTruncationSpace, the space refers to the east domain of[r, c]or itsflip, whichever is non-dual.trunc[2, r, c]applies to the y-bond between[r, c]and[r-1, c]. If it is aTruncationSpace, the space refers to the north domain of[r, c]or itsflip, whichever is non-dual.
PEPSKit.TimeEvolution — Type
abstract type TimeEvolutionAbstract super type for time evolution algorithms of InfinitePEPS or InfinitePEPO.
PEPSKit.TimeEvolver — Type
mutable struct TimeEvolver{TE <: TimeEvolution, C, S, N <: Number}Iterator for Trotter-based time evolution of InfinitePEPS or InfinitePEPO.
Fields
alg::PEPSKit.TimeEvolution: Time evolution algorithm (currently supported:SimpleUpdate)dt::Number: Trotter time stepnstep::Int64: The number of iteration stepscircuit::Any: LocalCircuit representing trotterized gatesstate::Any: Internal state of the iterator, including the number of already performed iterations, evolved time, PEPS/PEPO and its environment
PEPSKit.TimeEvolver — Method
TimeEvolver(
psi0::Union{InfinitePEPS, InfinitePEPO}, H::LocalOperator, dt::Number,
nstep::Int, alg::SimpleUpdate, env0::SUWeight; t0::Number = 0.0,
symmetrize_gates::Bool = false
)Initialize a TimeEvolver with Hamiltonian H and simple update alg, starting from the initial state psi0 and SUWeight environment env0.
- The initial time is specified by
t0. - Use
symmetrize_gates = truefor second-order Trotter decomposition.
PEPSKit.TruncPullback — Type
struct TruncPullbackTruncated reverse-rule algorithm which wraps MatrixAlgebraKit's truncated pullback methods, see eigh_trunc_pullback! and svd_trunc_pullback!.
Fields
degeneracy_atol::Realverbosity::Int64
Constructors
TruncPullback(; kwargs...)Construct a TruncPullback algorithm struct from the following keyword arguments:
degeneracy_atol::Real=1.0e-13: Absolute tolerance for idendifying degenerate subspaces.verbosity::Int=0: Suppresses all output if≤0, prints gauge dependency warnings if1, and always prints gauge dependency if≥2.
TensorKit.TensorMap — Method
TensorMap(Q::ColumnEnlargedCorner)Instantiate column-enlarged corner as a TensorMap.
TensorKit.TensorMap — Method
TensorMap(Q::EnlargedCorner)Instantiate enlarged corner as a TensorMap.
TensorKit.TensorMap — Method
TensorMap(env::FullInfiniteEnv)Instantiate full-infinite environment as TensorMap explicitly.
TensorKit.TensorMap — Method
TensorMap(env::HalfInfiniteEnv)Instantiate half-infinite environment as TensorMap explicitly.
FiniteDifferences.to_vec — Method
to_vec(A::InfinitePEPS) -> vec, state_from_vecVectorize an InfinitePEPS into a vector of real numbers. A vectorized infinite PEPS can retrieved again as an InfinitePEPS by application of the state_from_vec map.
MPSKit.add_physical_charge — Method
add_physical_charge(H::LocalOperator, charges::AbstractMatrix{<:Sector})Change the spaces of a LocalOperator by fusing in an auxiliary charge into the domain of the operator on every site, according to a given matrix of 'auxiliary' physical charges.
MPSKit.correlation_length — Method
correlation_length(state, env::CTMRGEnv; num_vals=2, kwargs...)Compute the correlation length associated to state as contracted using the environment env, based on the spectrum of the horizontal and vertical transfer matrices associated to env. Additionally the (normalized) eigenvalue spectrum is returned. The number of computed eigenvalues can be specified using num_vals, and any remaining keyword arguments are passed through to MPSKit.transfer_spectrum (e.g. allowing to target the correlation length in a specific symmetry sector).
MPSKit.expectation_value — Method
MPSKit.expectation_value(st::InfiniteMPS, op::Union{InfiniteTransferPEPS,InfiniteTransferPEPO})
MPSKit.expectation_value(st::MultilineMPS, op::Union{MultilineTransferPEPS,MultilineTransferPEPO})Compute expectation value of the transfer operator op for the state st for each site in the unit cell.
MPSKit.expectation_value — Method
expectation_value(state, O::LocalOperator, env::CTMRGEnv)
expectation_value(bra, O::LocalOperator, ket, env::CTMRGEnv)Compute the expectation value ⟨bra|O|ket⟩ / ⟨bra|ket⟩ of a LocalOperator O. This can be done either for a PEPS, or alternatively for a density matrix PEPO. In the latter case the first signature corresponds to a single layer PEPO contraction, while the second signature yields a bilayer contraction instead.
MPSKit.expectation_value — Method
expectation_value(pf::InfinitePartitionFunction, inds => O, env::CTMRGEnv)Compute the expectation value corresponding to inserting a local tensor(s) O at position inds in the partition function pf and contracting the chole using a given CTMRG environment env.
Here inds can be specified as either a Tuple{Int,Int} or a CartesianIndex{2}, and O should be a rank-4 tensor conforming to the PartitionFunctionTensor indexing convention.
MPSKit.leading_boundary — Method
leading_boundary(
st::InfiniteMPS, op::Union{InfiniteTransferPEPS,InfiniteTransferPEPO}, alg, [env]
)
leading_boundary(
st::MPSMulitline, op::Union{MultilineTransferPEPS,MultilineTransferPEPO}, alg, [env]
)Approximate the leading boundary MPS eigenvector for the transfer operator op using st as initial guess.
MPSKit.leading_boundary — Method
leading_boundary(env₀::BPEnv, network, alg::BeliefPropagation)Contract network in the BP approximation and return the corresponding messages.
MPSKit.leading_boundary — Method
leading_boundary(env₀, network; kwargs...) -> env, info
# expert version:
leading_boundary(env₀, network, alg::CTMRGAlgorithm)Contract network using CTMRG and return the CTM environment. The algorithm can be supplied via the keyword arguments or directly as an CTMRGAlgorithm struct.
Keyword arguments
CTMRG iterations
tol::Real=1.0e-8: Stopping criterium for the CTMRG iterations. This is the norm convergence, as well as the distance in singular values of the corners and edges.miniter::Int=4: Minimal number of CTMRG iterations.maxiter::Int=100: Maximal number of CTMRG iterations.verbosity::Int=2: Output verbosity level, should be one of the following:- Suppress all output
- Only print warnings
- Initialization and convergence info
- Iteration info
- Debug info
alg::Symbol=:SimultaneousCTMRG: Variant of the CTMRG algorithm. See alsoCTMRGAlgorithm.:SimultaneousCTMRG: Simultaneous expansion and renormalization of all sides.:SequentialCTMRG: Sequential application of left moves and rotations.:C4vCTMRG: CTMRG assuming C₄ᵥ-symmetric PEPS and environment.
Projector algorithm
trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:FixedSpaceTruncation): Truncation strategy for the projector computation, which controls the resulting virtual spaces. Here,algcan be one of the following::FixedSpaceTruncation: Keep virtual spaces fixed during projection:notrunc: No singular values are truncated and the performed SVDs are exact:truncerror: Additionally supply error thresholdη; truncate to the maximal virtual dimension ofη:truncrank: Additionally supply truncation dimensionη; truncate such that the 2-norm of the truncated values is smaller thanη:truncspace: Additionally supply truncation spaceη; truncate according to the supplied vector space:trunctol: Additionally supply singular value cutoffη; truncate such that every retained singular value is larger thanη
projector_alg::Symbol=:HalfInfiniteProjector: Variant of the projector algorithm. See alsoProjectorAlgorithm.:HalfInfiniteProjector: Projection via SVDs of half-infinite (two enlarged corners) CTMRG environments.:FullInfiniteProjector: Projection via SVDs of full-infinite (all four enlarged corners) CTMRG environments.:C4vEighProjector: Projection viaeighof the Hermitian enlarged corner, works only forC4vCTMRG.:C4vQRProjector: Projection via QR decomposition of the lower-rank column-enlarged corner, works only forC4vCTMRG.
decomposition_alg::Union{NamedTuple,<:SVDAdjoint,<:EighAdjoint,<:QRAdjoint}: Tensor decomposition algorithm used for computing projectors. When specified as aNamedTuple, the settings are passed a the forward algorithm to the appropriate decomposition for the given projector algorithm. For information on which forward algorithms are available, and how to specify them, seeSVDAdjoint,EighAdjointandQRAdjoint.
Return values
env: The final environment.info: ANamedTuplecontaining information about theleading_boundaryconvergence, which has the following fields:info.converged::Bool: Convergence flag indicating whether the contraction converged withinmaxiterandtol.info.convergence_error::Real: The final convergence error at the end of the contraction procedure.info.contraction_metrics::NamedTuple: ANamedTuplecontaining metrics which characterize the contraction. The precise contents depend onalg.
MPSKit.physicalspace — Method
physicalspace(O::LocalOperator)Return lattice of physical spaces on which the LocalOperator is defined.
MPSKit.physicalspace — Method
physicalspace(gates::LocalCircuit)Return lattice of physical spaces on which the LocalCircuit is defined.
MPSKit.time_evolve — Method
time_evolve(it; verbosity = 2, check_interval = 500) -> (psi, env, info)
time_evolve(it, H; tol = 1.0e-8, verbosity = 2, check_interval = 500) -> (psi, env, info)Perform time evolution to the end of TimeEvolver iterator it, or until convergence of SUWeight set by a positive tol.
- Setting
tol > 0enables convergence check (for imaginary time evolution of InfinitePEPS only). For other usages it should not be changed. verbositysets the verbosity level to output information.- 0: output no information except warnings.
- 1: indicate the start and the end of the evolution.
- 2: (default) output detailed progress of the evolution.
check_intervalsets the number of iterations to output evolution progress.
MPSKit.time_evolve — Method
time_evolve(
psi0::Union{InfinitePEPS, InfinitePEPO}, H::LocalOperator,
dt::Number, nstep::Int, alg::SimpleUpdate, env0::SUWeight;
symmetrize_gates::Bool = false, tol::Float64 = 0.0,
t0::Number = 0.0, verbosity::Int = 2, check_interval::Int = 500,
) -> (psi, env, info)Perform time evolution on the initial iPEPS or iPEPO psi0 and initial environment env0 with Hamiltonian H, using SimpleUpdate algorithm alg, time step dt for nstep number of steps.
- Set
symmetrize_gates = truefor second-order Trotter decomposition. - Set
tol > 0to enable convergence check (for imaginary time evolution of iPEPS only). - Use
t0to specify the initial time of the evolution. verbositysets the verbosity level to output information.check_intervalsets the interval to output evolution progress.infois a NamedTuple containing information of the evolution, including the timeinfo.tevolved sincepsi0.
MPSKit.timestep — Method
timestep(
it::TimeEvolver{<:SimpleUpdate}, psi::InfiniteState, env::SUWeight
) -> (psi, env, info)Given the TimeEvolver iterator it, perform one step of time evolution on the input state psi and its environment env.
MatrixAlgebraKit.eigh_trunc — Method
eigh_trunc(t, alg::EighAdjoint)
eigh_trunc!(t, alg::EighAdjoint)Wrapper around eigh_trunc(!) which dispatches on the EighAdjoint algorithm. This is needed since a custom adjoint may be defined, depending on the alg.
MatrixAlgebraKit.left_orth — Method
left_orth(t, alg::QRAdjoint)
left_orth!(t, alg::QRAdjoint)Wrapper around left_orth(!) which dispatches on the QRAdjoint algorithm. This is needed since a custom adjoint may be defined, depending on the alg.
MatrixAlgebraKit.svd_trunc — Method
svd_trunc(t, alg::SVDAdjoint)
svd_trunc!(t, alg::SVDAdjoint)Wrapper around svd_trunc(!) which dispatches on the SVDAdjoint algorithm. This is needed since a custom adjoint may be defined, depending on the alg. E.g., for IterSVD the adjoint for a truncated SVD from KrylovKit.svdsolve is used.
MatrixAlgebraKit.svd_trunc_no_error — Method
svd_trunc_no_error(t, alg::SVDAdjoint)
svd_trunc_no_error!(t, alg::SVDAdjoint)Wrapper around svd_trunc_no_error(!) which dispatches on the SVDAdjoint algorithm. This is needed since a custom adjoint may be defined, depending on the alg. E.g., for IterSVD the adjoint for a truncated SVD from KrylovKit.svdsolve is used. The _no_error(!) versions of svd_trunc(!) do not compute the truncation error.
PEPSKit._absorb_weight! — Method
Absorb weights into the open virtual legs of the cluster Ms of PEPS/PEPO tensors.
PEPSKit._als_init_truncate — Method
Initialize truncated bond tensors for 2-site ALS
PEPSKit._als_norm — Method
Calculate the 2-site norm
┌benv-------┐
├---a---b---┤
| ↓ ↓ |
├---ā---b̄---┤
└-----------┘using pre-calcuated partial contraction results.
PEPSKit._als_overlap — Method
Calculate the inner product (overlap)
┌benv-------┐
├---a₂--b₂--┤
| ↓ ↓ |
├---ā---b̄---┤
└-----------┘using pre-calculated partial contraction results.
PEPSKit._als_tensor_R — Method
_als_tensor_R(benv::BondEnv, xs::Vector{<:MPSTensor}, i::Int)Construct the bond environment around the ith bond tensor in two-site ALS optimization.
i = 1 i = 2
┌benv-------┐ ┌benv-------┐
├-- --b---┤ ├---a-- --┤
| ↓ | | ↓ |
├-- --b̄---┤ ├---ā-- --┤
└-----------┘ └-----------┘PEPSKit._als_tensor_S — Method
_als_tensor_S(
benv_ket::AbstractTensorMap{T, S, 2, 2},
xs::Vector{<:MPSTensor}, i::Int
) where {T <: Number, S <: ElementarySpace}Construct the overlap but with one of the bra bond tensor removed.
i = 1 i = 2
┌benv-------┐ ┌benv-------┐
├---a₂==b₂--┤ ├---a₂==b₂--┤
| ↓ ↓ | | ↓ ↓ |
├-- --b̄---┤ ├---ā-- --┤
└-----------┘ └-----------┘The ket part is provided by the partial contraction benv_ket.
PEPSKit._apply_gate — Method
_apply_gate(a, b, gate, trunc)
Apply 2-site gate on the reduced bond tensors a, b
-1← a --- 3 --- b ← -4 -2 -3
↓ ↓ ↓ ↓
1 2 |----gate---|
↓ ↓ or ↓ ↓
|----gate---| 1 2
↓ ↓ ↓ ↓
-2 -3 -1← a --- 3 --- b ← -4PEPSKit._apply_gatempo! — Method
Apply the gate MPO gs on the cluster Ms. When gate_ax is 1 or 2, the gate acts from the physical codomain or domain side.
e.g. Cluster in PEPS with gate_ax = 1:
╱ ╱ ╱
--- M1 -←-- M2 -←-- M3 ---
╱ | ╱ | ╱ |
↓ ↓ ↓
g1 -←-- g2 -←-- g3
↓ ↓ ↓PEPSKit._apply_sitegate — Method
Apply 1-site gate on the PEPS or PEPO tensor a.
PEPSKit._benv_ket — Method
Construct the norm with bra bond tensors removed
┌benv-------┐
├---a---b---┤
| ↓ ↓ |
├-- --┤
└-----------┘PEPSKit._bp_gauge_fix! — Method
_bp_gauge_fix!(I, psi::InfinitePEPS, env::BPEnv) -> psi, X, X⁻¹For the bond at direction I[1] (which can be NORTH or EAST) from site I[2], I[3], we identify the following gauge matrices, along the canonical direction of the PEPS arrows (SOUTH ← NORTH or WEST ← EAST):
\[ I = √M₁₂⁻¹ √M₁₂ √M₂₁ √M₂₁⁻¹ = √M₁₂⁻¹ (U Λ Vᴴ) √M₂₁⁻¹ = (√M₁₂⁻¹ U √Λ) (√Λ Vᴴ √M₂₁⁻¹) = X X⁻¹\]
Which are then used to update the gauge of psi. Thus, by convention X is attached to the SOUTH/WEST directions and X⁻¹ is attached to the NORTH/EAST directions.
PEPSKit._check_algorithm_combination — Method
_check_algorithm_combination(boundary_alg, gradient_alg_or_symmetrization)
_check_algorithm_combination(boundary_alg, gradient_alg, symmetrization)Check for allowed combinations of gradient algorithm and boundary algorithm to be used for computing the gradient of a leading_boundary call. Throws an error containing a recommended fix if the combination is not allowed or broken.
PEPSKit._check_hamiltonian_for_trotter — Method
_check_hamiltonian_for_trotter(H::LocalOperator)Assert that operator H contains only one-site and two-site terms. Returns the maximum squared distance covered by a two-site term in H. On the square lattice, the neighbor distances are
1st nb. 2nd nb. 3rd nb.
o
|
o---o o---o o---o---o
dist² = 1 dist² = 2 dist² = 4PEPSKit._check_virtual_dualness — Method
Checks if state follow the standard virtual arrow convention, i.e. north and east domains are non-dual spaces.
PEPSKit._cluster_truncate! — Method
Find projectors to truncate internal bonds of the cluster Ms.
PEPSKit._combine_ket — Method
Contract the virtual legs between
-- DX --a-- D --b-- DY --
↓ ↓
da dbPEPSKit._contract_corners — Method
_contract_corners(ind::Tuple{Int,Int}, env::CTMRGEnv)Contract all corners around the south-east at position ind of the CTMRG environment env.
PEPSKit._contract_horizontal_edges — Method
_contract_horizontal_edges(ind::Tuple{Int,Int}, env::CTMRGEnv)Contract the horizontal edges and corners around the south edge at position ind of the CTMRG environment env.
PEPSKit._contract_site — Method
_contract_site(ind::Tuple{Int,Int}, network::InfiniteSquareNetwork, env::CTMRGEnv)Contract around a single site ind of a square network using a given CTMRG environment.
PEPSKit._contract_vertical_edges — Method
_contract_vertical_edges(ind::Tuple{Int,Int}, env::CTMRGEnv)Contract the vertical edges and corners around the east edge at position ind of the CTMRG environment env.
PEPSKit._fixgauge_benvX — Method
Apply the gauge transformation Rinv for Z
┌-----------------------┐
└---Z--(X)--Rinv-- ---┘
↓to X. For example, when X is a PEPSTensor,
-2
|
-5 - X - 1 - Rinv - -3
| ╲
-4 -1PEPSKit._fixgauge_benvY — Method
Apply the gauge transformation Linv for Z
┌-----------------------┐
└---Z--- ---Linv--(Y)--┘
↓to Y. For example, when Y is a PEPSTensor,
-2
|
-5 - Linv - 1 - Y - -3
| ╲
-4 -1PEPSKit._flip_virtuals! — Method
Flip the virtual arrows in the MPS Ms
PEPSKit._fuse_ids — Method
_fuse_ids(op::AbstractTensorMap{T, S, N, N}, [Ps::NTuple{N, S}]) where {T, S, N}Fuse identities on auxiliary physical spaces Ps into a given operator op. When Ps is not specified, it defaults to the domain spaces of op.
PEPSKit._get_allRLs — Method
Given a cluster Ms, find all R, L matrices on each internal bond
PEPSKit._get_allprojs — Method
Given a cluster Ms, find all projectors Pa, Pb and Schmidt weights wts on internal bonds.
PEPSKit._get_cluster — Method
Obtain the cluster Ms along the (open) path sites in state.
Returns
Ms: Tensors in the cluster (not permuted to MPS axis order).open_vaxs: Open virtual axes (1 to 4) of each cluster tensor before permutation.perms: Permutations to change each tensor to MPS axis order.
PEPSKit._get_cluster_trunc — Method
Get the TruncationStrategy for each bond in the cluster updated by the Trotter evolution MPO.
PEPSKit._get_dt — Method
Process the Trotter time step dt according to the intended usage.
PEPSKit._get_fixedspacetrunc — Method
Get the SiteDependentTruncation used by time evolution that preserves virtual spaces of state.
PEPSKit._inv_mpo_perm — Method
Given the permutation perm that converts a PEPSTensor (N = 1) or PEPOTensor (N = 2) to MPS axis order, find the inverse permutation.
PEPSKit._linearmap_twist! — Method
_linearmap_twist!(t)
Apply a twist to domain or codomain indices that correspond to dual spaces
PEPSKit._message_tensor — Method
Construct a message tensor on a certain bond of a network, with bond space specified by pspaces. In the 2-layer case, the message tensor will be
┌--- pspaces[1] (ket layer)
m
└--- pspaces[2] (bra layer)Returning axis order is bra ← ket.
When posdef is true, the message will be made semi-posdef definite (when interpreted as a bra ← ket TensorMap).
PEPSKit._mpo_perm — Method
Find the permutation to permute out_ax, in_ax legs to the first and the last position of a tensor with N legs, then assign the last leg to domain, and the others to codomain to follow the GenericMPSTensor convention.
PEPSKit._nn_bondrev — Method
Given site1, site2 connected by a nearest neighbor bond, return the bond index and whether it is reversed from the standard orientation (site1 on the west/south of site2).
PEPSKit._nn_vec_direction — Method
Convert nearest neighbor vector nn_vec to direction labels.
NORTH
(-1,0)
↑
WEST (0,-1)-←-∘-→-(0,+1) EAST
↓
(+1,0)
SOUTHPEPSKit._permute_cluster — Method
Given a vector Ms of AbstractTensorMaps, apply permutations perms to each tensor.
PEPSKit._permute_to_last — Method
_permute_to_last(axes::NTuple{N, Int}, ax::Int) where {N}Returns (1, 2, ..., N) but with ax moved to the end, and the corresponding permutation for axes (with ax as the only domain index).
PEPSKit._prepare_site_tensor — Method
Convert tensor t connected by the bond to be truncated to a PEPSTensor.
PEPSKit._proj_from_RL — Method
Given the tensors R, L on a bond, construct the projectors Pa, Pb and the new bond weight s such that the contraction of Pa, s, Pb is identity when trunc = notrunc,
The arrows between Pa, s, Pb are
- Pa --←-- Pb -
1 ← s ← 2PEPSKit._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.
PEPSKit._set_decomposition_truncation — Method
_set_decomposition_truncation(alg::ProjectorAlgorithm, trunc::TruncationStrategy)Set the truncation strategy of the decomposition algorithm within a given projector algorithm, keeping all other settings the same.
PEPSKit._set_truncation — Method
_set_truncation(alg::ProjectorAlgorithm, trunc::TruncationStrategy)Update the truncation strategy of a given projector algorithm, keeping all other settings the same.
PEPSKit._shift_into_unitcell! — Method
Shift the first of inds into the unit cell (with size unitcell) by a lattice translation.
PEPSKit._singular_value_distance — Method
_singular_value_distance(S₁, S₂)Compute the singular value distance as an error measure, e.g. for CTMRG iterations. To that end, the singular values of the current iteration S₁ are compared with the previous one S₂. When the virtual spaces change, this comparison is not directly possible such that both tensors are projected into the smaller space and then subtracted.
PEPSKit._solve_als — Method
_solve_als(Rx, Sx, x0; kwargs...)
Solve the equations Rx x = Sx with initial guess x0.
In ALS over a, b, if we fix b, the cost function can be expressed in the Ra, Sa tensors as
f(a†,a) = a† Ra a - a† Sa - Sa† a + constTherefore f is minimized when
∂f/∂ā = Ra a - Sa = 0PEPSKit._su_iter! — Method
Simple update optimized for nearest neighbor gates utilizing reduced bond tensors with the physical leg.
PEPSKit._su_iter! — Method
Simple update with an N-site MPO gate (N ≥ 2).
PEPSKit._trotterize_1site! — Method
Trotterize a trivial Hamiltonian H containing only 1-site terms.
PEPSKit._trotterize_nn2site! — Method
Trotterize nearest neighbor terms in the Hamiltonian H.
PEPSKit._trotterize_nnn2site! — Method
Trotterize next-nearest neighbor terms in a Hamiltonian, converting them to 3-site MPO gates. For each gate, the sites are in counter-clockwise order
2---1 3---2
| |
3 1
1 3
| |
2---3 1---2PEPSKit.absorb_s — Method
absorb_s(U::AbstractTensorMap, S::DiagonalTensorMap, V::AbstractTensorMap)Given SVD result U, S and V, absorb singular values S into U and V by:
U -> U * sqrt(S), V -> sqrt(S) * VPEPSKit.absorb_weight — Method
absorb_weight(t::Union{PEPSTensor, PEPOTensor}, weights::SUWeight, rowcol::CartesianIndex{2}, virt_axes::NTuple{N, Int}; inv::Bool = false)
absorb_weight(t::Union{PEPSTensor, PEPOTensor}, weights::SUWeight, row::Int, col::Int, virt_axes::NTuple{N, Int}; inv::Bool = false)Absorb or remove (in a twist-free way) the square root of environment weight on an axis of the PEPS/PEPO tensor t known to be at position (row, col) in the unit cell of an InfinitePEPS/InfinitePEPO. The involved weights are
|
[2,r,c]
|
- [1,r,c-1] - T[r,c] - [1,r,c] -
|
[2,r+1,c]
|Arguments
t::Union{PEPSTensor, PEPOTensor}: PEPSTensor or PEPOTensor to which the weight will be absorbed.weights::SUWeight: All simple update weights.row::Int: The row index specifying the position in the tensor network.col::Int: The column index specifying the position in the tensor network.virt_axes::Int: The axis into which the weight is absorbed, taking values from 1 to 4, standing for north, east, south, west respectively.
Keyword arguments
inv::Bool=false: Iftrue, the inverse square root of the weight is absorbed.
Examples
# Absorb the weight into the north axis of tensor at position (2, 3)
absorb_weight(t, weights, 2, 3, (1,))
# Absorb the inverse of (i.e. remove) the weight into the east axis
absorb_weight(t, weights, 2, 3, (2,); inv=true)PEPSKit.bond_tensor_first — Method
Given the first tensor A in the cluster acted on by a gate, obtain reduced tensor on its next bond.
For PEPSTensor,
1
|
4 - X ← 2 1 ← a - 3
| ↘
3 2For PEPOTensor,
gate_ax = 1 gate_ax = 2
1 2 2 2
↘ | | ↘
5 - X ← 3 1 ← a - 3 5 - X ← 3 1 ← a - 3
| ↘ | ↘
4 2 4 1PEPSKit.bond_tensor_last — Method
Given the last tensor A in the cluster acted on by a gate, obtain reduced tensor on its previous bond.
For PEPSTensor,
1
|
1 - b → 3 4 → Y - 2
↘ |
2 3For PEPOTensor,
gate_ax = 1 gate_ax = 2
1 2 2 2
↘ | ↘ |
1 - b → 3 5 → Y - 3 1 - b → 3 5 → Y - 3
↘ | | ↘
2 4 4 1PEPSKit.bond_truncate — Method
bond_truncate(a::MPSTensor, b::MPSTensor, benv::BondEnv, alg) -> U, S, V, infoAfter time-evolving the reduced tensors a and b connected by a bond, truncate the bond dimension using the bond environment tensor benv.
┌-----------------------┐
| ┌----┐ |
└---| |-- a === b ---┘
|benv| ↓ ↓
┌---| |-- a† == b† --┐
| └----┘ |
└-----------------------┘The truncation algorithm alg can be either FullEnvTruncation or ALSTruncation. The index order of a or b follows MPSTensor convention.
1 -a/b- 3
↓ [1 2; 3]
2PEPSKit.bondenv_ctm — Method
Construct the environment (norm) tensor
-1 C1---E1---------E1---C2
| ‖ ‖ |
0 E4===XX== ==YY===E2
| ‖ ‖ |
1 C4---E3---------E3---C3
-1 0 1 2with X at position [row, col]. X, Y are unitary tensors produced when finding the reduced site tensors, and XX = X' X and YY = Y' Y (stacked together).
Axis order: [DX1 DY1; DX0 DY0], as in
┌---------------------┐
| ┌----┐ |
└-| |---DX0 DY0---┘
|benv|
┌-| |---DX1 DY1---┐
| └----┘ |
└---------------------┘PEPSKit.bp_iteration — Method
One iteration to update the BP environment.
PEPSKit.c4v_enlarge — Method
c4v_enlarge(network, env, ::C4vEighProjector)Compute the normalized and Hermitian-symmetrized C₄ᵥ enlarged corner.
PEPSKit.c4v_enlarge — Method
c4v_enlarge(env, ::C4vQRProjector)Compute the normalized column-enlarged northeast corner for C₄ᵥ QR-CTMRG.
PEPSKit.c4v_projector! — Method
c4v_projector!(enlarged_corner, alg::C4vEighProjector)Compute the C₄ᵥ projector from eigh decomposing the Hermitian enlarged_corner. Also return the normalized eigenvalues as the new corner tensor.
PEPSKit.c4v_projector! — Method
c4v_projector!(enlarged_corner, alg::C4vQRProjector)Compute the C₄ᵥ projector by decomposing the column-enlarged corner with left_orth.
R--←--
↓
C-←-E-←- = [~Q~]
↓ | ↓ |PEPSKit.calc_convergence — Method
calc_convergence(env, CS_old, TS_old)
calc_convergence(env_new, env_old)Given a new environment env, compute the maximal singular value distance. This determined either from the previous corner and edge singular values CS_old and TS_old, or alternatively, directly from the old environment.
PEPSKit.calc_elementwise_convergence — Method
calc_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 atol and return the maximal difference.
PEPSKit.check_input — Method
check_input(::typeof(fixedpoint), peps₀, env₀, alg::PEPSOptimize{<:SimultaneousCTMRG})Check compatibility of an initial PEPS and environment with a specified PEPS optimization algorithm.
PEPSKit.check_input — Method
check_input(::typeof(leading_boundary), network, env, alg::CTMRGAlgorithm)Check compatibility of a given network and environment with a specified CTMRG algorithm.
PEPSKit.checklattice — Method
checklattice(Bool, args...)
checklattice(args...)Helper function for checking lattice compatibility. The first version returns a boolean, while the second version throws an error if the lattices do not match.
PEPSKit.column_enlarge_northwest_corner — Method
column_enlarge_northwest_corner(C_northwest, edge)
Contract the half-enlarged northwest corner of the CTMRG environment.
C₁-←-E₁-←-
↓ |PEPSKit.compress — Method
compress((ρ1, ρ2), alg::LocalTruncation)Compress two 1-layer iPEPOs into a 1-layer iPEPO by truncating the virtual bonds with LocalTruncation. In the tuple (ρ1, ρ2), ρ1 is the lower layer and ρ2 is the upper layer.
PEPSKit.compute_projector — Method
compute_projector(enlarged_corners, alg::ProjectorAlgorithm)Determine left and right projectors at the bond given determined by the enlarged corners using the specified alg.
PEPSKit.contract_local_norm — Method
contract_local_norm(inds, ket, bra, env)
Contract a local norm of the PEPS peps around indices inds.
This works analogously to contract_local_operator by generating the contraction on a rectangular patch based on inds but replacing the operator with an identity such that the PEPS norm is computed. (Note that this is not the physical norm of the state.)
PEPSKit.contract_local_operator — Method
contract_local_operator(inds, O, ket, bra, env)
Contract a local operator O on the PEPS peps at the indices inds using the environment env.
This works by generating the appropriate contraction on a rectangular patch with its corners specified by inds. The peps is contracted with O from above and below, and the PEPS-operator sandwich is surrounded with the appropriate environment tensors.
PEPSKit.contract_local_tensor — Method
contract_local_tensor(inds, O::PEPOTensor, network, env)Contract a local tensor O inserted into the PEPO of a given network at position inds, using the environment env.
PEPSKit.contract_local_tensor — Method
contract_local_tensor(inds, O::PFTensor, env)Contract a local tensor O inserted into a partition function pf at position inds, using the environment env.
PEPSKit.contract_projectors — Method
contract_projectors(U, S, V, Q, Q_next)
Compute projectors based on a SVD of Q * Q_next, where the inverse square root isqS of the singular values is computed.
Left projector:
-- |~~~~~~| -- |~~|
|Q_next| |V'| -- isqS --
== |~~~~~~| == |~~|Right projector:
|~~| -- |~~~| --
-- isqS -- |U'| | Q |
|~~| == |~~~| ==PEPSKit.corner — Method
corner(env::CTMRGEnv, dir, i, j)Return the corner tensor of env at direction dir and unit-cell coordinates (i, j). The coordinates are wrapped periodically (mod1); the direction is passed through unchanged. Mixed Int/CartesianIndex arguments are supported via Base.to_indices, e.g. corner(env, NORTHWEST, CartesianIndex(r, c)).
PEPSKit.cost_function — Method
cost_function(peps::InfinitePEPS, env::CTMRGEnv, O::LocalOperator)Real part of expectation value of O. Prints a warning if the expectation value yields a finite imaginary part (up to a tolerance).
PEPSKit.cost_function_als — Method
cost_function_als(benv, ψ1, ψ2)
Calculate the cost function
f(a,b) = ‖ |ψ1⟩ - |ψ2⟩ ‖^2
= ⟨ψ1|benv|ψ1⟩ - 2 Re⟨ψ1|benv|ψ2⟩ + ⟨ψ2|benv|ψ2⟩and the fidelity
|⟨ψ1|benv|ψ2⟩|²
------------------------
⟨ψ1|benv|ψ1⟩⟨ψ2|benv|ψ2⟩PEPSKit.ctmrg_iteration — Method
ctmrg_iteration(network, env, alg::CTMRGAlgorithm) -> env′, infoPerform a single CTMRG iteration in which all directions are being grown and renormalized.
PEPSKit.ctmrg_leftmove — Method
ctmrg_leftmove(col::Int, network, env::CTMRGEnv, alg::SequentialCTMRG)Perform sequential CTMRG left move on the col-th column.
PEPSKit.decomposition_algorithm — Method
decomposition_algorithm(alg::ProjectorAlgorithm)Return the tensor decomposition algorithm of the alg projector algorithm.
PEPSKit.dtmap — Method
dtmap(args...; kwargs...)Differentiable wrapper around [OhMyThreads.tmap].
All calls of dtmap inside of PEPSKit use the threading scheduler stored inside Defaults.scheduler which can be modified using set_scheduler!.
PEPSKit.eachcoordinate — Function
eachcoordinate(x, [dirs=1:4])Enumerate all (dir, row, col) pairs.
PEPSKit.edge — Method
edge(env::CTMRGEnv, dir, i, j)Return the edge tensor of env at direction dir and unit-cell coordinates (i, j). The coordinates are wrapped periodically (mod1); the direction is passed through unchanged. Mixed Int/CartesianIndex arguments are supported via Base.to_indices.
PEPSKit.edge_transfer_left — Method
edge_transfer_left(v, Et, Eb)Apply an edge transfer matrix to the left.
┌─Et─
-v │
└─qƎ─PEPSKit.edge_transfer_left — Method
edge_transfer_left(v, O, Et, Eb)Apply an edge transfer matrix to the left.
┌──Et─
│ │
v──O──
│ │
└──qƎ─PEPSKit.edge_transfer_left — Method
edge_transfer_left(v, O, Et, Eb)Apply an edge transfer matrix to the left on an excited vector.
┌──Et─
│ │
-v──O──
│ │
└──qƎ─PEPSKit.edge_transfer_right — Method
edge_transfer_right(v, Et, Eb)Apply an edge transfer matrix to the right.
─Et─┐
│ v-
─qƎ─┘PEPSKit.edge_transfer_right — Method
edge_transfer_right(v, Et, Eb)Apply an edge transfer matrix to the right.
──Et─┐
│ │
──O──v
│ │
──qƎ─┘PEPSKit.edge_transfer_right — Method
edge_transfer_right(v, O, Et, Eb)Apply an edge transfer matrix to the right on an excited vector.
──Et─┐
│ │
──O──v-
│ │
──qƎ─┘PEPSKit.edge_transfer_spectrum — Method
edge_transfer_spectrum(top::Vector{E}, bot::Vector{E}; tol=Defaults.tol, num_vals=20,
sector=one(sectortype(E))) where {E<:CTMRGEdgeTensor}Calculate the partial spectrum of the left edge transfer matrix corresponding to the given top vector of edges and a bot vector of edge. The sector keyword argument can be used to specify a non-trivial total charge for the transfer matrix eigenvectors. Specifically, an auxiliary space ℂ[typeof(sector)](sector => 1)' will be added to the domain of each eigenvector. The tol and num_vals keyword arguments are passed to KrylovKit.eigolve.
PEPSKit.enlarge_northeast_corner — Method
enlarge_northeast_corner(E_north, C_northeast, E_east, A)
Contract the enlarged northeast corner of the CTMRG environment, either by specifying the coordinates, environments and network, or by directly providing the tensors.
out-- E_north -- C_northeast
| |
-- A -- E_east
| |
inPEPSKit.enlarge_northwest_corner — Method
enlarge_northwest_corner(E_west, C_northwest, E_north, A)
Contract the enlarged northwest corner of the CTMRG environment, either by specifying the coordinates, environments and network, or by directly providing the tensors.
C_northwest -- E_north --in
| |
E_west -- A --
| |
outPEPSKit.enlarge_southeast_corner — Method
enlarge_southeast_corner(E_east, C_southeast, E_south, A)
Contract the enlarged southeast corner of the CTMRG environment, either by specifying the coordinates, environments and network, or by directly providing the tensors.
out
| |
-- A -- E_east
| |
in-- E_south -- C_southeastPEPSKit.enlarge_southwest_corner — Method
enlarge_southwest_corner(E_south, C_southwest, E_west, A)
Contract the enlarged southwest corner of the CTMRG environment, either by specifying the coordinates, environments and network, or by directly providing the tensors.
in
| |
E_west -- A --
| |
C_southwest -- E_south --outPEPSKit.fix_gauge_corner — Method
fix_gauge_corner(corner, σ_out, σ_in)
Multiply corner tensor with incoming and outgoing gauge signs.
corner -- σ_in --in
|
σ_out
|
outPEPSKit.fix_gauge_east_edge — Method
fix_gauge_east_edge(, env, signs)
Apply fix_gauge_edge to the east edge with appropriate row and column indices.
PEPSKit.fix_gauge_east_left_vecs — Method
fix_gauge_east_left_vecs(, U, signs)
Multiply east left singular vectors with gauge signs from the right.
PEPSKit.fix_gauge_east_right_vecs — Method
fix_gauge_east_right_vecs(, V, signs)
Multiply east right singular vectors with gauge signs from the left.
PEPSKit.fix_gauge_edge — Method
fix_gauge_edge(edge, σ_out, σ_in)
Multiply edge tensor with incoming and outgoing gauge signs.
out-- σ_out -- edge -- σ_in --in
|PEPSKit.fix_gauge_north_edge — Method
fix_gauge_north_edge(, env, signs)
Apply fix_gauge_edge to the north edge with appropriate row and column indices.
PEPSKit.fix_gauge_north_left_vecs — Method
fix_gauge_north_left_vecs(, U, signs)
Multiply north left singular vectors with gauge signs from the right.
PEPSKit.fix_gauge_north_right_vecs — Method
fix_gauge_north_right_vecs(, V, signs)
Multiply north right singular vectors with gauge signs from the left.
PEPSKit.fix_gauge_northeast_corner — Method
fix_gauge_northeast_corner(, env, signs)
Apply fix_gauge_corner to the northeast corner with appropriate row and column indices.
PEPSKit.fix_gauge_northwest_corner — Method
fix_gauge_northwest_corner(, env, signs)
Apply fix_gauge_corner to the northwest corner with appropriate row and column indices.
PEPSKit.fix_gauge_south_edge — Method
fix_gauge_south_edge(, env, signs)
Apply fix_gauge_edge to the south edge with appropriate row and column indices.
PEPSKit.fix_gauge_south_left_vecs — Method
fix_gauge_south_left_vecs(, U, signs)
Multiply south left singular vectors with gauge signs from the right.
PEPSKit.fix_gauge_south_right_vecs — Method
fix_gauge_south_right_vecs(, V, signs)
Multiply south right singular vectors with gauge signs from the left.
PEPSKit.fix_gauge_southeast_corner — Method
fix_gauge_southeast_corner(, env, signs)
Apply fix_gauge_corner to the southeast corner with appropriate row and column indices.
PEPSKit.fix_gauge_southwest_corner — Method
fix_gauge_southwest_corner(, env, signs)
Apply fix_gauge_corner to the southwest corner with appropriate row and column indices.
PEPSKit.fix_gauge_west_edge — Method
fix_gauge_west_edge(, env, signs)
Apply fix_gauge_edge to the west edge with appropriate row and column indices.
PEPSKit.fix_gauge_west_left_vecs — Method
fix_gauge_west_left_vecs(, U, signs)
Multiply west left singular vectors with gauge signs from the right.
PEPSKit.fix_gauge_west_right_vecs — Method
fix_gauge_west_right_vecs(, V, signs)
Multiply west right singular vectors with gauge signs from the left.
PEPSKit.fix_global_phases — Method
fix_global_phases(envfix, envprev)
Fix global multiplicative phase of the environment tensors. To that end, the dot products between all corners and all edges are computed to obtain the global phase which is then divided out.
PEPSKit.fixedpoint — Method
fixedpoint(operator, peps₀::InfinitePEPS, env₀; kwargs...) -> peps_final, env_final, cost_final, info
# expert version:
fixedpoint(operator, peps₀::InfinitePEPS, env₀, alg::PEPSOptimize; finalize!=OptimKit._finalize!)Find the fixed point of operator (i.e. the ground state) starting from peps₀ according to the supplied optimization parameters. The initial environment env₀ serves as an initial guess for the first boundary contraction run. By default, a random initial environment is used.
The optimization parameters can be supplied via the keyword arguments or directly as a PEPSOptimize struct. The following keyword arguments are supported:
Keyword arguments
General settings
tol::Real=0.0001: Overall tolerance for gradient norm convergence of the optimizer. Sets related tolerance such as the boundary and boundary-gradient tolerances to sensible defaults unless they are explictly specified.verbosity::Int=1: Overall output information verbosity level, should be one of the following:- Suppress all output
- Only print warnings
- Initialization and convergence info
- Iteration info
- Debug info including AD outputs
reuse_env::Bool=true: Iftrue, the current optimization step is initialized on the previous environment, otherwise a random environment is used.symmetrization::Union{Nothing,SymmetrizationStyle}=nothing: Acceptsnothingor aSymmetrizationStyle, in which case the PEPS and PEPS gradient are symmetrized after each optimization iteration.hasconverged=OptimKit.DefaultHasConverged(optimizer_alg.gradtol): Function specifying the convergence criterion with signaturebool = hasconverged(state, cost, grad, gradnorm), see OptimKit.optimize for specifics. Note that this overrides the default convergence criterion.shouldstop=OptimKit.DefaultShouldStop(optimizer_alg.maxiter): Function specifying the stopping criterion with signaturebool = shouldstop(state, cost, grad, numfg, iter, timespent), see OptimKit.optimize for specifics. Note that this overrides the default stopping criterion.(finalize!)=OptimKit._finalize!: Inserts afinalize!function call after each optimization step by utilizing thefinalize!kwarg ofOptimKit.optimize. The function maps(state, env), f, g = finalize!((state, env), cost, grad, numiter).
Boundary algorithm
Supply boundary algorithm parameters via boundary_alg using either a NamedTuple of keyword arguments or a boundary algorithm instance directly. See leading_boundary for a description of all possible keyword arguments. By default, a CTMRG tolerance of tol=1e-4tol and is used.
Gradient algorithm
Supply gradient algorithm parameters via gradient_alg::Union{NamedTuple,Nothing,<:GradientAlgorithm} using either a NamedTuple of keyword arguments, nothing, or a GradientAlgorithm struct directly. Pass nothing to fully differentiate the CTMRG run, meaning that all iterations will be taken into account, instead of differentiating the fixed point. The supported NamedTuple keyword arguments are:
tol::Real=1e-2tol: Convergence tolerance for the fixed-point gradient iteration.maxiter::Int=30: Maximal number of gradient problem iterations.verbosity::Int: Gradient output verbosity, ≤0 by default to disable too verbose printing. Should only be >0 for debug purposes.alg::Symbol=:FixedPointGradient: Implicit gradient algorithm variant, can be one of the following::FixedPointGradient: Compute the gradient via fixed-point differentiation, seeFixedPointGradient
solver_alg::Union{Algorithm,NamedTuple}: Solver algorithm for computing the implicit gradient; seeFixedPointGradientfor supported algorithms.
Optimizer settings
Supply the optimizer algorithm via optimizer_alg::Union{NamedTuple,<:OptimKit.OptimizationAlgorithm} using either a NamedTuple of keyword arguments or a OptimKit.OptimizationAlgorithm directly. By default, OptimKit.LBFGS is used in combination with a HagerZhangLineSearch. The supported keyword arguments are:
alg::Symbol=:LBFGS: Optimizer algorithm, can be one of the following::GradientDescent: Gradient descent algorithm, see the OptimKit README:ConjugateGradient: Conjugate gradient algorithm, see the OptimKit README:LBFGS: L-BFGS algorithm, see the OptimKit README
tol::Real=tol: Gradient norm tolerance of the optimizer.maxiter::Int=100: Maximal number of optimization steps.verbosity::Int=3: Optimizer output verbosity.ls_maxiter::Int=10: Maximal number of linesearch iterations.ls_maxfg::Int=20: Maximal number of function-gradient evaluations during linesearch.lbfgs_memory::Int=20: Size of limited memory representation of BFGS Hessian matrix.
Return values
The function returns the final PEPS, CTMRG environment and cost value, as well as an information NamedTuple which contains the following entries:
last_gradient: Last gradient of the cost function.fg_evaluations: Number of evaluations of the cost and gradient function.costs: History of cost values.gradnorms: History of gradient norms.contraction_metrics: History of boundary-algorithm-specific contraction information, e.g. truncation errors and condition numbers.gradnorms_unitcell: History of gradient norms for each respective unit cell entry.times: History of optimization step execution times.
PEPSKit.fixedpoint_gradient — Function
fixedpoint_gradient(x̆, ∂ₓf, ∂ₚf, y₀, alg)Evaluates the VJP action $x̆ ∂ₚx$ for an intermediate variable $x \equiv x(p)$ which satisfies the fixed-point equation $x = f(x, p)$, given the VJP actions $∂ₓf$ and $∂ₚf$ of the iterating function $f$.
More specifically, given a cost function $E(x(p), p)$ defined in terms of a set of variational parameters $p$ and a set of intermediate variables $x$ that depend on $p$, $x \equiv x(p)$, the gradient of the cost function is given by
\[dE/dp = ∂ₓE ∂ₚx + ∂ₚE.\]
Given the fixed-point equation $x = f(x, p)$, the VJP action of the Jacobian $∂ₚx$on the adjointx̆ = ∂ₓE` in the first term of this expression can be evaluated through implicit differentiation of the fixed-point condition as
\[x̆ ∂ₚx = x̆ (1 - ∂ₓf)⁻¹ ∂ₚf = ∑ₙ x̆ (∂ₓf)ⁿ ∂ₚf.\]
This can be used to differentiate contraction routines, where $p$ are the variational parameters of a tensor network, $x̆ = ∂ₓE$ is the partial derivative of the cost function with respect to the contraction environment $x$, and $f$ is a single iteration of the contraction algorithm.
PEPSKit.fixgauge_benv — Method
Use QR decomposition to fix gauge of the half bond environment Z. The reduced bond tensors a, b and Z are arranged as
┌---------------┐
| |
└---Z---a---b---┘
| ↓ ↓
↓Reference:
- Physical Review B 90, 064425 (2014)
- Physical Review B 92, 035142 (2015)
PEPSKit.full_infinite_environment — Method
full_infinite_environment(quadrant1, quadrant2, quadrant3, quadrant4)
full_infinite_environment(half1, half2)
full_infinite_environment(C_1, C_2, C_3, C_4, E_1, E_2, E_3, E_4, E_5, E_6, E_7, E_8, A_1, A_2, A_3, A_4)
full_infinite_environment(C_1, C_2, E_1, E_2, E_3, E_4, x, A_1, A_2, A_3, A_4)
full_infinite_environment(x, C_1, C_2, E_1, E_2, E_3, E_4, A_1, A_2, A_3, A_4)Contract four quadrants (enlarged corners) to form a full-infinite environment.
|~~~~~~~~~| -- |~~~~~~~~~|
|quadrant1| |quadrant2|
|~~~~~~~~~| -- |~~~~~~~~~|
| | | |
out | |
| |
in | |
| | | |
|~~~~~~~~~| -- |~~~~~~~~~|
|quadrant4| |quadrant3|
|~~~~~~~~~| -- |~~~~~~~~~|In the same manner two halfs can be used to contract the full-infinite environment.
|~~~~~~~~~~~~~~~~~~~~~~~~|
| half1 |
|~~~~~~~~~~~~~~~~~~~~~~~~|
| | | |
out | |
| |
in | |
| | | |
|~~~~~~~~~~~~~~~~~~~~~~~~|
| half2 |
|~~~~~~~~~~~~~~~~~~~~~~~~|The environment can also be contracted directly from all its constituent tensors.
C_1 -- E_2 -- E_3 -- C_2
| | | |
E_1 -- A_1 -- A_2 -- E_4
| | | |
out | |
| |
in | | |
| | | |
E_8 -- A_4 -- A_3 -- E_5
| | | |
C_4 -- E_7 -- E_6 -- C_3Alternatively, contract the environment with a vector x acting on it
C_1 -- E_2 -- E_3 -- C_2
| | | |
E_1 -- A_1 -- A_2 -- E_4
| | | |
out | |
| |
[~~~~x~~~] | |
| | | |
E_8 -- A_4 -- A_3 -- E_5
| | | |
C_4 -- E_7 -- E_6 -- C_3or contract the adjoint environment with x, e.g. as needed for iterative solvers.
PEPSKit.fullenv_truncate — Method
fullenv_truncate(b0, benv::BondEnv, alg::FullEnvTruncation) -> U, S, V, infoPerform full environment truncation algorithm from Phys. Rev. B 98, 085155 (2018) on benv.
Given a fixed state |b0⟩ with bond matrix b0 and the corresponding positive-definite bond environment benv, find the state |b⟩ with truncated bond matrix b = u s v† that maximizes the fidelity (not normalized by ⟨b0|b0⟩)
F(b) = ⟨b|b0⟩⟨b0|b⟩ / ⟨b|b⟩
┌----------------------┐ ┌-----------------------┐
| ┌----┐ | | ┌----┐ |
└---| |---- b0 -----┘ └---| |- u ← s ← v† -┘
|benv| |benv|
┌---| |-u† → s → v -┐ ┌---| |----- b0† ----┐
| └----┘ | | └----┘ |
└----------------------┘ └-----------------------┘
= ───────────────────────────────────────────────────────
┌-----------------------┐
| ┌----┐ |
└---| |- u ← s ← v† -┘
|benv|
┌---| |- u† → s → v -┐
| └----┘ |
└-----------------------┘The singular value spectrum s is truncated to desired dimension, and normalized such that the maximum is 1. Note that benv is contracted to b0 using @tensor, instead of acting on b0 as a linear map.
The algorithm iteratively optimizes the vectors l, r
--- l -←- = --- u ← s -←- , -←- r --- = -←- s ← v† ---Optimization of r
Define the vector p and the positive map B as
┌---------------┐ ┌-----------------------┐
| ┌---┐ | | ┌----┐ |
└---| |-← --┘ └---| |- u ← ---┘
| p†| = |benv|
┌---| |-------┐ ┌---| |----- b0† ----┐
| └---┘ | | └----┘ |
└---------------┘ └-----------------------┘
┌---------------┐ ┌-----------------------┐
| ┌---┐ | | ┌----┐ |
└---| |-← --┘ └---| |- u ← ---┘
| B | = |benv|
┌---| |-→ --┐ ┌---| |- u†→ ---┐
| └---┘ | | └----┘ |
└---------------┘ └-----------------------┘Then (each index corresponds to a pair of fused indices)
F(r,r†) = |p† r|² / (r† B r)
= (r† p) (p† r) / (r† B r)which is maximized when
∂F/∂r̄ * (r† B r)²
= p (p† r) (r† B r) - |p† r|² (B r) = 0Note that B is positive (consequently B† = B). Then the solution for the vector r is
r = B⁻¹ pWe can verify that (using B† = B)
∂F/∂r̄ * (r† B r)²
= p (p† B⁻¹ p) (p† B⁻¹ B B⁻¹ p) - |p† B⁻¹ p|² (B B⁻¹ p)
= 0Then the bond matrix u s v† is updated by truncated SVD:
- u ← r - ==> - u ← s ← v† -Optimization of l
The process is entirely similar. Define the vector p and the positive map B as
┌---------------┐ ┌-----------------------┐
| ┌---┐ | | ┌----┐ |
└---| |- ←-o-┘ └---| |-- ←-o- v† -┘
| p†| = |benv|
┌---| |-------┐ ┌---| |----- b0† ----┐
| └---┘ | | └----┘ |
└---------------┘ └-----------------------┘
┌---------------┐ ┌-----------------------┐
| ┌---┐ | | ┌----┐ |
└---| |- ←-o-┘ └---| |-- ←-o- v†-┘
| B | = |benv|
┌---| |- →-o-┐ ┌---| |-- →-o- v -┐
| └---┘ | | └----┘ |
└---------------┘ └-----------------------┘Here o is the parity tensor (twist) necessary for fermions. Then (each index corresponds to a pair of fused indices)
F(l,l†) = |p† l|² / (l† B l)which is maximized when
l = B⁻¹ pThen the bond matrix u s v† is updated by SVD:
- l ← v† - ==> - u ← s ← v† -Return values
Returns the SVD result of the new bond matrix U, S, V, as well as an information NamedTuple containing the following fields:
fid: Last fidelity.Δfid: Last fidelity difference.Δs: Last singular value difference.
PEPSKit.fuse_physicalspaces — Method
fuse_physicalspaces(O)
Fuse the physical indices of a PEPO tensor, obtaining a PEPS tensor.
PEPSKit.gate_to_mpo — Method
Convert an N-site gate (N ≥ 2) to MPO by SVD, in which the axes are ordered as
site 1 mid sites site N
2 3 3
↓ ↓ ↓
g1 ←- 3 1 ←- g ←- 4 1 ←- gN
↓ ↓ ↓
1 2 2PEPSKit.gauge_fix — Method
gauge_fix(psi::Union{InfinitePEPS, InfinitePEPO}, alg::BPGauge, env::BPEnv)Fix the gauge of psi (which can be an InfinitePEPS, or an InfinitePEPO interpreted as purified state with two physical legs) using fixed point environment env of belief propagation.
PEPSKit.gauge_fix — Method
gauge_fix(psi::Union{InfinitePEPS, InfinitePEPO}, alg::SUGauge)Fix the gauge of psi using trivial simple update.
PEPSKit.gauge_fix — Method
gauge_fix(envfinal, envprev, alg)
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.
PEPSKit.half_infinite_environment — Method
half_infinite_environment(quadrant1, quadrant2)
half_infinite_environment(C_1, C_2, E_1, E_2, E_3, E_4, A_1, A_2)
half_infinite_environment(C_1, C_2, E_1, E_2, E_3, E_4, x, A_1, A_2)
half_infinite_environment(x, C_1, C_2, E_1, E_2, E_3, E_4, A_1, A_2)Contract two quadrants (enlarged corners) to form a half-infinite environment.
|~~~~~~~~~| -- |~~~~~~~~~|
|quadrant1| |quadrant2|
|~~~~~~~~~| -- |~~~~~~~~~|
| | | |
out inThe environment can also be contracted directly from all its constituent tensors.
C_1 -- E_2 -- E_3 -- C_2
| | | |
E_1 -- A_1 -- A_2 -- E_4
| | | |
out inAlternatively, contract the environment with a vector x acting on it
C_1 -- E_2 -- E_3 -- C_2
| | | |
E_1 -- A_1 -- A_2 -- E_4
| | | |
out [~~~x~~~~]or contract the adjoint environment with x, e.g. as needed for iterative solvers.
PEPSKit.hook_pullback — Method
hook_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.
PEPSKit.initialize_ctmrg_environment — Function
initialize_ctmrg_environment([elt::Type{<:Number},] n::InfiniteSquareNetwork, alg::RandomInitialization, [env0])Initialize a CTMRGEnv by applying a single untruncated iteration of SimultaneousCTMRG to a given initial environment. By default, the starting environment is chosen as a random product state.
PEPSKit.initialize_ctmrg_environment — Method
initialize_ctmrg_environment([elt::Type{<:Number},] n::InfiniteSquareNetwork, alg::RandomInitialization, [env0])Initialize a CTMRGEnv corresponding to a product state acting as an identity between the virtual spaces of a two-layer network, for example
╱
┌-----ket-----
| ╱ |
| |
| | ╱
└-----bra-----
╱ PEPSKit.initialize_ctmrg_environment — Method
initialize_ctmrg_environment([elt::Type{<:Number},] n::InfiniteSquareNetwork, alg::RandomInitialization)Initialize a CTMRGEnv corresponding to a product state with trivial virtual spaces and corners. The product state edge tensors are initialized as alg.f(elt, V::ProductSpace).
PEPSKit.initialize_ctmrg_environment — Method
initialize_ctmrg_environment([elt::Type{<:Number},] n::InfiniteSquareNetwork, alg::RandomInitialization, virtual_spaces...)Initialize a fully random CTMRGEnv using the given environment virtual spaces. See CTMRGEnv for details on the expected format of the virtual spaces.
PEPSKit.initialize_mps — Method
initialize_mps(
f=randn,
T=scalartype(O),
O::Union{InfiniteTransferPEPS,InfiniteTransferPEPO},
virtualspaces::AbstractArray{<:ElementarySpace,1}
)
initialize_mps(
f=randn,
T=scalartype(O),
O::Union{MultilineTransferPEPS,MultilineTransferPEPO},
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.
PEPSKit.initialize_random_c4v_env — Method
initialize_random_c4v_env([f=randn, T=scalartype(state)], state, Venv::ElementarySpace)Initialize a C₄ᵥ-symmetric CTMRGEnv on virtual spaces Venv with random entries created by f and scalartype T.
PEPSKit.initialize_singlet_c4v_env — Method
initialize_singlet_c4v_env([T=scalartype(state)], state::InfinitePEPS, Venv::ElementarySpace)Initialize a C₄ᵥ-symmetric CTMRGEnv with a singlet corner of dimension dim(Venv) and an identity edge from id(T, Venv ⊗ Vpeps).
PEPSKit.inner_prod — Method
Calculate the 2-site ALS inner product ⟨a₁,b₁|a₂,b₂⟩
┌benv-------┐
├---a₂--b₂--┤
| ↓ ↓ |
├---ā₁--b̄₁--┤
└-----------┘where |bra⟩ = |a₁,b₁⟩ and |ket⟩ = |a₂,b₂⟩, with virtual leg between a, b contracted.
PEPSKit.inner_prod — Method
inner_prod(benv, b1, b2)
Given the bond environment benv, calculate the inner product between two states specified by the bond matrices b1, b2
┌--------------------┐
| ┌----┐ |
└---| |---- b2 ---┘
⟨b1|b2⟩ = |benv|
┌---| |---- b1†---┐
| └----┘ |
└--------------------┘PEPSKit.j1_j2_model — Method
j1_j2_model([elt::Type{T}, symm::Type{S},] lattice::InfiniteSquare;
J1=1.0, J2=1.0, spin=1//2, sublattice=true)Square lattice $J_1\text{-}J_2$ model, defined by the Hamiltonian
\[H = J_1 \sum_{\langle i,j \rangle} \vec{S}_i \cdot \vec{S}_j + J_2 \sum_{\langle\langle i,j \rangle\rangle} \vec{S}_i \cdot \vec{S}_j,\]
where $\vec{S}_i = (S_i^x, S_i^y, S_i^z)$. We denote the nearest and next-nearest neighbor terms using $\langle i,j \rangle$ and $\langle\langle i,j \rangle\rangle$, respectively. The sublattice kwarg enables a single-site unit cell ground state via a unitary sublattice rotation.
PEPSKit.left_orth_twolayer — Method
Calculate the left_orth of 2-layer PEPO tensor with the east virtual legs transferred to the R tensor
↓ ╱
----A2-←- ┌-←-
╱ | |
↓ = (Q)-←--R
| ╱ |
----A1-←- └-←-
╱ ↓Only R is calculated and returned.
PEPSKit.left_projector — Method
left_projector(
E_1,
C_1,
E_2,
E_3,
C_2,
E_4,
V,
isqS,
A_1,
A_2
)
Contract the CTMRG left projector with the higher-dimensional subspace facing to the left.
C_1 -- E_2 -- E_3 -- C_2
| | | |
E_1 -- A_1 -- A_2 -- E_4
| | | |
out [~~~V'~]
|
isqS
|
inPEPSKit.left_projector — Method
left_projector(E_1, C, E_2, V, isqS, A)
Contract the CTMRG left projector with the higher-dimensional subspace facing to the left.
C -- E_2 -- |~~|
| | |V'| -- isqS --in
E_1 -- A -- |~~|
| |
outPEPSKit.lq_through — Method
Perform LQ decomposition through a GenericMPSTensor
╱ ╱
-←-L0-←-Q-←- <= -←-M-←-L1-←-
╱ | ╱ |PEPSKit.nearest_neighbour_hamiltonian — Method
nearest_neighbour_hamiltonian(lattice::Matrix{S}, h::AbstractTensorMap{T,S,2,2}) where {S,T}Create a nearest neighbor LocalOperator by specifying the 2-site interaction term h which acts both in horizontal and vertical direction.
PEPSKit.network_value — Method
network_value(network::InfiniteSquareNetwork, env::CTMRGEnv)Return the value (per unit cell) of a given contractible network contracted using a given CTMRG environment.
PEPSKit.norm_preserving_retract — Method
norm_preserving_retract(A, η, α)
Performs a norm-preserving retraction of vector A along the direction η with step size α, giving a new vector A´,
\[A' ← \cos ( α ‖η‖ / ‖A‖ ) A + \sin ( α ‖η‖ / ‖A‖ ) ‖A‖ η / ‖η‖,\]
and corresponding directional derivative ξ,
\[ξ = \cos ( α ‖η‖ / ‖A‖ ) η - \sin ( α ‖η‖ / ‖A‖ ) ‖η‖ A / ‖A‖,\]
such that $⟨ A', ξ ⟩ = 0$ and $‖A'‖ = ‖A‖$.
The vectors A and η should satisfy the interface specified by VectorInterface.jl
PEPSKit.norm_preserving_transport! — Method
norm_preserving_transport!(ξ, A, η, α, A´)
Transports a direction ξ at A to a valid direction at A´ corresponding to the norm-preserving retraction of A along η with step size α. In particular, starting from a direction η of the form
\[ξ = ⟨ η / ‖η‖, ξ ⟩ η / ‖η‖ + Δξ\]
where $⟨ Δξ, A ⟩ = ⟨ Δξ, η ⟩ = 0$, it returns
\[ξ(α) = ⟨ η / ‖η‖, ξ ⟩ ( \cos ( α ‖η‖ / ‖A‖ ) η / ‖η‖ - \sin ( α ‖η‖ / ‖A‖ ) A / ‖A‖ ) + Δξ\]
such that $‖ξ(α)‖ = ‖ξ‖, ⟨ A', ξ(α) ⟩ = 0$.
The vectors A and η should satisfy the interface specified by VectorInterface.jl
PEPSKit.peps_normalize — Method
peps_normalize(A::InfinitePEPS)Normalize the individual tensors in the unit cell of an InfinitePEPS such that they each have unit Euclidean norm.
PEPSKit.peps_retract — Method
peps_retract(x, η, α)
Performs a norm-preserving retraction of an infinite PEPS A = x[1] along η with step size α, giving a new PEPS A´,
\[A' ← \cos ( α ‖η‖ / ‖A‖ ) A + \sin ( α ‖η‖ / ‖A‖ ) ‖A‖ η / ‖η‖,\]
and corresponding directional derivative ξ,
\[ξ = \cos ( α ‖η‖ / ‖A‖ ) η - \sin ( α ‖η‖ / ‖A‖ ) ‖η‖ A / ‖A‖,\]
such that $⟨ A', ξ ⟩ = 0$ and $‖A'‖ = ‖A‖$.
PEPSKit.peps_transport! — Method
peps_transport!(ξ, x, η, α, x´)
Transports a direction at A = x[1] to a valid direction at A´ = x´[1] corresponding to the norm-preserving retraction of A along η with step size α. In particular, starting from a direction η of the form
\[ξ = ⟨ η / ‖η‖, ξ ⟩ η / ‖η‖ + Δξ\]
where $⟨ Δξ, A ⟩ = ⟨ Δξ, η ⟩ = 0$, it returns
\[ξ(α) = ⟨ η / ‖η‖, ξ ⟩ ( \cos ( α ‖η‖ / ‖A‖ ) η / ‖η‖ - \sin( α ‖η‖ / ‖A‖ ) A / ‖A‖ ) + Δξ\]
such that $‖ξ(α)‖ = ‖ξ‖, ⟨ A', ξ(α) ⟩ = 0$.
PEPSKit.periodic_getindex — Method
periodic_getindex(A, data, I::Tuple)Periodic indexing of A[I...] backed by data. For I::Vararg{Int}, this yields data[mod1.(I, size(data))...]. Mixed index arguments (Int / CartesianIndex) are supported by flattening with Base.to_indices.
PEPSKit.periodic_setindex! — Method
periodic_setindex!(A, data, v, I::Tuple)Periodic indexing assignment A[I...] = v backed by data, returning v so that the syntax A[I...] = v evaluates to v in line with Base Julia conventions. For I::Vararg{Int}, this yields data[mod1.(I, size(data))...] = v. Mixed index arguments (Int / CartesianIndex) are supported by flattening with Base.to_indices.
PEPSKit.positive_approx — Method
Find positive approximant Z† Z of a norm tensor benv (returns the "half environment" Z)
┌-----------------┐ ┌---------------┐
| ┌----┐ | | |
└-| |-- 3 4 --┘ └-- Z -- 3 4 --┘
|benv| = ↓
┌-| |-- 1 2 --┐ ┌-- Z†-- 1 2 --┐
| └----┘ | | |
└-----------------┘ └---------------┘PEPSKit.product_peps — Method
product_peps(peps_args...; unitcell=(1, 1), noise_amp=1e-2, state_vector=nothing)Initialize a normalized random product PEPS with noise. The given arguments are passed on to the InfinitePEPS constructor.
The noise intensity can be tuned with noise_amp. The product state coefficients can be specified using the state_vector kwarg in the form of a matrix of size unitcell containing vectors that match the PEPS physical dimensions. If nothing is provided, random Gaussian coefficients are used.
PEPSKit.pwave_superconductor — Method
pwave_superconductor([T=ComplexF64,] lattice::InfiniteSquare; t=1, μ=2, Δ=1)Square lattice $p$-wave superconductor model, defined by the Hamiltonian
\[ H = -\sum_{\langle i,j \rangle} \left( t c_i^\dagger c_j + \Delta c_i c_j + \text{h.c.} \right) - \mu \sum_i n_i,\]
where $t$ is the hopping amplitude, $\Delta$ specifies the superconducting gap, $\mu$ is the chemical potential, and $n_i = c_i^\dagger c_i$ is the fermionic number operator.
PEPSKit.qr_through — Method
Perform QR decomposition through a GenericMPSTensor
╱ ╱
-←-R0-←-M-←- => ---Q-←-R1-←-
╱ | ╱ |PEPSKit.random_dual! — Method
Randomly take the dual of ElementarySpaces in Vs with propability p
PEPSKit.reduced_densitymatrix — Function
Construct the reduced density matrix ρ of PEPS or PEPO (representing PEPS with ancilla legs) ket, bra with open indices inds using the environment env. Alternatively, construct the reduced density matrix ρ of a mixed state specified by the density matrix PEPO state with open indices inds using the environment env.
This works by generating the appropriate contraction on a rectangular patch with its corners specified by inds. The result is normalized such that tr(ρ) = 1.
PEPSKit.renormalize_corner — Method
renormalize_corner(quadrant, P_left, P_right)
Apply projectors to each side of a quadrant.
|~~~~~~~~| -- |~~~~~~|
|quadrant| |P_left| --in
|~~~~~~~~| -- |~~~~~~|
| |
[P_right]
|
outPEPSKit.renormalize_east_edge — Method
renormalize_east_edge((row, col), env, P_left, P_right, network::InfiniteSquareNetwork{P})
renormalize_east_edge(E_east, P_left, P_right, A::P)Absorb a local effective tensor into the east edge using the given projectors and environment tensors.
out
|
[~P_right~]
| |
-- A -- E_east
| |
[~~P_left~]
|
inPEPSKit.renormalize_north_edge — Method
renormalize_north_edge((row, col), env, P_left, P_right, network::InfiniteSquareNetwork{P})
renormalize_north_edge(E_north, P_left, P_right, A::P)Absorb a local effective tensor A into the north edge using the given projectors and environment tensors.
|~~~~~~~| -- E_north -- |~~~~~~|
out-- |P_right| | |P_left| --in
|~~~~~~~| -- A -- |~~~~~~|
|PEPSKit.renormalize_northeast_corner — Method
renormalize_northeast_corner((row, col), enlarged_env, P_left, P_right)
renormalize_northeast_corner(quadrant, P_left, P_right)
renormalize_northeast_corner(E_north, C_northeast, E_east, P_left, P_right, A)Apply renormalize_corner to the enlarged northeast corner.
|~~~~~~~| -- |~~~~~~~~|
out-- |P_right| |quadrant|
|~~~~~~~| -- |~~~~~~~~|
| |
[P_left]
|
inAlternatively, provide the constituent tensors and perform the complete contraction.
|~~~~~~~| -- E_north -- C_northeast
out-- |P_right| | |
|~~~~~~~| -- A -- E_east
| |
[~~~~~P_left~~~~~]
|
inPEPSKit.renormalize_northwest_corner — Method
renormalize_northwest_corner((row, col), enlarged_env, P_left, P_right)
renormalize_northwest_corner(quadrant, P_left, P_right)
renormalize_northwest_corner(E_west, C_northwest, E_north, P_left, P_right, A)Apply renormalize_corner to the enlarged northwest corner.
|~~~~~~~~| -- |~~~~~~|
|quadrant| |P_left| --in
|~~~~~~~~| -- |~~~~~~|
| |
[P_right]
|
outAlternatively, provide the constituent tensors and perform the complete contraction.
C_northwest -- E_north -- |~~~~~~|
| | |P_left| --in
E_west -- A -- |~~~~~~|
| |
[~~~~~P_right~~~~]
|
outPEPSKit.renormalize_northwest_corner — Method
renormalize_northwest_corner((row, col), env, projectors)
renormalize_northwest_corner(C_northwest, E_north, P_right)Apply right projector to northwest corner and north edge.
C --- E --in
| |
[P_right]
|
outPEPSKit.renormalize_sequentially — Method
renormalize_sequentially(col::Int, projectors, network, env)Renormalize one column of the CTMRG environment.
PEPSKit.renormalize_simultaneously — Method
renormalize_simultaneously(
enlarged_corners,
projectors,
network,
env
)
Renormalize all enlarged corners and edges simultaneously.
PEPSKit.renormalize_south_edge — Method
renormalize_south_edge((row, col), env, P_left, P_right, network::InfiniteSquareNetwork{P})
renormalize_south_edge(E_south, P_left, P_right, A::P)Absorb a local effective tensor into the south edge using the given projectors and environment tensors.
|
|~~~~~~| -- A -- |~~~~~~~|
in-- |P_left| | |P_right| --out
|~~~~~~| -- E_south -- |~~~~~~~|PEPSKit.renormalize_southeast_corner — Method
renormalize_southeast_corner((row, col), enlarged_env, P_left, P_right)
renormalize_southeast_corner(quadrant, P_left, P_right)
renormalize_southeast_corner(E_east, C_southeast, E_south, P_left, P_right, A)Apply renormalize_corner to the enlarged southeast corner.
out
|
[P_right]
| |
|~~~~~~| -- |~~~~~~~~|
in-- |P_left| |quadrant|
|~~~~~~| -- |~~~~~~~~|Alternatively, provide the constituent tensors and perform the complete contraction.
out
|
[~~~~P_right~~~~]
| |
|~~~~~~| -- A -- E_east
in-- |P_left| | |
|~~~~~~| -- E_south -- C_southeastPEPSKit.renormalize_southwest_corner — Method
renormalize_southwest_corner((row, col), enlarged_env, P_left, P_right)
renormalize_southwest_corner(quadrant, P_left, P_right)
renormalize_southwest_corner(E_south, C_southwest, E_west, P_left, P_right, A)Apply renormalize_corner to the enlarged southwest corner.
in
|
[P_left]
| |
|~~~~~~~~| -- |~~~~~~~|
|quadrant| |P_right| --out
|~~~~~~~~| -- |~~~~~~~|Alternatively, provide the constituent tensors and perform the complete contraction.
in
|
[~~~~~P_left~~~~~]
| |
E_west -- A -- |~~~~~~~|
| | |P_right| --out
C_southwest -- E_south -- |~~~~~~~|PEPSKit.renormalize_southwest_corner — Method
renormalize_southwest_corner((r, c), env, projectors)
renormalize_southwest_corner(C_southwest, E_south, P_left)Apply left projector to southwest corner and south edge.
in
|
[P_left]
| |
C -- E --outPEPSKit.renormalize_west_edge — Method
renormalize_west_edge((row, col), env, P_left, P_right, network::InfiniteSquareNetwork{P})
renormalize_west_edge(E_west, P_left, P_right, A::P)Absorb a local effective tensor into the west edge using the given projectors and environment tensors.
in
|
[~~P_left~]
| |
E_west -- A --
| |
[~P_right~]
|
outPEPSKit.right_orth_twolayer — Method
Calculate the right_orth of 2-layer PEPO tensor with the west virtual legs transferred to the L tensor
↓ ╱
--←-A2--- -←-┐
╱ | |
↓ = L--←-(Q)
| ╱ |
--←-A1--- -←-┘
╱ ↓ Only L is calculated and returned.
PEPSKit.right_projector — Method
right_projector(
E_1,
C_1,
E_2,
E_3,
C_2,
E_4,
U,
isqS,
A_1,
A_2
)
Contract the CTMRG left projector with the higher-dimensional subspace facing to the left.
C_1 -- E_2 -- E_3 -- C_2
| | | |
E_1 -- A_1 -- A_2 -- E_4
| | | |
[~~~U'~] in
|
isqS
|
outPEPSKit.right_projector — Method
right_projector(E_1, C, E_2, U, isqS, A)
Contract the CTMRG right projector with the higher-dimensional subspace facing to the right.
|~~| -- E_1 -- C
out-- isqS -- |U'| | |
|~~| -- A -- E_2
| |
inPEPSKit.rotate_north — Method
rotate_north(t, dir)
Rotate the dir direction of t to face north by successive applications of rotl90.
PEPSKit.sdiag_pow — Method
sdiag_pow(s, pow::Real; tol::Real=eps(real(scalartype(s)))^(3 / 4))Compute s^pow for a diagonal matrix s.
PEPSKit.select_algorithm — Function
select_algorithm(func_or_alg, args...; kwargs...) -> AlgorithmParse arguments and keyword arguments to the algorithm struct corresponding to func_or_alg and return an algorithm instance. To that end, we use a general interface where all keyword arguments that can be algorithm themselves can be specified using
alg::Algorithm: an instance of the algorithm struct or(; alg::Symbol, alg_kwargs...): aNamedTuplewhere the algorithm is specified by aSymboland the algorithm keyword arguments
A full description of the keyword argument can be found in the respective function or algorithm struct docstrings.
PEPSKit.sequential_projectors — Method
sequential_projectors(col::Int, network, env::CTMRGEnv, alg::ProjectorAlgorithm)
sequential_projectors(coordinate::NTuple{3,Int}, network::InfiniteSquareNetwork, env::CTMRGEnv, alg::ProjectorAlgorithm)Compute CTMRG projectors in the :SequentialCTMRG scheme either for an entire column col or for a specific coordinate (where dir=WEST is already implied in the :SequentialCTMRG scheme).
PEPSKit.setcorner! — Method
setcorner!(env::CTMRGEnv, value, dir, i, j) -> valueStore value as the corner tensor of env at direction dir and unit-cell coordinates (i, j), with periodic wrapping on (i, j). Returns value.
PEPSKit.setedge! — Method
setedge!(env::CTMRGEnv, value, dir, i, j) -> valueStore value as the edge tensor of env at direction dir and unit-cell coordinates (i, j), with periodic wrapping on (i, j). Returns value.
PEPSKit.simultaneous_projectors — Method
simultaneous_projectors(enlarged_corners::Array{E,3}, env::CTMRGEnv, alg::ProjectorAlgorithm)
simultaneous_projectors(coordinate, enlarged_corners::Array{E,3}, alg::ProjectorAlgorithm)Compute CTMRG projectors in the :SimultaneousCTMRG scheme either for all provided enlarged corners or on a specific coordinate.
PEPSKit.str — Method
str(t)Fermionic supertrace by using @tensor.
PEPSKit.su_iter — Method
One iteration of simple update
PEPSKit.symmetrize! — Method
symmetrize!(peps::InfinitePEPS, ::SymmetrizationStyle)Symmetrize a PEPS using the given SymmetrizationStyle in-place.
PEPSKit.symmetrize_retract_and_finalize! — Function
symmetrize_retract_and_finalize!(symm::SymmetrizationStyle, [retract, finalize!])Return the retract and finalize! function for symmetrizing the peps and grad tensors.
PEPSKit.trace_physicalspaces — Method
trace_physicalspaces(O)
Trace out the physical indices of a PEPO tensor, obtaining a partition function tensor.
PEPSKit.trmul — Method
trmul(H, ρ)Compute tr(H * ρ) without forming H * ρ.
PEPSKit.trotterize — Method
Trotterize the evolution operator exp(-H * dt). Currently, H can only contain the following terms:
- 1-site terms
- 2-site nearest neighbor (NN) terms
- 2-site next-nearest neighbor (NNN) terms
Keyword arguments
symmetrize_gates::Bool: if true, use second-order Trotter decomposition.force_mpo::Bool: if true, 2-site nearest-neighbor gates are also decomposed to MPOs.
PEPSKit.twistdual! — Method
twistdual(t::AbstractTensorMap, i)
twistdual!(t::AbstractTensorMap, i)Twist the i-th leg of a tensor t if it represents a dual space.
PEPSKit.twistnondual! — Method
twistnondual(t::AbstractTensorMap, i)
twistnondual!(t::AbstractTensorMap, i)Twist the i-th leg of a tensor t if it represents a non-dual space.
PEPSKit.undo_bond_tensor_first — Method
Undo the decomposition in bond_tensor_first.
PEPSKit.undo_bond_tensor_last — Method
Undo the decomposition in bond_tensor_last.
PEPSKit.update_message — Method
Update the BP message in env.messages[I].
PEPSKit.virtual_projector — Method
Find the local projector P1, P2 for the following truncation of two layers of InfinitePEPO
↓ ╱ ↓ ╱
----A2-←-|╲ ╱|--←-B2---
╱ | | ╲ ╱ | ╱ |
↓ |P1├-←-┤P2| ↓
| ╱ | ╱ ╲ | | ╱
----A1-←-|╱ ╲|--←-B1---
╱ ↓ ╱ ↓Reference: Physical Review B 100, 035449 (2019)
PEPSKit.weight_to_absorb — Method
Pick out the weight to be absorbed to the axth domain of the tensor at position [row, col], and take its square root (or inverse square root if inv = true).
PEPSKit.@autoopt — Macro
autoopt(ex)Preprocessor macro for @tensor which automatically inserts costs for all symbols that start with a pattern. In particular, all labels that start with d, D, or χ are automatically inserted with the corresponding costs.
PEPSKit.@fwdthreads — Macro
@fwdthreads(ex)Apply Threads.@threads only in the forward pass of the program.
It works by wrapping the for-loop expression in an if statement where in the forward pass the loop in computed in parallel using Threads.@threads, whereas in the backwards pass the Threads.@threads is omitted in order to make the expression differentiable.
PEPSKit.@showtypeofgrad — Macro
@showtypeofgrad(x)Macro utility to show to type of the gradient that is about to accumulate for x.
See also Zygote.@showgrad.
PEPSKit.Defaults — Module
module DefaultsModule containing default algorithm parameter values and arguments.
CTMRG
ctmrg_tol=1.0e-8: Tolerance checking singular value and norm convergence.ctmrg_maxiter=100: Maximal number of CTMRG iterations per run.ctmrg_miniter=4: Minimal number of CTMRG carried out.ctmrg_alg=:SimultaneousCTMRG: Default CTMRG algorithm variant.:SimultaneousCTMRG: Simultaneous expansion and renormalization of all sides.:SequentialCTMRG: Sequential application of left moves and rotations.
ctmrg_verbosity=2: CTMRG output information verbosity
SVD forward & reverse
trunc=:FixedSpaceTruncation: Truncation scheme for SVDs and other decompositions.:FixedSpaceTruncation: Keep virtual spaces fixed during projection:notrunc: No singular values are truncated and the performed SVDs are exact:truncerror: Additionally supply error thresholdη; truncate to the maximal virtual dimension ofη:truncrank: Additionally supply truncation dimensionη; truncate such that the 2-norm of the truncated values is smaller thanη:truncspace: Additionally supply truncation spaceη; truncate according to the supplied vector space:trunctol: Additionally supply singular value cutoffη; truncate such that every retained singular value is larger thanη
rrule_degeneracy_atol=1.0e-13: Broadening amplitude which smoothens the divergent term in the retained contributions of an SVD or eigh pullback, in case of (pseudo) degenerate singular valuessvd_fwd_alg=:DefaultAlgorithm: SVD algorithm that is used in the forward pass.:DefaultAlgorithm: MatrixAlgebraKit's default SVD algorithm for a given matrix type.:DivideAndConquer: MatrixAlgebraKit'sDivideAndConquer:QRIteration: MatrixAlgebraKit'sQRIteration:Bisection: MatrixAlgebraKit'sBisection:Jacobi: MatrixAlgebraKit'sJacobi:SVDViaPolar: MatrixAlgebraKit'sSVDViaPolar:SafeDivideAndConquer: MatrixAlgebraKit'sSafeDivideAndConquer:GKL: Iterative Krylov-based SVD only computing the specifed number of singular values and vectors, seeIterSVDfor details.
svd_rrule_tol=1.0e-8: Accuracy of SVD reverse-rule.svd_rrule_min_krylovdim=48: Minimal Krylov dimension of the reverse-rule algorithm (if it is a Krylov algorithm).svd_rrule_verbosity=-1: SVD gradient output verbosity.svd_rrule_alg=:FullPullback: Reverse-rule algorithm for the SVD gradient.:FullPullback: MatrixAlgebraKit'ssvd_pullback!that requires access to the full spectrum:TruncPullback: MatrixAlgebraKit'ssvd_trunc_pullback!solving a Sylvester equation on the truncated subspace:GMRES: GMRES iterative linear solver, seeKrylovKit.GMRES:BiCGStab: BiCGStab iterative linear solver, seeKrylovKit.BiCGStab:Arnoldi: Arnoldi Krylov algorithm, see theKrylovKit.Arnoldi
eigh forward & reverse
eigh_fwd_alg=:DefaultAlgorithm:eighalgorithm that is used in the forward pass.:DefaultAlgorithm: MatrixAlgebraKit's default Eigh algorithm for a given matrix type.:DivideAndConquer: MatrixAlgebraKit'sDivideAndConquer:QRIteration: MatrixAlgebraKit'sQRIteration:Bisection: MatrixAlgebraKit'sBisection:Jacobi: MatrixAlgebraKit'sJacobi:RobustRepresentations: MatrixAlgebraKit'sRobustRepresentations:Lanczos: Lanczos algorithm for symmetric/Hermitian matrices, seeKrylovKit.Lanczos:BlockLanczos: Block version of:Lanczosfor repeated extremal eigenvalues, seeKrylovKit.BlockLanczos
eigh_rrule_alg=:FullPullback: Reverse-rule algorithm for theeighgradient.:FullPullback: MatrixAlgebraKit'seigh_pullback!that requires access to the full spectrum:TruncPullback: MatrixAlgebraKit'seigh_trunc_pullback!solving a Sylvester equation on the truncated subspace
eigh_rrule_verbosity=0: eigh gradient output verbosity.
Projectors
projector_alg=:HalfInfiniteProjector: Default variant of the CTMRG projector algorithm.:HalfInfiniteProjector: Projection via SVDs of half-infinite (two enlarged corners) CTMRG environments.:FullInfiniteProjector: Projection via SVDs of full-infinite (all four enlarged corners) CTMRG environments.
projector_verbosity=0: Projector output information verbosity.projector_alg_c4v=:C4vEighProjector: Default variant of the C4v CTMRG projector algorithm.:C4vEighProjector: Projection via truncated Eigh of an enlarged corner.:C4vQRProjector: Projection via QR decomposition of a column-enlarged corner.
Fixed-point gradient
gradient_alg=:FixedPointGradient: Algorithm variant for computing the implicit gradient of the contraction routine.gradient_tol=1.0e-6: Convergence tolerance for the gradient algorithm.gradient_maxiter=30: Maximal number of iterations for the gradient computation.gradient_verbosity=-1: Gradient output information verbosity.gradient_fixedpoint_solver_alg=:Arnoldi: Default solver algorithm for theFixedPointGradientgradient algorithm.:GMRES: GMRES iterative linear solver, seeKrylovKit.GMRESfor details:BiCGStab: BiCGStab iterative linear solver, seeKrylovKit.BiCGStabfor details:Arnoldi: Arnoldi Krylov algorithm, seeKrylovKit.Arnoldifor details:GeomSum: Geometric sum approximation of the Neumann series of the inverse Jacobian, seePEPSKit.GeomSumfor details:ManualIter: Manual fixed-point iteration, seePEPSKit.ManualIterfor details
gradient_fixedpoint_solver_eager=true: Enables:Arnoldisolver algorithm to finish before the full Krylov dimension is reached.
Optimization
reuse_env=true: Iftrue, the current optimization step is initialized on the previous environment, otherwise a random environment is used.optimizer_tol=0.0001: Gradient norm tolerance of the optimizer.optimizer_maxiter=100: Maximal number of optimization steps.optimizer_verbosity=3: Optimizer output information verbosity.optimizer_alg=:LBFGS: DefaultOptimKit.OptimizerAlgorithmfor PEPS optimization.:GradientDescent: Gradient descent algorithm, see the OptimKit README:ConjugateGradient: Conjugate gradient algorithm, see the OptimKit README:LBFGS: L-BFGS algorithm, see the OptimKit README
ls_maxiter=10: Maximum number of iterations for the line search in each step of the optimization.ls_maxfg=20: Maximum number of function evaluations for the line search in each step of the optimization.lbfgs_memory=20: Size of limited memory representation of BFGS Hessian matrix.
OhMyThreads scheduler
scheduler=Ref{Scheduler}(...): Multithreading scheduler which can be accessed viaset_scheduler!.
PEPSKit.Defaults.set_scheduler! — Function
set_scheduler!([scheduler]; kwargs...)Set OhMyThreads multithreading scheduler parameters.
The function either accepts a scheduler as an OhMyThreads.Scheduler or as a symbol where the corresponding parameters are specificed as keyword arguments. For instance, a static scheduler that uses four tasks with chunking enabled can be set via
set_scheduler!(StaticScheduler(; ntasks=4, chunking=true))or equivalently with
set_scheduler!(:static; ntasks=4, chunking=true)For a detailed description of all schedulers and their keyword arguments consult the OhMyThreads documentation.
If no scheduler is passed and only kwargs are provided, the DynamicScheduler constructor is used with the provided kwargs.
To reset the scheduler to its default value, one calls set_scheduler! without passing arguments which then uses the default DynamicScheduler(). If the number of used threads is just one it falls back to SerialScheduler().