Library

PEPSKit.ALSTruncationType
struct ALSTruncation

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-15 : ALS converges when fidelity change 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.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(wts::SUWeight, peps::InfinitePEPS)

Construct a CTMRG environment with bond dimension χ = 1 for an InfinitePEPS peps from the accompanying SUWeight wts. The scalartype of the returned environment is always Float64.

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.EigSolverType
struct EigSolver{F} <: PEPSKit.GradMode{F}

Gradient mode wrapper around KrylovKit.KrylovAlgorithm for solving the gradient linear problem as an eigenvalue problem.

Fields

  • solver_alg::KrylovKit.KrylovAlgorithm

Constructors

EigSolver(; kwargs...)

Construct the EigSolver algorithm struct based on the following keyword arguments:

  • tol::Real=1.0e-6 : Convergence tolerance of the eigen solver.
  • maxiter::Int=30 : Maximal number of solver iterations.
  • verbosity::Int=-1 : Output information verbosity of the linear solver.
  • iterscheme::Symbol=:fixed : Style of CTMRG iteration which is being differentiated, which can be:
    • :fixed : the differentiated CTMRG iteration uses a pre-computed SVD with a fixed set of gauges
    • :diffgauge : the differentiated iteration consists of a CTMRG iteration and a subsequent gauge-fixing step such that the gauge-fixing procedure is differentiated as well
  • solver_alg::Union{KrylovKit.KrylovAlgorithm,NamedTuple}=(; alg=:arnoldi : Eigen solver algorithm which, if supplied directly as a KrylovKit.KrylovAlgorithm overrides the above specified tol, maxiter and verbosity. Alternatively, it can be supplied via a NamedTuple where alg can be one of the following:
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.FixedSVDType
struct FixedSVD{Ut, St, Vt, Utf, Stf, Vtf}

SVD struct containing a pre-computed decomposition or even multiple ones. Additionally, it can contain the untruncated full decomposition as well. The call to svd_trunc just returns the pre-computed U, S and V. In the reverse pass, the SVD adjoint is computed with these exact U, S, and V and, potentially, the full decompositions if the adjoints needs access to them.

Fields

  • U::Any

  • S::Any

  • V::Any

  • U_full::Any

  • S_full::Any

  • V_full::Any

source
PEPSKit.FixedSpaceTruncationType
struct FixedSpaceTruncation <: MatrixAlgebraKit.TruncationStrategy

CTMRG specific truncation strategy for svd_trunc which keeps the bond space on which the SVD is performed fixed. Since different environment directions and unit cell entries might have different spaces, this truncation style is different from TruncationSpace.

source
PEPSKit.FullEnvTruncationType
struct FullEnvTruncation

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-15 : FET converges when fidelity change 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

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

  • svd_alg::SVDAdjoint

  • trunc::Any

  • verbosity::Int64

Constructors

FullInfiniteProjector(; kwargs...)

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

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

SVD reverse-rule algorithm which uses a modified version of TensorKit's tsvd! reverse-rule allowing for Lorentzian broadening and output verbosity control.

Fields

  • broadening::Float64

  • verbosity::Int64

Constructors

FullSVDReverseRule(; kwargs...)

Construct a FullSVDReverseRule algorithm struct from the following keyword arguments:

  • broadening::Float64=1.0e-13 : Lorentzian broadening amplitude for smoothing divergent term in SVD derivative in case of (pseudo) degenerate singular values.
  • verbosity::Int=0 : Suppresses all output if ≤0, prints gauge dependency warnings if 1, and always prints gauge dependency if ≥2.
source
PEPSKit.GeomSumType
struct GeomSum{F} <: PEPSKit.GradMode{F}

Gradient mode for CTMRG using explicit evaluation of the 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
  • iterscheme::Symbol=:fixed : Style of CTMRG iteration which is being differentiated, which can be:
    • :fixed : the differentiated CTMRG iteration uses a pre-computed SVD with a fixed set of gauges
    • :diffgauge : the differentiated iteration consists of a CTMRG iteration and a subsequent gauge-fixing step such that the gauge-fixing procedure is differentiated as well
source
PEPSKit.GradModeMethod
GradMode(; kwargs...)

Keyword argument parser returning the appropriate GradMode 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

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

  • svd_alg::SVDAdjoint

  • trunc::Any

  • verbosity::Int64

Constructors

HalfInfiniteProjector(; kwargs...)

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

  • svd_alg::Union{<:SVDAdjoint,NamedTuple}=SVDAdjoint() : SVD algorithm including the reverse rule. See SVDAdjoint.
  • trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:fixedspace) : Truncation strategy for the projector computation, which controls the resulting virtual spaces. Here, alg can be one of the following:
    • :fixedspace : Keep virtual spaces fixed during projection
    • :notrunc : No singular values are truncated and the performed SVDs are exact
    • :truncerror : Additionally supply error threshold η; truncate to the maximal virtual dimension of η
    • :truncrank : Additionally supply truncation dimension η; truncate such that the 2-norm of the truncated values is smaller than η
    • :truncspace : Additionally supply truncation space η; truncate according to the supplied vector space
    • :trunctol : Additionally supply singular value cutoff η; truncate such that every retained singular value is larger than η
  • verbosity::Int=0 : Projector output verbosity which can be:
    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.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=random_start_vector : Function providing the initial vector for the iterative SVD algorithm.
