diff --git a/dev/examples/index.html b/dev/examples/index.html index 793148fe..31f273c3 100644 --- a/dev/examples/index.html +++ b/dev/examples/index.html @@ -1,2 +1,2 @@ -Examples · PEPSKit.jl
+Examples · PEPSKit.jl
diff --git a/dev/index.html b/dev/index.html index 12817bef..f5710bf4 100644 --- a/dev/index.html +++ b/dev/index.html @@ -20,4 +20,4 @@ ctm = leading_boundary(CTMRGEnv(state, ComplexSpace(chi)), state, ctm_alg) result = fixedpoint(state, H, opt_alg, ctm) -@show result.E # -0.6625... +@show result.E # -0.6625... diff --git a/dev/lib/lib/index.html b/dev/lib/lib/index.html index 0b20062f..a9110911 100644 --- a/dev/lib/lib/index.html +++ b/dev/lib/lib/index.html @@ -1,69 +1,69 @@ -Library · PEPSKit.jl

Library

PEPSKit.CTMRGType
CTMRG(; tol=Defaults.ctmrg_tol, maxiter=Defaults.ctmrg_maxiter,
+Library · PEPSKit.jl

Library

PEPSKit.CTMRGType
CTMRG(; tol=Defaults.ctmrg_tol, maxiter=Defaults.ctmrg_maxiter,
       miniter=Defaults.ctmrg_miniter, verbosity=0,
       svd_alg=SVDAdjoint(), trscheme=FixedSpaceTruncation(),
-      ctmrgscheme=Defaults.ctmrgscheme)

Algorithm struct that represents the CTMRG algorithm for contracting infinite PEPS. Each CTMRG run is converged up to tol where the singular value convergence of the corners as well as the norm is checked. The maximal and minimal number of CTMRG iterations is set with maxiter and miniter. Different levels of output information are printed depending on verbosity, where 0 suppresses all output, 1 only prints warnings, 2 gives information at the start and end, and 3 prints information every iteration.

The projectors are computed from svd_alg SVDs where the truncation scheme is set via trscheme.

In general, two different schemes can be selected with ctmrgscheme which determine how CTMRG is implemented. It can either be :sequential, where the projectors are succesively computed on the western side, and then applied and rotated. Or with :simultaneous all projectors are computed and applied simultaneously on all sides, where in particular the corners get contracted with two projectors at the same time.

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 PEPS tensors 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]
+      ctmrgscheme=Defaults.ctmrgscheme)

Algorithm struct that represents the CTMRG algorithm for contracting infinite PEPS. Each CTMRG run is converged up to tol where the singular value convergence of the corners as well as the norm is checked. The maximal and minimal number of CTMRG iterations is set with maxiter and miniter. Different levels of output information are printed depending on verbosity, where 0 suppresses all output, 1 only prints warnings, 2 gives information at the start and end, and 3 prints information every iteration.

The projectors are computed from svd_alg SVDs where the truncation scheme is set via trscheme.

In general, two different schemes can be selected with ctmrgscheme which determine how CTMRG is implemented. It can either be :sequential, where the projectors are succesively computed on the western side, and then applied and rotated. Or with :simultaneous all projectors are computed and applied simultaneously on all sides, where in particular the corners get contracted with two projectors at the same time.

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 PEPS tensors 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]=====AA[r,c]=======t[2,r,c+1]
    |              ||            |
-   c[4,r+1,c-1]---t[3,r+1,c]----c[3,r+1,c+1]

Fields

  • corners::Array{C,3}: Array of corner tensors.
  • edges::Array{T,3}: Array of edge tensors.
