Library
PEPSKit.ALSTruncation — Type
struct ALSTruncationAlgorithm 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-15: ALS converges when fidelity change between two iterations is smaller thantol.check_interval::Int=0: Set number of iterations to print information. Output is suppressed whencheck_interval <= 0.
PEPSKit.CTMRGAlgorithm — Type
abstract type CTMRGAlgorithmAbstract super type for the corner transfer matrix renormalization group (CTMRG) algorithm for contracting infinite PEPS.
sourcePEPSKit.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(wts::SUWeight, peps::InfinitePEPS)Construct a CTMRG environment with bond dimension χ = 1 for an InfinitePEPS peps from the accompanying SUWeight wts. The scalartype of the returned environment is always Float64.
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.
sourcePEPSKit.EigSolver — Type
struct EigSolver{F} <: PEPSKit.GradMode{F}Gradient mode wrapper around KrylovKit.KrylovAlgorithm for solving the gradient linear problem as an eigenvalue problem.
Fields
solver_alg::KrylovKit.KrylovAlgorithm
Constructors
EigSolver(; kwargs...)Construct the EigSolver algorithm struct based on the following keyword arguments:
tol::Real=1.0e-6: Convergence tolerance of the eigen solver.maxiter::Int=30: Maximal number of solver iterations.verbosity::Int=-1: Output information verbosity of the linear solver.iterscheme::Symbol=:fixed: Style of CTMRG iteration which is being differentiated, which can be::fixed: the differentiated CTMRG iteration uses a pre-computed SVD with a fixed set of gauges:diffgauge: the differentiated iteration consists of a CTMRG iteration and a subsequent gauge-fixing step such that the gauge-fixing procedure is differentiated as well
solver_alg::Union{KrylovKit.KrylovAlgorithm,NamedTuple}=(; alg=:arnoldi: Eigen solver algorithm which, if supplied directly as aKrylovKit.KrylovAlgorithmoverrides the above specifiedtol,maxiterandverbosity. Alternatively, it can be supplied via aNamedTuplewherealgcan be one of the following::arnoldi: Arnoldi Krylov algorithm, seeKrylovKit.Arnoldifor details
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.FixedSVD — Type
struct FixedSVD{Ut, St, Vt, Utf, Stf, Vtf}SVD struct containing a pre-computed decomposition or even multiple ones. Additionally, it can contain the untruncated full decomposition as well. The call to svd_trunc just returns the pre-computed U, S and V. In the reverse pass, the SVD adjoint is computed with these exact U, S, and V and, potentially, the full decompositions if the adjoints needs access to them.
Fields
U::AnyS::AnyV::AnyU_full::AnyS_full::AnyV_full::Any
PEPSKit.FixedSpaceTruncation — Type
struct FixedSpaceTruncation <: MatrixAlgebraKit.TruncationStrategyCTMRG specific truncation strategy for svd_trunc which keeps the bond space on which the SVD is performed fixed. Since different environment directions and unit cell entries might have different spaces, this truncation style is different from TruncationSpace.
PEPSKit.FullEnvTruncation — Type
struct FullEnvTruncationAlgorithm 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-15: FET converges when fidelity change 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
sourcePEPSKit.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_4
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).
sourcePEPSKit.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
svd_alg::SVDAdjointtrunc::Anyverbosity::Int64
Constructors
FullInfiniteProjector(; kwargs...)Construct the full-infinite projector algorithm based on the following keyword arguments:
svd_alg::Union{<:SVDAdjoint,NamedTuple}=SVDAdjoint(): SVD algorithm including the reverse rule. SeeSVDAdjoint.trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:fixedspace): Truncation scheme for the projector computation, which controls the resulting virtual spaces. Here,algcan be one of the following::fixedspace: 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.FullSVDReverseRule — Type
struct FullSVDReverseRuleSVD reverse-rule algorithm which uses a modified version of TensorKit's tsvd! reverse-rule allowing for Lorentzian broadening and output verbosity control.
Fields
broadening::Float64verbosity::Int64
Constructors
FullSVDReverseRule(; kwargs...)Construct a FullSVDReverseRule algorithm struct from the following keyword arguments:
broadening::Float64=1.0e-13: Lorentzian broadening amplitude for smoothing divergent term in SVD derivative in case of (pseudo) degenerate singular values.verbosity::Int=0: Suppresses all output if≤0, prints gauge dependency warnings if1, and always prints gauge dependency if≥2.
PEPSKit.GeomSum — Type
struct GeomSum{F} <: PEPSKit.GradMode{F}Gradient mode for CTMRG using explicit evaluation of the 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
iterscheme::Symbol=:fixed: Style of CTMRG iteration which is being differentiated, which can be::fixed: the differentiated CTMRG iteration uses a pre-computed SVD with a fixed set of gauges:diffgauge: the differentiated iteration consists of a CTMRG iteration and a subsequent gauge-fixing step such that the gauge-fixing procedure is differentiated as well
PEPSKit.GradMode — Method
GradMode(; kwargs...)Keyword argument parser returning the appropriate GradMode 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_2
Constructors
HalfInfiniteEnv(quadrant1::EnlargedCorner, quadrant2::EnlargedCorner)Construct sparse half-infinite environment based on two sparse enlarged corners (quadrants).
sourcePEPSKit.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
svd_alg::SVDAdjointtrunc::Anyverbosity::Int64
Constructors
HalfInfiniteProjector(; kwargs...)Construct the half-infinite projector algorithm based on the following keyword arguments:
svd_alg::Union{<:SVDAdjoint,NamedTuple}=SVDAdjoint(): SVD algorithm including the reverse rule. SeeSVDAdjoint.trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:fixedspace): Truncation strategy for the projector computation, which controls the resulting virtual spaces. Here,algcan be one of the following::fixedspace: 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.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.
sourcePEPSKit.InfinitePEPO — Method
PEPSKit.InfinitePEPO — Method
InfinitePEPO([f=randn, T=ComplexF64,] Pspaces, Nspaces, Espaces)Allow users to pass in arrays of spaces.
sourcePEPSKit.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.
sourcePEPSKit.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.
sourcePEPSKit.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.
sourcePEPSKit.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.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=random_start_vector: Function providing the initial vector for the iterative SVD algorithm.
PEPSKit.LinSolver — Type
struct LinSolver{F} <: PEPSKit.GradMode{F}Gradient mode wrapper around KrylovKit.LinearSolver for solving the gradient linear problem using iterative solvers.
Fields
solver_alg::KrylovKit.LinearSolver
Constructors
LinSolver(; kwargs...)Construct the LinSolver algorithm struct based on the following keyword arguments:
tol::Real=1.0e-6: Convergence tolerance of the linear solver.maxiter::Int=30: Maximal number of solver iterations.verbosity::Int=-1: Output information verbosity of the linear solver.iterscheme::Symbol=:fixed: Style of CTMRG iteration which is being differentiated, which can be::fixed: the differentiated CTMRG iteration uses a pre-computed SVD with a fixed set of gauges:diffgauge: the differentiated iteration consists of a CTMRG iteration and a subsequent gauge-fixing step such that the gauge-fixing procedure is differentiated as well
solver_alg::Union{KrylovKit.LinearSolver,NamedTuple}=(; alg::Symbol=:bicgstab: Linear solver algorithm which, if supplied directly as aKrylovKit.LinearSolveroverrides the above specifiedtol,maxiterandverbosity. Alternatively, it can be supplied via aNamedTuplewherealgcan be one of the following::gmres: GMRES iterative linear solver, seeKrylovKit.GMRESfor details:bicgstab: BiCGStab iterative linear solver, seeKrylovKit.BiCGStabfor details
PEPSKit.LocalOperator — Type
struct LocalOperator{T<:Tuple, 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 tuple of pairs of indices and operators.
Fields
lattice::Matrix{S}: The lattice on which the operator acts.terms::T: The terms of the operator, stored as a tuple of pairs of indices and 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)sourcePEPSKit.ManualIter — Type
struct ManualIter{F} <: PEPSKit.GradMode{F}Gradient mode for CTMRG using manual iteration to solve the linear problem.
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
iterscheme::Symbol=:fixed: Style of CTMRG iteration which is being differentiated, which can be::fixed: the differentiated CTMRG iteration uses a pre-computed SVD with a fixed set of gauges:diffgauge: the differentiated iteration consists of a CTMRG iteration and a subsequent gauge-fixing step such that the gauge-fixing procedure is differentiated as well
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 PsourcePEPSKit.PEPSOptimize — Type
struct PEPSOptimize{G}Algorithm struct for PEPS ground-state optimization using AD. See fixedpoint for details.
Fields
boundary_alg::PEPSKit.CTMRGAlgorithmgradient_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,<:GradMode}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 PsourcePEPSKit.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
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 sourcePEPSKit.ProjectorAlgorithm — Type
PEPSKit.ProjectorAlgorithm — Method
ProjectorAlgorithm(; kwargs...)Keyword argument parser returning the appropriate ProjectorAlgorithm algorithm struct.
PEPSKit.ReflectDepth — Type
struct ReflectDepth <: PEPSKit.SymmetrizationStyleReflection symmmetrization along the horizontal axis, such that north and south are mirrored.
sourcePEPSKit.ReflectWidth — Type
struct ReflectWidth <: PEPSKit.SymmetrizationStyleReflection symmmetrization along the vertical axis, such that east and west are mirrored.
sourcePEPSKit.Rotate — Type
struct Rotate <: PEPSKit.SymmetrizationStyleRotation symmmetrization leaving the object invariant under π/2 rotations.
sourcePEPSKit.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.
sourcePEPSKit.SUState — Type
Internal state of simple update algorithm
sourcePEPSKit.SUWeight — Type
struct SUWeight{E<:PEPSWeight}Schmidt bond weights used in simple/cluster update. Weight elements are always real and non-negative. The domain and codomain of each weight matrix must be an un-dualed ElementarySpace.
For a square lattice InfinitePEPS, the weights are placed as
|
-T[r-1,c]-
|
wt[2,r,c]
| |
--T[r,c]--wt[1,r,c]--T[r,c+1]--
| |Axis order of each weight matrix is
x-weights:
1 ← x ← 2 or 2 → x → 1
y-weights:
2 1
↓ ↑
y or y
↓ ↑
1 2Fields
data::Array{E, 3} where E<:(TensorKit.AbstractTensorMap{T, S, 1, 1} where {T, S})
Constructors
SUWeight(wts_mats::AbstractMatrix{E}...) where {E<:PEPSWeight}sourcePEPSKit.SUWeight — Method
SUWeight(pepo::InfinitePEPO)Create an SUWeight for a given one-layer InfinitePEPO. The weights are initialized as identity matrices of element type Float64.
PEPSKit.SUWeight — Method
SUWeight(peps::InfinitePEPS)Create an SUWeight for a given InfinitePEPS. The weights are initialized as identity matrices of element type Float64.
PEPSKit.SUWeight — Method
SUWeight(Nspaces::M, [Espaces::M]) where {M<:AbstractMatrix{<:Union{Int,ElementarySpace}}}Create an SUWeight by specifying the vertical (north) or horizontal (east) virtual bond spaces. Each individual space can be specified as either an Int or an ElementarySpace. The weights are initialized as identity matrices of element type Float64.
PEPSKit.SUWeight — Method
SUWeight(Nspace::S, Espace::S=Nspace; unitcell::Tuple{Int,Int}=(1, 1)) where {S<:ElementarySpace}Create an SUWeight by specifying its vertical (north) and horizontal (east) as ElementarySpaces) and unit cell size. The weights are initialized as identity matrices of element type Float64.
PEPSKit.SVDAdjoint — Type
struct SVDAdjoint{F, R}Wrapper for a SVD algorithm fwd_alg with a defined reverse rule rrule_alg. If isnothing(rrule_alg), Zygote differentiates the forward call automatically.
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=sdd): SVD algorithm of the forward pass which can either be passed as anAlgorithminstance or aNamedTuplewherealgis one of the following::sdd: MatrixAlgebraKit'sLAPACK_DivideAndConquer:svd: MatrixAlgebraKit'sLAPACK_QRIteration:iterative: Iterative SVD only computing the specifed number of singular values and vectors, seeIterSVD
rrule_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=full): Reverse-rule algorithm for differentiating the SVD. Can be supplied by anAlgorithminstance directly or as aNamedTuplewherealgis one of the following::full: Uses a modified version of TensorKit's reverse-rule fortsvdwhich doesn't solve any linear problem and instead requires access to the full SVD, seeFullSVDReverseRule.:gmres: GMRES iterative linear solver, see the KrylovKit docs for details:bicgstab: BiCGStab iterative linear solver, see the KrylovKit docs for details:arnoldi: Arnoldi Krylov algorithm, see the KrylovKit docs for details
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=:fixedspace)svd_alg::Union{<:SVDAdjoint,NamedTuple}projector_alg::Symbol=:halfinfinite
PEPSKit.SimpleUpdate — Type
struct SimpleUpdate <: 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_3site::Bool: When true, force the usage of 3-site simple updatebipartite::Bool: (Only applicable to InfinitePEPS) 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=:fixedspace)svd_alg::Union{<:SVDAdjoint,NamedTuple}projector_alg::Symbol=:halfinfinite
PEPSKit.TimeEvolution — Type
abstract type TimeEvolutionAbstract super type for time evolution algorithms of InfinitePEPS or InfinitePEPO.
sourcePEPSKit.TimeEvolver — Type
mutable struct TimeEvolver{TE <: TimeEvolution, G, 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 stepsgate::Any: Trotter 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::InfiniteState, H::LocalOperator, dt::Number, nstep::Int,
alg::SimpleUpdate, env0::SUWeight; t0::Number = 0.0
)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.
TensorKit.TensorMap — Method
TensorKit.TensorMap — Method
TensorKit.TensorMap — Method
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₀, 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=:simultaneous: Variant of the CTMRG algorithm. See alsoCTMRGAlgorithm.:simultaneous: Simultaneous expansion and renormalization of all sides.:sequential: Sequential application of left moves and rotations.
Projector algorithm
trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:fixedspace): Truncation strategy for the projector computation, which controls the resulting virtual spaces. Here,algcan be one of the following::fixedspace: 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η
svd_alg::Union{<:SVDAdjoint,NamedTuple}: SVD algorithm for computing projectors. See alsoSVDAdjoint. By default, a reverse-rule tolerance oftol=1e1tolwhere thekrylovdimis adapted to theenv₀environment dimension.projector_alg::Symbol=:halfinfinite: Variant of the projector algorithm. See alsoProjectorAlgorithm.:halfinfinite: Projection via SVDs of half-infinite (two enlarged corners) CTMRG environments.:fullinfinite: Projection via SVDs of full-infinite (all four enlarged corners) CTMRG environments.
Return values
The CTMRG routine returns the final CTMRG environment as well as an information NamedTuple containing the following fields:
truncation_error: Last (maximal) SVD truncation error of the CTMRG projectors.condition_number: Last (maximal) condition number of the enlarged CTMRG environment.
In case the alg is a SimultaneousCTMRG, the last SVD will also be returned:
U: Last unit cell of left singular vectors.S: Last unit cell of singular values.V: Last unit cell of right singular vectors.
If, in addition, the specified SVD algorithm computes the full, untruncated SVD, the full set of vectors and values will be returned as well:
U_full: Last unit cell of all left singular vectors.S_full: Last unit cell of all singular values.V_full: Last unit cell of all right singular vectors.
MPSKit.physicalspace — Method
physicalspace(O::LocalOperator)Return lattice of physical spaces on which the LocalOperator is defined.
MPSKit.time_evolve — Method
time_evolve(
it::TimeEvolver{<:SimpleUpdate};
tol::Float64 = 0.0, check_interval::Int = 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. check_intervalsets the number of iterations between outputs of information.
MPSKit.time_evolve — Method
time_evolve(
psi0::Union{InfinitePEPS, InfinitePEPO}, H::LocalOperator,
dt::Number, nstep::Int, alg::SimpleUpdate, env0::SUWeight;
tol::Float64 = 0.0, t0::Number = 0.0, check_interval::Int = 500
) -> (psi, env, info)Perform time evolution on the initial state psi0 and initial environment env0 with Hamiltonian H, using SimpleUpdate algorithm alg, time step dt for nstep number of steps.
- Setting
tol > 0enables convergence check (for imaginary time evolution of InfinitePEPS only). For other usages it should not be changed. - Use
t0to specify the initial time of the evolution. check_intervalsets the interval to output information. Output during the evolution can be turned off by settingcheck_interval <= 0.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.svd_trunc — Method
svd_trunc(t, alg::SVDAdjoint; trunc=notrunc())
svd_trunc!(t, alg::SVDAdjoint; trunc=notrunc())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.
PEPSKit._apply_gate — Method
_apply_gate(a, b, gate, trunc)
Apply 2-site gate on the reduced matrices a, b
-1← a --- 3 --- b ← -4 -2 -3
↓ ↓ ↓ ↓
1 2 |----gate---|
↓ ↓ or ↓ ↓
|----gate---| 1 2
↓ ↓ ↓ ↓
-2 -3 -1← a --- 3 --- b ← -4sourcePEPSKit._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
↓ ↓ ↓In the cluster, the axes of each tensor use the MPS order
PEPS: PEPO:
3 3 4
╱ | ╱
1 -- M -- 5 1 -- M -- 6
╱ | ╱ |
4 2 5 2
M[1 2 3 4; 5] M[1 2 3 4 5; 6]sourcePEPSKit._cluster_truncate! — Method
Find projectors to truncate internal bonds of the cluster Ms.
PEPSKit._combine_ab — Method
_combine_ab(a, b)
Contract the axis between a and b tensors
-- DX - a - D - b - DY --
↓ ↓
da dbsourcePEPSKit._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_benvXY — Method
When the (half) bond environment Z consists of two PEPSOrth tensors X, Y as
┌---------------┐ ┌-------------------┐
| | = | | ,
└---Z-- --┘ └--Z0---X-- --Y--┘
↓ ↓apply the gauge transformation Linv, Rinv for Z to X, Y:
-1 -1
| |
-4 - X - 1 - Rinv - -2 -4 - Linv - 1 - Y - -2
| |
-3 -3sourcePEPSKit._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 and the pre-calculated R, L bond matrices, find all projectors Pa, Pb and Schmidt weights wts on internal bonds.
PEPSKit._get_dt — Method
Process the Trotter time step dt according to the intended usage.
PEPSKit._get_gatempo_se — Method
Obtain the 3-site gate MPO on the southeast cluster at position [row, col]
r-1 g3
|
↓
r g1 -←- g2
c c+1sourcePEPSKit._get_gatempos_se — Method
Construct the 3-site gate MPOs on the southeast cluster for 3-site simple update on square lattice.
sourcePEPSKit._linearmap_twist! — Method
_linearmap_twist!(t)
Apply a twist to domain or codomain indices that correspond to dual spaces
sourcePEPSKit._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
rev = false: - Pa --←-- Pb -
1 ← s ← 2
rev = true: - Pa --→-- Pb -
2 → s → 1sourcePEPSKit._qr_bond — Method
_qr_bond(A, B; gate_ax)
Use QR decomposition on two tensors A, B connected by a bond to get the reduced tensors. When A, B are PEPSTensors,
2 1 1
| | |
5 -A/B- 3 ====> 4 - X ← 2 1 ← a - 3 1 - b → 3 4 → Y - 2
| ↘ | ↘ ↘ |
4 1 3 2 2 3When A, B are PEPOTensors,
- If
gate_ax = 1
2 3 1 2 1 2
↘ | ↘ | ↘ |
6 -A/B- 4 ====> 5 - X ← 3 1 ← a - 3 1 - b → 3 5 → Y - 3
| ↘ | ↘ ↘ |
5 1 4 2 2 4- If
gate_ax = 2
2 3 2 2 2 2
↘ | | ↘ ↘ |
6 -A/B- 4 ====> 5 - X ← 3 1 ← a - 3 1 - b → 3 5 → Y - 3
| ↘ | ↘ | ↘
5 1 4 1 4 1sourcePEPSKit._qr_bond_undo — Method
_qr_bond_undo(X, a, b, Y)
Reconstruct the tensors connected by a bond from their _qr_bond results. For PEPSTensors,
-2 -2
| |
-5- X - 1 - a - -3 -5 - b - 1 - Y - -3
| ↘ ↘ |
-4 -1 -1 -4For PEPOTensors
-2 -3 -2 -3
↘ | ↘ |
-6- X - 1 - a - -4 -6 - b - 1 - Y - -4
| ↘ ↘ |
-5 -1 -1 -5
-3 -2 -2 -3
| ↘ ↘ |
-6- X - 1 - a - -4 -6 - b - 1 - Y - -4
| ↘ | ↘
-5 -1 -5 -1sourcePEPSKit._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._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_ab — Method
_solve_ab(Rx, Sx, x0)
Solve the equations Rx x = Sx (x = a, b) with initial guess x0
┌---------------------------┐
| ┌----┐ |
└---| |--- 1 -- x -- 2 --┘
| | ↓
| Rx | -3
| |
┌---| |--- -1 -2 --┐
| └----┘ |
└---------------------------┘sourcePEPSKit._su_xbond! — Method
Simple update of the x-bond between [r,c] and [r,c+1].
| |
-- T[r,c] -- T[r,c+1] --
| |When gate_ax = 1 (or 2), the gate will be applied to the codomain (or domain) physicsl legs of state.
PEPSKit._su_ybond! — Method
Simple update of the y-bond between [r,c] and [r-1,c].
|
--T[r-1,c] --
|
-- T[r,c] ---
|When gate_ax = 1 (or 2), the gate will be applied to the codomain (or domain) physicsl legs of state.
PEPSKit._tensor_Ra — Method
_tensor_Ra(benv, b)
Construct the tensor
┌-----------------------------------┐
| ┌----┐ |
└---| |- DX0 Db0 - b -- DY0 -┘
| | ↓
|benv| db
| | ↓
┌---| |- DX1 Db1 - b† - DY1 -┐
| └----┘ |
└-----------------------------------┘sourcePEPSKit._tensor_Rb — Method
_tensor_Rb(benv, a)
Construct the tensor
┌-----------------------------------┐
| ┌----┐ |
└---| |- DX0 - a -- Da0 DY0 -┘
| | ↓
|benv| da
| | ↓
┌---| |- DX1 - a† - Da1 DY1 -┐
| └----┘ |
└-----------------------------------┘sourcePEPSKit._tensor_Sa — Method
_tensor_Sa(benv, b, a2b2)
Construct the tensor
┌-----------------------------------┐
| ┌----┐ |
└---| |- DX0 -- (a2 b2) -- DY0 --┘
| | ↓ ↓
|benv| da db
| | ↓
┌---| |- DX1 Db1 -- b† - DY1 --┐
| └----┘ |
└-----------------------------------┘sourcePEPSKit._tensor_Sb — Method
_tensor_Sb(benv, a, a2b2)
Construct the tensor
┌-----------------------------------┐
| ┌----┐ |
└---| |- DX0 -- (a2 b2) -- DY0 --┘
| | ↓ ↓
|benv| da db
| | ↓
┌---| |- DX1 -- a† - Da1 DY1 --┐
| └----┘ |
└-----------------------------------┘sourcePEPSKit.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) * VsourcePEPSKit.absorb_weight — Method
absorb_weight(t::Union{PEPSTensor, PEPOTensor}, weights::SUWeight, row::Int, col::Int, ax::Int; inv::Bool = false)
absorb_weight(t::Union{PEPSTensor, PEPOTensor}, weights::SUWeight, row::Int, col::Int, ax::NTuple{N, Int}; inv::Bool = false)Absorb or remove environment weight on an axis of tensor t known to be located at position (row, col) in the unit cell of an InfinitePEPS or InfinitePEPO. Weights around the tensor at (row, col) are
|
[2,r,c]
|
- [1,r,c-1] - T[r,c] - [1,r,c] -
|
[1,r+1,c]
|Arguments
t::PT: 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.ax::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)sourcePEPSKit.bond_truncate — Method
bond_truncate(a::AbstractTensorMap{T,S,2,1}, b::AbstractTensorMap{T,S,1,2}, benv::BondEnv{T,S}, 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 is
1 -a/b- 3
↓ a[1 2; 3]
2 b[1; 2 3]sourcePEPSKit.bondenv_fu — Method
Construct the environment (norm) tensor
C1---T1---------T1---C2 r-1
| ‖ ‖ |
T4===XX== ==YY===T2 r
| ‖ ‖ |
C4---T3---------T3---C3 r+1
c-1 c c+1 c+2where XX = X' X and YY = Y' Y (stacked together).
Axis order: [DX1 DY1; DX0 DY0], as in
┌---------------------┐
| ┌----┐ |
└-| |---DX0 DY0---┘
|benv|
┌-| |---DX1 DY1---┐
| └----┘ |
└---------------------┘sourcePEPSKit.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.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.
sourcePEPSKit.compute_projector — Method
compute_projector(enlarged_corners, coordinate, alg::ProjectorAlgorithm)Determine left and right projectors at the bond given determined by the enlarged corners and the given coordinate 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 |
|~~| == |~~~| ==sourcePEPSKit.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, a1b1, a2b2)
Calculate the cost function
f(a,b) = ‖ |a1,b1⟩ - |a2,b2⟩ ‖^2
= ⟨a1,b1|a1,b1⟩ - 2 Re⟨a1,b1|a2,b2⟩ + ⟨a2,b2|a2,b2⟩sourcePEPSKit.ctmrg_iteration — Method
ctmrg_iteration(network, env, alg::CTMRGAlgorithm) -> env′, infoPerform a single CTMRG iteration in which all directions are being grown and renormalized.
sourcePEPSKit.ctmrg_leftmove — Method
ctmrg_leftmove(col::Int, network, env::CTMRGEnv, alg::SequentialCTMRG)Perform sequential CTMRG left move on the col-th column.
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
PEPSKit.edge_transfer_left — Method
PEPSKit.edge_transfer_left — Method
edge_transfer_left(v, O, Et, Eb)Apply an edge transfer matrix to the left.
┌──Et─
│ │
v──O──
│ │
└──qƎ─sourcePEPSKit.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Ǝ─sourcePEPSKit.edge_transfer_right — Method
PEPSKit.edge_transfer_right — Method
transfer_right(v, Et, Eb)Apply an edge transfer matrix to the right.
──Et─┐
│ │
──O──v
│ │
──qƎ─┘sourcePEPSKit.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.
-- E_north -- C_northeast
| |
-- A -- E_east
| |sourcePEPSKit.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 --
| |
E_west -- A --
| |sourcePEPSKit.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.
| |
-- A -- E_east
| |
-- E_south -- C_southeastsourcePEPSKit.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.
| |
E_west -- A --
| |
C_southwest -- E_south --sourcePEPSKit.fidelity — Method
fidelity(benv, b1, b2)
Given the bond environment benv, calculate the fidelity between two states specified by the bond matrices b1, b2
F(b1, b2) = (⟨b1|b2⟩ ⟨b2|b1⟩) / (⟨b1|b1⟩ ⟨b2|b2⟩)sourcePEPSKit.fidelity — Method
fidelity(benv, a1b1, a2b2)
Calculate the fidelity between two evolution steps
|⟨a1,b1|a2,b2⟩|^2
--------------------------
⟨a1,b1|a1,b1⟩⟨a2,b2|a2,b2⟩sourcePEPSKit.fix_gauge_corner — Method
fix_gauge_corner(corner, σ_in, σ_out)
Multiply corner tensor with incoming and outgoing gauge signs.
corner -- σ_out --
|
σ_in
|sourcePEPSKit.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.
sourcePEPSKit.fix_gauge_east_right_vecs — Method
fix_gauge_east_right_vecs(, V, signs)
Multiply east right singular vectors with gauge signs from the left.
sourcePEPSKit.fix_gauge_edge — Method
fix_gauge_edge(edge, σ_in, σ_out)
Multiply edge tensor with incoming and outgoing gauge signs.
-- σ_in -- edge -- σ_out --sourcePEPSKit.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.
sourcePEPSKit.fix_gauge_north_right_vecs — Method
fix_gauge_north_right_vecs(, V, signs)
Multiply north right singular vectors with gauge signs from the left.
sourcePEPSKit.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.
sourcePEPSKit.fix_gauge_south_right_vecs — Method
fix_gauge_south_right_vecs(, V, signs)
Multiply south right singular vectors with gauge signs from the left.
sourcePEPSKit.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.
sourcePEPSKit.fix_gauge_west_right_vecs — Method
fix_gauge_west_right_vecs(, V, signs)
Multiply west right singular vectors with gauge signs from the left.
sourcePEPSKit.fix_global_phases — Method
fix_global_phases(envprev, envfix)
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.
sourcePEPSKit.fixedpoint — Method
fixedpoint(operator, peps₀::InfinitePEPS, env₀::CTMRGEnv; kwargs...) -> peps_final, env_final, cost_final, info
# expert version:
fixedpoint(operator, peps₀::InfinitePEPS, env₀::CTMRGEnv, 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 CTMRG 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.(finalize!)=OptimKit._finalize!: Inserts afinalize!function call after each optimization step by utilizing thefinalize!kwarg ofOptimKit.optimize. The function maps(peps, env), f, g = finalize!((peps, env), f, g, numiter).
Boundary algorithm
Supply boundary algorithm parameters via boundary_alg::Union{NamedTuple,<:CTMRGAlgorithm} using either a NamedTuple of keyword arguments or a CTMRGAlgorithm 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,<:GradMode} using either a NamedTuple of keyword arguments, nothing, or a GradMode 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.alg::Symbol=:eigsolver: Gradient algorithm variant, can be one of the following::geomsum: Compute gradient directly from the geometric sum, seeGeomSum:manualiter: Iterate gradient geometric sum manually, seeManualIter:linsolver: Solve fixed-point gradient linear problem using iterative solver, seeLinSolver:eigsolver: Determine gradient via eigenvalue formulation of its Sylvester equation, seeEigSolver
verbosity::Int: Gradient output verbosity, ≤0 by default to disable too verbose printing. Should only be >0 for debug purposes.iterscheme::Symbol=:fixed: CTMRG iteration scheme determining mode of differentiation. This can be::fixed: the differentiated CTMRG iteration uses a pre-computed SVD with a fixed set of gauges:diffgauge: the differentiated iteration consists of a CTMRG iteration and a subsequent gauge-fixing step such that the gauge-fixing procedure is differentiated as well
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.truncation_errors: History of maximal truncation errors of the boundary algorithm.condition_numbers: History of maximal condition numbers of the CTMRG environments.gradnorms_unitcell: History of gradient norms for each respective unit cell entry.times: History of optimization step execution times.
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.flip_svd — Method
flip_svd(u::AbstractTensorMap, s::DiagonalTensorMap, vh::AbstractTensorMap)Given SVD result u ← s ← vh, flip the arrow between the three tensors to u2 → s2 → vh2 such that
u * s * vh = (@tensor t2[-1, ...; -2, ...] := u2[-1, ...; 2] * s2[1; 2] * vh2[1; -2, ...])The axis orders for s, s2 are
1 ← s ← 2 2 → s2 → 1sourcePEPSKit.fpgrad — Function
fpgrad(∂F∂x, ∂f∂x, ∂f∂A, y0, alg)Compute the gradient of the CTMRG fixed point by solving the following equation:
dx = ∑ₙ (∂f∂x)ⁿ ∂f∂A dA = (1 - ∂f∂x)⁻¹ ∂f∂A dA
where ∂F∂x is the gradient of the cost function with respect to the PEPS tensors, ∂f∂x is the partial gradient of the CTMRG iteration with respect to the environment tensors, ∂f∂A is the partial gradient of the CTMRG iteration with respect to the PEPS tensors, and y0 is the initial guess for the fixed-point iteration. The function returns the gradient dx of the fixed-point iteration.
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|
|~~~~~~~~~| -- |~~~~~~~~~|
| | | |
| |
| | | |
|~~~~~~~~~| -- |~~~~~~~~~|
|quadrant4| |quadrant3|
|~~~~~~~~~| -- |~~~~~~~~~|In the same manner two halfs can be used to contract the full-infinite environment.
|~~~~~~~~~~~~~~~~~~~~~~~~|
| half1 |
|~~~~~~~~~~~~~~~~~~~~~~~~|
| | | |
| |
| | | |
|~~~~~~~~~~~~~~~~~~~~~~~~|
| 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
| | | |
| |
| | | |
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
| | | |
| |
[~~~~x~~~] | |
| | | |
E_8 -- A_4 -- A_3 -- E_5
| | | |
C_4 -- E_7 -- E_6 -- C_3
or contract the adjoint environment with x, e.g. as needed for iterative solvers.
PEPSKit.fullenv_truncate — Method
fullenv_truncate(benv::BondEnv{T,S}, b0::AbstractTensorMap{T,S,1,1}, 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
PEPSKit.gate_to_mpo3 — Method
Convert a 3-site gate to MPO form by SVD, in which the axes are ordered as
2 3 3
↓ ↓ ↓
g1 ←- 3 1 ←- g2 ←- 4 1 ←- g3
↓ ↓ ↓
1 2 2sourcePEPSKit.gauge_fix — Method
gauge_fix(envprev, envfinal)
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.get_3site_se — Method
Obtain the 3-site cluster in the "southeast corner" of a square plaquette.
r-1 M3
|
↓
r M1 -←- M2
c c+1sourcePEPSKit.get_expham — Method
get_expham(H::LocalOperator, dt::Number)Compute exp(-dt * op) for each term op in H, and combine them into a new LocalOperator. Each op in H must be a single TensorMap.
PEPSKit.get_gateterm — Method
get_gateterm(gate::LocalOperator, bond::NTuple{2,CartesianIndex{2}})Get the term of a 2-site gate acting on a certain bond. Input gate should only include one term for each nearest neighbor bond.
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|
|~~~~~~~~~| -- |~~~~~~~~~|
| | | |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
| | | |Alternatively, 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
| | | |
[~~~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_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.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†---┐
| └----┘ |
└--------------------┘sourcePEPSKit.inner_prod — Method
inner_prod(benv, a1b1, a2b2)
Calculate the inner product <a1,b1|a2,b2>
┌--------------------------------┐
| ┌----┐ |
└---| |- DX0 - (a2 b2) - DY0 -┘
| | ↓ ↓
|benv| da db
| | ↓ ↓
┌---| |- DX1 - (a1 b1)†- DY1 -┐
| └----┘ |
└--------------------------------┘sourcePEPSKit.is_equivalent_bond — Method
is_equivalent_bond(bond1::NTuple{2,CartesianIndex{2}}, bond2::NTuple{2,CartesianIndex{2}}, (Nrow, Ncol)::NTuple{2,Int})Check if two 2-site bonds are related by a (periodic) lattice translation.
sourcePEPSKit.is_nearest_neighbour — Method
is_nearest_neighbour(H::LocalOperator)Check if an operator H contains only nearest neighbor terms.
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_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 --
E_1 -- A -- |~~|
| |sourcePEPSKit.lq_through — Method
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.
sourcePEPSKit.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‖$.
sourcePEPSKit.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$.
sourcePEPSKit.positive_approx — Method
Replace bond environment benv by its positive approximant Z† Z (returns the "half environment" Z)
┌-----------------┐ ┌---------------┐
| ┌----┐ | | |
└-| |-- 3 4 --┘ └-- Z -- 3 4 --┘
|benv| = ↓
┌-| |-- 1 2 --┐ ┌-- Z†-- 1 2 --┐
| └----┘ | | |
└-----------------┘ └---------------┘sourcePEPSKit.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.
sourcePEPSKit.qr_through — Method
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_bottom_corner — Method
renormalize_bottom_corner((r, c), env, projectors)
renormalize_bottom_corner(C_southwest, E_south, P_bottom)Apply bottom projector to southwest corner and south edge.
|
[P_bottom]
| |
C -- E -- insourcePEPSKit.renormalize_corner — Method
renormalize_corner(quadrant, P_left, P_right)
Apply projectors to each side of a quadrant.
|~~~~~~~~| -- |~~~~~~|
|quadrant| |P_left| --
|~~~~~~~~| -- |~~~~~~|
| |
[P_right]
|sourcePEPSKit.renormalize_east_edge — Method
renormalize_east_edge((row, col), env, P_top, P_bottom, network::InfiniteSquareNetwork{P})
renormalize_east_edge(E_east, P_top, P_bottom, A::P)Absorb a blocal effective tensor into the east edge using the given projectors and environment tensors.
|
[~~P_top~~~]
| |
-- A -- E_east
| |
[~P_bottom~]
|sourcePEPSKit.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 -- |~~~~~~~|
-- |P_left| | |P_right| --
|~~~~~~| -- A -- |~~~~~~~|
|sourcePEPSKit.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.
|~~~~~~~| -- |~~~~~~~~|
-- |P_right| |quadrant|
|~~~~~~~| -- |~~~~~~~~|
| |
[P_left]
|Alternatively, provide the constituent tensors and perform the complete contraction.
|~~~~~~~| -- E_north -- C_northeast
-- |P_right| | |
|~~~~~~~| -- A -- E_east
| |
[~~~~~P_left~~~~~]
|sourcePEPSKit.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| --
|~~~~~~~~| -- |~~~~~~|
| |
[P_right]
|Alternatively, provide the constituent tensors and perform the complete contraction.
C_northwest -- E_north -- |~~~~~~|
| | |P_left| --
E_west -- A -- |~~~~~~|
| |
[~~~~~P_right~~~~]
|sourcePEPSKit.renormalize_sequentially — Method
renormalize_sequentially(col::Int, projectors, network, env)Renormalize one column of the CTMRG environment.
sourcePEPSKit.renormalize_simultaneously — Method
renormalize_simultaneously(
enlarged_corners,
projectors,
network,
env
)
Renormalize all enlarged corners and edges simultaneously.
sourcePEPSKit.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 -- |~~~~~~|
-- |P_right| | |P_left| --
|~~~~~~~| -- E_south -- |~~~~~~|
|sourcePEPSKit.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.
|
[P_right]
| |
|~~~~~~| -- |~~~~~~~~|
-- |P_left| |quadrant|
|~~~~~~| -- |~~~~~~~~|Alternatively, provide the constituent tensors and perform the complete contraction.
|
[~~~~P_right~~~~]
| |
|~~~~~~| -- A -- E_east
-- |P_left| | |
|~~~~~~| -- E_south -- C_southeastsourcePEPSKit.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.
|
[P_left]
| |
|~~~~~~~~| -- |~~~~~~|
|quadrant| |P_left| --
|~~~~~~~~| -- |~~~~~~|Alternatively, provide the constituent tensors and perform the complete contraction.
|
[~~~~~P_left~~~~~]
| |
E_west -- A -- |~~~~~~~|
| | |P_right| --
C_southwest -- E_south -- |~~~~~~~|sourcePEPSKit.renormalize_top_corner — Method
renormalize_top_corner((row, col), env, projectors)
renormalize_top_corner(C_northwest, E_north, P_top)Apply top projector to northwest corner and north edge.
C -- E --
| |
[~P_top~]
|sourcePEPSKit.renormalize_west_edge — Method
renormalize_west_edge((row, col), env, P_top, P_bottom, network::InfiniteSquareNetwork{P})
renormalize_west_edge(E_west, P_top, P_bottom, A::P)Absorb a local effective tensor into the west edge using the given projectors and environment tensors.
|
[~P_bottom~]
| |
E_west -- A --
| |
[~~P_top~~~]
|sourcePEPSKit.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_2 -- C
-- isqS -- |U'| | |
|~~| -- A -- E_1
| |sourcePEPSKit.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(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.
sourcePEPSKit.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 :sequential scheme either for an entire column col or for a specific coordinate (where dir=WEST is already implied in the :sequential scheme).
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 :simultaneous scheme either for all provided enlarged corners or on a specific coordinate.
PEPSKit.str — Method
PEPSKit.su_iter — Method
One iteration of simple update
sourcePEPSKit.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.
sourcePEPSKit.trmul — Method
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.@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=:simultaneous: Default CTMRG algorithm variant.:simultaneous: Simultaneous expansion and renormalization of all sides.:sequential: Sequential application of left moves and rotations.
ctmrg_verbosity=2: CTMRG output information verbosity
SVD forward & reverse
trunc=:fixedspace: Truncation scheme for SVDs and other decompositions.:fixedspace: 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η
svd_fwd_alg=:sdd: SVD algorithm that is used in the forward pass.:sdd: MatrixAlgebraKit'sLAPACK_DivideAndConquer:svd: MatrixAlgebraKit'sLAPACK_QRIteration:iterative: Iterative SVD only computing the specifed number of singular values and vectors, seeIterSVD
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=:full: Reverse-rule algorithm for the SVD gradient.:full: Uses a modified version of MatrixAlgebraKit's reverse-rule forsvd_compactwhich doesn't solve any linear problem and instead requires access to the full SVD, seePEPSKit.FullSVDReverseRule.:gmres: GMRES iterative linear solver, see the KrylovKit docs for details:bicgstab: BiCGStab iterative linear solver, see the KrylovKit docs for details:arnoldi: Arnoldi Krylov algorithm, see the KrylovKit docs for details
svd_rrule_broadening=1.0e-13: Lorentzian broadening amplitude which smoothens the divergent term in the SVD adjoint in case of (pseudo) degenerate singular values
Projectors
projector_alg=:halfinfinite: Default variant of the CTMRG projector algorithm.:halfinfinite: Projection via SVDs of half-infinite (two enlarged corners) CTMRG environments.:fullinfinite: Projection via SVDs of full-infinite (all four enlarged corners) CTMRG environments.
projector_verbosity=0: Projector output information verbosity.
Fixed-point gradient
gradient_tol=1.0e-6: Convergence tolerance for the fixed-point gradient iteration.gradient_maxiter=30: Maximal number of iterations for computing the CTMRG fixed-point gradient.gradient_verbosity=-1: Gradient output information verbosity.gradient_linsolver=:bicgstab: Default linear solver for theLinSolvergradient algorithm.:gmres: GMRES iterative linear solver, seeKrylovKit.GMRESfor details:bicgstab: BiCGStab iterative linear solver, seeKrylovKit.BiCGStabfor details
gradient_eigsolver=:arnoldi: Default eigensolver for theEigSolvergradient algorithm.:arnoldi: Arnoldi Krylov algorithm, seeKrylovKit.Arnoldifor details
gradient_eigsolver_eager=true: EnablesEigSolveralgorithm to finish before the full Krylov dimension is reached.gradient_iterscheme=:fixed: Scheme for differentiating one CTMRG iteration.:fixed: the differentiated CTMRG iteration uses a pre-computed SVD with a fixed set of gauges:diffgauge: the differentiated iteration consists of a CTMRG iteration and a subsequent gauge-fixing step such that the gauge-fixing procedure is differentiated as well
gradient_alg=:eigsolver: Algorithm variant for computing the gradient fixed-point.
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().