source
PEPSKit.LinSolverType
struct LinSolver{F} <: PEPSKit.GradMode{F}

Gradient mode wrapper around KrylovKit.LinearSolver for solving the gradient linear problem using iterative solvers.

Fields

  • solver_alg::KrylovKit.LinearSolver

Constructors

LinSolver(; kwargs...)

Construct the LinSolver algorithm struct based on the following keyword arguments:

  • tol::Real=1.0e-6 : Convergence tolerance of the linear solver.
  • maxiter::Int=30 : Maximal number of solver iterations.
  • verbosity::Int=-1 : Output information verbosity of the linear solver.
  • iterscheme::Symbol=:fixed : Style of CTMRG iteration which is being differentiated, which can be:
    • :fixed : the differentiated CTMRG iteration uses a pre-computed SVD with a fixed set of gauges
    • :diffgauge : the differentiated iteration consists of a CTMRG iteration and a subsequent gauge-fixing step such that the gauge-fixing procedure is differentiated as well
  • solver_alg::Union{KrylovKit.LinearSolver,NamedTuple}=(; alg::Symbol=:bicgstab : Linear solver algorithm which, if supplied directly as a KrylovKit.LinearSolver overrides the above specified tol, maxiter and verbosity. Alternatively, it can be supplied via a NamedTuple where alg can be one of the following:
source
PEPSKit.LocalOperatorType
struct LocalOperator{T<:Tuple, S}

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

Fields

  • lattice::Matrix{S}: The lattice on which the operator acts.
  • terms::T: The terms of the operator, stored as a tuple of pairs of indices and operators.

Constructors

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

Examples

lattice = fill(ℂ^2, 1, 1) # single-site unitcell
O1 = LocalOperator(lattice, ((1, 1),) => σx, ((1, 1), (1, 2)) => σx ⊗ σx, ((1, 1), (2, 1)) => σx ⊗ σx)
source
PEPSKit.ManualIterType
struct ManualIter{F} <: PEPSKit.GradMode{F}

Gradient mode for CTMRG using manual iteration to solve the linear problem.

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
  • iterscheme::Symbol=:fixed : Style of CTMRG iteration which is being differentiated, which can be:
    • :fixed : the differentiated CTMRG iteration uses a pre-computed SVD with a fixed set of gauges
    • :diffgauge : the differentiated iteration consists of a CTMRG iteration and a subsequent gauge-fixing step such that the gauge-fixing procedure is differentiated as well
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{G}

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

Fields

  • boundary_alg::PEPSKit.CTMRGAlgorithm

  • 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,<:GradMode}
  • 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.ProjectorAlgorithmMethod
ProjectorAlgorithm(; kwargs...)

Keyword argument parser returning the appropriate ProjectorAlgorithm algorithm struct.

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.SUWeightType
struct SUWeight{E<:PEPSWeight}

Schmidt bond weights used in simple/cluster update. Weight elements are always real and non-negative. The domain and codomain of each weight matrix must be an un-dualed ElementarySpace.

For a square lattice InfinitePEPS, the weights are placed as

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

Axis order of each weight matrix is

    x-weights:
        1 ← x ← 2   or   2 → x → 1
    
    y-weights:
        2           1
        ↓           ↑  
        y    or     y
        ↓           ↑
        1           2

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(pepo::InfinitePEPO)

Create an SUWeight for a given one-layer InfinitePEPO. The weights are initialized as identity matrices of element type Float64.

source
PEPSKit.SUWeightMethod
SUWeight(peps::InfinitePEPS)

Create an SUWeight for a given InfinitePEPS. The weights are initialized as identity matrices of element type Float64.

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

Create an SUWeight by specifying the vertical (north) or horizontal (east) virtual bond spaces. Each individual space can be specified as either an Int or an ElementarySpace. The weights are initialized as identity matrices of element type Float64.

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

Create an SUWeight by specifying its vertical (north) and horizontal (east) as ElementarySpaces) and unit cell size. The weights are initialized as identity matrices of element type Float64.

source
PEPSKit.SVDAdjointType
struct SVDAdjoint{F, R}

Wrapper for a SVD algorithm fwd_alg with a defined reverse rule rrule_alg. If isnothing(rrule_alg), Zygote differentiates the forward call automatically.

