Library

PEPSKit.ALSTruncationType
struct ALSTruncation{T<:MatrixAlgebraKit.TruncationStrategy}

Algorithm struct for the alternating least square (ALS) optimization of a bond.

Fields

  • trunc::MatrixAlgebraKit.TruncationStrategy

  • maxiter::Int64

  • tol::Float64

  • check_interval::Int64

Constructors

ALSTruncation(; kwargs...)

The truncation algorithm can be constructed from the following keyword arguments:

  • trunc::TruncationStrategy: SVD truncation strategy when initilizing the truncated tensors connected by the bond.
  • maxiter::Int=50 : Maximal number of ALS iterations.
  • tol::Float64=1e-9 : ALS converges when the relative change in bond SVD spectrum between two iterations is smaller than tol.
  • check_interval::Int=0 : Set number of iterations to print information. Output is suppressed when check_interval <= 0.
source
PEPSKit.ApplicationInitializationType
struct ApplicationInitialization{F} <: PEPSKit.InitializationStyle

Initialize a contraction environment by applying a single iteration of a contraction algorithm to a given environment.

Constructors

ApplicationInitialization(f = ones)

Contructs an application initialization strategy, where by default the starting environment is initialized using a ProductStateInitialization(f) strategy.

source
PEPSKit.BPEnvType
struct BPEnv{T}

Belief propagation (BP) environment for a square lattice norm network, containing a 4 x rows x cols array of message tensors, defined for each oriented nearest neighbor bond in the network.

The message tensors connect to the network tensors P at site [r,c] in the unit cell as:

                    m[1,r-1,c]
                    |
    m[4,r,c-1]------P[r,c]------m[2,r,c+1]
                    |
                    m[3,r+1,c]
  • [1,r-1,c]: message from P[r-1,c] to P[r,c] (axis order: ket ← bra)
  • [2,r,c+1]: message from P[r,c+1] to P[r,c] (axis order: ket ← bra)
  • [3,r+1,c]: message from P[r+1,c] to P[r,c] (axis order: bra ← ket)
  • [4,r,c-1]: message from P[r,c-1] to P[r,c] (axis order: bra ← ket)

Fields

  • messages::Array{T, 3} where T: 4 x rows x cols array of message tensors, where the first dimension specifies the spatial direction
source
PEPSKit.BPEnvMethod
BPEnv(wts::SUWeight)

Convert fixed point weights wts of trivial simple update to a belief propagation environment.

source
PEPSKit.BPEnvMethod
BPEnv(
    [f=isomorphism, T=ComplexF64], Ds_north::A, Ds_east::A; posdef::Bool = true
) where {A <: AbstractMatrix{<:ProductSpace}}

Construct a BP environment by specifying matrices of north and east virtual spaces of the corresponding InfiniteSquareNetwork. Each matrix entry corresponds to a site in the unit cell.

When posdef is true, all messages will be made semi-positive definite (when interpreted as a bra ← ket TensorMap).

Each entry of the Ds_north and Ds_east matrices corresponds to an effective local space of the network, and can be represented as a ProductSpace (e.g. for the case of a network representing overlaps of PEPSs).

source
PEPSKit.BPEnvMethod
BPEnv(
    [f=isomorphism, T=ComplexF64], D_north::P, D_east::P;
    unitcell::Tuple{Int, Int} = (1, 1), posdef::Bool = true
) where {P <: ProductSpace}

Construct a BP environment by specifying the north and east virtual spaces of the corresponding InfiniteSquareNetwork. The network unit cell can be specified by the unitcell keyword argument.

source
PEPSKit.BPGaugeType
struct BPGauge

Algorithm for gauging PEPS with belief propagation fixed point messages.

source
PEPSKit.BeliefPropagationType
struct BeliefPropagation

Algorithm for computing the belief propagation fixed point messages.

Fields

  • tol::Float64: Stopping criterion for the BP iterations in relative trace norm difference

  • miniter::Int64: Minimal number of BP iterations

  • maxiter::Int64: Maximal number of BP iterations

  • project_hermitian::Bool: Toggle for projecting messages onto the hermitian subspace immediately after update through BP equation

  • bipartite::Bool: When true, preserve bipartite structure of BPEnv inherited from input network

  • verbosity::Int64: Output verbosity level

source
PEPSKit.C4vCTMRGType
struct C4vCTMRG{P<:PEPSKit.ProjectorAlgorithm} <: PEPSKit.CTMRGAlgorithm

CTMRG algorithm assuming a C₄ᵥ-symmetric PEPS, i.e. invariance under 90° spatial rotation and Hermitian reflection. This requires a single-site unit cell. The projector is obtained from eigh decomposing the Hermitian enlarged corner.

Fields

  • tol::Float64

  • maxiter::Int64

  • miniter::Int64

  • verbosity::Int64

  • projector_alg::PEPSKit.ProjectorAlgorithm

Constructors

C4vCTMRG(; kwargs...)

Construct a C₄ᵥ CTMRG algorithm struct based on keyword arguments. For a full description, see leading_boundary. The supported keywords are:

  • tol::Real=1.0e-8
  • maxiter::Int=100
  • miniter::Int=4
  • verbosity::Int=2
  • trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:FixedSpaceTruncation)
  • decomposition_alg::Union{NamedTuple,<:EighAdjoint,<:QRAdjoint}=(;)
  • projector_alg::Symbol=:C4vEighProjector
source
PEPSKit.C4vEighProjectorType
struct C4vEighProjector{S<:EighAdjoint, T} <: PEPSKit.ProjectorAlgorithm

Projector algorithm implementing the eigh decomposition of a Hermitian enlarged corner.

Fields

  • decomposition_alg::EighAdjoint

  • trunc::Any

  • verbosity::Int64

Constructors

C4vEighProjector(; kwargs...)

Construct the C₄ᵥ eigh-based projector algorithm based on the following keyword arguments:

  • decomposition_alg::Union{<:EighAdjoint,NamedTuple}=EighAdjoint() : eigh algorithm including the reverse rule. See EighAdjoint.
  • trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:FixedSpaceTruncation) : Truncation strategy for the projector computation, which controls the resulting virtual spaces. Here, alg can be one of the following:
    • :FixedSpaceTruncation : Keep virtual spaces fixed during projection
    • :notrunc : No singular values are truncated and the performed SVDs are exact
    • :truncerror : Additionally supply error threshold η; truncate to the maximal virtual dimension of η
    • :truncrank : Additionally supply truncation dimension η; truncate such that the 2-norm of the truncated values is smaller than η
    • :truncspace : Additionally supply truncation space η; truncate according to the supplied vector space
    • :trunctol : Additionally supply singular value cutoff η; truncate such that every retained singular value is larger than η
  • verbosity::Int=0 : Projector output verbosity which can be:
    1. Suppress output information
    2. Print singular value degeneracy warnings
source
PEPSKit.C4vQRProjectorType
struct C4vQRProjector{S} <: PEPSKit.ProjectorAlgorithm

Projector algorithm implementing the qr decomposition of a column-enlarged corner.

Fields

  • decomposition_alg::Any

Constructors

C4vQRProjector(; kwargs...)

Construct the C₄ᵥ qr-based projector algorithm based on the following keyword arguments:

  • decomposition_alg=QRAdjoint() : left_orth algorithm including the reverse rule. See QRAdjoint.
source
PEPSKit.CTMRGAlgorithmType
abstract type CTMRGAlgorithm

Abstract super type for the corner transfer matrix renormalization group (CTMRG) algorithm for contracting infinite PEPS.

source
PEPSKit.CTMRGAlgorithmMethod
CTMRGAlgorithm(; kwargs...)

Keyword argument parser returning the appropriate CTMRGAlgorithm algorithm struct.

source
PEPSKit.CTMRGEnvType
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 direction

  • edges::Array{T, 3} where T: 4 x rows x cols array of edge tensors, where the first dimension specifies the spatial direction

source
PEPSKit.CTMRGEnvMethod
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.

source
PEPSKit.CTMRGEnvMethod
CTMRGEnv(bp_env::BPEnv)

Construct a CTMRG environment with bond dimension χ = 1 from the belief propagation environment bp_env.

source
PEPSKit.CTMRGEnvMethod
CTMRGEnv(prod_env::ProductStateEnv)

Construct a CTMRG environment with a trivial virtual space of bond dimension χ = 1 from the product state environment prod_env.

source
PEPSKit.CTMRGEnvMethod
CTMRGEnv(wts::SUWeight)

