Quantum
Tenet.Lane Type
Lane(id)
Lane(i, j, ...)
lane"i,j,..."
Represents the location of a physical index.
Tenet.Site Type
Site(id[; dual = false])
Site(i, j, ...[; dual = false])
site"i,j,...[']"
Represents a Lane
with an annotation of input or output. Site
objects are used to label the indices of tensors in a Quantum
Tensor Network.
Base.adjoint Method
adjoint(site::Site)
Returns the adjoint of site
, i.e. a new Site
object with the same coordinates as site
but with the dual
flag flipped (so an input site becomes an output site and vice versa).
Tenet.id Function
id(lane::AbstractLane)
Returns the coordinate location of the lane
.
See also: lanes
Tenet.isdual Method
isdual(site::Site)
Returns true
if site
is a dual site (i.e. is a "input"), false
otherwise (i.e. is an "output").
See also: adjoint(::Site)
Tenet.@lane_str Macro
lane"i,j,..."
Constructs a Lane
object with the given coordinates. The coordinates are given as a comma-separated list of integers.
Tenet.@site_str Macro
site"i,j,...[']"
Constructs a Site
object with the given coordinates. The coordinates are given as a comma-separated list of integers. Optionally, a trailing '
can be added to indicate that the site is a dual site (i.e. an "input").
Tenet.AbstractQuantum Type
AbstractQuantum
Abstract type for Quantum
-derived types. Its subtypes must implement conversion or extraction of the underlying Quantum
by overloading the Quantum
constructor.
Tenet.Operator Type
Operator <: Socket
Socket representing an operator; i.e. a Tensor Network with both input and output sites.
Tenet.Quantum Type
Quantum
Tensor Network with a notion of "causality". This leads to the concept of sites and directionality (input/output).
Notes
- Indices are referenced by
Site
s.
Tenet.Scalar Type
Scalar <: Socket
Socket representing a scalar; i.e. a Tensor Network with no open sites.
Tenet.Socket Type
Socket
Abstract type representing the socket trait of a AbstractQuantum
Tensor Network.
Tenet.State Type
State <: Socket
Socket representing a state; i.e. a Tensor Network with only input sites (or only output sites if dual = true
).
Tenet.TensorNetwork Method
TensorNetwork(q::AbstractQuantum)
Return the underlying TensorNetwork
of an AbstractQuantum
.
Base.adjoint Method
Base.adjoint(::AbstractQuantum)
Return the adjoint of a Quantum
Tensor Network; i.e. the conjugate Tensor Network with the inputs and outputs swapped.
Base.merge! Method
Base.merge!(::AbstractQuantum...; reset=true)
Merge in-place multiple AbstractQuantum
Tensor Networks. If reset=true
, then all indices are renamed. If reset=false
, then only the indices of the input/output sites are renamed.
Base.merge Method
Base.merge(a::AbstractQuantum, b::AbstractQuantum; reset=true)
Merge multiple AbstractQuantum
Tensor Networks. If reset=true
, then all indices are renamed. If reset=false
, then only the indices of the input/output sites are renamed.
LinearAlgebra.adjoint! Method
LinearAlgebra.adjoint!(::AbstractQuantum)
Like adjoint
, but in-place.
LinearAlgebra.norm Function
LinearAlgebra.norm(::AbstractQuantum, p=2; kwargs...)
Return the Lp-norm of a AbstractQuantum
Tensor Network.
Warning
Only L2-norm is implemented yet.
Tenet.isconnectable Method
isconnectable(a::AbstractQuantum, b::AbstractQuantum)
Return true
if two AbstractQuantum
Tensor Networks can be connected. This means:
The outputs of
a
are a superset of the inputs ofb
.The outputs of
a
andb
are disjoint except for the sites that are connected.
Tenet.lanes Method
lanes(q::AbstractQuantum)
Return the lanes of a AbstractQuantum
Tensor Network.
Tenet.nlanes Method
nlanes(q::AbstractQuantum)
Return the number of lanes of a AbstractQuantum
Tensor Network.
Tenet.nsites Method
nsites(q::AbstractQuantum)
Return the number of sites of a AbstractQuantum
Tensor Network.
Tenet.sites Function
sites(q::AbstractQuantum)
Return the sites of a AbstractQuantum
Tensor Network.
Tenet.socket Method
socket(q::AbstractQuantum)
Return the socket of a Quantum
Tensor Network; i.e. whether it is a Scalar
, State
or Operator
.
Tenet.@reindex! Macro
@reindex! a => b reset=true
Rename in-place the indices of the input/output sites of two Quantum
Tensor Networks to be able to connect between them. If reset=true
, then all indices are renamed. If reset=false
, then only the indices of the input/output sites are renamed.
Tenet.Gate Type
Gate
A Gate
is a Tensor
together with a set of Site
s that represent the input/output indices. It is similar to the relation between Quantum
and TensorNetwork
, but only applies to one tensor.
Although it is not a AbstractQuantum
, it can be converted to TensorNetwork
or Quantum
.
Base.iterate Function
Base.iterate(circuit::Circuit[, state=1])
Iterate over the gates in circuit
in the order they were added.
DocumenterMermaid.MermaidScriptBlock([...])