Fields

  • fwd_alg::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=sdd): SVD algorithm of the forward pass which can either be passed as an Algorithm instance or a NamedTuple where alg is one of the following:
    • :sdd: MatrixAlgebraKit's LAPACK_DivideAndConquer
    • :svd: MatrixAlgebraKit's LAPACK_QRIteration
    • :iterative : Iterative SVD only computing the specifed number of singular values and vectors, see IterSVD
  • rrule_alg::Union{Algorithm,NamedTuple}=(; alg::Symbol=full): 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:
    • :full: Uses a modified version of TensorKit's reverse-rule for tsvd which doesn't solve any linear problem and instead requires access to the full SVD, see FullSVDReverseRule.
    • :gmres: GMRES iterative linear solver, see the KrylovKit docs for details
    • :bicgstab: BiCGStab iterative linear solver, see the KrylovKit docs for details
    • :arnoldi: Arnoldi Krylov algorithm, see the KrylovKit docs for details
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=:fixedspace)
  • svd_alg::Union{<:SVDAdjoint,NamedTuple}
  • projector_alg::Symbol=:halfinfinite
source
PEPSKit.SimpleUpdateType
struct SimpleUpdate <: 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_3site::Bool: When true, force the usage of 3-site simple update

  • bipartite::Bool: (Only applicable to InfinitePEPS) 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=:fixedspace)
  • svd_alg::Union{<:SVDAdjoint,NamedTuple}
  • projector_alg::Symbol=:halfinfinite
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, G, S, N <: Number}

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

Fields

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

  • dt::Number: Trotter time step

  • nstep::Int64: The number of iteration steps

  • gate::Any: Trotter 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::InfiniteState, H::LocalOperator, dt::Number, nstep::Int, 
    alg::SimpleUpdate, env0::SUWeight; t0::Number = 0.0
)

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

  • The initial time is specified by t0.
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
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₀, 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=:simultaneous : Variant of the CTMRG algorithm. See also CTMRGAlgorithm.
    • :simultaneous: Simultaneous expansion and renormalization of all sides.
    • :sequential: Sequential application of left moves and rotations.

Projector algorithm

  • trunc::Union{TruncationStrategy,NamedTuple}=(; alg::Symbol=:fixedspace) : Truncation strategy for the projector computation, which controls the resulting virtual spaces. Here, alg can be one of the following:
    • :fixedspace : Keep virtual spaces fixed during projection
    • :notrunc : No singular values are truncated and the performed SVDs are exact
    • :truncerror : Additionally supply error threshold η; truncate to the maximal virtual dimension of η
    • :truncrank : Additionally supply truncation dimension η; truncate such that the 2-norm of the truncated values is smaller than η
    • :truncspace : Additionally supply truncation space η; truncate according to the supplied vector space
    • :trunctol : Additionally supply singular value cutoff η; truncate such that every retained singular value is larger than η
  • svd_alg::Union{<:SVDAdjoint,NamedTuple} : SVD algorithm for computing projectors. See also SVDAdjoint. By default, a reverse-rule tolerance of tol=1e1tol where the krylovdim is adapted to the env₀ environment dimension.
  • projector_alg::Symbol=:halfinfinite : Variant of the projector algorithm. See also ProjectorAlgorithm.
    • :halfinfinite : Projection via SVDs of half-infinite (two enlarged corners) CTMRG environments.
    • :fullinfinite : Projection via SVDs of full-infinite (all four enlarged corners) CTMRG environments.

Return values

The CTMRG routine returns the final CTMRG environment as well as an information NamedTuple containing the following fields:

  • truncation_error : Last (maximal) SVD truncation error of the CTMRG projectors.
  • condition_number : Last (maximal) condition number of the enlarged CTMRG environment.

In case the alg is a SimultaneousCTMRG, the last SVD will also be returned:

  • U : Last unit cell of left singular vectors.
  • S : Last unit cell of singular values.
  • V : Last unit cell of right singular vectors.

If, in addition, the specified SVD algorithm computes the full, untruncated SVD, the full set of vectors and values will be returned as well:

  • U_full : Last unit cell of all left singular vectors.
  • S_full : Last unit cell of all singular values.
  • V_full : Last unit cell of all right singular vectors.
source
MPSKit.physicalspaceMethod
physicalspace(O::LocalOperator)

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

source
MPSKit.time_evolveMethod
time_evolve(
    it::TimeEvolver{<:SimpleUpdate}; 
    tol::Float64 = 0.0, check_interval::Int = 500
) -> (psi, env, info)

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

  • Setting tol > 0 enables convergence check (for imaginary time evolution of InfinitePEPS only). For other usages it should not be changed.
  • check_interval sets the number of iterations between outputs of information.