Construct a CTMRG environment with a trivial environment space (bond dimension χ = 1) from SUWeight wts, which has the same real scalartype as `wts.

source
PEPSKit.CTMRGEnvMethod
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).

source
PEPSKit.CTMRGEnvMethod
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.

source
PEPSKit.ColumnEnlargedCornerType
struct ColumnEnlargedCorner{TC, TE}

Column-enlarged CTMRG corner tensor storage.

Constructors

ColumnEnlargedCorner(env, coordinates)

Construct a column-enlarged corner with the correct row and column indices based on the given coordinates which are of the form (dir, row, col).

    [NORTHWEST,r,c]         [NORTHEAST,r,c]

        c-1    c                 c     c+1
    r   C₁--←--E₁--←--      --←--E₂--←--C₂  r
        ↓      |                 |      ↑

        ↓      |                 |      ↑
    r   C₄--→--E₃--→--      --→--E₃--→--C₃  r
        c-1    c                 c     c+1

    [SOUTHWEST,r,c]         [SOUTHEAST,r,c]
source
PEPSKit.EighAdjointType
struct EighAdjoint{F, R}

Wrapper for a eigenvalue decomposition algorithm fwd_alg with a defined reverse rule rrule_alg.

Fields

  • fwd_alg::Any

  • rrule_alg::Any

Constructors

EighAdjoint(; kwargs...)

Construct a EighAdjoint algorithm struct based on the following keyword arguments:

  • fwd_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=DefaultAlgorithm): Eigh algorithm of the forward pass which can either be passed as an Algorithm instance or a NamedTuple where the algorithm is specified by the alg keyword. The available Eigh algorithms can be divided into two categories:
    • "Dense" Eigh algorithms which compute a truncated Eigh through the truncation of a full MatrixAlgebraKit.eigh_full! decomposition. Available algorithms are:
    • "Sparse" Eigh algorithms which directly compute a truncated Eigh without access to the full decomposition. Available algorithms are:
  • rrule_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=FullPullback): Reverse-rule algorithm for differentiating the eigenvalue decomposition. Can be supplied by an Algorithm instance directly or as a NamedTuple where alg is one of the following:
    • :FullPullback : MatrixAlgebraKit's eigh_pullback! that requires access to the full spectrum
    • :TruncPullback : MatrixAlgebraKit's eigh_trunc_pullback! solving a Sylvester equation on the truncated subspace
Note

Manually specifying a rrule_alg is considered expert-mode usage, and should only be done when full control over the implementation is desired. For all regular use cases, the default reverse rule algorithms, automatically chosen based on the forward algorithm, should be sufficient.

source
PEPSKit.EnlargedCornerType
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).

source
PEPSKit.FixedPointGradientType
struct FixedPointGradient{A} <: PEPSKit.GradientAlgorithm{A}

Gradient algorithm for computing the gradient of a fixed-point problem through implicit fixed-point differentiation.

Fields

  • solver_alg::Any

Constructors

FixedPointGradient(; kwargs...)

Construct a fixed-point gradient algorithm struct based on keyword arguments. The supported keywords are:

  • tol::Real=1.0e-6
  • maxiter::Int=30
  • verbosity::Int=-1
  • solver_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=:Arnoldi): solver algorithm for the FixedPointGradient gradient algorithm.
    • :GMRES : GMRES iterative linear solver, see KrylovKit.GMRES for details
    • :BiCGStab : BiCGStab iterative linear solver, see KrylovKit.BiCGStab for details
    • :Arnoldi : Arnoldi Krylov algorithm, see KrylovKit.Arnoldi for details
    • :GeomSum : Geometric sum approximation of the Neumann series of the inverse Jacobian, see PEPSKit.GeomSum for details
    • :ManualIter : Manual fixed-point iteration, see PEPSKit.ManualIter for details
source
PEPSKit.FixedSpaceTruncationType
struct FixedSpaceTruncation <: MatrixAlgebraKit.TruncationStrategy

SVD truncation strategy which preserves the CTMRGEnv environment virtual spaces, or InfinitePEPS, InfinitePEPO virtual spaces.

source
PEPSKit.FullEnvTruncationType
struct FullEnvTruncation{T<:MatrixAlgebraKit.TruncationStrategy}

Algorithm struct for the full environment truncation (FET).

Fields

  • trunc::MatrixAlgebraKit.TruncationStrategy

  • maxiter::Int64

  • tol::Float64

  • trunc_init::Bool

  • check_interval::Int64

Constructors

FullEnvTruncation(; kwargs...)

The truncation algorithm can be constructed from the following keyword arguments:

  • trunc::TruncationStrategy : SVD truncation strategy when optimizing the new bond matrix.
  • maxiter::Int=50 : Maximal number of FET iterations.
  • tol::Float64=1e-9 : FET converges when the relative change in bond SVD spectrum between two FET iterations is smaller than tol.
  • 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 when check_interval <= 0.

References

source
PEPSKit.FullInfiniteEnvType
struct FullInfiniteEnv{TC, TE, TA}

Full-infinite CTMRG environment tensor storage.

Fields

  • 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

  • A_1r

  • A_2r

  • A_3r

  • A_4r

  • dir

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).

source
PEPSKit.FullInfiniteEnvMethod
(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.

source
PEPSKit.FullInfiniteProjectorType
struct FullInfiniteProjector{S<:SVDAdjoint, T} <: PEPSKit.ProjectorAlgorithm

Projector algorithm implementing projectors from SVDing the full 4x4 CTMRG environment.

Fields

  • decomposition_alg::SVDAdjoint

  • trunc::Any

  • verbosity::Int64

Constructors

FullInfiniteProjector(; kwargs...)

Construct the full-infinite projector algorithm based on the following keyword arguments:

  • decomposition_alg::Union{<:SVDAdjoint,NamedTuple}=SVDAdjoint() : SVD algorithm including the reverse rule. See SVDAdjoint.
  • trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:FixedSpaceTruncation) : Truncation scheme for the projector computation, which controls the resulting virtual spaces. Here, alg can be one of the following:
    • :FixedSpaceTruncation : Keep virtual spaces fixed during projection
    • :notrunc : No singular values are truncated and the performed SVDs are exact
    • :truncerror : Additionally supply error threshold η; truncate to the maximal virtual dimension of η
    • :truncrank : Additionally supply truncation dimension η; truncate such that the 2-norm of the truncated values is smaller than η
    • :truncspace : Additionally supply truncation space η; truncate according to the supplied vector space
    • :trunctol : Additionally supply singular value cutoff η; truncate such that every retained singular value is larger than η
  • verbosity::Int=0 : Projector output verbosity which can be:
    1. Suppress output information
    2. Print singular value degeneracy warnings
source
PEPSKit.FullPullbackType
struct FullPullback

Reverse-rule algorithm which wraps MatrixAlgebraKit's full pullback methods, see eigh_pullback!, svd_pullback!, qr_pullback!.

Fields

  • degeneracy_atol::Real

  • verbosity::Int64

Constructors

FullPullback(; kwargs...)

Construct a FullPullback algorithm struct from the following keyword arguments:

  • degeneracy_atol::Real=1.0e-13 : Absolute tolerance for idendifying degenerate subspaces.
  • verbosity::Int=0 : Suppresses all output if ≤0, prints gauge dependency warnings if 1, and always prints gauge dependency if ≥2.
source
PEPSKit.GeomSumType
struct GeomSum

Algorithm for solving the fixed-point gradient linear problem as a geometric sum.

Fields

  • tol::Real

  • maxiter::Int64

  • verbosity::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:
    1. Suppress output information
    2. Print convergence warnings
    3. Information at each gradient iteration
source
PEPSKit.GradientAlgorithmMethod
GradientAlgorithm(; kwargs...)

Keyword argument parser returning the appropriate GradientAlgorithm algorithm struct.

source
PEPSKit.HalfInfiniteEnvType
struct HalfInfiniteEnv{TC, TE, TA}

Half-infinite CTMRG environment tensor storage.

Fields

  • C_1

  • C_2

  • E_1

  • E_2

  • E_3

  • E_4

  • A_1

  • A_2

  • A_1r

  • A_2r

  • dir

Constructors

HalfInfiniteEnv(quadrant1::EnlargedCorner, quadrant2::EnlargedCorner)

Construct sparse half-infinite environment based on two sparse enlarged corners (quadrants).

source
PEPSKit.HalfInfiniteEnvMethod
(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.

source
PEPSKit.HalfInfiniteProjectorType
struct HalfInfiniteProjector{S<:SVDAdjoint, T} <: PEPSKit.ProjectorAlgorithm

Projector algorithm implementing projectors from SVDing the half-infinite CTMRG environment.

Fields

  • decomposition_alg::SVDAdjoint

  • trunc::Any

  • verbosity::Int64

Constructors

HalfInfiniteProjector(; kwargs...)

Construct the half-infinite projector algorithm based on the following keyword arguments:

  • decomposition_alg::Union{<:SVDAdjoint,NamedTuple}=SVDAdjoint() : SVD algorithm including the reverse rule. See SVDAdjoint.
  • trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:FixedSpaceTruncation) : Truncation strategy for the projector computation, which controls the resulting virtual spaces. Here, alg can be one of the following:
    • :FixedSpaceTruncation : Keep virtual spaces fixed during projection
    • :notrunc : No singular values are truncated and the performed SVDs are exact
    • :truncerror : Additionally supply error threshold η; truncate to the maximal virtual dimension of η
    • :truncrank : Additionally supply truncation dimension η; truncate such that the 2-norm of the truncated values is smaller than η
    • :truncspace : Additionally supply truncation space η; truncate according to the supplied vector space
    • :trunctol : Additionally supply singular value cutoff η; truncate such that every retained singular value is larger than η
  • verbosity::Int=0 : Projector output verbosity which can be:
    1. Suppress output information
    2. Print singular value degeneracy warnings
source
PEPSKit.InfinitePEPOType
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)
source
PEPSKit.InfinitePEPOMethod
InfinitePEPO(A::PEPOTensor; unitcell=(1, 1, 1))

Create an InfinitePEPO by specifying a tensor which is repeated across the unit cell.

source
PEPSKit.InfinitePEPOMethod
InfinitePEPO([f=randn, T=ComplexF64,] Pspaces, Nspaces, Espaces)

Allow users to pass in arrays of spaces.

source
PEPSKit.InfinitePEPOMethod
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.

source
PEPSKit.InfinitePEPSType
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)
source
PEPSKit.InfinitePEPSMethod
InfinitePEPS(A::AbstractMatrix{T})

Create an InfinitePEPS by specifying a matrix containing the PEPS tensors at each site in the unit cell.

source
PEPSKit.InfinitePEPSMethod
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.

source
PEPSKit.InfinitePEPSMethod
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.

source
PEPSKit.InfinitePEPSMethod
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.

source
PEPSKit.InfinitePartitionFunctionType
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)
source
PEPSKit.InfinitePartitionFunctionMethod
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.

source
PEPSKit.InfinitePartitionFunctionMethod
InfinitePartitionFunction(A::AbstractMatrix{T})

Create an InfinitePartitionFunction by specifying a matrix containing the PEPS tensors at each site in the unit cell.

source
PEPSKit.InfinitePartitionFunctionMethod
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.

source
PEPSKit.InfinitePartitionFunctionMethod
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.

source
PEPSKit.InfiniteSquareType
struct InfiniteSquare <: MPSKitModels.AbstractLattice{2}

Infinite square lattice with a unit cell of size (Nrows, Ncols).

Fields

  • Nrows::Int64

  • Ncols::Int64

Constructor

InfiniteSquare([Nrows=1, Ncols=1])

By default, an infinite square with a (1, 1)-unitcell is constructed.

source
PEPSKit.InfiniteTransferPEPOType
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.

source
PEPSKit.InfiniteTransferPEPOMethod
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.

source
PEPSKit.InfiniteTransferPEPSType
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.

source
PEPSKit.InfiniteTransferPEPSMethod
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.

source
PEPSKit.IterEighType
struct IterEigh

Iterative eigenvalue solver based on KrylovKit's eigsolve, adapted to (symmetric) tensors. The number of targeted eigenvalues is set via the truncspace in ProjectorAlg. In particular, this makes it possible to specify the targeted eigenvalues block-wise. In case the symmetry block is too small as compared to the number of singular values, or the iterative decomposition didn't converge, the algorithm falls back to a dense eigh/eigh.

Fields

  • alg::Any

  • fallback_threshold::Float64

  • start_vector::Any

Constructors

IterEigh(; kwargs...)

Construct an IterEigh algorithm struct based on the following keyword arguments:

  • alg=KrylovKit.Lanczos(; tol=1e-14, krylovdim=25) : KrylovKit algorithm struct for iterative eigenvalue decomposition.
  • fallback_threshold::Float64=Inf : Threshold for howmany / minimum(size(block)) above which (if the block is too small) the algorithm falls back to a dense decomposition.
  • start_vector=deterministic_start_vector : Function providing the initial vector for the iterative algorithm.
source
PEPSKit.IterSVDType
struct IterSVD

Iterative 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.GKL

  • fallback_threshold::Float64

  • start_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 for howmany / minimum(size(block)) above which (if the block is too small) the algorithm falls back to TensorKit's dense SVD.
  • start_vector=deterministic_start_vector : Function providing the initial vector for the iterative SVD algorithm.
source
PEPSKit.LocalCircuitType
struct LocalCircuit{O, S}

Circuit consisting of local gates and MPOs.

Fields

  • lattice::Matrix: lattice of physical spaces on which the gates act

  • gates::Array{Pair{Vector{CartesianIndex{2}}, O}, 1} where O: list of sites => gate pairs that make up the circuit. sites is not required to be sorted.

source
PEPSKit.LocalOperatorType
struct LocalOperator{O, S}

A sum of local operators acting on a lattice. The lattice is stored as a matrix of vector spaces, and the terms are stored as a Dict of indices mapping to operators.

Fields

  • lattice::Matrix: lattice of physical spaces on which the gates act

  • terms::Dict{Vector{CartesianIndex{2}}}: list of sites => term pairs that make up the operator

  • lattice::Matrix{S}: The lattice on which the operator acts.
  • terms::Dict{Vector{CartesianIndex{2}}, O}: The terms of the operator, mapping coordinates to operators

Constructors

LocalOperator(lattice::Matrix{S}, terms::Pair...)
LocalOperator{T, S}(lattice::Matrix{S}, terms::T) where {T,S}

Examples

lattice = fill(ℂ^2, 1, 1) # single-site unitcell
O1 = LocalOperator(lattice, [(1, 1),] => σx, [(1, 1), (1, 2)] => σx ⊗ σx, [(1, 1), (2, 1)] => σx ⊗ σx)
source
PEPSKit.LocalTruncationType
struct LocalTruncation

Algorithm to truncate virtual bonds of a two-layer network with projectors that minimizes the local cost function, which is the 2-norm of (e.g. for two layers of iPEPO)

        ↓ ╱      ↓ ╱            ↓ ╱                 ↓ ╱
    ----A2---←---B2---      ----A2-←-|╲       ╱|--←-B2---
      ╱ |      ╱ |            ╱ |    | ╲     ╱ |  ╱ |
        ↓        ↓       -      ↓    |P1├-←-┤P2|    ↓
        | ╱      | ╱            | ╱  | ╱     ╲ |    | ╱
    ----A1---←---B1---      ----A1-←-|╱       ╲|--←-B1---
      ╱ ↓      ╱ ↓            ╱ ↓                 ╱ ↓

on each bond of the network.

source
PEPSKit.ManualIterType
struct ManualIter

Algorithm for solving the fixed-point gradient linear problem using manual iteration.

Fields

  • tol::Real

  • maxiter::Int64

  • verbosity::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 consecutive dx contributions.
  • maxiter::Int=30 : Maximal number of gradient iterations.
  • verbosity::Int=-1 : Output information verbosity that can be one of the following:
    1. Suppress output information
    2. Print convergence warnings
    3. Information at each gradient iteration
source
PEPSKit.MultilineTransferPEPOType
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.

source
PEPSKit.MultilineTransferPEPOMethod
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.

source
PEPSKit.MultilineTransferPEPSType
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.

source
PEPSKit.MultilineTransferPEPSMethod
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.

source
PEPSKit.PEPOTensorType
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  P
source
PEPSKit.PEPSOptimizeType
struct PEPSOptimize{B, G}

Algorithm struct for PEPS ground-state optimization using AD. See fixedpoint for details.

Fields

  • boundary_alg::Any

  • gradient_alg::Any

  • optimizer_alg::OptimKit.OptimizationAlgorithm

  • reuse_env::Bool

  • symmetrization::Union{Nothing, PEPSKit.SymmetrizationStyle}

Constructors

PEPSOptimize(; kwargs...)

Construct a PEPS optimization algorithm struct based on keyword arguments. For a full description, see fixedpoint. The supported keywords are:

  • boundary_alg::Union{NamedTuple,<:CTMRGAlgorithm,...}
  • gradient_alg::Union{NamedTuple,Nothing,<:GradientAlgorithm}
  • optimizer_alg::Union{NamedTuple,<:OptimKit.OptimizationAlgorithm}
  • reuse_env::Bool=true
  • symmetrization::Union{Nothing,SymmetrizationStyle}=nothing
source
PEPSKit.PEPSTensorType
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  P
source
PEPSKit.PEPSTensorMethod
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.

source
PEPSKit.PartitionFunctionTensorType
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 
source
PEPSKit.PartitionFunctionTensorMethod
PartitionFunctionTensor(f, ::Type{T}, Pspace::S, Nspace::S,
           [Espace::S], [Sspace::S], [Wspace::S]) where {T,S<:Union{Int,ElementarySpace}}

Construct a PartitionFunctionTensor tensor based on the north, east, west and south spaces. The tensor elements are generated based on f and the element type is specified in T.

source
PEPSKit.ProductStateEnvType
struct ProductStateEnv{T}

Tensor product environment for an infinite square network, containing a 4 x rows x cols array of tensors, defined for each nearest neighbor bond in the network.

The product state tensors p connect to the network tensors P at site [r,c] in the unit cell as:

                    p[1,r-1,c]
                    |
    p[4,r,c-1]------P[r,c]------p[2,r,c+1]
                    |
                    p[3,r+1,c]

Fields

  • edges::Array{T, 3} where T: 4 x rows x cols array of edge tensors making up a product state environment, where the first dimension specifies the spatial direction
source
PEPSKit.ProductStateEnvMethod
ProductStateEnv(
    [f=randn, T=ComplexF64], Ds_north::A, Ds_east::A
) where {A <: AbstractMatrix{<:ProductSpace}}

Construct a product state environment by specifying matrices of north and east virtual spaces of the corresponding InfiniteSquareNetwork. Each matrix entry corresponds to a site in the unit cell.

Each entry of the Ds_north and Ds_east matrices corresponds to an effective local space of the network, and can be represented as a ProductSpace (e.g. for the case of a network representing overlaps of PEPSs).

source
PEPSKit.ProductStateInitializationType
struct ProductStateInitialization{F} <: PEPSKit.InitializationStyle

Initialize a contraction environment from a product state made up of (N, 0) tensors.

Constructors

ProductStateInitialization(f = ones)

Contructs a product state initialization strategy, where the product state tensors are initialized by the function f as f(T::Type{<:Number}, V::ProductSpace).

source
PEPSKit.ProjectorAlgorithmMethod
ProjectorAlgorithm(; kwargs...)

Keyword argument parser returning the appropriate ProjectorAlgorithm algorithm struct.

source
PEPSKit.QRAdjointType
struct QRAdjoint{F, R}

Wrapper for a QR decomposition algorithm fwd_alg with a defined reverse rule rrule_alg.

Fields

  • fwd_alg::Any

  • rrule_alg::Any

Constructors

QRAdjoint(; kwargs...)

Construct a QRAdjoint algorithm struct based on the following keyword arguments:

  • fwd_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=DefaultAlgorithm): QR algorithm of the forward pass which can either be passed as an Algorithm instance or a NamedTuple where the algorithm is specified by the alg keyword. The available algorithms are provided through MatrixAlgebraKit and include:
  • rrule_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=FullPullback): Reverse-rule algorithm for differentiating the eigenvalue decomposition. Can be supplied by an Algorithm instance directly or as a NamedTuple where alg is one of the following:
Note

Manually specifying a rrule_alg is considered expert-mode usage, and should only be done when full control over the implementation is desired. For all regular use cases, the default reverse rule algorithms, automatically chosen based on the forward algorithm, should be sufficient.

source
PEPSKit.RandomInitializationType
struct RandomInitialization{F} <: PEPSKit.InitializationStyle

Initialize a fully random contraction environment.

Constructors

RandomInitialization(f = randn)

Contructs a random initialization strategy, where the environment tensors are initialized by the function f as f(T::Type{<:Number}, V::HomSpace).

source
PEPSKit.ReflectDepthType
struct ReflectDepth <: PEPSKit.SymmetrizationStyle

Reflection symmmetrization along the horizontal axis, such that north and south are mirrored.

source
PEPSKit.ReflectWidthType
struct ReflectWidth <: PEPSKit.SymmetrizationStyle

Reflection symmmetrization along the vertical axis, such that east and west are mirrored.

source
PEPSKit.RotateType
struct Rotate <: PEPSKit.SymmetrizationStyle

Rotation symmmetrization leaving the object invariant under π/2 rotations.

source
PEPSKit.RotateReflectType
struct RotateReflect <: PEPSKit.SymmetrizationStyle

Full reflection and rotation symmmetrization, such that reflection along the horizontal and vertical axis as well as π/2 rotations leave the object invariant.

source
PEPSKit.SUGaugeType
struct SUGauge

Algorithm for fixing gauge of an iPEPS using trivial simple update (with identity gates).

Fields

  • tol::Float64: Stopping criterion for the trivial SU iterations in weight difference

  • miniter::Int64: Minimal number of SU iterations

  • maxiter::Int64: Maximal number of SU iterations

source
PEPSKit.SUWeightType
struct SUWeight{E<:PEPSWeight}

Schmidt bond weights used in simple/cluster update. Each weight is a real and semi-positive definite DiagonalTensorMap, with the same codomain and domain.

On the square lattice,

  • wt[1,r,c] is on the x-bond between [r,c] and [r,c+1];
  • wt[2,r,c] is on the y-bond between [r,c] and [r-1,c].

Axis order of each weight matrix is

    x-weights:      y-weights:

    1 - x - 2           2
                        |
                        y
                        |
                        1

Fields

  • data::Array{E, 3} where E<:(TensorKit.AbstractTensorMap{T, S, 1, 1} where {T, S})

Constructors

SUWeight(wts_mats::AbstractMatrix{E}...) where {E<:PEPSWeight}
source
PEPSKit.SUWeightMethod
SUWeight(env::BPEnv)

Construct SUWeight from belief propagation fixed point environment env.

source
PEPSKit.SUWeightMethod
SUWeight(pepo::InfinitePEPO)

Create a trivial SUWeight for a given one-layer InfinitePEPO.

source
PEPSKit.SUWeightMethod
SUWeight(peps::InfinitePEPS)

Create a trivial SUWeight for a given InfinitePEPS.

source
PEPSKit.SUWeightMethod
SUWeight(Nspaces::M, [Espaces::M]) where {M<:AbstractMatrix{<:ElementarySpace}}

Create a trivial SUWeight by specifying the vertical (north) or horizontal (east) virtual bond spaces.

source
PEPSKit.SUWeightMethod
SUWeight(Nspace::S, Espace::S=Nspace; unitcell::Tuple{Int,Int}=(1, 1)) where {S<:ElementarySpace}

Create a trivial SUWeight by specifying its vertical (north) and horizontal (east) as ElementarySpaces) and unit cell size.

source
PEPSKit.SVDAdjointType
struct SVDAdjoint{F, R}

Wrapper for a SVD algorithm fwd_alg with a defined reverse rule rrule_alg.

Fields

  • fwd_alg::Any

  • rrule_alg::Any

Constructors

SVDAdjoint(; kwargs...)

Construct a SVDAdjoint algorithm struct based on the following keyword arguments:

  • fwd_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=DefaultAlgorithm): SVD algorithm of the forward pass which can either be passed as an Algorithm instance or a NamedTuple where the algorithm is specified by the alg keyword. The available SVD algorithms can be divided into two categories:
    • "Dense" SVD algorithms which compute a truncated SVD through the truncation of a full MatrixAlgebraKit.svd_compact! decomposition. Available algorithms are:
    • "Sparse" SVD algorithms which directly compute a truncated SVD without access to the full decomposition. Available algorithms are:
      • :GKL : Iterative Krylov-based SVD only computing the specifed number of singular values and vectors, see IterSVD
  • rrule_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=:FullPullback): Reverse-rule algorithm for differentiating the SVD. Can be supplied by an Algorithm instance directly or as a NamedTuple where alg is one of the following:
Note

Manually specifying a rrule_alg is considered expert-mode usage, and should only be done when full control over the implementation is desired. For all regular use cases, the default reverse rule algorithms, automatically chosen based on the forward algorithm, should be sufficient.

source
PEPSKit.ScramblingEnvGaugeType
struct ScramblingEnvGauge

CTMRG environment gauge fixing algorithm implementing the "general" technique from https://arxiv.org/abs/2311.11894. This works by constructing a transfer matrix consisting of an edge tensor and a random MPS, thus scrambling potential degeneracies, and then performing a QR decomposition to extract the gauge signs. This is adapted accordingly for asymmetric CTMRG algorithms using multi-site unit cell transfer matrices.

source
PEPSKit.SequentialCTMRGType
struct SequentialCTMRG <: CTMRGAlgorithm

CTMRG 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::Float64

  • maxiter::Int64

  • miniter::Int64

  • verbosity::Int64

  • projector_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-8
  • maxiter::Int=100
  • miniter::Int=4
  • verbosity::Int=2
  • trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:FixedSpaceTruncation)
  • decomposition_alg::Union{<:SVDAdjoint,NamedTuple}
  • projector_alg::Symbol=:HalfInfiniteProjector
source
PEPSKit.SimpleUpdateType
struct SimpleUpdate{T<:MatrixAlgebraKit.TruncationStrategy} <: PEPSKit.TimeEvolution

Algorithm struct for simple update (SU) of InfinitePEPS or InfinitePEPO.

Fields

  • trunc::MatrixAlgebraKit.TruncationStrategy: Truncation strategy for bonds updated by Trotter gates

  • imaginary_time::Bool: When true (or false), the Trotter gate is exp(-H dt) (or exp(-iH dt))

  • force_mpo::Bool: When true, force decomposition of nearest neighbor gates to MPOs.

  • bipartite::Bool: When true, assume bipartite unit cell structure

  • purified::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).

source
PEPSKit.SimultaneousCTMRGType
struct SimultaneousCTMRG{P<:PEPSKit.ProjectorAlgorithm} <: PEPSKit.CTMRGAlgorithm

CTMRG 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::Float64

  • maxiter::Int64

  • miniter::Int64

  • verbosity::Int64

  • projector_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-8
  • maxiter::Int=100
  • miniter::Int=4
  • verbosity::Int=2
  • trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:FixedSpaceTruncation)
  • decomposition_alg::Union{<:SVDAdjoint,NamedTuple}
  • projector_alg::Symbol=:HalfInfiniteProjector
source
PEPSKit.SiteDependentTruncationType
struct SiteDependentTruncation{T<:MatrixAlgebraKit.TruncationStrategy} <: MatrixAlgebraKit.TruncationStrategy

SVD truncation strategy specified for each nearest neighbor bond in InfinitePEPS, InfinitePEPO:

  • trunc[1, r, c] applies to the x-bond between [r, c] and [r, c+1]. If it is a TruncationSpace, the space refers to the east domain of [r, c] or its flip, whichever is non-dual.
  • trunc[2, r, c] applies to the y-bond between [r, c] and [r-1, c]. If it is a TruncationSpace, the space refers to the north domain of [r, c] or its flip, whichever is non-dual.
source
PEPSKit.TimeEvolutionType
abstract type TimeEvolution

Abstract super type for time evolution algorithms of InfinitePEPS or InfinitePEPO.

source
PEPSKit.TimeEvolverType
mutable struct TimeEvolver{TE <: TimeEvolution, C, S, N <: Number}

Iterator for Trotter-based time evolution of InfinitePEPS or InfinitePEPO.

Fields

  • alg::PEPSKit.TimeEvolution: Time evolution algorithm (currently supported: SimpleUpdate)

  • dt::Number: Trotter time step

  • nstep::Int64: The number of iteration steps

  • circuit::Any: LocalCircuit representing trotterized gates

  • state::Any: Internal state of the iterator, including the number of already performed iterations, evolved time, PEPS/PEPO and its environment

source
PEPSKit.TimeEvolverMethod
TimeEvolver(
    psi0::Union{InfinitePEPS, InfinitePEPO}, H::LocalOperator, dt::Number,
    nstep::Int, alg::SimpleUpdate, env0::SUWeight; t0::Number = 0.0,
    symmetrize_gates::Bool = false
)

Initialize a TimeEvolver with Hamiltonian H and simple update alg, starting from the initial state psi0 and SUWeight environment env0.

  • The initial time is specified by t0.
  • Use symmetrize_gates = true for second-order Trotter decomposition.
source
PEPSKit.TruncPullbackType
struct TruncPullback

Truncated reverse-rule algorithm which wraps MatrixAlgebraKit's truncated pullback methods, see eigh_trunc_pullback! and svd_trunc_pullback!.

Fields

  • degeneracy_atol::Real

  • verbosity::Int64

Constructors

TruncPullback(; kwargs...)

Construct a TruncPullback algorithm struct from the following keyword arguments:

  • degeneracy_atol::Real=1.0e-13 : Absolute tolerance for idendifying degenerate subspaces.
  • verbosity::Int=0 : Suppresses all output if ≤0, prints gauge dependency warnings if 1, and always prints gauge dependency if ≥2.
source
TensorKit.TensorMapMethod
TensorMap(env::FullInfiniteEnv)

Instantiate full-infinite environment as TensorMap explicitly.

source
TensorKit.TensorMapMethod
TensorMap(env::HalfInfiniteEnv)

Instantiate half-infinite environment as TensorMap explicitly.

source
Base.:*Method
ρ1 * ρ2

Lazily multiply two infinite PEPOs by stacking the layers of ρ1 under those of ρ2.

source
FiniteDifferences.to_vecMethod
to_vec(A::InfinitePEPS) -> vec, state_from_vec

Vectorize 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.

source
MPSKit.add_physical_chargeMethod
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.

source
MPSKit.correlation_lengthMethod
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).

source
MPSKit.expectation_valueMethod
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.

source
MPSKit.expectation_valueMethod
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.

source
MPSKit.expectation_valueMethod
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.

source
MPSKit.leading_boundaryMethod
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.

source
MPSKit.leading_boundaryMethod
leading_boundary(env₀::BPEnv, network, alg::BeliefPropagation)

Contract network in the BP approximation and return the corresponding messages.

source
MPSKit.leading_boundaryMethod
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:
    1. Suppress all output
    2. Only print warnings
    3. Initialization and convergence info
    4. Iteration info
    5. Debug info
  • alg::Symbol=:SimultaneousCTMRG : Variant of the CTMRG algorithm. See also CTMRGAlgorithm.
    • :SimultaneousCTMRG : Simultaneous expansion and renormalization of all sides.
    • :SequentialCTMRG : Sequential application of left moves and rotations.
    • :C4vCTMRG : CTMRG assuming C₄ᵥ-symmetric PEPS and environment.

Projector algorithm

  • trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:FixedSpaceTruncation) : Truncation strategy for the projector computation, which controls the resulting virtual spaces. Here, alg can be one of the following:
    • :FixedSpaceTruncation : Keep virtual spaces fixed during projection
    • :notrunc : No singular values are truncated and the performed SVDs are exact
    • :truncerror : Additionally supply error threshold η; truncate to the maximal virtual dimension of η
    • :truncrank : Additionally supply truncation dimension η; truncate such that the 2-norm of the truncated values is smaller than η
    • :truncspace : Additionally supply truncation space η; truncate according to the supplied vector space
    • :trunctol : Additionally supply singular value cutoff η; truncate such that every retained singular value is larger than η
  • projector_alg::Symbol=:HalfInfiniteProjector : Variant of the projector algorithm. See also ProjectorAlgorithm.
    • :HalfInfiniteProjector : Projection via SVDs of half-infinite (two enlarged corners) CTMRG environments.
    • :FullInfiniteProjector : Projection via SVDs of full-infinite (all four enlarged corners) CTMRG environments.
    • :C4vEighProjector : Projection via eigh of the Hermitian enlarged corner, works only for C4vCTMRG.
    • :C4vQRProjector : Projection via QR decomposition of the lower-rank column-enlarged corner, works only for C4vCTMRG.
  • decomposition_alg::Union{NamedTuple,<:SVDAdjoint,<:EighAdjoint,<:QRAdjoint} : Tensor decomposition algorithm used for computing projectors. When specified as a NamedTuple, the settings are passed a the forward algorithm to the appropriate decomposition for the given projector algorithm. For information on which forward algorithms are available, and how to specify them, see SVDAdjoint, EighAdjoint and QRAdjoint.

Return values

  • env : The final environment.
  • info : A NamedTuple containing information about the leading_boundary convergence, which has the following fields:
    • info.converged::Bool : Convergence flag indicating whether the contraction converged within maxiter and tol.
    • info.convergence_error::Real : The final convergence error at the end of the contraction procedure.
    • info.contraction_metrics::NamedTuple : A NamedTuple containing metrics which characterize the contraction. The precise contents depend on alg.
source
MPSKit.physicalspaceMethod
physicalspace(O::LocalOperator)

Return lattice of physical spaces on which the LocalOperator is defined.

source
MPSKit.physicalspaceMethod
physicalspace(gates::LocalCircuit)

Return lattice of physical spaces on which the LocalCircuit is defined.

source
MPSKit.time_evolveMethod
time_evolve(it; verbosity = 2, check_interval = 500) -> (psi, env, info)
time_evolve(it, H; tol = 1.0e-8, verbosity = 2, check_interval = 500) -> (psi, env, info)

Perform time evolution to the end of TimeEvolver iterator it, or until convergence of SUWeight set by a positive tol.

  • Setting tol > 0 enables convergence check (for imaginary time evolution of InfinitePEPS only). For other usages it should not be changed.
  • verbosity sets the verbosity level to output information.
    • 0: output no information except warnings.
    • 1: indicate the start and the end of the evolution.
    • 2: (default) output detailed progress of the evolution.
  • check_interval sets the number of iterations to output evolution progress.
source
MPSKit.time_evolveMethod
time_evolve(
    psi0::Union{InfinitePEPS, InfinitePEPO}, H::LocalOperator,
    dt::Number, nstep::Int, alg::SimpleUpdate, env0::SUWeight;
    symmetrize_gates::Bool = false, tol::Float64 = 0.0,
    t0::Number = 0.0, verbosity::Int = 2, check_interval::Int = 500,
) -> (psi, env, info)

Perform time evolution on the initial iPEPS or iPEPO psi0 and initial environment env0 with Hamiltonian H, using SimpleUpdate algorithm alg, time step dt for nstep number of steps.

  • Set symmetrize_gates = true for second-order Trotter decomposition.
  • Set tol > 0 to enable convergence check (for imaginary time evolution of iPEPS only).
  • Use t0 to specify the initial time of the evolution.
  • verbosity sets the verbosity level to output information.
  • check_interval sets the interval to output evolution progress.
  • info is a NamedTuple containing information of the evolution, including the time info.t evolved since psi0.
source
MPSKit.timestepMethod
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.

source
MatrixAlgebraKit.eigh_truncMethod
eigh_trunc(t, alg::EighAdjoint)
eigh_trunc!(t, alg::EighAdjoint)

Wrapper around eigh_trunc(!) which dispatches on the EighAdjoint algorithm. This is needed since a custom adjoint may be defined, depending on the alg.

source
MatrixAlgebraKit.left_orthMethod
left_orth(t, alg::QRAdjoint)
left_orth!(t, alg::QRAdjoint)

Wrapper around left_orth(!) which dispatches on the QRAdjoint algorithm. This is needed since a custom adjoint may be defined, depending on the alg.

source
MatrixAlgebraKit.svd_truncMethod
svd_trunc(t, alg::SVDAdjoint)
svd_trunc!(t, alg::SVDAdjoint)

Wrapper around svd_trunc(!) which dispatches on the SVDAdjoint algorithm. This is needed since a custom adjoint may be defined, depending on the alg. E.g., for IterSVD the adjoint for a truncated SVD from KrylovKit.svdsolve is used.

source
MatrixAlgebraKit.svd_trunc_no_errorMethod
svd_trunc_no_error(t, alg::SVDAdjoint)
svd_trunc_no_error!(t, alg::SVDAdjoint)

Wrapper around svd_trunc_no_error(!) which dispatches on the SVDAdjoint algorithm. This is needed since a custom adjoint may be defined, depending on the alg. E.g., for IterSVD the adjoint for a truncated SVD from KrylovKit.svdsolve is used. The _no_error(!) versions of svd_trunc(!) do not compute the truncation error.

source
PEPSKit._als_normMethod

Calculate the 2-site norm

    ┌benv-------┐
    ├---a---b---┤
    |   ↓   ↓   |
    ├---ā---b̄---┤
    └-----------┘

using pre-calcuated partial contraction results.

source
PEPSKit._als_overlapMethod

Calculate the inner product (overlap)

    ┌benv-------┐
    ├---a₂--b₂--┤
    |   ↓   ↓   |
    ├---ā---b̄---┤
    └-----------┘

using pre-calculated partial contraction results.

source
PEPSKit._als_tensor_RMethod
_als_tensor_R(benv::BondEnv, xs::Vector{<:MPSTensor}, i::Int)

Construct the bond environment around the ith bond tensor in two-site ALS optimization.

    i = 1           i = 2
    ┌benv-------┐   ┌benv-------┐
    ├--   --b---┤   ├---a--   --┤
    |       ↓   |   |   ↓       |
    ├--   --b̄---┤   ├---ā--   --┤
    └-----------┘   └-----------┘
source
PEPSKit._als_tensor_SMethod
_als_tensor_S(
    benv_ket::AbstractTensorMap{T, S, 2, 2},
    xs::Vector{<:MPSTensor}, i::Int
) where {T <: Number, S <: ElementarySpace}

Construct the overlap but with one of the bra bond tensor removed.

    i = 1           i = 2
    ┌benv-------┐   ┌benv-------┐
    ├---a₂==b₂--┤   ├---a₂==b₂--┤
    |   ↓   ↓   |   |   ↓   ↓   |
    ├--   --b̄---┤   ├---ā--   --┤
    └-----------┘   └-----------┘

The ket part is provided by the partial contraction benv_ket.

source
PEPSKit._apply_gateMethod
_apply_gate(a, b, gate, trunc)

Apply 2-site gate on the reduced bond tensors a, b

    -1← a --- 3 --- b ← -4          -2         -3
        ↓           ↓               ↓           ↓
        1           2               |----gate---|
        ↓           ↓       or      ↓           ↓
        |----gate---|               1           2
        ↓           ↓               ↓           ↓
        -2         -3           -1← a --- 3 --- b ← -4
source
PEPSKit._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
        ↓       ↓       ↓
source
PEPSKit._benv_ketMethod

Construct the norm with bra bond tensors removed

    ┌benv-------┐
    ├---a---b---┤
    |   ↓   ↓   |
    ├--       --┤
    └-----------┘
source
PEPSKit._bp_gauge_fix!Method
_bp_gauge_fix!(I, psi::InfinitePEPS, env::BPEnv) -> psi, X, X⁻¹

For the bond at direction I[1] (which can be NORTH or EAST) from site I[2], I[3], we identify the following gauge matrices, along the canonical direction of the PEPS arrows (SOUTH ← NORTH or WEST ← EAST):

\[ I = √M₁₂⁻¹ √M₁₂ √M₂₁ √M₂₁⁻¹ = √M₁₂⁻¹ (U Λ Vᴴ) √M₂₁⁻¹ = (√M₁₂⁻¹ U √Λ) (√Λ Vᴴ √M₂₁⁻¹) = X X⁻¹\]

Which are then used to update the gauge of psi. Thus, by convention X is attached to the SOUTH/WEST directions and X⁻¹ is attached to the NORTH/EAST directions.

source
PEPSKit._check_algorithm_combinationMethod
_check_algorithm_combination(boundary_alg, gradient_alg_or_symmetrization)
_check_algorithm_combination(boundary_alg, gradient_alg, symmetrization)

Check for allowed combinations of gradient algorithm and boundary algorithm to be used for computing the gradient of a leading_boundary call. Throws an error containing a recommended fix if the combination is not allowed or broken.

source
PEPSKit._check_hamiltonian_for_trotterMethod
_check_hamiltonian_for_trotter(H::LocalOperator)

Assert that operator H contains only one-site and two-site terms. Returns the maximum squared distance covered by a two-site term in H. On the square lattice, the neighbor distances are

    1st nb.     2nd nb.     3rd nb.

                    o
                    |
    o---o       o---o       o---o---o

    dist² = 1   dist² = 2   dist² = 4
source
PEPSKit._contract_cornersMethod
_contract_corners(ind::Tuple{Int,Int}, env::CTMRGEnv)

Contract all corners around the south-east at position ind of the CTMRG environment env.

source
PEPSKit._contract_horizontal_edgesMethod
_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.

source
PEPSKit._contract_siteMethod
_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.

source
PEPSKit._contract_vertical_edgesMethod
_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.

source
PEPSKit._fixgauge_benvXMethod

Apply the gauge transformation Rinv for Z

    ┌-----------------------┐
    └---Z--(X)--Rinv--   ---┘
        ↓

to X. For example, when X is a PEPSTensor,

        -2
         |
    -5 - X - 1 - Rinv - -3
         | ╲ 
        -4  -1
source
PEPSKit._fixgauge_benvYMethod

Apply the gauge transformation Linv for Z

    ┌-----------------------┐
    └---Z---  ---Linv--(Y)--┘
        ↓

to Y. For example, when Y is a PEPSTensor,

                   -2
                    |
    -5 - Linv - 1 - Y - -3
                    | ╲
                   -4  -1
source
PEPSKit._fuse_idsMethod
_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.

source
PEPSKit._get_clusterMethod

Obtain the cluster Ms along the (open) path sites in state.

Returns

  • Ms: Tensors in the cluster (not permuted to MPS axis order).
  • open_vaxs: Open virtual axes (1 to 4) of each cluster tensor before permutation.
  • perms: Permutations to change each tensor to MPS axis order.
source
PEPSKit._inv_mpo_permMethod

Given the permutation perm that converts a PEPSTensor (N = 1) or PEPOTensor (N = 2) to MPS axis order, find the inverse permutation.

source
PEPSKit._message_tensorMethod

Construct a message tensor on a certain bond of a network, with bond space specified by pspaces. In the 2-layer case, the message tensor will be

    ┌--- pspaces[1] (ket layer)
    m
    └--- pspaces[2] (bra layer)

Returning axis order is bra ← ket.

When posdef is true, the message will be made semi-posdef definite (when interpreted as a bra ← ket TensorMap).

source
PEPSKit._mpo_permMethod

Find the permutation to permute out_ax, in_ax legs to the first and the last position of a tensor with N legs, then assign the last leg to domain, and the others to codomain to follow the GenericMPSTensor convention.

source
PEPSKit._nn_bondrevMethod

Given site1, site2 connected by a nearest neighbor bond, return the bond index and whether it is reversed from the standard orientation (site1 on the west/south of site2).

source
PEPSKit._nn_vec_directionMethod

Convert nearest neighbor vector nn_vec to direction labels.

                NORTH
                (-1,0)
                  ↑
    WEST (0,-1)-←-∘-→-(0,+1) EAST
                  ↓
                (+1,0)
                SOUTH
source
PEPSKit._permute_to_lastMethod
_permute_to_last(axes::NTuple{N, Int}, ax::Int) where {N}

Returns (1, 2, ..., N) but with ax moved to the end, and the corresponding permutation for axes (with ax as the only domain index).

source
PEPSKit._proj_from_RLMethod

Given the tensors R, L on a bond, construct the projectors Pa, Pb and the new bond weight s such that the contraction of Pa, s, Pb is identity when trunc = notrunc,

The arrows between Pa, s, Pb are

    - Pa --←-- Pb -
       1 ← s ← 2
source
PEPSKit._rruleMethod
_rrule(alg_rrule, config, f, args...; kwargs...) -> ∂f, ∂args...

Customize the pullback of a function f. This function can specialize on its first argument in order to have multiple implementations for a pullback. If no specialization is needed, the default alg_rrule=nothing results in the default AD pullback.

Warning

No tangent is expected for the alg_rrule argument

source
PEPSKit._set_decomposition_truncationMethod
_set_decomposition_truncation(alg::ProjectorAlgorithm, trunc::TruncationStrategy)

Set the truncation strategy of the decomposition algorithm within a given projector algorithm, keeping all other settings the same.

source
PEPSKit._set_truncationMethod
_set_truncation(alg::ProjectorAlgorithm, trunc::TruncationStrategy)

Update the truncation strategy of a given projector algorithm, keeping all other settings the same.

source
PEPSKit._singular_value_distanceMethod
_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.

source
PEPSKit._solve_alsMethod
_solve_als(Rx, Sx, x0; kwargs...)

Solve the equations Rx x = Sx with initial guess x0.

In ALS over a, b, if we fix b, the cost function can be expressed in the Ra, Sa tensors as

    f(a†,a) = a† Ra a - a† Sa - Sa† a + const

Therefore f is minimized when

    ∂f/∂ā = Ra a - Sa = 0
source
PEPSKit._su_iter!Method

Simple update optimized for nearest neighbor gates utilizing reduced bond tensors with the physical leg.

source
PEPSKit._trotterize_nnn2site!Method

Trotterize next-nearest neighbor terms in a Hamiltonian, converting them to 3-site MPO gates. For each gate, the sites are in counter-clockwise order

    2---1   3---2
    |           |
    3           1

    1           3
    |           |
    2---3   1---2
source
PEPSKit.absorb_sMethod
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) * V
source
PEPSKit.absorb_weightMethod
absorb_weight(t::Union{PEPSTensor, PEPOTensor}, weights::SUWeight, rowcol::CartesianIndex{2}, virt_axes::NTuple{N, Int}; inv::Bool = false)
absorb_weight(t::Union{PEPSTensor, PEPOTensor}, weights::SUWeight, row::Int, col::Int, virt_axes::NTuple{N, Int}; inv::Bool = false)

Absorb or remove (in a twist-free way) the square root of environment weight on an axis of the PEPS/PEPO tensor t known to be at position (row, col) in the unit cell of an InfinitePEPS/InfinitePEPO. The involved weights are

                    |
                 [2,r,c]
                    |
    - [1,r,c-1] - T[r,c] - [1,r,c] -
                    |
                [2,r+1,c]
                    |

Arguments

  • t::Union{PEPSTensor, PEPOTensor} : PEPSTensor or PEPOTensor to which the weight will be absorbed.
  • weights::SUWeight : All simple update weights.
  • row::Int : The row index specifying the position in the tensor network.
  • col::Int : The column index specifying the position in the tensor network.
  • virt_axes::Int : The axis into which the weight is absorbed, taking values from 1 to 4, standing for north, east, south, west respectively.

Keyword arguments

  • inv::Bool=false : If true, 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)
source
PEPSKit.bond_tensor_firstMethod

Given the first tensor A in the cluster acted on by a gate, obtain reduced tensor on its next bond.

For PEPSTensor,

        1
        |
    4 - X ← 2   1 ← a - 3
        |            ↘
        3             2

For PEPOTensor,

    gate_ax = 1                 gate_ax = 2

    1   2                           2         2
      ↘ |                           |          ↘
    5 - X ← 3   1 ← a - 3       5 - X ← 3   1 ← a - 3
        |            ↘              | ↘
        4             2             4   1
source
PEPSKit.bond_tensor_lastMethod

Given the last tensor A in the cluster acted on by a gate, obtain reduced tensor on its previous bond.

For PEPSTensor,

                    1
                    |
    1 - b → 3   4 → Y - 2
          ↘         |
            2       3

For PEPOTensor,

    gate_ax = 1                 gate_ax = 2

                 1  2             2             2
                  ↘ |              ↘            |
    1 - b → 3   5 → Y - 3       1 - b → 3   5 → Y - 3
         ↘          |                           | ↘
          2         4                           4  1
source
PEPSKit.bond_truncateMethod
bond_truncate(a::MPSTensor, b::MPSTensor, benv::BondEnv, alg) -> U, S, V, info

After time-evolving the reduced tensors a and b connected by a bond, truncate the bond dimension using the bond environment tensor benv.

    ┌-----------------------┐
    |   ┌----┐              |
    └---|    |-- a === b ---┘
        |benv|   ↓     ↓
    ┌---|    |-- a† == b† --┐
    |   └----┘              |
    └-----------------------┘

The truncation algorithm alg can be either FullEnvTruncation or ALSTruncation. The index order of a or b follows MPSTensor convention.

    1 -a/b- 3
        ↓       [1 2; 3]
        2
source
PEPSKit.bondenv_ctmMethod

Construct the environment (norm) tensor

    -1  C1---E1---------E1---C2
        |    ‖          ‖    |
    0   E4===XX==     ==YY===E2
        |    ‖          ‖    |
    1   C4---E3---------E3---C3
        -1   0          1    2

with X at position [row, col]. X, Y are unitary tensors produced when finding the reduced site tensors, and XX = X' X and YY = Y' Y (stacked together).

Axis order: [DX1 DY1; DX0 DY0], as in

    ┌---------------------┐
    | ┌----┐              |
    └-|    |---DX0  DY0---┘
      |benv|
    ┌-|    |---DX1  DY1---┐
    | └----┘              |
    └---------------------┘
source
PEPSKit.c4v_enlargeMethod
c4v_enlarge(network, env, ::C4vEighProjector)

Compute the normalized and Hermitian-symmetrized C₄ᵥ enlarged corner.

source
PEPSKit.c4v_enlargeMethod
c4v_enlarge(env, ::C4vQRProjector)

Compute the normalized column-enlarged northeast corner for C₄ᵥ QR-CTMRG.

source
PEPSKit.c4v_projector!Method
c4v_projector!(enlarged_corner, alg::C4vEighProjector)

Compute the C₄ᵥ projector from eigh decomposing the Hermitian enlarged_corner. Also return the normalized eigenvalues as the new corner tensor.

source
PEPSKit.c4v_projector!Method
c4v_projector!(enlarged_corner, alg::C4vQRProjector)

Compute the C₄ᵥ projector by decomposing the column-enlarged corner with left_orth.

                   R--←--
                   ↓
    C-←-E-←-  =  [~Q~]    
    ↓   |        ↓   |
source
PEPSKit.calc_convergenceMethod
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.

source
PEPSKit.calc_elementwise_convergenceMethod
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.

source
PEPSKit.check_inputMethod
check_input(::typeof(fixedpoint), peps₀, env₀, alg::PEPSOptimize{<:SimultaneousCTMRG})

Check compatibility of an initial PEPS and environment with a specified PEPS optimization algorithm.

source
PEPSKit.check_inputMethod
check_input(::typeof(leading_boundary), network, env, alg::CTMRGAlgorithm)

Check compatibility of a given network and environment with a specified CTMRG algorithm.

source
PEPSKit.checklatticeMethod
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.

source
PEPSKit.compressMethod
compress((ρ1, ρ2), alg::LocalTruncation)

Compress two 1-layer iPEPOs into a 1-layer iPEPO by truncating the virtual bonds with LocalTruncation. In the tuple (ρ1, ρ2), ρ1 is the lower layer and ρ2 is the upper layer.

source
PEPSKit.compute_projectorMethod
compute_projector(enlarged_corners, alg::ProjectorAlgorithm)

Determine left and right projectors at the bond given determined by the enlarged corners using the specified alg.

source
PEPSKit.contract_local_normMethod
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.)

source
PEPSKit.contract_local_operatorMethod
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.

source
PEPSKit.contract_local_tensorMethod
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.

source
PEPSKit.contract_local_tensorMethod
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.

source
PEPSKit.contract_projectorsMethod
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 |
               |~~| == |~~~| ==
source
PEPSKit.cornerMethod
corner(env::CTMRGEnv, dir, i, j)

Return the corner tensor of env at direction dir and unit-cell coordinates (i, j). The coordinates are wrapped periodically (mod1); the direction is passed through unchanged. Mixed Int/CartesianIndex arguments are supported via Base.to_indices, e.g. corner(env, NORTHWEST, CartesianIndex(r, c)).

source
PEPSKit.cost_functionMethod
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).

source
PEPSKit.cost_function_alsMethod
cost_function_als(benv, ψ1, ψ2)

Calculate the cost function

    f(a,b) = ‖ |ψ1⟩ - |ψ2⟩ ‖^2
    = ⟨ψ1|benv|ψ1⟩ - 2 Re⟨ψ1|benv|ψ2⟩ + ⟨ψ2|benv|ψ2⟩

and the fidelity

        |⟨ψ1|benv|ψ2⟩|²
    ------------------------
    ⟨ψ1|benv|ψ1⟩⟨ψ2|benv|ψ2⟩
source
PEPSKit.ctmrg_iterationMethod
ctmrg_iteration(network, env, alg::CTMRGAlgorithm) -> env′, info

Perform a single CTMRG iteration in which all directions are being grown and renormalized.

source
PEPSKit.ctmrg_leftmoveMethod
ctmrg_leftmove(col::Int, network, env::CTMRGEnv, alg::SequentialCTMRG)

Perform sequential CTMRG left move on the col-th column.

source
PEPSKit.dtmapMethod
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!.

source
PEPSKit.edgeMethod
edge(env::CTMRGEnv, dir, i, j)

Return the edge tensor of env at direction dir and unit-cell coordinates (i, j). The coordinates are wrapped periodically (mod1); the direction is passed through unchanged. Mixed Int/CartesianIndex arguments are supported via Base.to_indices.

source
PEPSKit.edge_transfer_leftMethod
edge_transfer_left(v, O, Et, Eb)

Apply an edge transfer matrix to the left.

 ┌──Et─
 │  │
 v──O──
 │  │
 └──qƎ─
source
PEPSKit.edge_transfer_leftMethod
edge_transfer_left(v, O, Et, Eb)

Apply an edge transfer matrix to the left on an excited vector.

 ┌──Et─
 │  │
-v──O──
 │  │
 └──qƎ─
source
PEPSKit.edge_transfer_rightMethod
edge_transfer_right(v, Et, Eb)

Apply an edge transfer matrix to the right.

──Et─┐
  │  │
──O──v
  │  │
──qƎ─┘
source
PEPSKit.edge_transfer_rightMethod
edge_transfer_right(v, O, Et, Eb)

Apply an edge transfer matrix to the right on an excited vector.

──Et─┐
  │  │
──O──v-
  │  │
──qƎ─┘
source
PEPSKit.edge_transfer_spectrumMethod
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.

source
PEPSKit.enlarge_northeast_cornerMethod
enlarge_northeast_corner(E_north, C_northeast, E_east, A)

Contract the enlarged northeast corner of the CTMRG environment, either by specifying the coordinates, environments and network, or by directly providing the tensors.

    out-- E_north -- C_northeast
             |             |
       --    A    --    E_east
             |             |
                           in
source
PEPSKit.enlarge_northwest_cornerMethod
enlarge_northwest_corner(E_west, C_northwest, E_north, A)

Contract the enlarged northwest corner of the CTMRG environment, either by specifying the coordinates, environments and network, or by directly providing the tensors.

    C_northwest -- E_north --in
         |            |
      E_west    --    A    --
         |            |
        out
source
PEPSKit.enlarge_southeast_cornerMethod
enlarge_southeast_corner(E_east, C_southeast, E_south, A)

Contract the enlarged southeast corner of the CTMRG environment, either by specifying the coordinates, environments and network, or by directly providing the tensors.

                         out
            |             |
      --    A    --    E_east
            |             |
    in-- E_south -- C_southeast
source
PEPSKit.enlarge_southwest_cornerMethod
enlarge_southwest_corner(E_south, C_southwest, E_west, A)

Contract the enlarged southwest corner of the CTMRG environment, either by specifying the coordinates, environments and network, or by directly providing the tensors.

         in
          |           |
       E_west   --    A    --
          |           |
    C_southwest -- E_south --out
source
PEPSKit.fix_gauge_cornerMethod
fix_gauge_corner(corner, σ_out, σ_in)

Multiply corner tensor with incoming and outgoing gauge signs.

    corner -- σ_in --in
      |
     σ_out
      |
     out
source
PEPSKit.fix_gauge_edgeMethod
fix_gauge_edge(edge, σ_out, σ_in)

Multiply edge tensor with incoming and outgoing gauge signs.

    out-- σ_out -- edge -- σ_in --in
                    |
source
PEPSKit.fix_global_phasesMethod
fix_global_phases(envfix, envprev)

Fix global multiplicative phase of the environment tensors. To that end, the dot products between all corners and all edges are computed to obtain the global phase which is then divided out.

source
PEPSKit.fixedpointMethod
fixedpoint(operator, peps₀::InfinitePEPS, env₀; kwargs...) -> peps_final, env_final, cost_final, info
# expert version:
fixedpoint(operator, peps₀::InfinitePEPS, env₀, alg::PEPSOptimize; finalize!=OptimKit._finalize!)

Find the fixed point of operator (i.e. the ground state) starting from peps₀ according to the supplied optimization parameters. The initial environment env₀ serves as an initial guess for the first boundary contraction run. By default, a random initial environment is used.

The optimization parameters can be supplied via the keyword arguments or directly as a PEPSOptimize struct. The following keyword arguments are supported:

Keyword arguments

General settings

  • tol::Real=0.0001 : Overall tolerance for gradient norm convergence of the optimizer. Sets related tolerance such as the boundary and boundary-gradient tolerances to sensible defaults unless they are explictly specified.
  • verbosity::Int=1 : Overall output information verbosity level, should be one of the following:
    1. Suppress all output
    2. Only print warnings
    3. Initialization and convergence info
    4. Iteration info
    5. Debug info including AD outputs
  • reuse_env::Bool=true : If true, the current optimization step is initialized on the previous environment, otherwise a random environment is used.
  • symmetrization::Union{Nothing,SymmetrizationStyle}=nothing : Accepts nothing or a SymmetrizationStyle, in which case the PEPS and PEPS gradient are symmetrized after each optimization iteration.
  • hasconverged=OptimKit.DefaultHasConverged(optimizer_alg.gradtol) : Function specifying the convergence criterion with signature bool = hasconverged(state, cost, grad, gradnorm), see OptimKit.optimize for specifics. Note that this overrides the default convergence criterion.
  • shouldstop=OptimKit.DefaultShouldStop(optimizer_alg.maxiter) : Function specifying the stopping criterion with signature bool = shouldstop(state, cost, grad, numfg, iter, timespent), see OptimKit.optimize for specifics. Note that this overrides the default stopping criterion.
  • (finalize!)=OptimKit._finalize! : Inserts a finalize! function call after each optimization step by utilizing the finalize! kwarg of OptimKit.optimize. The function maps (state, env), f, g = finalize!((state, env), cost, grad, numiter).

Boundary algorithm

Supply boundary algorithm parameters via boundary_alg using either a NamedTuple of keyword arguments or a boundary algorithm instance directly. See leading_boundary for a description of all possible keyword arguments. By default, a CTMRG tolerance of tol=1e-4tol and is used.

Gradient algorithm

Supply gradient algorithm parameters via gradient_alg::Union{NamedTuple,Nothing,<:GradientAlgorithm} using either a NamedTuple of keyword arguments, nothing, or a GradientAlgorithm struct directly. Pass nothing to fully differentiate the CTMRG run, meaning that all iterations will be taken into account, instead of differentiating the fixed point. The supported NamedTuple keyword arguments are:

  • tol::Real=1e-2tol : Convergence tolerance for the fixed-point gradient iteration.
  • maxiter::Int=30 : Maximal number of gradient problem iterations.
  • verbosity::Int : Gradient output verbosity, ≤0 by default to disable too verbose printing. Should only be >0 for debug purposes.
  • alg::Symbol=:FixedPointGradient : Implicit gradient algorithm variant, can be one of the following:
    • :FixedPointGradient : Compute the gradient via fixed-point differentiation, see FixedPointGradient
  • solver_alg::Union{Algorithm,NamedTuple}: Solver algorithm for computing the implicit gradient; see FixedPointGradient for supported algorithms.

Optimizer settings

Supply the optimizer algorithm via optimizer_alg::Union{NamedTuple,<:OptimKit.OptimizationAlgorithm} using either a NamedTuple of keyword arguments or a OptimKit.OptimizationAlgorithm directly. By default, OptimKit.LBFGS is used in combination with a HagerZhangLineSearch. The supported keyword arguments are:

  • alg::Symbol=:LBFGS : Optimizer algorithm, can be one of the following:
  • tol::Real=tol : Gradient norm tolerance of the optimizer.
  • maxiter::Int=100 : Maximal number of optimization steps.
  • verbosity::Int=3 : Optimizer output verbosity.
  • ls_maxiter::Int=10 : Maximal number of linesearch iterations.
  • ls_maxfg::Int=20 : Maximal number of function-gradient evaluations during linesearch.
  • lbfgs_memory::Int=20 : Size of limited memory representation of BFGS Hessian matrix.

Return values

The function returns the final PEPS, CTMRG environment and cost value, as well as an information NamedTuple which contains the following entries:

  • last_gradient : Last gradient of the cost function.
  • fg_evaluations : Number of evaluations of the cost and gradient function.
  • costs : History of cost values.
  • gradnorms : History of gradient norms.
  • contraction_metrics : History of boundary-algorithm-specific contraction information, e.g. truncation errors and condition numbers.
  • gradnorms_unitcell : History of gradient norms for each respective unit cell entry.
  • times : History of optimization step execution times.
source
PEPSKit.fixedpoint_gradientFunction
fixedpoint_gradient(x̆, ∂ₓf, ∂ₚf, y₀, alg)

Evaluates the VJP action $x̆ ∂ₚx$ for an intermediate variable $x \equiv x(p)$ which satisfies the fixed-point equation $x = f(x, p)$, given the VJP actions $∂ₓf$ and $∂ₚf$ of the iterating function $f$.

More specifically, given a cost function $E(x(p), p)$ defined in terms of a set of variational parameters $p$ and a set of intermediate variables $x$ that depend on $p$, $x \equiv x(p)$, the gradient of the cost function is given by

\[dE/dp = ∂ₓE ∂ₚx + ∂ₚE.\]

Given the fixed-point equation $x = f(x, p)$, the VJP action of the Jacobian $∂ₚx$on the adjointx̆ = ∂ₓE` in the first term of this expression can be evaluated through implicit differentiation of the fixed-point condition as