source
PEPSKit.CTMRGEnvMethod
CTMRGEnv(
+   c[4,r+1,c-1]---t[3,r+1,c]----c[3,r+1,c+1]

Fields

  • corners::Array{C,3}: Array of corner tensors.
  • edges::Array{T,3}: Array of edge tensors.
source
PEPSKit.CTMRGEnvMethod
CTMRGEnv(
     [f=randn, ComplexF64], Ds_north, Ds_east::A, chis_north::A, [chis_east::A], [chis_south::A], [chis_west::A]
-) where {A<:AbstractMatrix{<:Union{Int,ElementarySpace}}}

Construct a CTMRG environment by specifying matrices of north and east virtual spaces of the corresponding InfinitePEPS 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.

source
PEPSKit.CTMRGEnvMethod
CTMRGEnv(
+) where {A<:AbstractMatrix{<:Union{Int,ElementarySpace}}}

Construct a CTMRG environment by specifying matrices of north and east virtual spaces of the corresponding InfinitePEPS 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.

source
PEPSKit.CTMRGEnvMethod
CTMRGEnv(
     [f=randn, T=ComplexF64], peps::InfinitePEPS, chis_north::A, [chis_east::A], [chis_south::A], [chis_west::A]
-) where {A<:AbstractMatrix{<:Union{Int,ElementarySpace}}}

Construct a CTMRG environment by specifying a corresponding InfinitePEPS, and the north, east, south and west virtual spaces of the environment as matrices. 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(
+) where {A<:AbstractMatrix{<:Union{Int,ElementarySpace}}}

Construct a CTMRG environment by specifying a corresponding InfinitePEPS, and the north, east, south and west virtual spaces of the environment as matrices. 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(
     peps::InfinitePEPS, chi_north::S, [chi_east::S], [chi_south::S], [chi_west::S],
-) where {S<:Union{Int,ElementarySpace}}

Construct a CTMRG environment by specifying a corresponding InfinitePEPS, and the north, east, south and west virtual spaces of the environment. By default, the virtual 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.CTMRGEnvMethod
CTMRGEnv(
+) where {S<:Union{Int,ElementarySpace}}

Construct a CTMRG environment by specifying a corresponding InfinitePEPS, and the north, east, south and west virtual spaces of the environment. By default, the virtual 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.CTMRGEnvMethod
CTMRGEnv(
     [f=randn, ComplexF64], D_north::S, D_south::S, chi_north::S, [chi_east::S], [chi_south::S], [chi_west::S]; unitcell::Tuple{Int,Int}=(1, 1),
-) where {S<:Union{Int,ElementarySpace}}

Construct a CTMRG environment by specifying the north and east virtual spaces of the corresponding InfinitePEPS and the north, east, south and west virtual spaces of the environment. The PEPS 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.EnlargedCornerMethod
EnlargedCorner(state, envs, 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

SVD struct containing a pre-computed decomposition or even multiple ones. The call to tsvd 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.

source
PEPSKit.FixedSpaceTruncationType
FixedSpaceTruncation <: TensorKit.TruncationScheme

CTMRG specific truncation scheme for tsvd 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.GeomSumType
struct GeomSum(; maxiter=Defaults.fpgrad_maxiter, tol=Defaults.fpgrad_tol,
-               verbosity=0, iterscheme=Defaults.iterscheme) <: GradMode{iterscheme}

Gradient mode for CTMRG using explicit evaluation of the geometric sum.

With iterscheme the style of CTMRG iteration which is being differentiated can be chosen. If set to :fixed, the differentiated CTMRG iteration is assumed to have a pre-computed SVD of the environments with a fixed set of gauges. Alternatively, if set to :diffgauge, the differentiated iteration consists of a CTMRG iteration and a subsequent gauge fixing step, such that gauge_fix will also be differentiated everytime a CTMRG derivative is computed.

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.InfinitePEPOType
struct InfinitePEPO{T<:PEPOTensor}

Represents an infinite projected entangled-pair operator (PEPO) on a 3D cubic lattice.

source
PEPSKit.InfinitePEPOMethod
InfinitePEPO(A; unitcell=(1, 1, 1))

Create an InfinitePEPO by specifying a tensor and 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, Nspace, [Espace]; unitcell=(1,1,1))

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.

source
PEPSKit.InfinitePEPSMethod
InfinitePEPS(A; 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:

   |            |          |
+) where {S<:Union{Int,ElementarySpace}}

Construct a CTMRG environment by specifying the north and east virtual spaces of the corresponding InfinitePEPS and the north, east, south and west virtual spaces of the environment. The PEPS 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.EnlargedCornerMethod
EnlargedCorner(state, envs, 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

SVD struct containing a pre-computed decomposition or even multiple ones. The call to tsvd 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.

source
PEPSKit.FixedSpaceTruncationType
FixedSpaceTruncation <: TensorKit.TruncationScheme

CTMRG specific truncation scheme for tsvd 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.GeomSumType
struct GeomSum(; maxiter=Defaults.fpgrad_maxiter, tol=Defaults.fpgrad_tol,
+               verbosity=0, iterscheme=Defaults.iterscheme) <: GradMode{iterscheme}

Gradient mode for CTMRG using explicit evaluation of the geometric sum.

With iterscheme the style of CTMRG iteration which is being differentiated can be chosen. If set to :fixed, the differentiated CTMRG iteration is assumed to have a pre-computed SVD of the environments with a fixed set of gauges. Alternatively, if set to :diffgauge, the differentiated iteration consists of a CTMRG iteration and a subsequent gauge fixing step, such that gauge_fix will also be differentiated everytime a CTMRG derivative is computed.

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.InfinitePEPOType
struct InfinitePEPO{T<:PEPOTensor}

Represents an infinite projected entangled-pair operator (PEPO) on a 3D cubic lattice.

source
PEPSKit.InfinitePEPOMethod
InfinitePEPO(A; unitcell=(1, 1, 1))

Create an InfinitePEPO by specifying a tensor and 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, Nspace, [Espace]; unitcell=(1,1,1))

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.

source
PEPSKit.InfinitePEPSMethod
InfinitePEPS(A; 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(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(
+   |            ||         ||

The unit cell has periodic boundary conditions, so [r, c] is indexed modulo the size of the unit cell.

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(
     f=randn, T=ComplexF64, Pspaces::A, Nspaces::A, [Espaces::A]
-) where {A<:AbstractMatrix{<:Union{Int,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. Each individual space can be specified as either an Int or an ElementarySpace.

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. Spaces can be specified either via Int or via ElementarySpace.

source
PEPSKit.InfiniteSquareType
InfiniteSquare(Nrows::Integer=1, Ncols::Integer=1)

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

source
PEPSKit.InfiniteTransferPEPOType
InfiniteTransferPEPO{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(; alg=KrylovKit.GKL(), fallback_threshold = Inf)

Iterative SVD solver based on KrylovKit's GKL algorithm, adapted to (symmetric) tensors. The number of targeted singular values is set via the TruncationSpace 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.

source
PEPSKit.LinSolverType
struct LinSolver(; solver=KrylovKit.GMRES(), iterscheme=Defaults.iterscheme) <: GradMode{iterscheme}

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

With iterscheme the style of CTMRG iteration which is being differentiated can be chosen. If set to :fixed, the differentiated CTMRG iteration is assumed to have a pre-computed SVD of the environments with a fixed set of gauges. Alternatively, if set to :diffgauge, the differentiated iteration consists of a CTMRG iteration and a subsequent gauge fixing step, such that gauge_fix will also be differentiated everytime a CTMRG derivative is computed.

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...)
+) where {A<:AbstractMatrix{<:Union{Int,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. Each individual space can be specified as either an Int or an ElementarySpace.

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. Spaces can be specified either via Int or via ElementarySpace.

source
PEPSKit.InfiniteSquareType
InfiniteSquare(Nrows::Integer=1, Ncols::Integer=1)

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

source
PEPSKit.InfiniteTransferPEPOType
InfiniteTransferPEPO{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(; alg=KrylovKit.GKL(), fallback_threshold = Inf)

Iterative SVD solver based on KrylovKit's GKL algorithm, adapted to (symmetric) tensors. The number of targeted singular values is set via the TruncationSpace 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.

source
PEPSKit.LinSolverType
struct LinSolver(; solver=KrylovKit.GMRES(), iterscheme=Defaults.iterscheme) <: GradMode{iterscheme}

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

With iterscheme the style of CTMRG iteration which is being differentiated can be chosen. If set to :fixed, the differentiated CTMRG iteration is assumed to have a pre-computed SVD of the environments with a fixed set of gauges. Alternatively, if set to :diffgauge, the differentiated iteration consists of a CTMRG iteration and a subsequent gauge fixing step, such that gauge_fix will also be differentiated everytime a CTMRG derivative is computed.

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} # expert mode

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(; maxiter=Defaults.fpgrad_maxiter, tol=Defaults.fpgrad_tol,
-                  verbosity=0, iterscheme=Defaults.iterscheme) <: GradMode{iterscheme}

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

With iterscheme the style of CTMRG iteration which is being differentiated can be chosen. If set to :fixed, the differentiated CTMRG iteration is assumed to have a pre-computed SVD of the environments with a fixed set of gauges. Alternatively, if set to :diffgauge, the differentiated iteration consists of a CTMRG iteration and a subsequent gauge fixing step, such that gauge_fix will also be differentiated everytime a CTMRG derivative is computed.

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: O : P ⊗ P' ← N ⊗ E ⊗ S ⊗ W.

source
PEPSKit.PEPSOptimizeType
PEPSOptimize{G}(; boundary_alg=CTMRG(), optimizer::OptimKit.OptimizationAlgorithm=Defaults.optimizer
-                reuse_env::Bool=true, gradient_alg::G=LinSolver())

Algorithm struct that represent PEPS ground-state optimization using AD. Set the algorithm to contract the infinite PEPS in boundary_alg; currently only CTMRG is supported. The optimizer computes the gradient directions based on the CTMRG gradient and updates the PEPS parameters. In this optimization, the CTMRG runs can be started on the converged environments of the previous optimizer step by setting reuse_env to true. Otherwise a random environment is used at each step. The CTMRG gradient itself is computed using the gradient_alg algorithm.

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$, $N$, $E$, $S$ and $W$ denote the physics, north, east, south and west spaces, respectively.

source
PEPSKit.PEPSTensorMethod
PEPSTensor(f, ::Type{T}, Pspace::S, Nspace::S,
+O1 = LocalOperator(lattice, ((1, 1),) => σx, ((1, 1), (1, 2)) => σx ⊗ σx, ((1, 1), (2, 1)) => σx ⊗ σx)
source
PEPSKit.ManualIterType
struct ManualIter(; maxiter=Defaults.fpgrad_maxiter, tol=Defaults.fpgrad_tol,
+                  verbosity=0, iterscheme=Defaults.iterscheme) <: GradMode{iterscheme}

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

With iterscheme the style of CTMRG iteration which is being differentiated can be chosen. If set to :fixed, the differentiated CTMRG iteration is assumed to have a pre-computed SVD of the environments with a fixed set of gauges. Alternatively, if set to :diffgauge, the differentiated iteration consists of a CTMRG iteration and a subsequent gauge fixing step, such that gauge_fix will also be differentiated everytime a CTMRG derivative is computed.

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: O : P ⊗ P' ← N ⊗ E ⊗ S ⊗ W.

source
PEPSKit.PEPSOptimizeType
PEPSOptimize{G}(; boundary_alg=CTMRG(), optimizer::OptimKit.OptimizationAlgorithm=Defaults.optimizer
+                reuse_env::Bool=true, gradient_alg::G=LinSolver())

Algorithm struct that represent PEPS ground-state optimization using AD. Set the algorithm to contract the infinite PEPS in boundary_alg; currently only CTMRG is supported. The optimizer computes the gradient directions based on the CTMRG gradient and updates the PEPS parameters. In this optimization, the CTMRG runs can be started on the converged environments of the previous optimizer step by setting reuse_env to true. Otherwise a random environment is used at each step. The CTMRG gradient itself is computed using the gradient_alg algorithm.

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$, $N$, $E$, $S$ and $W$ denote the physics, north, east, south and west spaces, respectively.

source
PEPSKit.PEPSTensorMethod
PEPSTensor(f, ::Type{T}, Pspace::S, Nspace::S,
            [Espace::S], [Sspace::S], [Wspace::S]) where {T,S<:ElementarySpace}
 PEPSTensor(f, ::Type{T}, Pspace::Int, Nspace::Int,
-           [Espace::Int], [Sspace::Int], [Wspace::Int]) where {T}

Construct a PEPS tensor based on the physical, north, east, west and south spaces. Alternatively, only the space dimensions can be provided and ℂ is assumed as the field. The tensor elements are generated based on f and the element type is specified in T.

source
PEPSKit.ProjectorAlgType
struct ProjectorAlg{S}(; svd_alg=TensorKit.SVD(), trscheme=TensorKit.notrunc(),
-                       fixedspace=false, verbosity=0)

Algorithm struct collecting all projector related parameters. The truncation scheme has to be a TensorKit.TruncationScheme, and some SVD algorithms might have further restrictions on what kind of truncation scheme can be used. If fixedspace is true, the truncation scheme is set to truncspace(V) where V is the environment bond space, adjusted to the corresponding environment direction/unit cell entry.

source
PEPSKit.ReflectDepthType
struct ReflectDepth <: SymmetrizationStyle

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

source
PEPSKit.ReflectWidthType
struct ReflectWidth <: SymmetrizationStyle

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

source
PEPSKit.RotateType
struct Rotate <: SymmetrizationStyle

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

source
PEPSKit.RotateReflectType
struct RotateReflect <: 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.SVDAdjointType
struct SVDAdjoint(; fwd_alg=Defaults.fwd_alg, rrule_alg=Defaults.rrule_alg,
-                  broadening=nothing)

Wrapper for a SVD algorithm fwd_alg with a defined reverse rule rrule_alg. If isnothing(rrule_alg), Zygote differentiates the forward call automatically. In case of degenerate singular values, one might need a broadening scheme which removes the divergences from the adjoint.

source
PEPSKit.TransferPEPOMultilineType
const TransferPEPOMultiline = MPSKit.Multiline{<:InfiniteTransferPEPO}

Type that represents a multi-line transfer operator, where each line each corresponds to a row of a partition function encoding the overlap of an InfinitePEPO between 'ket' and 'bra' InfinitePEPS states.

source
PEPSKit.TransferPEPOMultilineMethod
TransferPEPOMultiline(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.TransferPEPSMultilineType
const TransferPEPSMultiline = MPSKit.Multiline{<:InfiniteTransferPEPS}

Type that represents a multi-line transfer operator, where each line each corresponds to a row of a partition function encoding the overlap between 'ket' and 'bra' InfinitePEPS states.

source
PEPSKit.TransferPEPSMultilineMethod
TransferPEPSMultiline(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
TensorKit.TensorMapMethod
TensorKit.TensorMap(Q::EnlargedCorner, dir::Int)

Instantiate enlarged corner as TensorMap where dir selects the correct contraction direction, i.e. the way the environment and PEPS tensors connect.

source
TensorKit.TensorMapMethod
TensorKit.TensorMap(env::HalfInfiniteEnv)

Instantiate half-infinite environment as TensorMap explicitly.

source
MPSKit.correlation_lengthMethod
correlation_length(peps::InfinitePEPS, env::CTMRGEnv; howmany=2)

Compute the PEPS correlation length based on the horizontal and vertical transfer matrices. Additionally the (normalized) eigenvalue spectrum is returned. Specify the number of computed eigenvalues with howmany.

source
MPSKit.expectation_valueMethod
MPSKit.expectation_value(st::InfiniteMPS, op::Union{InfiniteTransferPEPS,InfiniteTransferPEPO})
-MPSKit.expectation_value(st::MPSMultiline, op::Union{TransferPEPSMultiline,TransferPEPOMultiline})

Compute expectation value of the transfer operator op for the state st for each site in the unit cell.

source
MPSKit.leading_boundaryMethod
MPSKit.leading_boundary(
+           [Espace::Int], [Sspace::Int], [Wspace::Int]) where {T}

Construct a PEPS tensor based on the physical, north, east, west and south spaces. Alternatively, only the space dimensions can be provided and ℂ is assumed as the field. The tensor elements are generated based on f and the element type is specified in T.

source
PEPSKit.ProjectorAlgType
struct ProjectorAlg{S}(; svd_alg=TensorKit.SVD(), trscheme=TensorKit.notrunc(),
+                       fixedspace=false, verbosity=0)

Algorithm struct collecting all projector related parameters. The truncation scheme has to be a TensorKit.TruncationScheme, and some SVD algorithms might have further restrictions on what kind of truncation scheme can be used. If fixedspace is true, the truncation scheme is set to truncspace(V) where V is the environment bond space, adjusted to the corresponding environment direction/unit cell entry.

source
PEPSKit.ReflectDepthType
struct ReflectDepth <: SymmetrizationStyle

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

source
PEPSKit.ReflectWidthType
struct ReflectWidth <: SymmetrizationStyle

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

source
PEPSKit.RotateType
struct Rotate <: SymmetrizationStyle

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

source
PEPSKit.RotateReflectType
struct RotateReflect <: 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.SVDAdjointType
struct SVDAdjoint(; fwd_alg=Defaults.fwd_alg, rrule_alg=Defaults.rrule_alg,
+                  broadening=nothing)

Wrapper for a SVD algorithm fwd_alg with a defined reverse rule rrule_alg. If isnothing(rrule_alg), Zygote differentiates the forward call automatically. In case of degenerate singular values, one might need a broadening scheme which removes the divergences from the adjoint.

source
PEPSKit.TransferPEPOMultilineType
const TransferPEPOMultiline = MPSKit.Multiline{<:InfiniteTransferPEPO}

Type that represents a multi-line transfer operator, where each line each corresponds to a row of a partition function encoding the overlap of an InfinitePEPO between 'ket' and 'bra' InfinitePEPS states.

source
PEPSKit.TransferPEPOMultilineMethod
TransferPEPOMultiline(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.TransferPEPSMultilineType
const TransferPEPSMultiline = MPSKit.Multiline{<:InfiniteTransferPEPS}

Type that represents a multi-line transfer operator, where each line each corresponds to a row of a partition function encoding the overlap between 'ket' and 'bra' InfinitePEPS states.

source
PEPSKit.TransferPEPSMultilineMethod
TransferPEPSMultiline(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
TensorKit.TensorMapMethod
TensorKit.TensorMap(Q::EnlargedCorner, dir::Int)

Instantiate enlarged corner as TensorMap where dir selects the correct contraction direction, i.e. the way the environment and PEPS tensors connect.

source
TensorKit.TensorMapMethod
TensorKit.TensorMap(env::HalfInfiniteEnv)

Instantiate half-infinite environment as TensorMap explicitly.

source
MPSKit.correlation_lengthMethod
correlation_length(peps::InfinitePEPS, env::CTMRGEnv; howmany=2)

Compute the PEPS correlation length based on the horizontal and vertical transfer matrices. Additionally the (normalized) eigenvalue spectrum is returned. Specify the number of computed eigenvalues with howmany.

source
MPSKit.expectation_valueMethod
MPSKit.expectation_value(st::InfiniteMPS, op::Union{InfiniteTransferPEPS,InfiniteTransferPEPO})
+MPSKit.expectation_value(st::MPSMultiline, op::Union{TransferPEPSMultiline,TransferPEPOMultiline})

Compute expectation value of the transfer operator op for the state st for each site in the unit cell.

source
MPSKit.leading_boundaryMethod
MPSKit.leading_boundary(
     st::InfiniteMPS, op::Union{InfiniteTransferPEPS,InfiniteTransferPEPO}, alg, [envs]
 )
 MPSKit.leading_boundary(
     st::MPSMulitline, op::Union{TransferPEPSMultiline,TransferPEPOMultiline}, alg, [envs]
-)

Approximate the leading boundary MPS eigenvector for the transfer operator op using st as initial guess.

source
MPSKit.leading_boundaryMethod
MPSKit.leading_boundary([envinit], state, alg::CTMRG)

Contract state using CTMRG and return the CTM environment. Per default, a random initial environment is used.

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.build_projectorsMethod
build_projectors(U::AbstractTensorMap{E,3,1}, S::AbstractTensorMap{E,1,1}, V::AbstractTensorMap{E,1,3},
+)

Approximate the leading boundary MPS eigenvector for the transfer operator op using st as initial guess.

source
MPSKit.leading_boundaryMethod
MPSKit.leading_boundary([envinit], state, alg::CTMRG)

Contract state using CTMRG and return the CTM environment. Per default, a random initial environment is used.

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.build_projectorsMethod
build_projectors(U::AbstractTensorMap{E,3,1}, S::AbstractTensorMap{E,1,1}, V::AbstractTensorMap{E,1,3},
     Q::AbstractTensorMap{E,3,3}, Q_next::AbstractTensorMap{E,3,3}) where {E<:ElementarySpace}
 build_projectors(U::AbstractTensorMap{E,3,1}, S::AbstractTensorMap{E,1,1}, V::AbstractTensorMap{E,1,3},
-    Q::EnlargedCorner, Q_next::EnlargedCorner) where {E<:ElementarySpace}

Construct left and right projectors where the higher-dimensional is facing left and right, respectively.

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 some tolerance.

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.contract_localoperatorMethod
contract_localoperator(inds, O, peps, env)

Contract a local operator O on the PEPS peps at the indices inds using the environment env.

source
PEPSKit.ctmrg_expandMethod
ctmrg_expand(state, envs, alg::CTMRG{M})

Expand the environment by absorbing a new PEPS tensor. There are two modes of expansion: M = :sequential and M = :simultaneous. The first mode expands the environment in one direction at a time, for convenience towards the left. The second mode expands the environment in all four directions simultaneously.

source
PEPSKit.ctmrg_iterMethod
ctmrg_iter(state, envs::CTMRGEnv, alg::CTMRG) -> envs′, info

Perform one iteration of CTMRG that maps the state and envs to a new environment, and also returns the truncation error.

source
PEPSKit.ctmrg_projectorsMethod
ctmrg_projectors(enlarged_envs, env, alg::CTMRG{M})

Compute the CTMRG projectors based from enlarged environments. In the :simultaneous mode, the environment SVD is run in parallel.

source
PEPSKit.ctmrg_renormalizeMethod
ctmrg_renormalize(enlarged_envs, projectors, state, envs, alg::CTMRG{M})

Apply projectors to renormalize corners and edges.

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.enlarge_northeast_cornerFunction
enlarge_northeast_corner((row, col), envs, ket, bra)
+    Q::EnlargedCorner, Q_next::EnlargedCorner) where {E<:ElementarySpace}

Construct left and right projectors where the higher-dimensional is facing left and right, respectively.

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 some tolerance.

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.contract_localoperatorMethod
contract_localoperator(inds, O, peps, env)

Contract a local operator O on the PEPS peps at the indices inds using the environment env.

source
PEPSKit.ctmrg_expandMethod
ctmrg_expand(state, envs, alg::CTMRG{M})

Expand the environment by absorbing a new PEPS tensor. There are two modes of expansion: M = :sequential and M = :simultaneous. The first mode expands the environment in one direction at a time, for convenience towards the left. The second mode expands the environment in all four directions simultaneously.

source
PEPSKit.ctmrg_iterMethod
ctmrg_iter(state, envs::CTMRGEnv, alg::CTMRG) -> envs′, info

Perform one iteration of CTMRG that maps the state and envs to a new environment, and also returns the truncation error.

source
PEPSKit.ctmrg_projectorsMethod
ctmrg_projectors(enlarged_envs, env, alg::CTMRG{M})

Compute the CTMRG projectors based from enlarged environments. In the :simultaneous mode, the environment SVD is run in parallel.

source
PEPSKit.ctmrg_renormalizeMethod
ctmrg_renormalize(enlarged_envs, projectors, state, envs, alg::CTMRG{M})

Apply projectors to renormalize corners and edges.

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.enlarge_northeast_cornerFunction
enlarge_northeast_corner((row, col), envs, ket, bra)
 enlarge_northeast_corner(E_north, C_northeast, E_east, ket, bra)

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

    -- E_north -- C_northeast
           ||            |
     == ket-bra ==    E_east
-          ||            |
source
PEPSKit.enlarge_northwest_cornerFunction
enlarge_northwest_corner((row, col), envs, ket, bra)
 enlarge_northwest_corner(E_west, C_northwest, E_north, ket, bra)

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

    C_northwest -- E_north --
          |            ||
       E_west    == ket-bra ==
-         |            ||
source
PEPSKit.enlarge_southeast_cornerFunction
enlarge_southeast_corner((row, col), envs, ket, bra)
 enlarge_southeast_corner(E_east, C_southeast, E_south, ket, bra)

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

          ||            |
     == ket-bra ==    E_east
           ||            |
-    -- E_south -- C_southeast
source
PEPSKit.enlarge_southwest_cornerFunction
enlarge_southwest_corner((row, col), envs, ket, bra)
 enlarge_southwest_corner(E_south, C_southwest, E_west, ket, bra)

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

          |           ||      
        E_west   == ket-bra == 
           |           ||      
-    C_southwest -- E_south -- 
source
PEPSKit.fix_gauge_cornerMethod
fix_gauge_corner(corner, σ_in, σ_out)

Multiply corner tensor with incoming and outgoing gauge signs.

    corner -- σ_out --
+    C_southwest -- E_south -- 
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_east_edgeMethod
fix_gauge_east_edge((row, col), envs, signs)

Apply fix_gauge_edge to the east edge with appropriate row and column indices.

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_gauge_west_edgeMethod
fix_gauge_south_edge((row, col), envs, signs)

Apply fix_gauge_edge to the west edge with appropriate row and column indices.

source
PEPSKit.fixedpointMethod
fixedpoint(ψ₀::InfinitePEPS{T}, H, alg::PEPSOptimize, [env₀::CTMRGEnv];
-           finalize!=OptimKit._finalize!, symmetrization=nothing) where {T}

Optimize ψ₀ with respect to the Hamiltonian H according to the parameters supplied in alg. The initial environment env₀ serves as an initial guess for the first CTMRG run. By default, a random initial environment is used.

The finalize! kwarg can be used to insert a function call after each optimization step by utilizing the finalize! kwarg of OptimKit.optimize. The function maps (peps, envs), f, g = finalize!((peps, envs), f, g, numiter). The symmetrization kwarg accepts nothing or a SymmetrizationStyle, in which case the PEPS and PEPS gradient are symmetrized after each optimization iteration. Note that this requires a symmmetric ψ₀ and env₀ to converge properly.

The function returns a NamedTuple which contains the following entries:

  • peps: final InfinitePEPS
  • env: CTMRGEnv corresponding to the final PEPS
  • E: final energy
  • E_history: convergence history of the energy function
  • grad: final energy gradient
  • gradnorm_history: convergence history of the energy gradient norms
  • numfg: total number of calls to the energy function
source
PEPSKit.fpgradFunction
fpgrad(∂F∂x, ∂f∂x, ∂f∂A, y0, alg)

Compute the gradient of the cost function for CTMRG by solving the following equation:

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

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

source
PEPSKit.gauge_fixMethod
gauge_fix(envprev::CTMRGEnv{C,T}, envfinal::CTMRGEnv{C,T}) where {C,T}

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

source
PEPSKit.fix_gauge_east_edgeMethod
fix_gauge_east_edge((row, col), envs, signs)

Apply fix_gauge_edge to the east edge with appropriate row and column indices.

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_gauge_west_edgeMethod
fix_gauge_south_edge((row, col), envs, signs)

Apply fix_gauge_edge to the west edge with appropriate row and column indices.

source
PEPSKit.fixedpointMethod
fixedpoint(ψ₀::InfinitePEPS{T}, H, alg::PEPSOptimize, [env₀::CTMRGEnv];
+           finalize!=OptimKit._finalize!, symmetrization=nothing) where {T}

Optimize ψ₀ with respect to the Hamiltonian H according to the parameters supplied in alg. The initial environment env₀ serves as an initial guess for the first CTMRG run. By default, a random initial environment is used.

The finalize! kwarg can be used to insert a function call after each optimization step by utilizing the finalize! kwarg of OptimKit.optimize. The function maps (peps, envs), f, g = finalize!((peps, envs), f, g, numiter). The symmetrization kwarg accepts nothing or a SymmetrizationStyle, in which case the PEPS and PEPS gradient are symmetrized after each optimization iteration. Note that this requires a symmmetric ψ₀ and env₀ to converge properly.

The function returns a NamedTuple which contains the following entries:

  • peps: final InfinitePEPS
  • env: CTMRGEnv corresponding to the final PEPS
  • E: final energy
  • E_history: convergence history of the energy function
  • grad: final energy gradient
  • gradnorm_history: convergence history of the energy gradient norms
  • numfg: total number of calls to the energy function
source
PEPSKit.fpgradFunction
fpgrad(∂F∂x, ∂f∂x, ∂f∂A, y0, alg)

Compute the gradient of the cost function for CTMRG by solving the following equation:

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

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

source
PEPSKit.gauge_fixMethod
gauge_fix(envprev::CTMRGEnv{C,T}, envfinal::CTMRGEnv{C,T}) where {C,T}

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

source
PEPSKit.halfinfinite_environmentMethod
halfinfinite_environment(quadrant1::AbstractTensorMap{S,3,3}, quadrant2::AbstractTensorMap{S,3,3})
 halfinfinite_environment(C_1, C_2, E_1, E_2, E_3, E_4,
                          ket_1::P, ket_2::P, bra_1::P=ket_1, bra_2::P=ket_2) where {P<:PEPSTensor}
 halfinfinite_environment(C_1, C_2, E_1, E_2, E_3, E_4, x,
@@ -80,83 +80,83 @@
     E_1 == ket_bra_1 == ket_bra_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.initializeMPSMethod
initializeMPS(
+                         ||           |

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.initializeMPSMethod
initializeMPS(
     O::Union{InfiniteTransferPEPS,InfiniteTransferPEPO},
     virtualspaces::AbstractArray{<:ElementarySpace,1}
 )
 initializeMPS(
     O::Union{TransferPEPSMultiline,TransferPEPOMultiline},
     virtualspaces::AbstractArray{<:ElementarySpace,2}
-)

Inialize a boundary MPS for the transfer operator O by specifying an array of virtual spaces consistent with the unit cell.

source
PEPSKit.j1_j2Method
j1_j2([elt::Type{T}], [symm::Type{S}], [lattice::InfiniteSquare];
-                    J1=1.0, J2=1.0, spin=1//2, sublattice=true)

Square lattice J₁-J₂ model. The sublattice kwarg enables a single site unit cell via a sublattice rotation.

source
PEPSKit.left_projectorFunction
left_projector(E_1, C, E_2, V, isqS, ket::PEPSTensor, bra::PEPSTensor=ket)

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

     C  --  E_2    -- |~~|
+)

Inialize a boundary MPS for the transfer operator O by specifying an array of virtual spaces consistent with the unit cell.

source
PEPSKit.j1_j2Method
j1_j2([elt::Type{T}], [symm::Type{S}], [lattice::InfiniteSquare];
+                    J1=1.0, J2=1.0, spin=1//2, sublattice=true)

Square lattice J₁-J₂ model. The sublattice kwarg enables a single site unit cell via a sublattice rotation.

source
PEPSKit.left_projectorFunction
left_projector(E_1, C, E_2, V, isqS, ket::PEPSTensor, bra::PEPSTensor=ket)

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

     C  --  E_2    -- |~~|
      |       ||       |V'| -- isqS --
     E_1 == ket-bra == |~~|
-     |       ||
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.projector_typeMethod
projector_type(T::DataType, size)
-projector_type(edges::Array{<:AbstractTensorMap})

Create two arrays of specified size that contain undefined tensors representing left and right acting projectors, respectively. The projector types are inferred from the TensorMap type T which avoids having to recompute transpose tensors. Alternatively, supply an array of edge tensors from which left and right projectors are intialized explicitly with zeros.

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.projector_typeMethod
projector_type(T::DataType, size)
+projector_type(edges::Array{<:AbstractTensorMap})

Create two arrays of specified size that contain undefined tensors representing left and right acting projectors, respectively. The projector types are inferred from the TensorMap type T which avoids having to recompute transpose tensors. Alternatively, supply an array of edge tensors from which left and right projectors are intialized explicitly with zeros.

source
PEPSKit.renormalize_cornerMethod
renormalize_corner(quadrant::AbstractTensorMap{S,3,3}, P_left, P_right)

Apply projectors to each side of a quadrant.

    |~~~~~~~~| -- |~~~~~~|
+     C --  E -- in
source
PEPSKit.renormalize_cornerMethod
renormalize_corner(quadrant::AbstractTensorMap{S,3,3}, P_left, P_right)

Apply projectors to each side of a quadrant.

    |~~~~~~~~| -- |~~~~~~|
     |quadrant|    |P_left| --
     |~~~~~~~~| == |~~~~~~|
      |    ||
     [P_right]
-        |
source
PEPSKit.renormalize_east_edgeFunction
renormalize_east_edge((row, col), envs, P_top, P_bottom, ket, bra)
 renormalize_east_edge(E_east, P_top, P_bottom, ket, bra)

Absorb a bra-ket pair into the east edge using the given projectors and environment tensors.

            |
      [~~P_bottom~~]
       |         ||
     E_east == ket-bra
       |         ||
      [~~~~P_top~~~]
-            |
source
PEPSKit.renormalize_north_edgeFunction
renormalize_north_edge((row, col), envs, P_left, P_right, ket, bra)
 renormalize_north_edge(E_north, P_left, P_right, ket, bra)

Absorb a bra-ket pair into the north edge using the given projectors and environment tensors.

       |~~~~~~| -- E_north -- |~~~~~~~| 
     -- |P_left|      ||       |P_right| --
        |~~~~~~| == ket-bra == |~~~~~~~| 
-
source
PEPSKit.renormalize_northeast_cornerMethod
renormalize_northeast_corner((row, col), enlarged_envs::CTMRGEnv, P_left, P_right)
 renormalize_northwest_corner(quadrant::AbstractTensorMap{S,3,3}, P_left, P_right) where {S}
 renormalize_northeast_corner(E_north, C_northeast, E_east, P_left, P_right, ket::PEPSTensor, bra::PEPSTensor=ket)

Apply renormalize_corner to the enlarged northeast corner. Alternatively, provide the constituent tensors and perform the complete contraction.

       |~~~~~~~| --  E_north --  C_northeast
     -- |P_right|       ||             |  
        |~~~~~~~| ==  ket-bra ==     E_east
                        ||             |
                      [~~~~~~P_left~~~~~~]
-                              |
source
PEPSKit.renormalize_northwest_cornerMethod
renormalize_northwest_corner((row, col), enlarged_envs::CTMRGEnv, P_left, P_right)
 renormalize_northwest_corner(quadrant::AbstractTensorMap{S,3,3}, P_left, P_right) where {S}
 renormalize_northwest_corner(E_west, C_northwest, E_north, P_left, P_right, ket::PEPSTensor, bra::PEPSTensor=ket)

Apply renormalize_corner to the enlarged northwest corner. Alternatively, provide the constituent tensors and perform the complete contraction.

    C_northwest -- E_north -- |~~~~~~|
          |           ||       |P_left| --
       E_west=   == ket-bra == |~~~~~~|
          |           ||
       [~~~~~P_right~~~~~]
-               |
source
PEPSKit.renormalize_south_edgeFunction
renormalize_south_edge((row, col), envs, P_left, P_right, ket, bra)
 renormalize_south_edge(E_south, P_left, P_right, ket, bra)

Absorb a bra-ket pair into the south edge using the given projectors and environment tensors.

       |~~~~~~~| == ket-bra == |~~~~~~| 
     -- |P_right|      ||       |P_left| --
        |~~~~~~~| -- E_south -- |~~~~~~| 
-
source
PEPSKit.renormalize_southeast_cornerMethod
renormalize_southeast_corner((row, col), enlarged_envs::CTMRGEnv, P_left, P_right)
 renormalize_southeast_corner(quadrant::AbstractTensorMap{S,3,3}, P_left, P_right) where {S}
 renormalize_southeast_corner(E_east, C_southeast, E_south, P_left, P_right, ket::PEPSTensor, bra::PEPSTensor=ket)

Apply renormalize_corner to the enlarged southeast corner. Alternatively, provide the constituent tensors and perform the complete contraction.

                            |
                    [~~~~~P_right~~~~~]
                       ||           |
        |~~~~~~| == ket-bra ==    E_east
     -- |P_left|       ||           |
-       |~~~~~~| -- E_south -- C_southeast
source
PEPSKit.renormalize_southwest_cornerMethod
renormalize_southwest_corner((row, col), enlarged_envs::CTMRGEnv, P_left, P_right)
 renormalize_southwest_corner(quadrant::AbstractTensorMap{S,3,3}, P_left, P_right) where {S}
 renormalize_southwest_corner(E_south, C_southwest, E_west, P_left, P_right, ket::PEPSTensor, bra::PEPSTensor=ket)

Apply renormalize_corner to the enlarged southwest corner. Alternatively, provide the constituent tensors and perform the complete contraction.

               |
       [~~~~~P_right~~~~~]
         ||            |
        E_west   == ket-bra == |~~~~~~|
          |           ||       |P_left| --
-    C_southwest -- E_south -- |~~~~~~|
source
PEPSKit.renormalize_top_cornerMethod
renormalize_top_corner((row, col), envs::CTMRGEnv, projectors)

Apply top projector to northwest corner and north edge.

     C -- E -- 
+    C_southwest -- E_south -- |~~~~~~|
source
PEPSKit.renormalize_top_cornerMethod
renormalize_top_corner((row, col), envs::CTMRGEnv, projectors)

Apply top projector to northwest corner and north edge.

     C -- E -- 
      |    ||
     [~P_top~]
-        | 
source
PEPSKit.renormalize_west_edgeMethod
renormalize_west_edge((row, col), envs, P_top, P_bottom, ket, bra)
 renormalize_west_edge(E_west, P_top, P_bottom, ket, bra)

Absorb a bra-ket pair into the west edge using the given projectors and environment tensors.

            |
      [~~P_bottom~~]
       |         ||
     E_west == ket-bra
       |         ||
      [~~~~P_top~~~]
-            |
source
PEPSKit.right_projectorFunction
right_projector(E_1, C, E_2, U, isqS, ket::PEPSTensor, bra::PEPSTensor=ket)

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

               |~~| --   E_2   --  C
+            |
source
PEPSKit.right_projectorFunction
right_projector(E_1, C, E_2, U, isqS, ket::PEPSTensor, bra::PEPSTensor=ket)

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

               |~~| --   E_2   --  C
     -- isqS -- |U'|      ||        |
                |~~| == ket-bra == E_1
-                         ||        |
source
PEPSKit.symmetrize!Method
symmetrize!(peps::InfinitePEPS, ::SymmetrizationStyle)

Symmetrize a PEPS using the given SymmetrizationStyle in-place.

source
TensorKit.tsvdMethod
PEPSKit.tsvd(t, alg; trunc=notrunc(), p=2)

Wrapper around TensorKit.tsvd which dispatches on the alg argument. This is needed since a custom adjoint for PEPSKit.tsvd may be defined, depending on the algorithm. E.g., for IterSVD the adjoint for a truncated SVD from KrylovKit.svdsolve is used.

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.@diffsetMacro
@diffset assign

Helper macro which allows in-place operations in the forward-pass of Zygote, but resorts to non-mutating operations in the backwards-pass. The expression assign should assign an object to an pre-existing AbstractArray and the use of updating operators is also possible. This is especially needed when in-place assigning tensors to unit-cell arrays of environments.

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.symmetrize!Method
symmetrize!(peps::InfinitePEPS, ::SymmetrizationStyle)

Symmetrize a PEPS using the given SymmetrizationStyle in-place.

source
TensorKit.tsvdMethod
PEPSKit.tsvd(t, alg; trunc=notrunc(), p=2)

Wrapper around TensorKit.tsvd which dispatches on the alg argument. This is needed since a custom adjoint for PEPSKit.tsvd may be defined, depending on the algorithm. E.g., for IterSVD the adjoint for a truncated SVD from KrylovKit.svdsolve is used.

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.@diffsetMacro
@diffset assign

Helper macro which allows in-place operations in the forward-pass of Zygote, but resorts to non-mutating operations in the backwards-pass. The expression assign should assign an object to an pre-existing AbstractArray and the use of updating operators is also possible. This is especially needed when in-place assigning tensors to unit-cell arrays of environments.

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.DefaultsModule
module Defaults
     const ctmrg_maxiter = 100
     const ctmrg_miniter = 4
     const ctmrg_tol = 1e-8
@@ -175,4 +175,4 @@
     const iterscheme = :fixed
     const gradient_alg = LinSolver(; solver=gradient_linsolver, iterscheme)
     const scheduler = Ref{Scheduler}(Threads.nthreads() == 1 ? SerialScheduler() : DynamicScheduler())
-end

Module containing default values that represent typical algorithm parameters.

  • ctmrg_maxiter: Maximal number of CTMRG iterations per run
  • ctmrg_miniter: Minimal number of CTMRG carried out
  • ctmrg_tol: Tolerance checking singular value and norm convergence
  • fpgrad_maxiter: Maximal number of iterations for computing the CTMRG fixed-point gradient
  • fpgrad_tol: Convergence tolerance for the fixed-point gradient iteration
  • ctmrgscheme: Scheme for growing, projecting and renormalizing CTMRG environments
  • reuse_env: If true, the current optimization step is initialized on the previous environment
  • trscheme: Truncation scheme for SVDs and other decompositions
  • fwd_alg: SVD algorithm that is used in the forward pass
  • rrule_alg: Reverse-rule for differentiating that SVD
  • svd_alg: Combination of fwd_alg and rrule_alg
  • optimizer: Optimization algorithm for PEPS ground-state optimization
  • gradient_linsolver: Default linear solver for the LinSolver gradient algorithm
  • iterscheme: Scheme for differentiating one CTMRG iteration
  • gradient_alg: Algorithm to compute the gradient fixed-point
  • scheduler: Multi-threading scheduler which can be accessed via set_scheduler!
source
PEPSKit.Defaults.set_scheduler!Function
set_scheduler!([scheduler]; kwargs...)

Set OhMyThreads multi-threading 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
+end

Module containing default values that represent typical algorithm parameters.

  • ctmrg_maxiter: Maximal number of CTMRG iterations per run
  • ctmrg_miniter: Minimal number of CTMRG carried out
  • ctmrg_tol: Tolerance checking singular value and norm convergence
  • fpgrad_maxiter: Maximal number of iterations for computing the CTMRG fixed-point gradient
  • fpgrad_tol: Convergence tolerance for the fixed-point gradient iteration
  • ctmrgscheme: Scheme for growing, projecting and renormalizing CTMRG environments
  • reuse_env: If true, the current optimization step is initialized on the previous environment
  • trscheme: Truncation scheme for SVDs and other decompositions
  • fwd_alg: SVD algorithm that is used in the forward pass
  • rrule_alg: Reverse-rule for differentiating that SVD
  • svd_alg: Combination of fwd_alg and rrule_alg
  • optimizer: Optimization algorithm for PEPS ground-state optimization
  • gradient_linsolver: Default linear solver for the LinSolver gradient algorithm
  • iterscheme: Scheme for differentiating one CTMRG iteration
  • gradient_alg: Algorithm to compute the gradient fixed-point
  • scheduler: Multi-threading scheduler which can be accessed via set_scheduler!
source
PEPSKit.Defaults.set_scheduler!Function
set_scheduler!([scheduler]; kwargs...)

Set OhMyThreads multi-threading 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
diff --git a/dev/man/intro/index.html b/dev/man/intro/index.html index 1a23b8ba..22e5dd39 100644 --- a/dev/man/intro/index.html +++ b/dev/man/intro/index.html @@ -1,2 +1,2 @@ -Manual · PEPSKit.jl

Coming soon.

+Manual · PEPSKit.jl

Coming soon.

diff --git a/dev/search/index.html b/dev/search/index.html index 844ba732..171af783 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · PEPSKit.jl

Loading search...

    +Search · PEPSKit.jl

    Loading search...