source
MPSKit.time_evolveMethod
time_evolve(
    psi0::Union{InfinitePEPS, InfinitePEPO}, H::LocalOperator, 
    dt::Number, nstep::Int, alg::SimpleUpdate, env0::SUWeight;
    tol::Float64 = 0.0, t0::Number = 0.0, check_interval::Int = 500
) -> (psi, env, info)

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

  • Setting tol > 0 enables convergence check (for imaginary time evolution of InfinitePEPS only). For other usages it should not be changed.
  • Use t0 to specify the initial time of the evolution.
  • check_interval sets the interval to output information. Output during the evolution can be turned off by setting check_interval <= 0.
  • 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.svd_truncMethod
svd_trunc(t, alg::SVDAdjoint; trunc=notrunc())
svd_trunc!(t, alg::SVDAdjoint; trunc=notrunc())

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

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

Apply 2-site gate on the reduced matrices a, b

    -1← a --- 3 --- b ← -4          -2         -3
        ↓           ↓               ↓           ↓
        1           2               |----gate---|
        ↓           ↓       or      ↓           ↓
        |----gate---|               1           2
        ↓           ↓               ↓           ↓
        -2         -3           -1← a --- 3 --- b ← -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
        ↓       ↓       ↓

In the cluster, the axes of each tensor use the MPS order

    PEPS:           PEPO:
           3             3  4
          ╱              | ╱
    1 -- M -- 5     1 -- M -- 6
       ╱ |             ╱ |
      4  2            5  2
    M[1 2 3 4; 5]  M[1 2 3 4 5; 6]
source
PEPSKit._combine_abMethod
_combine_ab(a, b)

Contract the axis between a and b tensors

    -- DX - a - D - b - DY --
            ↓       ↓
            da      db
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_benvXYMethod

When the (half) bond environment Z consists of two PEPSOrth tensors X, Y as

    ┌---------------┐   ┌-------------------┐
    |               | = |                   | ,
    └---Z--       --┘   └--Z0---X--    --Y--┘
        ↓                  ↓

apply the gauge transformation Linv, Rinv for Z to X, Y:

        -1                                     -1
         |                                      |
    -4 - X - 1 - Rinv - -2      -4 - Linv - 1 - Y - -2
         |                                      |
        -3                                     -3
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_allprojsMethod

Given a cluster Ms and the pre-calculated R, L bond matrices, find all projectors Pa, Pb and Schmidt weights wts on internal bonds.

source
PEPSKit._get_gatempo_seMethod

Obtain the 3-site gate MPO on the southeast cluster at position [row, col]

    r-1        g3
                |
                ↓
    r   g1 -←- g2
        c      c+1
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

    rev = false: - Pa --←-- Pb -
                    1 ← s ← 2

    rev = true:  - Pa --→-- Pb - 
                    2 → s → 1
source
PEPSKit._qr_bondMethod
_qr_bond(A, B; gate_ax)

Use QR decomposition on two tensors A, B connected by a bond to get the reduced tensors. When A, B are PEPSTensors,

        2                   1                                   1
        |                   |                                   |
    5 -A/B- 3   ====>   4 - X ← 2   1 ← a - 3   1 - b → 3   4 → Y - 2
        | ↘                 |            ↘           ↘          |
        4   1               3             2           2         3

When A, B are PEPOTensors,

  • If gate_ax = 1
    2   3                1  2                                1  2
      ↘ |                 ↘ |                                 ↘ |
    6 -A/B- 4   ====>   5 - X ← 3   1 ← a - 3   1 - b → 3   5 → Y - 3
        | ↘                 |            ↘           ↘          |
        5   1               4             2           2         4
  • If gate_ax = 2
    2   3                   2         2           2             2
      ↘ |                   |          ↘           ↘            |
    6 -A/B- 4   ====>   5 - X ← 3   1 ← a - 3   1 - b → 3   5 → Y - 3
        | ↘                 | ↘                                 | ↘
        5   1               4  1                                4  1
source
PEPSKit._qr_bond_undoMethod
_qr_bond_undo(X, a, b, Y)

Reconstruct the tensors connected by a bond from their _qr_bond results. For PEPSTensors,

        -2                             -2
        |                               |
    -5- X - 1 - a - -3     -5 - b - 1 - Y - -3
        |        ↘               ↘      |
        -4        -1              -1   -4

For PEPOTensors

    -2  -3                          -2  -3
      ↘ |                             ↘ |
    -6- X - 1 - a - -4     -6 - b - 1 - Y - -4
        |        ↘               ↘      |
        -5        -1              -1   -5

        -3   -2              -2        -3
        |      ↘               ↘        |
    -6- X - 1 - a - -4     -6 - b - 1 - Y - -4
        | ↘                             | ↘
        -5 -1                          -5  -1
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._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_abMethod
_solve_ab(Rx, Sx, x0)

Solve the equations Rx x = Sx (x = a, b) with initial guess x0

    ┌---------------------------┐
    |   ┌----┐                  |
    └---|    |--- 1 -- x -- 2 --┘
        |    |         ↓
        | Rx |        -3
        |    |
    ┌---|    |--- -1       -2 --┐
    |   └----┘                  |
    └---------------------------┘