\[x̆ ∂ₚx = x̆ (1 - ∂ₓf)⁻¹ ∂ₚf = ∑ₙ x̆ (∂ₓf)ⁿ ∂ₚf.\]

This can be used to differentiate contraction routines, where $p$ are the variational parameters of a tensor network, $x̆ = ∂ₓE$ is the partial derivative of the cost function with respect to the contraction environment $x$, and $f$ is a single iteration of the contraction algorithm.

source
PEPSKit.fixgauge_benvMethod

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)
source
PEPSKit.full_infinite_environmentMethod
full_infinite_environment(quadrant1, quadrant2, quadrant3, quadrant4)
full_infinite_environment(half1, half2)
full_infinite_environment(C_1, C_2, C_3, C_4, E_1, E_2, E_3, E_4, E_5, E_6, E_7, E_8, A_1, A_2, A_3, A_4)
full_infinite_environment(C_1, C_2, E_1, E_2, E_3, E_4, x, A_1, A_2, A_3, A_4)
full_infinite_environment(x, C_1, C_2, E_1, E_2, E_3, E_4, A_1, A_2, A_3, A_4)

Contract four quadrants (enlarged corners) to form a full-infinite environment.

    |~~~~~~~~~| -- |~~~~~~~~~|
    |quadrant1|    |quadrant2|
    |~~~~~~~~~| -- |~~~~~~~~~|
      |     |        |     |
     out             |     |
                     |     |
     in              |     |
      |     |        |     |
    |~~~~~~~~~| -- |~~~~~~~~~|
    |quadrant4|    |quadrant3|
    |~~~~~~~~~| -- |~~~~~~~~~|

