Skip to content

Ansatz

Tenet.Lattice Type
julia
Lattice

A lattice is a graph where the vertices are Sites and the edges are virtual bonds. It is used for representing the topology of a Ansatz Tensor Network. It fulfills the AbstractGraph interface.

source

Tenet.Lattice Method
julia
Lattice(::Val{:chain}, n; periodic=false)

Create a chain lattice with n sites.

source

Tenet.Lattice Method
julia
Lattice(::Val{:lieb}, nrows, ncols)

Create a Lieb lattice with nrows cell rows and ncols cell columns.

source

Tenet.Lattice Method
julia
Lattice(::Val{:rectangular}, nrows, ncols; periodic=false)

Create a rectangular lattice with nrows rows and ncols columns.

source

Graphs.edges Method
julia
Graphs.edges(::Lattice)

Return the edges of the lattice; i.e. pairs of Lanes.

source

Graphs.has_edge Method
julia
Graphs.has_edge(lattice::Lattice, edge)
Graphs.has_edge(lattice::Lattice, a::Lane, b::Lane)

Return true if the lattice has the given edge.

source

Graphs.has_vertex Method
julia
Graphs.has_vertex(lattice::Lattice, lane::AbstractLane)

Return true if the lattice has the given Lane.

source

Graphs.ne Method
julia
Graphs.ne(::Lattice)

Return the number of edges in the lattice.

source

Graphs.neighbors Method
julia
Graphs.neighbors(lattice::Lattice, lane::AbstractLane)

Return the neighbors Lanes of the given Lane.

source

Graphs.nv Method
julia
Graphs.nv(::Lattice)

Return the number of vertices; i.e. Lanes, in the lattice.

source

Graphs.vertices Method
julia
Graphs.vertices(::Lattice)

Return the vertices of the lattice; i.e. the list of Lanes.

source

Tenet.AbstractAnsatz Type
julia
AbstractAnsatz

Abstract type for Ansatz-derived types. Its subtypes must implement conversion or extraction to the underlying Ansatz.

source

Tenet.Ansatz Type
julia
Ansatz

AbstractQuantum Tensor Network together with a Lattice for connectivity information between Lanes.

source

Tenet.Boundary Type
julia
Boundary

Abstract type representing the boundary condition trait of a AbstractAnsatz Tensor Network.

source

Tenet.Canonical Type
julia
Canonical

Form trait representing a AbstractAnsatz Tensor Network in canonical form or Vidal gauge.

source

Tenet.Form Type
julia
Form

Abstract type representing the canonical form trait of a AbstractAnsatz Tensor Network.

source

Tenet.MixedCanonical Type
julia
MixedCanonical

Form trait representing a AbstractAnsatz Tensor Network in mixed-canonical form.

  • The orthogonality center is a Lane or a vector of Lanes. The tensors to the left of the orthogonality center are left-canonical and the tensors to the right are right-canonical.

source

Tenet.NonCanonical Type
julia
NonCanonical

Form trait representing a AbstractAnsatz Tensor Network in non-canonical form.

source

Tenet.Open Type
julia
Open

Boundary trait representing an open boundary condition.

source

Tenet.Periodic Type
julia
Periodic

Boundary trait representing a periodic boundary condition.

source

Tenet.Quantum Method
julia
Quantum(tn::AbstractAnsatz)

Return the underlying Quantum Tensor Network of an AbstractAnsatz.

source

Base.truncate Method
julia
truncate(tn::AbstractAnsatz, bond; threshold = nothing, maxdim = nothing)

Like truncate!, but returns a new Tensor Network instead of modifying the original one.

source

EinExprs.inds Method
julia
inds(tn::AbstractAnsatz; bond)

Return the index of the virtual bond between two AbstractLanes in a AbstractAnsatz Tensor Network.

source

Graphs.has_edge Method
julia
has_edge(tn::AbstractAnsatz, a::AbstractLane, b::AbstractLane)

Check whether there is an edge between two AbstractLanes in the Lattice of the AbstractAnsatz Tensor Network.

source

Graphs.neighbors Method
julia
neighbors(tn::AbstractAnsatz, lane::AbstractLane)

Return the neighboring sites of a given AbstractLane in the Lattice of the AbstractAnsatz Tensor Network.

source

LinearAlgebra.normalize Method
julia
normalize!::AbstractAnsatz, at)

Normalize the state at a given Site or bond in a AbstractAnsatz Tensor Network.

source

Tenet.canonize! Function
julia
canonize!(tn::AbstractAnsatz)

Transform an AbstractAnsatz Tensor Network into the canonical form (aka Vidal gauge); i.e. the singular values matrix Λᵢ between each tensor Γᵢ₋₁ and Γᵢ.

source

Tenet.canonize Method
julia
canonize(tn::AbstractAnsatz)

Like canonize!, but returns a new Tensor Network instead of modifying the original one.

source

Tenet.contract! Method
julia
contract!(tn::AbstractAnsatz; bond)

Contract the virtual bond between two AbstractLanes in a AbstractAnsatz Tensor Network.

source

Tenet.evolve! Method
julia
evolve!::AbstractAnsatz, gate; threshold = nothing, maxdim = nothing, normalize = false)

Evolve (through time) a AbstractAnsatz Tensor Network with a gate operator.

Note

Currently only the "Simple Update" algorithm is implemented.

Arguments

  • ψ: Tensor Network representing the state.

  • gate: The gate operator to evolve the state with.