source
PEPSKit._su_xbond!Method

Simple update of the x-bond between [r,c] and [r,c+1].

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

When gate_ax = 1 (or 2), the gate will be applied to the codomain (or domain) physicsl legs of state.

source
PEPSKit._su_ybond!Method

Simple update of the y-bond between [r,c] and [r-1,c].

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

When gate_ax = 1 (or 2), the gate will be applied to the codomain (or domain) physicsl legs of state.

source
PEPSKit._tensor_RaMethod
_tensor_Ra(benv, b)

Construct the tensor

    ┌-----------------------------------┐
    |   ┌----┐                          |
    └---|    |- DX0     Db0 - b -- DY0 -┘
        |    |                ↓
        |benv|                db
        |    |                ↓
    ┌---|    |- DX1     Db1 - b† - DY1 -┐
    |   └----┘                          |
    └-----------------------------------┘
source
PEPSKit._tensor_RbMethod
_tensor_Rb(benv, a)

Construct the tensor

    ┌-----------------------------------┐
    |   ┌----┐                          |
    └---|    |- DX0 - a -- Da0     DY0 -┘
        |    |        ↓
        |benv|        da
        |    |        ↓
    ┌---|    |- DX1 - a† - Da1     DY1 -┐
    |   └----┘                          |
    └-----------------------------------┘
source
PEPSKit._tensor_SaMethod
_tensor_Sa(benv, b, a2b2)

Construct the tensor

    ┌-----------------------------------┐
    |   ┌----┐                          |
    └---|    |- DX0 -- (a2 b2) -- DY0 --┘
        |    |         ↓     ↓
        |benv|         da    db
        |    |               ↓
    ┌---|    |- DX1   Db1 -- b† - DY1 --┐
    |   └----┘                          |
    └-----------------------------------┘
source
PEPSKit._tensor_SbMethod
_tensor_Sb(benv, a, a2b2)

Construct the tensor

    ┌-----------------------------------┐
    |   ┌----┐                          |
    └---|    |- DX0 -- (a2 b2) -- DY0 --┘
        |    |         ↓     ↓
        |benv|         da    db
        |    |         ↓
    ┌---|    |- DX1 -- a† - Da1   DY1 --┐
    |   └----┘                          |
    └-----------------------------------┘
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, row::Int, col::Int, ax::Int; inv::Bool = false)
absorb_weight(t::Union{PEPSTensor, PEPOTensor}, weights::SUWeight, row::Int, col::Int, ax::NTuple{N, Int}; inv::Bool = false)

Absorb or remove environment weight on an axis of tensor t known to be located at position (row, col) in the unit cell of an InfinitePEPS or InfinitePEPO. Weights around the tensor at (row, col) are

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

Arguments

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

Keyword arguments

  • inv::Bool=false : 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_truncateMethod
bond_truncate(a::AbstractTensorMap{T,S,2,1}, b::AbstractTensorMap{T,S,1,2}, benv::BondEnv{T,S}, 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 is

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

Construct the environment (norm) tensor

    C1---T1---------T1---C2   r-1
    |    ‖          ‖    |
    T4===XX==     ==YY===T2    r
    |    ‖          ‖    |
    C4---T3---------T3---C3   r+1
    c-1  c         c+1  c+2

where XX = X' X and YY = Y' Y (stacked together).

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

    ┌---------------------┐
    | ┌----┐              |
    └-|    |---DX0  DY0---┘
      |benv|
    ┌-|    |---DX1  DY1---┐
    | └----┘              |
    └---------------------┘
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.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.compute_projectorMethod
compute_projector(enlarged_corners, coordinate, alg::ProjectorAlgorithm)

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

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.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, a1b1, a2b2)

Calculate the cost function

    f(a,b)  = ‖ |a1,b1⟩ - |a2,b2⟩ ‖^2
    = ⟨a1,b1|a1,b1⟩ - 2 Re⟨a1,b1|a2,b2⟩ + ⟨a2,b2|a2,b2⟩
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.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
transfer_right(v, Et, Eb)

Apply an edge transfer matrix to the right.

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

    -- E_north -- C_northeast
          |             |
    --    A    --    E_east
          |             |
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 --
         |            |
      E_west    --    A    --
         |            |
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.

          |             |
    --    A    --    E_east
          |             |
    -- 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.

          |           |
       E_west   --    A    --
          |           |
    C_southwest -- E_south --
source
PEPSKit.fidelityMethod
fidelity(benv, b1, b2)

Given the bond environment benv, calculate the fidelity between two states specified by the bond matrices b1, b2

    F(b1, b2) = (⟨b1|b2⟩ ⟨b2|b1⟩) / (⟨b1|b1⟩ ⟨b2|b2⟩)
source
PEPSKit.fidelityMethod
fidelity(benv, a1b1, a2b2)