In the same manner two halfs can be used to contract the full-infinite environment.

    |~~~~~~~~~~~~~~~~~~~~~~~~|
    |         half1          |
    |~~~~~~~~~~~~~~~~~~~~~~~~|
      |     |        |     |
     out             |     |
                     |     |
     in              |     |
      |     |        |     |
    |~~~~~~~~~~~~~~~~~~~~~~~~|
    |         half2          |
    |~~~~~~~~~~~~~~~~~~~~~~~~|

The environment can also be contracted directly from all its constituent tensors.

    C_1 -- E_2 -- E_3 -- C_2
     |      |      |      |
    E_1 -- A_1 -- A_2 -- E_4
     |      |      |      |
    out            |      |
                   |      |
    in      |      |      |
     |      |      |      |
    E_8 -- A_4 -- A_3 -- E_5
     |      |      |      |
    C_4 -- E_7 -- E_6 -- C_3

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
     |      |      |      |
    out            |      |
                   |      |
    [~~~~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.

source
PEPSKit.fullenv_truncateMethod
fullenv_truncate(b0, benv::BondEnv, alg::FullEnvTruncation) -> U, S, V, info

Perform 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) = 0

Note that B is positive (consequently B† = B). Then the solution for the vector r is

    r = B⁻¹ p

We 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) 
    = 0