Keyword Arguments

  • threshold: The threshold to truncate the bond dimension.

  • maxdim: The maximum bond dimension to keep.

  • normalize: Whether to normalize the state after truncation.

Notes

  • The gate must act on neighboring sites according to the Lattice of the Tensor Network.

  • The gate must have the same number of inputs and outputs.

  • Currently only the "Simple Update" algorithm is used and the gate must be a 1-site or 2-site operator.

source

Tenet.expect Method
julia
expect::AbstractAnsatz, observable)

Compute the expectation value of an observable on a AbstractAnsatz Tensor Network.

Arguments

  • ψ: Tensor Network representing the state. It must be a state (i.e. socket returns State(dual=false)).

  • observable: The observable to compute the expectation value. If a Vector or Tuple of observables is provided, the sum of the expectation values is returned.

Keyword Arguments

  • bra: The bra state. It must be a dual state (i.e. socket returns State(dual=true)). Defaults to the adjoint of ψ.

source

Tenet.form Function
julia
form(tn::AbstractAnsatz)

Return the canonical form of the AbstractAnsatz Tensor Network.

source

Tenet.isisometry Function
julia
isisometry(tn::AbstractAnsatz, lane; dir, kwargs...)

Check if the tensor at a given Lane in a AbstractAnsatz Tensor Network is an isometry. The dir keyword argument specifies the direction of the isometry to check.

source

Tenet.lattice Method
julia
lattice(tn::AbstractAnsatz)

Return the Lattice of the AbstractAnsatz Tensor Network.

source

Tenet.mixed_canonize! Function
julia
mixed_canonize!(tn::AbstractAnsatz, orthog_center)

Transform an AbstractAnsatz Tensor Network into the mixed-canonical form, that is, for i < orthog_center the tensors are left-canonical and for i >= orthog_center the tensors are right-canonical, and in the orthog_center there is a tensor with the Schmidt coefficients in it.

source

Tenet.mixed_canonize Method
julia
mixed_canonize(tn::AbstractAnsatz, orthog_center)

Like mixed_canonize!, but returns a new Tensor Network instead of modifying the original one.

source

Tenet.overlap Method
julia
overlap(a::AbstractAnsatz, b::AbstractAnsatz)

Compute the overlap between two AbstractAnsatz Tensor Networks.

source

Tenet.simple_update! Method
julia
simple_update!::AbstractAnsatz, gate; threshold = nothing, maxdim = nothing, kwargs...)

Update a AbstractAnsatz Tensor Network with a gate operator using the "Simple Update" algorithm. kwargs are passed to the truncate! method in the case of a multi-site gate.

Warning

Currently only 1-site and 2-site gates are supported.

Arguments

  • ψ: Tensor Network representing the state.

  • gate: The gate operator to update the state with.

Keyword Arguments

  • threshold: The threshold to truncate the bond dimension.

  • maxdim: The maximum bond dimension to keep.

  • normalize: Whether to normalize the state after truncation.

Notes

  • If both threshold and maxdim are provided, maxdim is used.

source

Tenet.tensors Method
julia
tensors(tn::AbstractAnsatz; bond)

Return the Tensor in a virtual bond between two AbstractLanes in a AbstractAnsatz Tensor Network.

Notes

  • If the AbstractAnsatz Tensor Network is in the canonical form, Tenet stores the Schmidt coefficients of the bond in a vector connected to the bond hyperedge between the two sites and the vector.

  • If the bond contains no Schmidt coefficients, this method will throw a MissingSchmidtCoefficientsException.

source

Tenet.truncate! Method
julia
truncate!(::Canonical, tn::AbstractAnsatz, bond; canonize=true, kwargs...)

Truncate the dimension of the virtual bond of a Canonical Tensor Network by keeping the maxdim largest Schmidt coefficients or those larger than threshold, and then canonizes the Tensor Network if canonize is true.

source

Tenet.truncate! Method
julia
truncate!(::NonCanonical, tn::AbstractAnsatz, bond; threshold, maxdim, compute_local_svd=true)

Truncate the dimension of the virtual bond of a NonCanonical Tensor Network by contracting the bond, performing an SVD and keeping the maxdim largest singular values or those larger than threshold.

Arguments

Keyword Arguments

  • threshold: The threshold to truncate the bond dimension.

  • maxdim: The maximum bond dimension to keep.

  • compute_local_svd: Whether to compute the local SVD of the bond. If true, it will contract the bond and perform a SVD to get the local singular values. Defaults to true.

  • normalize: Whether to normalize the state at the bond after truncation. Defaults to false.

source

Tenet.truncate! Method
julia
truncate!(tn::AbstractAnsatz, bond; threshold = nothing, maxdim = nothing)

Truncate the dimension of the virtual bond``of an [Ansatz](@ref) Tensor Network. Dispatches to the appropriate method based on the [form`](@ref) of the Tensor Network:

  • If the Tensor Network is in the MixedCanonical form, the bond is truncated by moving the orthogonality center to the bond and keeping the maxdim largest Schmidt coefficients or those larger than threshold.

  • If the Tensor Network is in the Canonical form, the bond is truncated by keeping the maxdim largest Schmidt coefficients or those larger than threshold, and then recanonizing the Tensor Network.

  • If the Tensor Network is in the NonCanonical form, the bond is truncated by contracting the bond, performing an SVD and keeping the maxdim largest singular values or those larger than threshold.

Notes

  • Either threshold or maxdim must be provided. If both are provided, maxdim is used.

source

DocumenterMermaid.MermaidScriptBlock([...])

Made with DocumenterVitepress.jl