Calculate the fidelity between two evolution steps

        |⟨a1,b1|a2,b2⟩|^2
    --------------------------
    ⟨a1,b1|a1,b1⟩⟨a2,b2|a2,b2⟩
source
PEPSKit.fix_gauge_cornerMethod
fix_gauge_corner(corner, σ_in, σ_out)

Multiply corner tensor with incoming and outgoing gauge signs.

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

Multiply edge tensor with incoming and outgoing gauge signs.

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

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

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

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

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

Keyword arguments

General settings

  • tol::Real=0.0001 : Overall tolerance for gradient norm convergence of the optimizer. Sets related tolerance such as the boundary and boundary-gradient tolerances to sensible defaults unless they are explictly specified.
  • verbosity::Int=1 : Overall output information verbosity level, should be one of the following:
    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.
  • (finalize!)=OptimKit._finalize! : Inserts a finalize! function call after each optimization step by utilizing the finalize! kwarg of OptimKit.optimize. The function maps (peps, env), f, g = finalize!((peps, env), f, g, numiter).

Boundary algorithm

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

Gradient algorithm

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

  • tol::Real=1e-2tol : Convergence tolerance for the fixed-point gradient iteration.
  • maxiter::Int=30 : Maximal number of gradient problem iterations.
  • alg::Symbol=:eigsolver : Gradient algorithm variant, can be one of the following:
    • :geomsum : Compute gradient directly from the geometric sum, see GeomSum
    • :manualiter : Iterate gradient geometric sum manually, see ManualIter
    • :linsolver : Solve fixed-point gradient linear problem using iterative solver, see LinSolver
    • :eigsolver : Determine gradient via eigenvalue formulation of its Sylvester equation, see EigSolver
  • verbosity::Int : Gradient output verbosity, ≤0 by default to disable too verbose printing. Should only be >0 for debug purposes.
  • iterscheme::Symbol=:fixed : CTMRG iteration scheme determining mode of differentiation. This can be:
    • :fixed : the differentiated CTMRG iteration uses a pre-computed SVD with a fixed set of gauges
    • :diffgauge : the differentiated iteration consists of a CTMRG iteration and a subsequent gauge-fixing step such that the gauge-fixing procedure is differentiated as well

Optimizer settings

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

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

Return values

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

  • last_gradient : Last gradient of the cost function.
  • fg_evaluations : Number of evaluations of the cost and gradient function.
  • costs : History of cost values.
  • gradnorms : History of gradient norms.
  • truncation_errors : History of maximal truncation errors of the boundary algorithm.
  • condition_numbers : History of maximal condition numbers of the CTMRG environments.
  • gradnorms_unitcell : History of gradient norms for each respective unit cell entry.
  • times : History of optimization step execution times.
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.flip_svdMethod
flip_svd(u::AbstractTensorMap, s::DiagonalTensorMap, vh::AbstractTensorMap)

Given SVD result u ← s ← vh, flip the arrow between the three tensors to u2 → s2 → vh2 such that

    u * s * vh = (@tensor t2[-1, ...; -2, ...] := u2[-1, ...; 2] * s2[1; 2] * vh2[1; -2, ...])

The axis orders for s, s2 are

    1 ← s ← 2   2 → s2 → 1
source
PEPSKit.fpgradFunction
fpgrad(∂F∂x, ∂f∂x, ∂f∂A, y0, alg)

Compute the gradient of the CTMRG fixed point by solving the following equation:

dx = ∑ₙ (∂f∂x)ⁿ ∂f∂A dA = (1 - ∂f∂x)⁻¹ ∂f∂A dA