Then 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⁻¹ p

Then 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.
source
PEPSKit.gate_to_mpoMethod

Convert an N-site gate (N ≥ 2) to MPO by SVD, in which the axes are ordered as

    site 1      mid sites      site N
    2               3               3
    ↓               ↓               ↓
    g1 ←- 3    1 ←- g ←- 4    1 ←- gN
    ↓               ↓               ↓
    1               2               2
source
PEPSKit.gauge_fixMethod
gauge_fix(psi::Union{InfinitePEPS, InfinitePEPO}, alg::BPGauge, env::BPEnv)

Fix the gauge of psi (which can be an InfinitePEPS, or an InfinitePEPO interpreted as purified state with two physical legs) using fixed point environment env of belief propagation.

source
PEPSKit.gauge_fixMethod
gauge_fix(psi::Union{InfinitePEPS, InfinitePEPO}, alg::SUGauge)

Fix the gauge of psi using trivial simple update.

source
PEPSKit.gauge_fixMethod
gauge_fix(envfinal, envprev, alg)

Fix the gauge of envfinal based on the previous environment envprev. This assumes that the envfinal is the result of one CTMRG iteration on envprev. Given that the CTMRG run is converged, the returned environment will be element-wise converged to envprev.

source
PEPSKit.half_infinite_environmentMethod
half_infinite_environment(quadrant1, quadrant2)
half_infinite_environment(C_1, C_2, E_1, E_2, E_3, E_4, A_1, A_2)
half_infinite_environment(C_1, C_2, E_1, E_2, E_3, E_4, x, A_1, A_2)
half_infinite_environment(x, C_1, C_2, E_1, E_2, E_3, E_4, A_1, A_2)

