Ansatz
Tenet.Lattice Type
Lattice
A lattice is a graph where the vertices are Site
s and the edges are virtual bonds. It is used for representing the topology of a Ansatz
Tensor Network. It fulfills the AbstractGraph
interface.
Tenet.Lattice Method
Lattice(::Val{:chain}, n; periodic=false)
Create a chain lattice with n
sites.
Tenet.Lattice Method
Lattice(::Val{:lieb}, nrows, ncols)
Create a Lieb lattice with nrows
cell rows and ncols
cell columns.
Tenet.Lattice Method
Lattice(::Val{:rectangular}, nrows, ncols; periodic=false)
Create a rectangular lattice with nrows
rows and ncols
columns.
Graphs.edges Method
Graphs.edges(::Lattice)
Return the edges of the lattice; i.e. pairs of Lane
s.
Graphs.has_edge Method
Graphs.has_edge(lattice::Lattice, edge)
Graphs.has_edge(lattice::Lattice, a::Lane, b::Lane)
Return true
if the lattice has the given edge.
Graphs.has_vertex Method
Graphs.has_vertex(lattice::Lattice, lane::AbstractLane)
Return true
if the lattice has the given Lane
.
Graphs.neighbors Method
Graphs.neighbors(lattice::Lattice, lane::AbstractLane)
Graphs.vertices Method
Graphs.vertices(::Lattice)
Return the vertices of the lattice; i.e. the list of Lane
s.
Tenet.AbstractAnsatz Type
AbstractAnsatz
Abstract type for Ansatz
-derived types. Its subtypes must implement conversion or extraction to the underlying Ansatz
.
Tenet.Ansatz Type
Ansatz
AbstractQuantum
Tensor Network together with a Lattice
for connectivity information between Lane
s.
Tenet.Boundary Type
Boundary
Abstract type representing the boundary condition trait of a AbstractAnsatz
Tensor Network.
Tenet.Canonical Type
Canonical
Form
trait representing a AbstractAnsatz
Tensor Network in canonical form or Vidal gauge.
Tenet.Form Type
Form
Abstract type representing the canonical form trait of a AbstractAnsatz
Tensor Network.
Tenet.MixedCanonical Type
MixedCanonical
Form
trait representing a AbstractAnsatz
Tensor Network in mixed-canonical form.
Tenet.NonCanonical Type
NonCanonical
Form
trait representing a AbstractAnsatz
Tensor Network in non-canonical form.
Tenet.Quantum Method
Quantum(tn::AbstractAnsatz)
Return the underlying Quantum
Tensor Network of an AbstractAnsatz
.
Base.truncate Method
truncate(tn::AbstractAnsatz, bond; threshold = nothing, maxdim = nothing)
Like truncate!
, but returns a new Tensor Network instead of modifying the original one.
EinExprs.inds Method
inds(tn::AbstractAnsatz; bond)
Return the index of the virtual bond between two AbstractLane
s in a AbstractAnsatz
Tensor Network.
Graphs.has_edge Method
has_edge(tn::AbstractAnsatz, a::AbstractLane, b::AbstractLane)
Check whether there is an edge between two AbstractLane
s in the Lattice
of the AbstractAnsatz
Tensor Network.
Graphs.neighbors Method
neighbors(tn::AbstractAnsatz, lane::AbstractLane)
Return the neighboring sites of a given AbstractLane
in the Lattice
of the AbstractAnsatz
Tensor Network.
LinearAlgebra.normalize Method
normalize!(ψ::AbstractAnsatz, at)
Normalize the state at a given Site
or bond in a AbstractAnsatz
Tensor Network.
Tenet.canonize! Function
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 Γᵢ.
Tenet.canonize Method
canonize(tn::AbstractAnsatz)
Like canonize!
, but returns a new Tensor Network instead of modifying the original one.
Tenet.contract! Method
contract!(tn::AbstractAnsatz; bond)
Contract the virtual bond between two AbstractLane
s in a AbstractAnsatz
Tensor Network.
Tenet.evolve! Method
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.
Tenet.expect Method
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
returnsState(dual=false)
).observable
: The observable to compute the expectation value. If aVector
orTuple
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
returnsState(dual=true)
). Defaults to the adjoint ofψ
.
Tenet.form Function
form(tn::AbstractAnsatz)
Return the canonical form of the AbstractAnsatz
Tensor Network.
Tenet.isisometry Function
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.
Tenet.lattice Method
lattice(tn::AbstractAnsatz)
Return the Lattice
of the AbstractAnsatz
Tensor Network.
Tenet.mixed_canonize! Function
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.
Tenet.mixed_canonize Method
mixed_canonize(tn::AbstractAnsatz, orthog_center)
Like mixed_canonize!
, but returns a new Tensor Network instead of modifying the original one.
Tenet.overlap Method
overlap(a::AbstractAnsatz, b::AbstractAnsatz)
Compute the overlap between two AbstractAnsatz
Tensor Networks.
Tenet.simple_update! Method
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
andmaxdim
are provided,maxdim
is used.
Tenet.tensors Method
tensors(tn::AbstractAnsatz; bond)
Return the Tensor
in a virtual bond between two AbstractLane
s 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
.
Tenet.truncate! Method
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
.
Tenet.truncate! Method
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
tn
: TheAbstractAnsatz
Tensor Network.bond
: The bond to truncate.
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. Iftrue
, it will contract the bond and perform a SVD to get the local singular values. Defaults totrue
.normalize
: Whether to normalize the state at the bond after truncation. Defaults tofalse
.
Tenet.truncate! Method
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 themaxdim
largest Schmidt coefficients or those larger thanthreshold
.If the Tensor Network is in the
Canonical
form, the bond is truncated by keeping themaxdim
largest Schmidt coefficients or those larger thanthreshold
, 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 themaxdim
largest singular values or those larger thanthreshold
.
Notes
- Either
threshold
ormaxdim
must be provided. If both are provided,maxdim
is used.
DocumenterMermaid.MermaidScriptBlock([...])