where ∂F∂x is the gradient of the cost function with respect to the PEPS tensors, ∂f∂x is the partial gradient of the CTMRG iteration with respect to the environment tensors, ∂f∂A is the partial gradient of the CTMRG iteration with respect to the PEPS tensors, and y0 is the initial guess for the fixed-point iteration. The function returns the gradient dx of the fixed-point iteration.

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|
    |~~~~~~~~~| -- |~~~~~~~~~|
      |     |        |     |
                     |     |
      |     |        |     |
    |~~~~~~~~~| -- |~~~~~~~~~|
    |quadrant4|    |quadrant3|
    |~~~~~~~~~| -- |~~~~~~~~~|

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

    |~~~~~~~~~~~~~~~~~~~~~~~~|
    |         half1          |
    |~~~~~~~~~~~~~~~~~~~~~~~~|
      |     |        |     |
                     |     |
      |     |        |     |
    |~~~~~~~~~~~~~~~~~~~~~~~~|
    |         half2          |
    |~~~~~~~~~~~~~~~~~~~~~~~~|

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

    C_1 -- E_2 -- E_3 -- C_2
     |      |      |      |
    E_1 -- A_1 -- A_2 -- E_4
     |      |      |      |
                   |      |
     |      |      |      |
    E_8 -- A_4 -- A_3 -- E_5
     |      |      |      |
    C_4 -- E_7 -- E_6 -- C_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
     |      |      |      |
                   |      |
    [~~~~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(benv::BondEnv{T,S}, b0::AbstractTensorMap{T,S,1,1}, 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_mpo3Method

Convert a 3-site gate to MPO form by SVD, in which the axes are ordered as

    2               3               3
    ↓               ↓               ↓
    g1 ←- 3    1 ←- g2 ←- 4    1 ←- g3
    ↓               ↓               ↓
    1               2               2
source
PEPSKit.gauge_fixMethod
gauge_fix(envprev, envfinal)

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

source
PEPSKit.get_3site_seMethod

Obtain the 3-site cluster in the "southeast corner" of a square plaquette.

    r-1         M3
                |
                ↓
    r   M1 -←- M2
        c      c+1
source
PEPSKit.get_exphamMethod
get_expham(H::LocalOperator, dt::Number)

Compute exp(-dt * op) for each term op in H, and combine them into a new LocalOperator. Each op in H must be a single TensorMap.

source
PEPSKit.get_gatetermMethod
get_gateterm(gate::LocalOperator, bond::NTuple{2,CartesianIndex{2}})

Get the term of a 2-site gate acting on a certain bond. Input gate should only include one term for each nearest neighbor bond.

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|
    |~~~~~~~~~| -- |~~~~~~~~~|
      |     |        |     |

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

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

Alternatively, contract the environment with a vector x acting on it

    C_1 -- E_2 -- E_3 -- C_2
     |      |      |      |
    E_1 -- A_1 -- A_2 -- E_4
     |      |      |      |
                  [~~~x~~~~]

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

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_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.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.inner_prodMethod
inner_prod(benv, a1b1, a2b2)

Calculate the inner product <a1,b1|a2,b2>

    ┌--------------------------------┐
    |   ┌----┐                       |
    └---|    |- DX0 - (a2 b2) - DY0 -┘
        |    |        ↓    ↓
        |benv|        da   db
        |    |        ↓    ↓
    ┌---|    |- DX1 - (a1 b1)†- DY1 -┐
    |   └----┘                       |
    └--------------------------------┘
source
PEPSKit.is_equivalent_bondMethod
is_equivalent_bond(bond1::NTuple{2,CartesianIndex{2}}, bond2::NTuple{2,CartesianIndex{2}}, (Nrow, Ncol)::NTuple{2,Int})

Check if two 2-site bonds are related by a (periodic) lattice translation.

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_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 --
    E_1 --   A     -- |~~|
     |       |
source
PEPSKit.lq_throughMethod

Perform LQ decomposition through a tensor

             ╱           ╱
    --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.positive_approxMethod

Replace bond environment benv by its positive approximant Z† Z (returns the "half environment" Z)

    ┌-----------------┐     ┌---------------┐
    | ┌----┐          |     |               |
    └-|    |-- 3  4 --┘     └-- Z -- 3  4 --┘
      |benv|            =       ↓
    ┌-|    |-- 1  2 --┐     ┌-- Z†-- 1  2 --┐
    | └----┘          |     |               |
    └-----------------┘     └---------------┘
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 PEPS tensor

             ╱           ╱
    --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_bottom_cornerMethod
renormalize_bottom_corner((r, c), env, projectors)
renormalize_bottom_corner(C_southwest, E_south, P_bottom)

Apply bottom projector to southwest corner and south edge.

        |
    [P_bottom]
     |     |
     C --  E -- in
source
PEPSKit.renormalize_cornerMethod
renormalize_corner(quadrant, P_left, P_right)

Apply projectors to each side of a quadrant.

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

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

           |
     [~~P_top~~~]
      |        |
   -- A  --  E_east
      |        |
     [~P_bottom~]
           |
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 -- |~~~~~~~|
    -- |P_left|       |       |P_right| --
       |~~~~~~| --    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.

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

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

       |~~~~~~~| -- E_north -- C_northeast
    -- |P_right|       |            |
       |~~~~~~~| --    A    --    E_east
                       |            |
                     [~~~~~P_left~~~~~]
                              |
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| --
    |~~~~~~~~| -- |~~~~~~|
     |     |
    [P_right]
        |

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

    C_northwest -- E_north -- |~~~~~~|
         |           |        |P_left| --
      E_west    --   A     -- |~~~~~~|
         |           |
      [~~~~~P_right~~~~]
               |
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    -- |~~~~~~|
    -- |P_right|       |       |P_left| --
       |~~~~~~~| -- 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.

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

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

                            |
                    [~~~~P_right~~~~]
                      |           |
       |~~~~~~| --    A    --   E_east
    -- |P_left|       |           |
       |~~~~~~| -- E_south -- C_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.

         |
     [P_left]
      |    |
    |~~~~~~~~| -- |~~~~~~|
    |quadrant|    |P_left| --
    |~~~~~~~~| -- |~~~~~~|

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

               |
       [~~~~~P_left~~~~~]
         |            |
       E_west   --    A    -- |~~~~~~~|
         |            |       |P_right| --
    C_southwest -- E_south -- |~~~~~~~|
source
PEPSKit.renormalize_top_cornerMethod
renormalize_top_corner((row, col), env, projectors)
renormalize_top_corner(C_northwest, E_north, P_top)

Apply top projector to northwest corner and north edge.

     C -- E --
     |    |
    [~P_top~]
        |
source
PEPSKit.renormalize_west_edgeMethod
renormalize_west_edge((row, col), env, P_top, P_bottom, network::InfiniteSquareNetwork{P})
renormalize_west_edge(E_west, P_top, P_bottom, A::P)

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

           |
     [~P_bottom~]
      |        |
    E_west --  A --
      |        |
     [~~P_top~~~]
           |
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_2   --  C
    -- isqS -- |U'|      |         |
               |~~| --   A     -- E_1
                         |         |
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(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 :sequential scheme either for an entire column col or for a specific coordinate (where dir=WEST is already implied in the :sequential scheme).

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 :simultaneous 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.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.@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=:simultaneous : Default CTMRG algorithm variant.
    • :simultaneous: Simultaneous expansion and renormalization of all sides.
    • :sequential: Sequential application of left moves and rotations.
  • ctmrg_verbosity=2 : CTMRG output information verbosity

SVD forward & reverse

  • trunc=:fixedspace : Truncation scheme for SVDs and other decompositions.
    • :fixedspace : Keep virtual spaces fixed during projection
    • :notrunc : No singular values are truncated and the performed SVDs are exact
    • :truncerror : Additionally supply error threshold η; truncate to the maximal virtual dimension of η
    • :truncrank : Additionally supply truncation dimension η; truncate such that the 2-norm of the truncated values is smaller than η
    • :truncspace : Additionally supply truncation space η; truncate according to the supplied vector space
    • :trunctol : Additionally supply singular value cutoff η; truncate such that every retained singular value is larger than η
  • svd_fwd_alg=:sdd : SVD algorithm that is used in the forward pass.
    • :sdd: MatrixAlgebraKit's LAPACK_DivideAndConquer
    • :svd: MatrixAlgebraKit's LAPACK_QRIteration
    • :iterative: Iterative SVD only computing the specifed number of singular values and vectors, see IterSVD
  • svd_rrule_tol=1.0e-8 : Accuracy of SVD reverse-rule.
  • svd_rrule_min_krylovdim=48 : Minimal Krylov dimension of the reverse-rule algorithm (if it is a Krylov algorithm).
  • svd_rrule_verbosity=-1 : SVD gradient output verbosity.
  • svd_rrule_alg=:full : Reverse-rule algorithm for the SVD gradient.
    • :full: Uses a modified version of MatrixAlgebraKit's reverse-rule for svd_compact which doesn't solve any linear problem and instead requires access to the full SVD, see PEPSKit.FullSVDReverseRule.
    • :gmres: GMRES iterative linear solver, see the KrylovKit docs for details
    • :bicgstab: BiCGStab iterative linear solver, see the KrylovKit docs for details
    • :arnoldi: Arnoldi Krylov algorithm, see the KrylovKit docs for details
  • svd_rrule_broadening=1.0e-13 : Lorentzian broadening amplitude which smoothens the divergent term in the SVD adjoint in case of (pseudo) degenerate singular values

Projectors

  • projector_alg=:halfinfinite : Default variant of the CTMRG projector algorithm.
    • :halfinfinite: Projection via SVDs of half-infinite (two enlarged corners) CTMRG environments.
    • :fullinfinite: Projection via SVDs of full-infinite (all four enlarged corners) CTMRG environments.
  • projector_verbosity=0 : Projector output information verbosity.

Fixed-point gradient

  • gradient_tol=1.0e-6 : Convergence tolerance for the fixed-point gradient iteration.
  • gradient_maxiter=30 : Maximal number of iterations for computing the CTMRG fixed-point gradient.
  • gradient_verbosity=-1 : Gradient output information verbosity.
  • gradient_linsolver=:bicgstab : Default linear solver for the LinSolver gradient algorithm.
  • gradient_eigsolver=:arnoldi : Default eigensolver for the EigSolver gradient algorithm.
  • gradient_eigsolver_eager=true : Enables EigSolver algorithm to finish before the full Krylov dimension is reached.
  • gradient_iterscheme=:fixed : Scheme for differentiating one CTMRG iteration.
    • :fixed : the differentiated CTMRG iteration uses a pre-computed SVD with a fixed set of gauges
    • :diffgauge : the differentiated iteration consists of a CTMRG iteration and a subsequent gauge-fixing step such that the gauge-fixing procedure is differentiated as well
  • gradient_alg=:eigsolver : Algorithm variant for computing the gradient fixed-point.

Optimization

  • reuse_env=true : 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