Contract two quadrants (enlarged corners) to form a half-infinite environment.

    |~~~~~~~~~| -- |~~~~~~~~~|
    |quadrant1|    |quadrant2|
    |~~~~~~~~~| -- |~~~~~~~~~|
      |     |        |     |
     out                   in

The environment can also be contracted directly from all its constituent tensors.

    C_1 -- E_2 -- E_3 -- C_2
     |      |      |      |
    E_1 -- A_1 -- A_2 -- E_4
     |      |      |      |
    out                   in

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
     |      |      |      |
    out           [~~~x~~~~]

or contract the adjoint environment with x, e.g. as needed for iterative solvers.

source
PEPSKit.hook_pullbackMethod
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.

source
PEPSKit.initialize_ctmrg_environmentFunction
initialize_ctmrg_environment([elt::Type{<:Number},] n::InfiniteSquareNetwork, alg::RandomInitialization, [env0])

Initialize a CTMRGEnv by applying a single untruncated iteration of SimultaneousCTMRG to a given initial environment. By default, the starting environment is chosen as a random product state.

source
PEPSKit.initialize_ctmrg_environmentMethod
initialize_ctmrg_environment([elt::Type{<:Number},] n::InfiniteSquareNetwork, alg::RandomInitialization, [env0])

Initialize a CTMRGEnv corresponding to a product state acting as an identity between the virtual spaces of a two-layer network, for example

         ╱      
┌-----ket----- 
|    ╱ |        
|      |   
|      | ╱      
└-----bra----- 
     ╱          
source
PEPSKit.initialize_ctmrg_environmentMethod
initialize_ctmrg_environment([elt::Type{<:Number},] n::InfiniteSquareNetwork, alg::RandomInitialization)

Initialize a CTMRGEnv corresponding to a product state with trivial virtual spaces and corners. The product state edge tensors are initialized as alg.f(elt, V::ProductSpace).

source
PEPSKit.initialize_ctmrg_environmentMethod
initialize_ctmrg_environment([elt::Type{<:Number},] n::InfiniteSquareNetwork, alg::RandomInitialization, virtual_spaces...)

Initialize a fully random CTMRGEnv using the given environment virtual spaces. See CTMRGEnv for details on the expected format of the virtual spaces.

source
PEPSKit.initialize_mpsMethod
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.

source
PEPSKit.initialize_random_c4v_envMethod
initialize_random_c4v_env([f=randn, T=scalartype(state)], state, Venv::ElementarySpace)

Initialize a C₄ᵥ-symmetric CTMRGEnv on virtual spaces Venv with random entries created by f and scalartype T.

source
PEPSKit.initialize_singlet_c4v_envMethod
initialize_singlet_c4v_env([T=scalartype(state)], state::InfinitePEPS, Venv::ElementarySpace)

Initialize a C₄ᵥ-symmetric CTMRGEnv with a singlet corner of dimension dim(Venv) and an identity edge from id(T, Venv ⊗ Vpeps).

source
PEPSKit.inner_prodMethod

Calculate the 2-site ALS inner product ⟨a₁,b₁|a₂,b₂⟩

    ┌benv-------┐
    ├---a₂--b₂--┤
    |   ↓   ↓   |
    ├---ā₁--b̄₁--┤
    └-----------┘

where |bra⟩ = |a₁,b₁⟩ and |ket⟩ = |a₂,b₂⟩, with virtual leg between a, b contracted.

source
PEPSKit.inner_prodMethod
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†---┐
            |   └----┘           |
            └--------------------┘
source
PEPSKit.j1_j2_modelMethod
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.

source
PEPSKit.left_orth_twolayerMethod

Calculate the left_orth of 2-layer PEPO tensor with the east virtual legs transferred to the R tensor

        ↓ ╱
    ----A2-←-           ┌-←-
      ╱ |               |
        ↓     =  (Q)-←--R
        | ╱             |
    ----A1-←-           └-←-
      ╱ ↓

Only R is calculated and returned.

source
PEPSKit.left_projectorMethod
left_projector(
    E_1,
    C_1,
    E_2,
    E_3,
    C_2,
    E_4,
    V,
    isqS,
    A_1,
    A_2
)

Contract the CTMRG left projector with the higher-dimensional subspace facing to the left.

    C_1 -- E_2 -- E_3 -- C_2
     |      |      |      |
    E_1 -- A_1 -- A_2 -- E_4
     |      |      |      |
    out            [~~~V'~]
                       |
                     isqS
                       |
                       in
source
PEPSKit.left_projectorMethod
left_projector(E_1, C, E_2, V, isqS, A)

Contract the CTMRG left projector with the higher-dimensional subspace facing to the left.

     C  --  E_2    -- |~~|
     |       |        |V'| -- isqS --in
    E_1 --   A     -- |~~|
     |       |
    out
source
PEPSKit.lq_throughMethod

Perform LQ decomposition through a GenericMPSTensor

             ╱            ╱
    -←-L0-←-Q-←-  <=  -←-M-←-L1-←-
          ╱ |          ╱ |
source
PEPSKit.nearest_neighbour_hamiltonianMethod
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.

source
PEPSKit.network_valueMethod
network_value(network::InfiniteSquareNetwork, env::CTMRGEnv)

Return the value (per unit cell) of a given contractible network contracted using a given CTMRG environment.

source
PEPSKit.norm_preserving_retractMethod
norm_preserving_retract(A, η, α)

Performs a norm-preserving retraction of vector A along the direction η with step size α, giving a new vector ,

\[A' ← \cos ( α ‖η‖ / ‖A‖ ) A + \sin ( α ‖η‖ / ‖A‖ ) ‖A‖ η / ‖η‖,\]

and corresponding directional derivative ξ,

\[ξ = \cos ( α ‖η‖ / ‖A‖ ) η - \sin ( α ‖η‖ / ‖A‖ ) ‖η‖ A / ‖A‖,\]

such that $⟨ A', ξ ⟩ = 0$ and $‖A'‖ = ‖A‖$.

Note

The vectors A and η should satisfy the interface specified by VectorInterface.jl

source
PEPSKit.norm_preserving_transport!Method
norm_preserving_transport!(ξ, A, η, α, A´)

Transports a direction ξ at A to a valid direction at 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$.

Note

The vectors A and η should satisfy the interface specified by VectorInterface.jl

source
PEPSKit.peps_normalizeMethod
peps_normalize(A::InfinitePEPS)

Normalize the individual tensors in the unit cell of an InfinitePEPS such that they each have unit Euclidean norm.

source
PEPSKit.peps_retractMethod
peps_retract(x, η, α)

Performs a norm-preserving retraction of an infinite PEPS A = x[1] along η with step size α, giving a new PEPS ,

\[A' ← \cos ( α ‖η‖ / ‖A‖ ) A + \sin ( α ‖η‖ / ‖A‖ ) ‖A‖ η / ‖η‖,\]

and corresponding directional derivative ξ,

\[ξ = \cos ( α ‖η‖ / ‖A‖ ) η - \sin ( α ‖η‖ / ‖A‖ ) ‖η‖ A / ‖A‖,\]

such that $⟨ A', ξ ⟩ = 0$ and $‖A'‖ = ‖A‖$.

source
PEPSKit.peps_transport!Method
peps_transport!(ξ, x, η, α, x´)

Transports a direction at A = x[1] to a valid direction at A´ = x´[1] corresponding to the norm-preserving retraction of A along η with step size α. In particular, starting from a direction η of the form

\[ξ = ⟨ η / ‖η‖, ξ ⟩ η / ‖η‖ + Δξ\]

where $⟨ Δξ, A ⟩ = ⟨ Δξ, η ⟩ = 0$, it returns

\[ξ(α) = ⟨ η / ‖η‖, ξ ⟩ ( \cos ( α ‖η‖ / ‖A‖ ) η / ‖η‖ - \sin( α ‖η‖ / ‖A‖ ) A / ‖A‖ ) + Δξ\]

such that $‖ξ(α)‖ = ‖ξ‖, ⟨ A', ξ(α) ⟩ = 0$.

source
PEPSKit.periodic_getindexMethod
periodic_getindex(A, data, I::Tuple)

Periodic indexing of A[I...] backed by data. For I::Vararg{Int}, this yields data[mod1.(I, size(data))...]. Mixed index arguments (Int / CartesianIndex) are supported by flattening with Base.to_indices.

Warning

Linear indexing schemes are not supported.

source
PEPSKit.periodic_setindex!Method
periodic_setindex!(A, data, v, I::Tuple)

Periodic indexing assignment A[I...] = v backed by data, returning v so that the syntax A[I...] = v evaluates to v in line with Base Julia conventions. For I::Vararg{Int}, this yields data[mod1.(I, size(data))...] = v. Mixed index arguments (Int / CartesianIndex) are supported by flattening with Base.to_indices.

Warning

Linear indexing schemes are not supported.

source
PEPSKit.positive_approxMethod

Find positive approximant Z† Z of a norm tensor benv (returns the "half environment" Z)

    ┌-----------------┐     ┌---------------┐
    | ┌----┐          |     |               |
    └-|    |-- 3  4 --┘     └-- Z -- 3  4 --┘
      |benv|            =       ↓
    ┌-|    |-- 1  2 --┐     ┌-- Z†-- 1  2 --┐
    | └----┘          |     |               |
    └-----------------┘     └---------------┘
source
PEPSKit.product_pepsMethod
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.

source
PEPSKit.pwave_superconductorMethod
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.

source
PEPSKit.qr_throughMethod

Perform QR decomposition through a GenericMPSTensor

             ╱            ╱
    -←-R0-←-M-←-  =>  ---Q-←-R1-←-
          ╱ |          ╱ |
source
PEPSKit.reduced_densitymatrixFunction

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.

source
PEPSKit.renormalize_cornerMethod
renormalize_corner(quadrant, P_left, P_right)

Apply projectors to each side of a quadrant.

    |~~~~~~~~| -- |~~~~~~|
    |quadrant|    |P_left| --in
    |~~~~~~~~| -- |~~~~~~|
     |     |
    [P_right]
        |
       out
source
PEPSKit.renormalize_east_edgeMethod
renormalize_east_edge((row, col), env, P_left, P_right, network::InfiniteSquareNetwork{P})
renormalize_east_edge(E_east, P_left, P_right, A::P)

Absorb a local effective tensor into the east edge using the given projectors and environment tensors.

          out
           |
      [~P_right~]
       |       |
    -- A -- E_east
       |       |
      [~~P_left~]
           |
           in
source
PEPSKit.renormalize_north_edgeMethod
renormalize_north_edge((row, col), env, P_left, P_right, network::InfiniteSquareNetwork{P})
renormalize_north_edge(E_north, P_left, P_right, A::P)

Absorb a local effective tensor A into the north edge using the given projectors and environment tensors.

          |~~~~~~~| -- E_north -- |~~~~~~|
    out-- |P_right|       |       |P_left| --in
          |~~~~~~~| --    A    -- |~~~~~~|
                          |
source
PEPSKit.renormalize_northeast_cornerMethod
renormalize_northeast_corner((row, col), enlarged_env, P_left, P_right)
renormalize_northeast_corner(quadrant, P_left, P_right)
renormalize_northeast_corner(E_north, C_northeast, E_east, P_left, P_right, A)

Apply renormalize_corner to the enlarged northeast corner.

          |~~~~~~~| -- |~~~~~~~~|
    out-- |P_right|    |quadrant|
          |~~~~~~~| -- |~~~~~~~~|
                         |    |
                        [P_left]
                            |
                            in

Alternatively, provide the constituent tensors and perform the complete contraction.

          |~~~~~~~| -- E_north -- C_northeast
    out-- |P_right|       |            |
          |~~~~~~~| --    A    --    E_east
                          |            |
                        [~~~~~P_left~~~~~]
                                 |
                                 in
source
PEPSKit.renormalize_northwest_cornerMethod
renormalize_northwest_corner((row, col), enlarged_env, P_left, P_right)
renormalize_northwest_corner(quadrant, P_left, P_right)
renormalize_northwest_corner(E_west, C_northwest, E_north, P_left, P_right, A)

Apply renormalize_corner to the enlarged northwest corner.

    |~~~~~~~~| -- |~~~~~~|
    |quadrant|    |P_left| --in
    |~~~~~~~~| -- |~~~~~~|
     |     |
    [P_right]
        |
       out

Alternatively, provide the constituent tensors and perform the complete contraction.

    C_northwest -- E_north -- |~~~~~~|
         |           |        |P_left| --in
      E_west    --   A     -- |~~~~~~|
         |           |
      [~~~~~P_right~~~~]
               |
              out
source
PEPSKit.renormalize_northwest_cornerMethod
renormalize_northwest_corner((row, col), env, projectors)
renormalize_northwest_corner(C_northwest, E_north, P_right)

Apply right projector to northwest corner and north edge.

     C --- E --in
     |     |
    [P_right]
        |
       out
source
PEPSKit.renormalize_south_edgeMethod
renormalize_south_edge((row, col), env, P_left, P_right, network::InfiniteSquareNetwork{P})
renormalize_south_edge(E_south, P_left, P_right, A::P)

Absorb a local effective tensor into the south edge using the given projectors and environment tensors.

                        |
         |~~~~~~| --    A    -- |~~~~~~~|
    in-- |P_left|       |       |P_right| --out
         |~~~~~~| -- E_south -- |~~~~~~~|
source
PEPSKit.renormalize_southeast_cornerMethod
renormalize_southeast_corner((row, col), enlarged_env, P_left, P_right)
renormalize_southeast_corner(quadrant, P_left, P_right)
renormalize_southeast_corner(E_east, C_southeast, E_south, P_left, P_right, A)

Apply renormalize_corner to the enlarged southeast corner.

                         out
                          |
                      [P_right]
                        |   |
         |~~~~~~| -- |~~~~~~~~|
    in-- |P_left|    |quadrant|
         |~~~~~~| -- |~~~~~~~~|

Alternatively, provide the constituent tensors and perform the complete contraction.

                             out
                              |
                      [~~~~P_right~~~~]
                        |           |
         |~~~~~~| --    A    --   E_east
    in-- |P_left|       |           |
         |~~~~~~| -- E_south -- C_southeast
source
PEPSKit.renormalize_southwest_cornerMethod
renormalize_southwest_corner((row, col), enlarged_env, P_left, P_right)
renormalize_southwest_corner(quadrant, P_left, P_right)
renormalize_southwest_corner(E_south, C_southwest, E_west, P_left, P_right, A)

Apply renormalize_corner to the enlarged southwest corner.

         in
         |
     [P_left]
      |    |
    |~~~~~~~~| -- |~~~~~~~|
    |quadrant|    |P_right| --out
    |~~~~~~~~| -- |~~~~~~~|

Alternatively, provide the constituent tensors and perform the complete contraction.

               in
               |
       [~~~~~P_left~~~~~]
         |            |
       E_west   --    A    -- |~~~~~~~|
         |            |       |P_right| --out
    C_southwest -- E_south -- |~~~~~~~|
source
PEPSKit.renormalize_southwest_cornerMethod
renormalize_southwest_corner((r, c), env, projectors)
renormalize_southwest_corner(C_southwest, E_south, P_left)

Apply left projector to southwest corner and south edge.

        in
        |
    [P_left]
     |    |
     C -- E --out
source
PEPSKit.renormalize_west_edgeMethod
renormalize_west_edge((row, col), env, P_left, P_right, network::InfiniteSquareNetwork{P})
renormalize_west_edge(E_west, P_left, P_right, A::P)

Absorb a local effective tensor into the west edge using the given projectors and environment tensors.

          in
          |
     [~~P_left~]
      |       |
    E_west -- A --
      |       |
     [~P_right~]
          |
         out
source
PEPSKit.right_orth_twolayerMethod

Calculate the right_orth of 2-layer PEPO tensor with the west virtual legs transferred to the L tensor

        ↓ ╱  
    --←-A2---    -←-┐
      ╱ |           |
        ↓      =    L--←-(Q)
        | ╱         |
    --←-A1---    -←-┘
      ╱ ↓    

Only L is calculated and returned.

source
PEPSKit.right_projectorMethod
right_projector(
    E_1,
    C_1,
    E_2,
    E_3,
    C_2,
    E_4,
    U,
    isqS,
    A_1,
    A_2
)

Contract the CTMRG left projector with the higher-dimensional subspace facing to the left.

    C_1 -- E_2 -- E_3 -- C_2
     |      |      |      |
    E_1 -- A_1 -- A_2 -- E_4
     |      |      |      |
     [~~~U'~]             in            
         |
        isqS
         |
        out
source
PEPSKit.right_projectorMethod
right_projector(E_1, C, E_2, U, isqS, A)

Contract the CTMRG right projector with the higher-dimensional subspace facing to the right.

                  |~~| --   E_1   --  C
    out-- isqS -- |U'|      |         |
                  |~~| --   A     -- E_2
                            |         |
                                      in
source
PEPSKit.rotate_northMethod
rotate_north(t, dir)

Rotate the dir direction of t to face north by successive applications of rotl90.

source
PEPSKit.sdiag_powMethod
sdiag_pow(s, pow::Real; tol::Real=eps(real(scalartype(s)))^(3 / 4))

Compute s^pow for a diagonal matrix s.

source
PEPSKit.select_algorithmFunction
select_algorithm(func_or_alg, args...; kwargs...) -> Algorithm

Parse 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...) : a NamedTuple where the algorithm is specified by a Symbol and the algorithm keyword arguments

A full description of the keyword argument can be found in the respective function or algorithm struct docstrings.

source
PEPSKit.sequential_projectorsMethod
sequential_projectors(col::Int, network, env::CTMRGEnv, alg::ProjectorAlgorithm)
sequential_projectors(coordinate::NTuple{3,Int}, network::InfiniteSquareNetwork, env::CTMRGEnv, alg::ProjectorAlgorithm)

Compute CTMRG projectors in the :SequentialCTMRG scheme either for an entire column col or for a specific coordinate (where dir=WEST is already implied in the :SequentialCTMRG scheme).

source
PEPSKit.setcorner!Method
setcorner!(env::CTMRGEnv, value, dir, i, j) -> value

Store value as the corner tensor of env at direction dir and unit-cell coordinates (i, j), with periodic wrapping on (i, j). Returns value.

source
PEPSKit.setedge!Method
setedge!(env::CTMRGEnv, value, dir, i, j) -> value

Store value as the edge tensor of env at direction dir and unit-cell coordinates (i, j), with periodic wrapping on (i, j). Returns value.

source
PEPSKit.simultaneous_projectorsMethod
simultaneous_projectors(enlarged_corners::Array{E,3}, env::CTMRGEnv, alg::ProjectorAlgorithm)
simultaneous_projectors(coordinate, enlarged_corners::Array{E,3}, alg::ProjectorAlgorithm)

Compute CTMRG projectors in the :SimultaneousCTMRG scheme either for all provided enlarged corners or on a specific coordinate.

source
PEPSKit.symmetrize!Method
symmetrize!(peps::InfinitePEPS, ::SymmetrizationStyle)

Symmetrize a PEPS using the given SymmetrizationStyle in-place.

source
PEPSKit.trotterizeMethod

Trotterize the evolution operator exp(-H * dt). Currently, H can only contain the following terms:

  • 1-site terms
  • 2-site nearest neighbor (NN) terms
  • 2-site next-nearest neighbor (NNN) terms

Keyword arguments

  • symmetrize_gates::Bool: if true, use second-order Trotter decomposition.
  • force_mpo::Bool: if true, 2-site nearest-neighbor gates are also decomposed to MPOs.
source
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.

source
PEPSKit.twistnondual!Method
twistnondual(t::AbstractTensorMap, i)
twistnondual!(t::AbstractTensorMap, i)

Twist the i-th leg of a tensor t if it represents a non-dual space.

source
PEPSKit.virtual_projectorMethod

Find the local projector P1, P2 for the following truncation of two layers of InfinitePEPO

        ↓ ╱                 ↓ ╱
    ----A2-←-|╲       ╱|--←-B2---
      ╱ |    | ╲     ╱ |  ╱ |
        ↓    |P1├-←-┤P2|    ↓
        | ╱  | ╱     ╲ |    | ╱
    ----A1-←-|╱       ╲|--←-B1---
      ╱ ↓                 ╱ ↓

Reference: Physical Review B 100, 035449 (2019)

source
PEPSKit.weight_to_absorbMethod

Pick out the weight to be absorbed to the axth domain of the tensor at position [row, col], and take its square root (or inverse square root if inv = true).

source
PEPSKit.@autooptMacro
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.

source
PEPSKit.@fwdthreadsMacro
@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.

source
PEPSKit.@showtypeofgradMacro
@showtypeofgrad(x)

Macro utility to show to type of the gradient that is about to accumulate for x.

See also Zygote.@showgrad.

source
PEPSKit.DefaultsModule
module Defaults

Module containing default algorithm parameter values and arguments.

CTMRG

  • ctmrg_tol=1.0e-8 : Tolerance checking singular value and norm convergence.
  • ctmrg_maxiter=100 : Maximal number of CTMRG iterations per run.
  • ctmrg_miniter=4 : Minimal number of CTMRG carried out.
  • ctmrg_alg=:SimultaneousCTMRG : Default CTMRG algorithm variant.
    • :SimultaneousCTMRG : Simultaneous expansion and renormalization of all sides.
    • :SequentialCTMRG : Sequential application of left moves and rotations.
  • ctmrg_verbosity=2 : CTMRG output information verbosity

SVD forward & reverse

  • trunc=:FixedSpaceTruncation : Truncation scheme for SVDs and other decompositions.

    • :FixedSpaceTruncation : Keep virtual spaces fixed during projection
    • :notrunc : No singular values are truncated and the performed SVDs are exact
    • :truncerror : Additionally supply error threshold η; truncate to the maximal virtual dimension of η
    • :truncrank : Additionally supply truncation dimension η; truncate such that the 2-norm of the truncated values is smaller than η
    • :truncspace : Additionally supply truncation space η; truncate according to the supplied vector space
    • :trunctol : Additionally supply singular value cutoff η; truncate such that every retained singular value is larger than η
  • rrule_degeneracy_atol=1.0e-13 : Broadening amplitude which smoothens the divergent term in the retained contributions of an SVD or eigh pullback, in case of (pseudo) degenerate singular values

  • svd_fwd_alg=:DefaultAlgorithm : SVD algorithm that is used in the forward pass.

    • :DefaultAlgorithm : MatrixAlgebraKit's default SVD algorithm for a given matrix type.
    • :DivideAndConquer : MatrixAlgebraKit's DivideAndConquer
    • :QRIteration : MatrixAlgebraKit's QRIteration
    • :Bisection : MatrixAlgebraKit's Bisection
    • :Jacobi : MatrixAlgebraKit's Jacobi
    • :SVDViaPolar : MatrixAlgebraKit's SVDViaPolar
    • :SafeDivideAndConquer : MatrixAlgebraKit's SafeDivideAndConquer
    • :GKL : Iterative Krylov-based SVD only computing the specifed number of singular values and vectors, see IterSVD for details.
  • svd_rrule_tol=1.0e-8 : Accuracy of SVD reverse-rule.

  • svd_rrule_min_krylovdim=48 : Minimal Krylov dimension of the reverse-rule algorithm (if it is a Krylov algorithm).

  • svd_rrule_verbosity=-1 : SVD gradient output verbosity.

  • svd_rrule_alg=:FullPullback : Reverse-rule algorithm for the SVD gradient.

eigh forward & reverse

  • eigh_fwd_alg=:DefaultAlgorithm : eigh algorithm that is used in the forward pass.
    • :DefaultAlgorithm : MatrixAlgebraKit's default Eigh algorithm for a given matrix type.
    • :DivideAndConquer : MatrixAlgebraKit's DivideAndConquer
    • :QRIteration : MatrixAlgebraKit's QRIteration
    • :Bisection : MatrixAlgebraKit's Bisection
    • :Jacobi : MatrixAlgebraKit's Jacobi
    • :RobustRepresentations : MatrixAlgebraKit's RobustRepresentations
    • :Lanczos : Lanczos algorithm for symmetric/Hermitian matrices, see KrylovKit.Lanczos
    • :BlockLanczos : Block version of :Lanczos for repeated extremal eigenvalues, see KrylovKit.BlockLanczos
  • eigh_rrule_alg=:FullPullback : Reverse-rule algorithm for the eigh gradient.
    • :FullPullback : MatrixAlgebraKit's eigh_pullback! that requires access to the full spectrum
    • :TruncPullback : MatrixAlgebraKit's eigh_trunc_pullback! solving a Sylvester equation on the truncated subspace
  • eigh_rrule_verbosity=0 : eigh gradient output verbosity.

Projectors

  • projector_alg=:HalfInfiniteProjector : Default variant of the CTMRG projector algorithm.
    • :HalfInfiniteProjector : Projection via SVDs of half-infinite (two enlarged corners) CTMRG environments.
    • :FullInfiniteProjector : Projection via SVDs of full-infinite (all four enlarged corners) CTMRG environments.
  • projector_verbosity=0 : Projector output information verbosity.
  • projector_alg_c4v=:C4vEighProjector : Default variant of the C4v CTMRG projector algorithm.
    • :C4vEighProjector : Projection via truncated Eigh of an enlarged corner.
    • :C4vQRProjector : Projection via QR decomposition of a column-enlarged corner.

Fixed-point gradient

  • gradient_alg=:FixedPointGradient : Algorithm variant for computing the implicit gradient of the contraction routine.
  • gradient_tol=1.0e-6 : Convergence tolerance for the gradient algorithm.
  • gradient_maxiter=30 : Maximal number of iterations for the gradient computation.
  • gradient_verbosity=-1 : Gradient output information verbosity.
  • gradient_fixedpoint_solver_alg=:Arnoldi : Default solver algorithm for the FixedPointGradient gradient algorithm.
    • :GMRES : GMRES iterative linear solver, see KrylovKit.GMRES for details
    • :BiCGStab : BiCGStab iterative linear solver, see KrylovKit.BiCGStab for details
    • :Arnoldi : Arnoldi Krylov algorithm, see KrylovKit.Arnoldi for details
    • :GeomSum : Geometric sum approximation of the Neumann series of the inverse Jacobian, see PEPSKit.GeomSum for details
    • :ManualIter : Manual fixed-point iteration, see PEPSKit.ManualIter for details
  • gradient_fixedpoint_solver_eager=true : Enables :Arnoldi solver algorithm to finish before the full Krylov dimension is reached.

Optimization

  • reuse_env=true : If true, 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 : Default OptimKit.OptimizerAlgorithm for PEPS optimization.
  • 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 via set_scheduler!.
source
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().

source