From 5bac52e066adcf43b61c08053125f396dfed2d3e Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Fri, 13 Dec 2024 17:52:52 +0000 Subject: [PATCH] build based on bfc20d6 --- dev/.documenter-siteinfo.json | 2 +- .../BoundaryConditions/index.html | 2 +- dev/advanced topics/HybridSystems/index.html | 2 +- dev/advanced topics/IndexOrders/index.html | 2 +- dev/advanced topics/Introduction/index.html | 2 +- .../LaTeXFormattedOutputs/index.html | 2 +- dev/advanced topics/ManageProjects/index.html | 2 +- .../Transformations/index.html | 2 +- dev/index.html | 2 +- dev/man/DegreesOfFreedom/index.html | 110 +++++++++--------- dev/man/Frameworks/index.html | 28 ++--- dev/man/QuantumNumbers/index.html | 45 +++---- dev/man/QuantumOperators/index.html | 62 +++++----- dev/man/QuantumSystems/index.html | 76 ++++++------ dev/man/Spatials/index.html | 62 +++++----- dev/man/Toolkit/index.html | 56 ++++----- dev/objects.inv | Bin 13646 -> 13746 bytes dev/search_index.js | 2 +- .../index.html | 2 +- .../GeneratorOfOperators/index.html | 2 +- .../InternalDegreesOfFreedom/index.html | 2 +- .../Introduction/index.html | 2 +- .../SpatialInfoOfAUnitcell/index.html | 2 +- 23 files changed, 235 insertions(+), 234 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index c7d14d69..6fa5a758 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2024-12-13T15:47:54","documenter_version":"1.8.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2024-12-13T17:52:44","documenter_version":"1.8.0"}} \ No newline at end of file diff --git a/dev/advanced topics/BoundaryConditions/index.html b/dev/advanced topics/BoundaryConditions/index.html index cbf73281..378b3113 100644 --- a/dev/advanced topics/BoundaryConditions/index.html +++ b/dev/advanced topics/BoundaryConditions/index.html @@ -3,4 +3,4 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-89508993-1', {'page_path': location.pathname + location.search + location.hash}); -
+
diff --git a/dev/advanced topics/HybridSystems/index.html b/dev/advanced topics/HybridSystems/index.html index 936d6991..f48b7436 100644 --- a/dev/advanced topics/HybridSystems/index.html +++ b/dev/advanced topics/HybridSystems/index.html @@ -3,4 +3,4 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-89508993-1', {'page_path': location.pathname + location.search + location.hash}); -
+
diff --git a/dev/advanced topics/IndexOrders/index.html b/dev/advanced topics/IndexOrders/index.html index adf71d9d..9241bc42 100644 --- a/dev/advanced topics/IndexOrders/index.html +++ b/dev/advanced topics/IndexOrders/index.html @@ -3,4 +3,4 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-89508993-1', {'page_path': location.pathname + location.search + location.hash}); -
+
diff --git a/dev/advanced topics/Introduction/index.html b/dev/advanced topics/Introduction/index.html index b25f049c..6b1897d4 100644 --- a/dev/advanced topics/Introduction/index.html +++ b/dev/advanced topics/Introduction/index.html @@ -3,4 +3,4 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-89508993-1', {'page_path': location.pathname + location.search + location.hash}); -
+
diff --git a/dev/advanced topics/LaTeXFormattedOutputs/index.html b/dev/advanced topics/LaTeXFormattedOutputs/index.html index 4e89de6c..0bf417dc 100644 --- a/dev/advanced topics/LaTeXFormattedOutputs/index.html +++ b/dev/advanced topics/LaTeXFormattedOutputs/index.html @@ -3,4 +3,4 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-89508993-1', {'page_path': location.pathname + location.search + location.hash}); -
+
diff --git a/dev/advanced topics/ManageProjects/index.html b/dev/advanced topics/ManageProjects/index.html index 023d130c..2c15e7d2 100644 --- a/dev/advanced topics/ManageProjects/index.html +++ b/dev/advanced topics/ManageProjects/index.html @@ -3,4 +3,4 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-89508993-1', {'page_path': location.pathname + location.search + location.hash}); -
+
diff --git a/dev/advanced topics/Transformations/index.html b/dev/advanced topics/Transformations/index.html index 2ffb82d7..685fc02d 100644 --- a/dev/advanced topics/Transformations/index.html +++ b/dev/advanced topics/Transformations/index.html @@ -3,4 +3,4 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-89508993-1', {'page_path': location.pathname + location.search + location.hash}); -
+
diff --git a/dev/index.html b/dev/index.html index 77f02931..b1302e7f 100644 --- a/dev/index.html +++ b/dev/index.html @@ -3,4 +3,4 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-89508993-1', {'page_path': location.pathname + location.search + location.hash}); -

QuantumLattices.jl

CI codecov 996.icu LICENSE LICENSE Code Style: Blue ColPrac: Contributor's Guide on Collaborative Practices for Community Packages

Julia package for the construction of quantum lattice systems.

Welcome to QuantumLattices. Here we provide a general framework to construct the operator-formed Hamiltonian of any quantum lattice system, with the inputs as simple as its description by the natural language. This operator-formed Hamiltonian supports complete symbolic computations when combined with SymPy, and can serve as a convenient frontend of quantum many-body algorithms, such as TBA (tight-bind approximation), LSWT (linear spin wave theory), SCMF (self-consistent mean field theory), ED (exact diagonalization), CPT/VCA (cluster perturbation theory / variational cluster approach), DMRG (density matrix renormalization group), RPA (random phase approximation), etc. Generic interfaces are defined to provide a unified access to these algorithms with automatic project management.

Installation

In Julia v1.8+, please type ] in the REPL to use the package mode, then type this command:

pkg> add QuantumLattices

Package Features

The mathematical foundations of our package is that the operators in a lattice Hamiltonian:

  • act on local Hilbert spaces, and
  • form an algebra over the complex field.

Based on this, the package has the following features:

  • Unitcell Description Framework: the Hamiltonian can be constructed based on the unitcell of a lattice with the information of the local algebra acting on the local Hilbert space living on each point and the terms that couples different degrees of freedom on the same or different points. Such information can be input into the program as simple as describing the quantum system in a usual research paper.

  • Complete Symbolic Computation: with only this package, symbolic computation between operators is realized while the coefficient of any operator remains numeric; by integrating it with SymPy, complete symbolic computation can be achieved and no modifications need be made on the methods in this package.

  • Generic Frontend of Many-Body Algorithms: with the operator-formed Hamiltonian as the foothold, quantum many-body algorithms can be initialized in quite similar ways with only minor modifications needed. Moreover, automatic project management is realized, including that of result recording, data caching, parameter updating, information logging, dependency managing, etc.

Supported Systems

Four common categories of quantum lattice systems in condensed matter physics are supported:

  • canonical complex fermionic systems
  • canonical complex and hard-core bosonic systems
  • SU(2) spin systems
  • Phononic systems

Furthermore, other systems can be supported easily by extending the generic protocols provided in this package.

Supported Algorithms

Concrete algorithms could be considered as the "backend" of quantum lattice systems. They are developed in separate packages (still in progress):

  • TBA: tight-binding approximation for complex-fermionic/complex-bosonic/phononic systems;
  • LSWT: linear spin wave theory for magnetically ordered local-spin systems;
  • SCMF: self-consistent mean field theory for complex fermionic systems;
  • ED: exact diagonalization for complex-fermionic/hard-core-bosonic/local-spin systems;
  • CPT/VCA: cluster perturbation theory and variational cluster approach for complex fermionic and local spin systems;
  • DMRG: density matrix renormalization group for complex-fermionic/hard-core-bosonic/local-spin systems based on TensorKit and MPSKit;
  • RPA: random phase approximation for complex fermionic systems.

Getting Started

Note

Due to the fast development of this package, releases with different minor version numbers are not guaranteed to be compatible with previous ones before the release of v1.0.0. Comments are welcomed in the GitHub issues.

Contact

waltergu1989@gmail.com

Python counterpart

HamiltonianPy: in fact, the authors of this Julia package worked on the python package at first and only turned to Julia later.

+

QuantumLattices.jl

CI codecov 996.icu LICENSE LICENSE Code Style: Blue ColPrac: Contributor's Guide on Collaborative Practices for Community Packages

Julia package for the construction of quantum lattice systems.

Welcome to QuantumLattices. Here we provide a general framework to construct the operator-formed Hamiltonian of any quantum lattice system, with the inputs as simple as its description by the natural language. This operator-formed Hamiltonian supports complete symbolic computations when combined with SymPy, and can serve as a convenient frontend of quantum many-body algorithms, such as TBA (tight-bind approximation), LSWT (linear spin wave theory), SCMF (self-consistent mean field theory), ED (exact diagonalization), CPT/VCA (cluster perturbation theory / variational cluster approach), DMRG (density matrix renormalization group), RPA (random phase approximation), etc. Generic interfaces are defined to provide a unified access to these algorithms with automatic project management.

Installation

In Julia v1.8+, please type ] in the REPL to use the package mode, then type this command:

pkg> add QuantumLattices

Package Features

The mathematical foundations of our package is that the operators in a lattice Hamiltonian:

  • act on local Hilbert spaces, and
  • form an algebra over the complex field.

Based on this, the package has the following features:

  • Unitcell Description Framework: the Hamiltonian can be constructed based on the unitcell of a lattice with the information of the local algebra acting on the local Hilbert space living on each point and the terms that couples different degrees of freedom on the same or different points. Such information can be input into the program as simple as describing the quantum system in a usual research paper.

  • Complete Symbolic Computation: with only this package, symbolic computation between operators is realized while the coefficient of any operator remains numeric; by integrating it with SymPy, complete symbolic computation can be achieved and no modifications need be made on the methods in this package.

  • Generic Frontend of Many-Body Algorithms: with the operator-formed Hamiltonian as the foothold, quantum many-body algorithms can be initialized in quite similar ways with only minor modifications needed. Moreover, automatic project management is realized, including that of result recording, data caching, parameter updating, information logging, dependency managing, etc.

Supported Systems

Four common categories of quantum lattice systems in condensed matter physics are supported:

  • canonical complex fermionic systems
  • canonical complex and hard-core bosonic systems
  • SU(2) spin systems
  • Phononic systems

Furthermore, other systems can be supported easily by extending the generic protocols provided in this package.

Supported Algorithms

Concrete algorithms could be considered as the "backend" of quantum lattice systems. They are developed in separate packages (still in progress):

  • TBA: tight-binding approximation for complex-fermionic/complex-bosonic/phononic systems;
  • LSWT: linear spin wave theory for magnetically ordered local-spin systems;
  • SCMF: self-consistent mean field theory for complex fermionic systems;
  • ED: exact diagonalization for complex-fermionic/hard-core-bosonic/local-spin systems;
  • CPT/VCA: cluster perturbation theory and variational cluster approach for complex fermionic and local spin systems;
  • DMRG: density matrix renormalization group for complex-fermionic/hard-core-bosonic/local-spin systems based on TensorKit and MPSKit;
  • RPA: random phase approximation for complex fermionic systems.

Getting Started

Note

Due to the fast development of this package, releases with different minor version numbers are not guaranteed to be compatible with previous ones before the release of v1.0.0. Comments are welcomed in the GitHub issues.

Contact

waltergu1989@gmail.com

Python counterpart

HamiltonianPy: in fact, the authors of this Julia package worked on the python package at first and only turned to Julia later.

diff --git a/dev/man/DegreesOfFreedom/index.html b/dev/man/DegreesOfFreedom/index.html index f817a017..6b82a2ab 100644 --- a/dev/man/DegreesOfFreedom/index.html +++ b/dev/man/DegreesOfFreedom/index.html @@ -3,27 +3,27 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-89508993-1', {'page_path': location.pathname + location.search + location.hash}); -

Degrees of freedom

QuantumLattices.DegreesOfFreedom.AllEqualType
AllEqual{Fields} <: Function

All-equal constraint for the direct product of homogenous simple internal indexes that for every specified field the values of the internal indexes should be all equal.

source
QuantumLattices.DegreesOfFreedom.AllEqualMethod
(constraint::AllEqual{fields})(index::InternalIndexProd{NTuple{N, I}}) where {fields, N, I<:SimpleInternalIndex} -> Bool

Judge whether the direct product of a set of homogenous simple internal indexes is subject to an all-equal constraint.

source
QuantumLattices.DegreesOfFreedom.CouplingMethod
Coupling(indexes::Index...)
+

Degrees of freedom

QuantumLattices.DegreesOfFreedom.AllEqualType
AllEqual{Fields} <: Function

All-equal constraint for the direct product of homogenous simple internal indexes that for every specified field the values of the internal indexes should be all equal.

source
QuantumLattices.DegreesOfFreedom.AllEqualMethod
(constraint::AllEqual{fields})(index::InternalIndexProd{NTuple{N, I}}) where {fields, N, I<:SimpleInternalIndex} -> Bool

Judge whether the direct product of a set of homogenous simple internal indexes is subject to an all-equal constraint.

source
QuantumLattices.DegreesOfFreedom.CouplingMethod
Coupling(sites::Union{NTuple{N, Ordinal}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleInternalIndex}
+Coupling(value, indexes::Tuple{Vararg{Index}})

Construct a coupling with the input indexes as the pattern.

source
QuantumLattices.DegreesOfFreedom.CouplingMethod
Coupling(sites::Union{NTuple{N, Ordinal}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleInternalIndex}
 Coupling(value, sites::Union{NTuple{N, Ordinal}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleInternalIndex}
 Coupling{N}(sites::Union{NTuple{N, Ordinal}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleInternalIndex}
-Coupling{N}(value, sites::Union{NTuple{N, Ordinal}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleInternalIndex}

Construct a Coupling with the input sites and the fields of a kind of simple internal index.

source
QuantumLattices.DegreesOfFreedom.CouplingMethod
Coupling(f::Union{Function, Type{<:Function}}, sites::Union{NTuple{N, Ordinal}, Colon}, fields::Union{NTuple{N}, Colon}...) where N
+Coupling{N}(value, sites::Union{NTuple{N, Ordinal}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleInternalIndex}

Construct a Coupling with the input sites and the fields of a kind of simple internal index.

source
QuantumLattices.DegreesOfFreedom.CouplingMethod
Coupling(f::Union{Function, Type{<:Function}}, sites::Union{NTuple{N, Ordinal}, Colon}, fields::Union{NTuple{N}, Colon}...) where N
 Coupling(value::Number, f::Union{Function, Type{<:Function}}, sites::Union{NTuple{N, Ordinal}, Colon}, fields::Union{NTuple{N}, Colon}...) where N
 Coupling{N}(f::Union{Function, Type{<:Function}}, sites::Union{NTuple{N, Ordinal}, Colon}, fields::Union{NTuple{N}, Colon}...) where N
-Coupling{N}(value::Number, f::Union{Function, Type{<:Function}}, sites::Union{NTuple{N, Ordinal}, Colon}, fields::Union{NTuple{N}, Colon}...) where N

Construct a Coupling by a function that can construct an Index with the input sites and the fields of a kind of simple internal index.

source
QuantumLattices.DegreesOfFreedom.HilbertMethod
Hilbert(internals::Internal...)
+Coupling{N}(value::Number, f::Union{Function, Type{<:Function}}, sites::Union{NTuple{N, Ordinal}, Colon}, fields::Union{NTuple{N}, Colon}...) where N

Construct a Coupling by a function that can construct an Index with the input sites and the fields of a kind of simple internal index.

source
QuantumLattices.DegreesOfFreedom.HilbertMethod
Hilbert(internals::Internal...)
 Hilbert(internals::Tuple{Vararg{Internal}})
-Hilbert(internals::AbstractVector{<:Internal})

Construct a Hilbert space with the given internal spaces.

source
QuantumLattices.DegreesOfFreedom.IndexType
Index(site::Union{Int, Ordinal, Colon}, internal::SimpleInternalIndex)

Index of a degree of freedom, which consist of the spatial part (i.e., the site index) and the internal part (i.e., the internal index).

source
QuantumLattices.DegreesOfFreedom.InternalPatternType
InternalPattern(index::InternalIndexProd, constraint::Function, representation::String=string(constraint))
-InternalPattern{P}(index::InternalIndexProd, constraints::NTuple{N, Function}, representations::NTuple{N, String}=map(string, constraints))  where {P, N}

Construct an internal pattern for the direct product of a set of simple internal indexes with 1) only one constraint function, and 2) several constraint functions.

source
QuantumLattices.DegreesOfFreedom.InternalPatternMethod
InternalPattern(index::SimpleInternalIndex)
-InternalPattern(index::InternalIndexProd{<:Tuple{Vararg{I}}}) where {I<:SimpleInternalIndex}

Construct an internal pattern whose constraint is an AllEqual function for the direct product of a homogeneous set of simple internal indexes.

source
QuantumLattices.DegreesOfFreedom.MatrixCouplingType
MatrixCoupling{I}(sites::Union{NTuple{2, Ordinal}, NTuple{2, Colon}}, contents::Tuple{Vararg{Component}}) where {I<:SimpleInternalIndex}
-MatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{I}, contents::Component...) where {I<:SimpleInternalIndex}

Matrix coupling, i.e., a set of couplings whose coefficients are specified by matrices acting on separated internal spaces.

source
QuantumLattices.DegreesOfFreedom.MetricType
Metric <: Function

Rules for measuring an operator index so that different operator indexes can be compared.

As a function, every instance should accept only one positional argument, i.e. the operator index to be measured.

source
QuantumLattices.DegreesOfFreedom.OperatorIndexToTupleType
OperatorIndexToTuple{Fields} <: Metric

A rule that converts an operator index into a tuple based on the specified type parameter Fields.

Here, Fields must be a tuple of Union{Symbol, Function}, which determines the elements of the converted tuple on an element-by-element basis.

For the ith element of Fields:

  1. If it is a Symbol, it represents the name of a single index of an OperatorIndex, and its value will become the corresponding element in the converted tuple.
  2. If it is a Function, it should be a trait function of an OperatorIndex, and its return value will become the corresponding element in the converted tuple.
source
QuantumLattices.DegreesOfFreedom.TableType
Table(indexes::AbstractVector{<:OperatorIndex}, by::Metric=OperatorIndexToTuple(eltype(indexes)))

Convert a set of operator units to the corresponding table of operator index vs. sequence pairs.

The input operator units are measured by the input by function with the duplicates removed. The resulting unique values are sorted, which determines the sequence of the input indexes. Note that two operator units have the same sequence if their converted values are equal to each other.

source
QuantumLattices.DegreesOfFreedom.TermMethod
Term{K}(id::Symbol, value, bondkind, coupling, ishermitian::Bool; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true) where K

Construct a term.

source
QuantumLattices.DegreesOfFreedom.@patternMacro
@pattern index₁ index₂ ...
-@pattern(index₁, index₂, ...; constraint=...)

Construct a coupling pattern according to the pattern of the input indexes and an optional constraint.

source
Base.:*Method
*(mc₁::MatrixCoupling, mc₂::MatrixCoupling) -> MatrixCouplingProd
+Hilbert(internals::AbstractVector{<:Internal})

Construct a Hilbert space with the given internal spaces.

source
QuantumLattices.DegreesOfFreedom.IndexType
Index(site::Union{Int, Ordinal, Colon}, internal::SimpleInternalIndex)

Index of a degree of freedom, which consist of the spatial part (i.e., the site index) and the internal part (i.e., the internal index).

source
QuantumLattices.DegreesOfFreedom.InternalPatternType
InternalPattern(index::InternalIndexProd, constraint::Function, representation::String=string(constraint))
+InternalPattern{P}(index::InternalIndexProd, constraints::NTuple{N, Function}, representations::NTuple{N, String}=map(string, constraints))  where {P, N}

Construct an internal pattern for the direct product of a set of simple internal indexes with 1) only one constraint function, and 2) several constraint functions.

source
QuantumLattices.DegreesOfFreedom.InternalPatternMethod
InternalPattern(index::SimpleInternalIndex)
+InternalPattern(index::InternalIndexProd{<:Tuple{Vararg{I}}}) where {I<:SimpleInternalIndex}

Construct an internal pattern whose constraint is an AllEqual function for the direct product of a homogeneous set of simple internal indexes.

source
QuantumLattices.DegreesOfFreedom.MatrixCouplingType
MatrixCoupling{I}(sites::Union{NTuple{2, Ordinal}, NTuple{2, Colon}}, contents::Tuple{Vararg{Component}}) where {I<:SimpleInternalIndex}
+MatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{I}, contents::Component...) where {I<:SimpleInternalIndex}

Matrix coupling, i.e., a set of couplings whose coefficients are specified by matrices acting on separated internal spaces.

source
QuantumLattices.DegreesOfFreedom.MetricType
Metric <: Function

Rules for measuring an operator index so that different operator indexes can be compared.

As a function, every instance should accept only one positional argument, i.e. the operator index to be measured.

source
QuantumLattices.DegreesOfFreedom.OperatorIndexToTupleType
OperatorIndexToTuple{Fields} <: Metric

A rule that converts an operator index into a tuple based on the specified type parameter Fields.

Here, Fields must be a tuple of Union{Symbol, Function}, which determines the elements of the converted tuple on an element-by-element basis.

For the ith element of Fields:

  1. If it is a Symbol, it represents the name of a single index of an OperatorIndex, and its value will become the corresponding element in the converted tuple.
  2. If it is a Function, it should be a trait function of an OperatorIndex, and its return value will become the corresponding element in the converted tuple.
source
QuantumLattices.DegreesOfFreedom.TableType
Table(indexes::AbstractVector{<:OperatorIndex}, by::Metric=OperatorIndexToTuple(eltype(indexes)))

Convert a set of operator units to the corresponding table of operator index vs. sequence pairs.

The input operator units are measured by the input by function with the duplicates removed. The resulting unique values are sorted, which determines the sequence of the input indexes. Note that two operator units have the same sequence if their converted values are equal to each other.

source
QuantumLattices.DegreesOfFreedom.TermMethod
Term{K}(id::Symbol, value, bondkind, coupling, ishermitian::Bool; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true) where K

Construct a term.

source
QuantumLattices.DegreesOfFreedom.@patternMacro
@pattern index₁ index₂ ...
+@pattern(index₁, index₂, ...; constraint=...)

Construct a coupling pattern according to the pattern of the input indexes and an optional constraint.

source
Base.:*Method
*(mc₁::MatrixCoupling, mc₂::MatrixCoupling) -> MatrixCouplingProd
 *(mc::MatrixCoupling, mcp::MatrixCouplingProd) -> MatrixCouplingProd
 *(mcp::MatrixCouplingProd, mc::MatrixCoupling) -> MatrixCouplingProd
 *(mcp₁::MatrixCouplingProd, mcp₂::MatrixCouplingProd) -> MatrixCouplingProd
@@ -33,10 +33,10 @@
 *(mcp::MatrixCouplingProd, factor::Number) -> MatrixCouplingProd
 *(mcs::MatrixCouplingSum, element::Union{Number, MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum
 *(element::Union{Number, MatrixCoupling, MatrixCouplingProd}, mcs::MatrixCouplingSum) -> MatrixCouplingSum
-*(mcs₁::MatrixCouplingSum, mcs₂::MatrixCouplingSum) -> MatrixCouplingSum

Product between MatrixCouplings and MatrixCouplingProds.

source
Base.:+Method
+(mc₁::Union{MatrixCoupling, MatrixCouplingProd}, mc₂::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum
+*(mcs₁::MatrixCouplingSum, mcs₂::MatrixCouplingSum) -> MatrixCouplingSum

Product between MatrixCouplings and MatrixCouplingProds.

source
Base.:+Method
+(mc₁::Union{MatrixCoupling, MatrixCouplingProd}, mc₂::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum
 +(mc::Union{MatrixCoupling, MatrixCouplingProd}, mcs::MatrixCouplingSum) -> MatrixCouplingSum
 +(mcs::MatrixCouplingSum, mc::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum
-+(mcs₁::MatrixCouplingSum, mcs₂::MatrixCouplingSum) -> MatrixCouplingSum

Addition between MatrixCouplings and MatrixCouplingProds.

source
Base.:/Method
/(mcp::MatrixCouplingProd, factor::Number) -> MatrixCouplingProd
++(mcs₁::MatrixCouplingSum, mcs₂::MatrixCouplingSum) -> MatrixCouplingSum

Addition between MatrixCouplings and MatrixCouplingProds.

source
Base.:/Method
/(mcp::MatrixCouplingProd, factor::Number) -> MatrixCouplingProd
 /(mcs::MatrixCouplingSum, factor::Number) -> MatrixCouplingSum
 /(mc::MatrixCoupling, factor::Number) -> MatrixCouplingProd
 //(mcp::MatrixCouplingProd, factor::Number) -> MatrixCouplingProd
@@ -48,49 +48,49 @@
 -(mc₁::Union{MatrixCoupling, MatrixCouplingProd}, mc₂::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum
 -(mc::Union{MatrixCoupling, MatrixCouplingProd}, mcs::MatrixCouplingSum) -> MatrixCouplingSum
 -(mcs::MatrixCouplingSum, mc::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum
--(mcs₁::MatrixCouplingSum, mcs₂::MatrixCouplingSum) -> MatrixCouplingSum

Define right-division, minus and subtraction operator for a MatrixCoupling/MatrixCouplingProd/MatrixCouplingSum.

source
Base.:^Method
^(mc::Union{MatrixCoupling, MatrixCouplingProd, MatrixCouplingSum}, n::Integer) -> Union{MatrixCoupling, MatrixCouplingProd, MatrixCouplingSum}

Get the nth power of a MatrixCoupling/MatrixCouplingProd/MatrixCouplingSum.

source
Base.adjointMethod
adjoint(index::CoordinatedIndex) -> typeof(index)

Get the adjoint of a coordinated index.

source
Base.adjointMethod
adjoint(index::Index) -> typeof(index)

Get the adjoint of an index.

source
Base.filterMethod
filter(ii::SimpleInternalIndex, ci::CompositeInternal) -> Union{Nothing, SimpleInternal, CompositeInternal}
-filter(::Type{I}, ci::CompositeInternal) where {I<:SimpleInternalIndex} -> Union{Nothing, SimpleInternal, CompositeInternal}

Filter the composite internal space and select those that match the input simple internal index or the type of a simple internal index.

source
Base.filterMethod
filter(ii::SimpleInternalIndex, i::SimpleInternal) -> Union{Nothing, typeof(internal)}
-filter(::Type{I}, i::SimpleInternal) where {I<:SimpleInternalIndex} -> Union{Nothing, typeof(internal)}

Filter a simple internal space with respect to the input simple internal index or the type of a simple internal index.

source
Base.filterMethod
filter(ii::SimpleInternalIndex, ::Type{CI}) where {CI<:CompositeInternal}
-filter(::Type{I}, ::Type{CI}) where {I<:SimpleInternalIndex, CI<:CompositeInternal}

Filter the type of a composite internal space and select those that match the input simple internal index or the type of a simple internal index.

source
Base.filterMethod
filter(ii::SimpleInternalIndex, ::Type{SI}) where {SI<:SimpleInternal}
-filter(::Type{I}, ::Type{SI}) where {I<:SimpleInternalIndex, SI<:SimpleInternal}

Filter the type of a simple internal space with respect to the input simple internal index or the type of a simple internal index.

source
Base.findallMethod
findall(select::Function, hilbert::Hilbert, table::Table) -> Vector{Int}

Find all the sequences of indexes contained in a Hilbert space according to a table and a select function.

source
Base.getindexMethod
getindex(table::Table, index::OperatorIndex) -> Int

Inquiry the sequence of an operator index.

source
Base.haskeyMethod
haskey(table::Table, index::OperatorIndex) -> Bool
-haskey(table::Table, indexes::ID{OperatorIndex}) -> Tuple{Vararg{Bool}}

Judge whether a single operator index or a set of operator indexes have been assigned with sequences in table.

source
Base.keysMethod
keys(bound::Boundary) -> Tuple{Vararg{Symbol}}
-keys(::Type{<:Boundary{Names}}) where Names -> Names

Get the names of the boundary parameters.

source
Base.keysMethod
keys(::OperatorIndexToTuple{Fields}) where Fields -> Fields
-keys(::Type{<:OperatorIndexToTuple{Fields}}) where Fields -> Fields

Get the values of the type parameter Fields.

source
Base.matchMethod
match(pattern::InternalPattern, index::InternalIndexProd) -> Bool

Judge whether the direct product of a set of simple internal indexes satisfies an internal pattern.

source
Base.matchMethod
match(ii::SimpleInternalIndex, i::SimpleInternal) -> Bool
+-(mcs₁::MatrixCouplingSum, mcs₂::MatrixCouplingSum) -> MatrixCouplingSum

Define right-division, minus and subtraction operator for a MatrixCoupling/MatrixCouplingProd/MatrixCouplingSum.

source
Base.:^Method
^(mc::Union{MatrixCoupling, MatrixCouplingProd, MatrixCouplingSum}, n::Integer) -> Union{MatrixCoupling, MatrixCouplingProd, MatrixCouplingSum}

Get the nth power of a MatrixCoupling/MatrixCouplingProd/MatrixCouplingSum.

source
Base.adjointMethod
adjoint(index::CoordinatedIndex) -> typeof(index)

Get the adjoint of a coordinated index.

source
Base.adjointMethod
adjoint(index::Index) -> typeof(index)

Get the adjoint of an index.

source
Base.filterMethod
filter(ii::SimpleInternalIndex, ci::CompositeInternal) -> Union{Nothing, SimpleInternal, CompositeInternal}
+filter(::Type{I}, ci::CompositeInternal) where {I<:SimpleInternalIndex} -> Union{Nothing, SimpleInternal, CompositeInternal}

Filter the composite internal space and select those that match the input simple internal index or the type of a simple internal index.

source
Base.filterMethod
filter(ii::SimpleInternalIndex, i::SimpleInternal) -> Union{Nothing, typeof(internal)}
+filter(::Type{I}, i::SimpleInternal) where {I<:SimpleInternalIndex} -> Union{Nothing, typeof(internal)}

Filter a simple internal space with respect to the input simple internal index or the type of a simple internal index.

source
Base.filterMethod
filter(ii::SimpleInternalIndex, ::Type{CI}) where {CI<:CompositeInternal}
+filter(::Type{I}, ::Type{CI}) where {I<:SimpleInternalIndex, CI<:CompositeInternal}

Filter the type of a composite internal space and select those that match the input simple internal index or the type of a simple internal index.

source
Base.filterMethod
filter(ii::SimpleInternalIndex, ::Type{SI}) where {SI<:SimpleInternal}
+filter(::Type{I}, ::Type{SI}) where {I<:SimpleInternalIndex, SI<:SimpleInternal}

Filter the type of a simple internal space with respect to the input simple internal index or the type of a simple internal index.

source
Base.findallMethod
findall(select::Function, hilbert::Hilbert, table::Table) -> Vector{Int}

Find all the sequences of indexes contained in a Hilbert space according to a table and a select function.

source
Base.getindexMethod
getindex(table::Table, index::OperatorIndex) -> Int

Inquiry the sequence of an operator index.

source
Base.haskeyMethod
haskey(table::Table, index::OperatorIndex) -> Bool
+haskey(table::Table, indexes::ID{OperatorIndex}) -> Tuple{Vararg{Bool}}

Judge whether a single operator index or a set of operator indexes have been assigned with sequences in table.

source
Base.keysMethod
keys(bound::Boundary) -> Tuple{Vararg{Symbol}}
+keys(::Type{<:Boundary{Names}}) where Names -> Names

Get the names of the boundary parameters.

source
Base.keysMethod
keys(::OperatorIndexToTuple{Fields}) where Fields -> Fields
+keys(::Type{<:OperatorIndexToTuple{Fields}}) where Fields -> Fields

Get the values of the type parameter Fields.

source
Base.matchMethod
match(pattern::InternalPattern, index::InternalIndexProd) -> Bool

Judge whether the direct product of a set of simple internal indexes satisfies an internal pattern.

source
Base.matchMethod
match(ii::SimpleInternalIndex, i::SimpleInternal) -> Bool
 match(::Type{I}, i::SimpleInternal) where {I<:SimpleInternalIndex} -> Bool
 match(ii::SimpleInternalIndex, ::Type{SI}) where {SI<:SimpleInternal} -> Bool
-match(::Type{I}, ::Type{SI}) where {I<:SimpleInternalIndex, SI<:SimpleInternal} -> Bool

Judge whether a simple internal space or the type of a simple internal space matches a simple internal index or the type of a simple internal index.

Here, "match" means that the eltype of the simple internal space is consistent with the type of the simple internal index, which usually means that they share the same type name.

source
Base.merge!Method
merge!(bound::Boundary, another::Boundary) -> typeof(bound)

Merge the values and vectors of the twisted boundary condition from another one.

source
Base.replaceMethod
replace(bound::Boundary; values=bound.values, vectors=bound.vectors) -> Boundary

Replace the values or vectors of a twisted boundary condition and get the new one.

Note

The plain boundary condition keeps plain even when replaced with new values or new vectors.

source
Base.replaceMethod
replace(term::Term, value) -> Term

Replace the value of a term.

source
Base.stringMethod
string(term::Term, bond::Bond, hilbert::Hilbert) -> String

Get the string representation of a term on a bond with a given Hilbert space.

source
Base.unionMethod
union(tables::Table...) -> Table

Unite several operator index vs. sequence tables.

source
Base.valtypeMethod
valtype(term::Term)
-valtype(::Type{<:Term)

Get the value type of a term.

source
Base.valtypeMethod
valtype(terms::Tuple{Term, Vararg{Term}})
-valtype(::Type{<:T}) where {T<:Tuple{Term, Vararg{Term}}}

Get the common value type of a set of terms.

source
Base.valtypeMethod
valtype(::Type{<:OperatorIndexToTuple}, ::Type{<:Index})

Get the valtype of applying an OperatorIndexToTuple rule to an Index.

source
LinearAlgebra.rankMethod
rank(ci::CompositeInternal) -> Int
-rank(::Type{<:CompositeInternal{T}}) where {T<:Tuple{Vararg{SimpleInternal}}} -> Int

Get the number of simple internal spaces in a composite internal space.

source
LinearAlgebra.rankMethod
rank(coupling::Coupling) -> Int
-rank(::Type{M}) where {M<:Coupling} -> Int

Get the rank of a coupling.

source
LinearAlgebra.rankMethod
rank(cii::InternalIndexProd) -> Int
-rank(::Type{<:InternalIndexProd{T}}) where {T<:Tuple{Vararg{SimpleInternalIndex}}} -> Int

Get the number of simple internal indexes in a direct product.

source
LinearAlgebra.rankMethod
rank(pattern::InternalPattern, i::Integer) -> Int
-rank(::Type{P}, i::Integer) where {P<:InternalPattern} -> Int

Get the rank of the direct product of the simple internal indexes that the ith constraint in an internal pattern can apply.

source
LinearAlgebra.rankMethod
rank(pattern::InternalPattern) -> Int
-rank(::Type{P}) where {P<:InternalPattern} -> Int

Get the rank of the direct product of the simple internal indexes that an internal pattern can apply.

source
LinearAlgebra.rankMethod
rank(pattern::Pattern) -> Int
-rank(::Type{<:Pattern{<:InternalPattern, S}}) where {S<:Tuple{Vararg{Union{Ordinal, Colon}}}} -> Int

Get the rank of a coupling pattern.

source
QuantumLattices.:⊕Method
⊕(is::SimpleInternal...) -> InternalSum
+match(::Type{I}, ::Type{SI}) where {I<:SimpleInternalIndex, SI<:SimpleInternal} -> Bool

Judge whether a simple internal space or the type of a simple internal space matches a simple internal index or the type of a simple internal index.

Here, "match" means that the eltype of the simple internal space is consistent with the type of the simple internal index, which usually means that they share the same type name.

source
Base.merge!Method
merge!(bound::Boundary, another::Boundary) -> typeof(bound)

Merge the values and vectors of the twisted boundary condition from another one.

source
Base.replaceMethod
replace(bound::Boundary; values=bound.values, vectors=bound.vectors) -> Boundary

Replace the values or vectors of a twisted boundary condition and get the new one.

Note

The plain boundary condition keeps plain even when replaced with new values or new vectors.

source
Base.replaceMethod
replace(term::Term, value) -> Term

Replace the value of a term.

source
Base.stringMethod
string(term::Term, bond::Bond, hilbert::Hilbert) -> String

Get the string representation of a term on a bond with a given Hilbert space.

source
Base.unionMethod
union(tables::Table...) -> Table

Unite several operator index vs. sequence tables.

source
Base.valtypeMethod
valtype(term::Term)
+valtype(::Type{<:Term)

Get the value type of a term.

source
Base.valtypeMethod
valtype(terms::Tuple{Term, Vararg{Term}})
+valtype(::Type{<:T}) where {T<:Tuple{Term, Vararg{Term}}}

Get the common value type of a set of terms.

source
Base.valtypeMethod
valtype(::Type{<:OperatorIndexToTuple}, ::Type{<:Index})

Get the valtype of applying an OperatorIndexToTuple rule to an Index.

source
LinearAlgebra.rankMethod
rank(ci::CompositeInternal) -> Int
+rank(::Type{<:CompositeInternal{T}}) where {T<:Tuple{Vararg{SimpleInternal}}} -> Int

Get the number of simple internal spaces in a composite internal space.

source
LinearAlgebra.rankMethod
rank(coupling::Coupling) -> Int
+rank(::Type{M}) where {M<:Coupling} -> Int

Get the rank of a coupling.

source
LinearAlgebra.rankMethod
rank(cii::InternalIndexProd) -> Int
+rank(::Type{<:InternalIndexProd{T}}) where {T<:Tuple{Vararg{SimpleInternalIndex}}} -> Int

Get the number of simple internal indexes in a direct product.

source
LinearAlgebra.rankMethod
rank(pattern::InternalPattern, i::Integer) -> Int
+rank(::Type{P}, i::Integer) where {P<:InternalPattern} -> Int

Get the rank of the direct product of the simple internal indexes that the ith constraint in an internal pattern can apply.

source
LinearAlgebra.rankMethod
rank(pattern::InternalPattern) -> Int
+rank(::Type{P}) where {P<:InternalPattern} -> Int

Get the rank of the direct product of the simple internal indexes that an internal pattern can apply.

source
LinearAlgebra.rankMethod
rank(pattern::Pattern) -> Int
+rank(::Type{<:Pattern{<:InternalPattern, S}}) where {S<:Tuple{Vararg{Union{Ordinal, Colon}}}} -> Int

Get the rank of a coupling pattern.

source
QuantumLattices.:⊕Method
⊕(is::SimpleInternal...) -> InternalSum
 ⊕(i::SimpleInternal, ci::InternalSum) -> InternalSum
 ⊕(ci::InternalSum, i::SimpleInternal) -> InternalSum
-⊕(ci₁::InternalSum, ci₂::InternalSum) -> InternalSum

Direct sum between simple internal spaces and composite internal spaces.

source
QuantumLattices.:⊗Method
*(cp₁::Coupling, cp₂::Coupling) -> Coupling
-⊗(cp₁::Coupling, cp₂::Coupling) -> Coupling

Get the multiplication between two coupling.

source
QuantumLattices.:⊗Method
⊗(pattern₁::InternalPattern, pattern₂::InternalPattern) -> InternalPattern

Get the combination of two internal patterns.

source
QuantumLattices.:⊗Method
⊗(pattern₁::Pattern, pattern₂::Pattern) -> Pattern

Get the combination of two coupling patterns.

source
QuantumLattices.:⊗Method
⊗(iis::SimpleInternalIndex...) -> InternalIndexProd
+⊕(ci₁::InternalSum, ci₂::InternalSum) -> InternalSum

Direct sum between simple internal spaces and composite internal spaces.

source
QuantumLattices.:⊗Method
*(cp₁::Coupling, cp₂::Coupling) -> Coupling
+⊗(cp₁::Coupling, cp₂::Coupling) -> Coupling

Get the multiplication between two coupling.

source
QuantumLattices.:⊗Method
⊗(pattern₁::InternalPattern, pattern₂::InternalPattern) -> InternalPattern

Get the combination of two internal patterns.

source
QuantumLattices.:⊗Method
⊗(pattern₁::Pattern, pattern₂::Pattern) -> Pattern

Get the combination of two coupling patterns.

source
QuantumLattices.:⊗Method
⊗(iis::SimpleInternalIndex...) -> InternalIndexProd
 ⊗(ii::SimpleInternalIndex, cii::InternalIndexProd) -> InternalIndexProd
 ⊗(cii::InternalIndexProd, ii::SimpleInternalIndex) -> InternalIndexProd
-⊗(cii₁::InternalIndexProd, cii₂::InternalIndexProd) -> InternalIndexProd

Direct product between internal indexes.

source
QuantumLattices.:⊗Method
⊗(is::SimpleInternal...) -> InternalProd
+⊗(cii₁::InternalIndexProd, cii₂::InternalIndexProd) -> InternalIndexProd

Direct product between internal indexes.

source
QuantumLattices.:⊗Method
⊗(is::SimpleInternal...) -> InternalProd
 ⊗(i::SimpleInternal, ci::InternalProd) -> InternalProd
 ⊗(ci::InternalProd, i::SimpleInternal) -> InternalProd
-⊗(ci₁::InternalProd, ci₂::InternalProd) -> InternalProd

Direct product between simple internal spaces and composite internal spaces.

source
QuantumLattices.DegreesOfFreedom.isdefiniteMethod
isdefinite(indexes::Tuple{Vararg{Index}}) -> Bool
-isdefinite(::Type{T}) where {T<:Tuple{Vararg{Index}}} -> Bool

Determine whether a tuple of indexes denotes a definite degree of freedom.

source
QuantumLattices.DegreesOfFreedom.partitionMethod
partition(pattern::InternalPattern) -> Tuple{Vararg{Int}}
-partition(::Type{<:InternalPattern{I, P} where I}) where P -> P

Get the partition of the direct product of a set of simple internal indexes on which the extra constraints operate independently.

source
QuantumLattices.DegreesOfFreedom.patternruleFunction
patternrule(value, ::Val{Name}, args...; kwargs...) where Name

By overriding this function, a named rule for the value of some attributes in a pattern can be defined so that the value can be transformed into the desired one.

In most cases, such overridden functions define the default rules for the attributes in a pattern when they take on the default value :.

source
QuantumLattices.DegreesOfFreedom.patternruleMethod
patternrule(index::InternalIndexProd{T}, ::Val{Name}) where {N, T<:NTuple{N, SimpleInternalIndex}, Name} -> InternalIndexProd

Define the default rule for the internal index in an internal pattern.

source
QuantumLattices.QuantumOperators.scriptMethod
script(index::CoordinatedIndex, ::Val{:rcoordinate}; kwargs...) -> String
-script(index::CoordinatedIndex, ::Val{:icoordinate}; kwargs...) -> String

Get the rcoordinate/icoordinate script of a coordinated index.

source
QuantumLattices.Spatials.nneighborMethod
nneighbor(term::Term) -> Int
-nneighbor(terms::Tuple{Term, Vararg{Term}}) -> Int

Get the

  1. order of neighbor in a single term;
  2. highest order of neighbors in a set of terms.
source
QuantumLattices.Toolkit.shapeMethod
shape(internal::SimpleInternal, index::SimpleInternalIndex) -> OrdinalRange{Int, Int}

Get the shape of a simple internal space when a labeled simple internal index are considered.

A constrained internal space need this function to generate all the internal indexes that match the internal pattern, which gets a default implementation, i.e.,

shape(internal::SimpleInternal, index::SimpleInternalIndex) = shape(internal)

It can be overloaded to restrict the shape of a simple internal space based on the input simple internal index to significantly improve efficiency, but this is not necessary.

source
QuantumLattices.expand!Method
expand!(operators::Operators, term::Term, bond::Bond, hilbert::Hilbert; half::Bool=false) -> Operators
-expand!(operators::Operators, term::Term, bonds, hilbert::Hilbert; half::Bool=false) -> Operators

Expand the operators of a term on a bond/set-of-bonds with a given Hilbert space.

The half parameter determines the behavior of generating operators, which falls into the following two categories

  • true: "Hermitian half" of the generated operators
  • false: "Hermitian whole" of the generated operators
source
QuantumLattices.expandMethod
expand(term::Term, bond::Bond, hilbert::Hilbert; half::Bool=false) -> Operators
-expand(term::Term, bonds, hilbert::Hilbert; half::Bool=false) -> Operators

Expand the operators of a term on a bond/set-of-bonds with a given Hilbert space.

source
QuantumLattices.expandMethod
expand(coupling::Coupling, ::Val{Rule}, bond::Bond, hilbert::Hilbert) where Rule

Expand a coupling with the given bond and Hilbert space under a given named pattern rule.

source
QuantumLattices.permuteMethod
permute(index₁::CoordinatedIndex, index₂::CoordinatedIndex) -> Tuple{Vararg{Operator}}

Get the permutation of two coordinated indexes.

source
QuantumLattices.reset!Method
reset!(table::Table, indexes::AbstractVector{<:OperatorIndex}) -> Table

Reset a table by a new set of indexes.

source
+⊗(ci₁::InternalProd, ci₂::InternalProd) -> InternalProd

Direct product between simple internal spaces and composite internal spaces.

source
QuantumLattices.DegreesOfFreedom.isdefiniteMethod
isdefinite(indexes::Tuple{Vararg{Index}}) -> Bool
+isdefinite(::Type{T}) where {T<:Tuple{Vararg{Index}}} -> Bool

Determine whether a tuple of indexes denotes a definite degree of freedom.

source
QuantumLattices.DegreesOfFreedom.partitionMethod
partition(pattern::InternalPattern) -> Tuple{Vararg{Int}}
+partition(::Type{<:InternalPattern{I, P} where I}) where P -> P

Get the partition of the direct product of a set of simple internal indexes on which the extra constraints operate independently.

source
QuantumLattices.DegreesOfFreedom.patternruleFunction
patternrule(value, ::Val{Name}, args...; kwargs...) where Name

By overriding this function, a named rule for the value of some attributes in a pattern can be defined so that the value can be transformed into the desired one.

In most cases, such overridden functions define the default rules for the attributes in a pattern when they take on the default value :.

source
QuantumLattices.DegreesOfFreedom.patternruleMethod
patternrule(index::InternalIndexProd{T}, ::Val{Name}) where {N, T<:NTuple{N, SimpleInternalIndex}, Name} -> InternalIndexProd

Define the default rule for the internal index in an internal pattern.

source
QuantumLattices.QuantumOperators.scriptMethod
script(index::CoordinatedIndex, ::Val{:rcoordinate}; kwargs...) -> String
+script(index::CoordinatedIndex, ::Val{:icoordinate}; kwargs...) -> String

Get the rcoordinate/icoordinate script of a coordinated index.

source
QuantumLattices.Spatials.nneighborMethod
nneighbor(term::Term) -> Int
+nneighbor(terms::Tuple{Term, Vararg{Term}}) -> Int

Get the

  1. order of neighbor in a single term;
  2. highest order of neighbors in a set of terms.
source
QuantumLattices.Toolkit.shapeMethod
shape(internal::SimpleInternal, index::SimpleInternalIndex) -> OrdinalRange{Int, Int}

Get the shape of a simple internal space when a labeled simple internal index are considered.

A constrained internal space need this function to generate all the internal indexes that match the internal pattern, which gets a default implementation, i.e.,

shape(internal::SimpleInternal, index::SimpleInternalIndex) = shape(internal)

It can be overloaded to restrict the shape of a simple internal space based on the input simple internal index to significantly improve efficiency, but this is not necessary.

source
QuantumLattices.expand!Method
expand!(operators::Operators, term::Term, bond::Bond, hilbert::Hilbert; half::Bool=false) -> Operators
+expand!(operators::Operators, term::Term, bonds, hilbert::Hilbert; half::Bool=false) -> Operators

Expand the operators of a term on a bond/set-of-bonds with a given Hilbert space.

The half parameter determines the behavior of generating operators, which falls into the following two categories

  • true: "Hermitian half" of the generated operators
  • false: "Hermitian whole" of the generated operators
source
QuantumLattices.expandMethod
expand(term::Term, bond::Bond, hilbert::Hilbert; half::Bool=false) -> Operators
+expand(term::Term, bonds, hilbert::Hilbert; half::Bool=false) -> Operators

Expand the operators of a term on a bond/set-of-bonds with a given Hilbert space.

source
QuantumLattices.expandMethod
expand(coupling::Coupling, ::Val{Rule}, bond::Bond, hilbert::Hilbert) where Rule

Expand a coupling with the given bond and Hilbert space under a given named pattern rule.

source
QuantumLattices.permuteMethod
permute(index₁::CoordinatedIndex, index₂::CoordinatedIndex) -> Tuple{Vararg{Operator}}

Get the permutation of two coordinated indexes.

source
QuantumLattices.reset!Method
reset!(table::Table, indexes::AbstractVector{<:OperatorIndex}) -> Table

Reset a table by a new set of indexes.

source
diff --git a/dev/man/Frameworks/index.html b/dev/man/Frameworks/index.html index 7acb7875..c860221e 100644 --- a/dev/man/Frameworks/index.html +++ b/dev/man/Frameworks/index.html @@ -3,19 +3,19 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-89508993-1', {'page_path': location.pathname + location.search + location.hash}); -

Frameworks

QuantumLattices.Frameworks.AlgorithmMethod
(alg::Algorithm)(assign::Assignment) -> Tuple{Algorithm, Assignment}
-(assign::Assignment)(alg::Algorithm) -> Tuple{Algorithm, Assignment}

Run an assignment based on an algorithm.

The difference between these two methods is that the first uses the parameters of assign as the current parameters while the second uses those of alg.

source
QuantumLattices.Frameworks.AlgorithmMethod
(alg::Algorithm)(id::Symbol, action::Action; info::Bool=true, kwargs...) -> Tuple{Algorithm, Assignment}

Add an assignment on a algorithm by providing the contents of the assignment, and run this assignment.

source
QuantumLattices.Frameworks.AlgorithmMethod
Algorithm(name::Symbol, frontend::Frontend; din::String=".", dout::String=".", parameters::Parameters=Parameters(frontend), map::Function=identity)

Construct an algorithm.

source
QuantumLattices.Frameworks.AlgorithmMethod
(alg::Algorithm)(id::Symbol; info::Bool=true, parameters::Parameters=Parameters{()}()) -> Tuple{Algorithm, Assignment}

Run an assignment specified by its id.

Optionally, the time of the run process can be informed by setting the info argument to be true.

source
QuantumLattices.Frameworks.CategorizedGeneratorType
CategorizedGenerator{V, C, A<:NamedTuple, B<:NamedTuple, P<:Parameters, D<:Boundary, S<:ExpansionStyle} <: Generator{V}

Categorized generator that groups the (representations of) quantum operators in a quantum lattice system into three categories, i.e., the constant, the alterable, and the boundary.

source
QuantumLattices.Frameworks.GeneratorMethod
Generator(constops, alterops::NamedTuple, boundops::NamedTuple, parameters::Parameters, boundary::Boundary, style::ExpansionStyle) -> CategorizedGenerator

Construct a CategorizedGenerator.

source
QuantumLattices.Frameworks.GeneratorMethod
Generator(operators::CategorizedGenerator{<:Operators}, bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, half::Bool) -> OperatorGenerator
-Generator(bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, boundary::Boundary=plain, style::ExpansionStyle=eager; half::Bool=false) -> OperatorGenerator

Construct an OperatorGenerator.

source
QuantumLattices.Frameworks.OperatorGeneratorType
OperatorGenerator(bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, boundary::Boundary=plain, style::ExpansionStyle=eager; half::Bool=false)

Construct a generator of quantum operators based on the input bonds, Hilbert space, terms and (twisted) boundary condition.

When the boundary condition is plain, the boundary operators will be set to be empty for simplicity and efficiency.

source
QuantumLattices.Frameworks.OperatorGeneratorType
OperatorGenerator{V<:Operators, CG<:CategorizedGenerator{V}, B<:Bond, H<:Hilbert, TS<:Tuple{Vararg{Term}}} <: Generator{V}

A generator of operators based on the terms, bonds and Hilbert space of a quantum lattice system.

source
Base.:*Method
*(cat::CategorizedGenerator, factor) -> CategorizedGenerator
-*(factor, cat::CategorizedGenerator) -> CategorizedGenerator

Multiply a categorized generator of (representations of) quantum operators with a factor.

source
Base.:+Method
+(cat₁::CategorizedGenerator, cat₂::CategorizedGenerator) -> CategorizedGenerator

Addition of two categorized generators of (representations of) quantum operators.

source
Base.eltypeMethod
eltype(gen::Generator)
-eltype(::Type{T}) where {T<:Generator}

Get the eltype of a Generator.

source
Base.emptyMethod
empty(cat::CategorizedGenerator) -> CategorizedGenerator
-empty!(cat::CategorizedGenerator) -> CategorizedGenerator

Get an empty copy of a categorized generator or empty a categorized generator of (representations of) quantum operators.

source
Base.emptyMethod
empty(gen::OperatorGenerator) -> OperatorGenerator
-empty!(gen::OperatorGenerator) -> OperatorGenerator

Get an empty copy of or empty an operator generator.

source
Base.isemptyMethod
isempty(cat::CategorizedGenerator) -> Bool

Judge whether a categorized generator is empty.

source
Base.isemptyMethod
isempty(gen::OperatorGenerator) -> Bool

Judge whether an OperatorGenerator is empty.

source
Base.iterateMethod
iterate(gen::Generator)
-iterate(::Generator, state)

Iterate over a Generator.

source
Base.matchMethod
match(params₁::Parameters, params₂::Parameters; atol=atol, rtol=rtol) -> Bool

Judge whether the second set of parameters matches the first.

source
Base.nameofMethod
nameof(alg::Algorithm, assign::Assignment) -> String

Get the name of the combination of an algorithm and an assignment.

source
Base.showMethod
show(io::IO, alg::Algorithm)

Show an algorithm.

Optionally, some parameters of the algorithm can be filtered by specifying the :select context in io. Besides, the maximum number of decimals of the parameters can also be specified by the :ndecimal context in io.

source
Base.valtypeMethod
valtype(assign::Assignment)
-valtype(::Type{<:Assignment})

Type of the data (result) of an assignment.

source
Base.valtypeMethod
valtype(formula::Formula)
-valtype(::Type{<:Formula{V}})

Get the valtype of a Formula.

source
Base.valtypeMethod
valtype(gen::Generator)
-valtype(::Type{<:Generator{V}}) where V

Get the valtype of a Generator.

source
QuantumLattices.Frameworks.prepare!Function
prepare!(alg::Algorithm, assign::Assignment, f::Function=assign->true) -> Tuple{Algorithm, Assignment}

Run the dependencies of an assignment.

Optionally, some dependencies can be filtered by specifying the f function.

source
QuantumLattices.Spatials.saveMethod
save(alg::Algorithm, assign::Assignment; delimited=false) -> Tuple{Algorithm, Assignment}

Save the data of an assignment registered on an algorithm.

source
QuantumLattices.add!Method
add!(alg::Algorithm, id::Symbol, action::Action; parameters::Parameters=Parameters{()}(), map::Function=identity, dependencies::Tuple=(), kwargs...) -> Tuple{Algorithm, Assignment}

Add an assignment on an algorithm by providing the contents of the assignment without the execution of it.

source
QuantumLattices.expand!Method
expand!(result, gen::Generator) -> typeof(result)

Expand the generator to add the (representations of) quantum operators in a quantum lattice system to result.

source
QuantumLattices.expandMethod
expand(cat::CategorizedGenerator, ::Lazy)

Expand a categorized generator to get the (representations of) quantum operators in a quantum lattice system.

source
QuantumLattices.expandMethod
expand(gen::Generator)
+

Frameworks

QuantumLattices.Frameworks.AlgorithmMethod
(alg::Algorithm)(assign::Assignment) -> Tuple{Algorithm, Assignment}
+(assign::Assignment)(alg::Algorithm) -> Tuple{Algorithm, Assignment}

Run an assignment based on an algorithm.

The difference between these two methods is that the first uses the parameters of assign as the current parameters while the second uses those of alg.

source
QuantumLattices.Frameworks.AlgorithmMethod
(alg::Algorithm)(id::Symbol, action::Action; info::Bool=true, kwargs...) -> Tuple{Algorithm, Assignment}

Add an assignment on a algorithm by providing the contents of the assignment, and run this assignment.

source
QuantumLattices.Frameworks.AlgorithmMethod
Algorithm(name::Symbol, frontend::Frontend; din::String=".", dout::String=".", parameters::Parameters=Parameters(frontend), map::Function=identity)

Construct an algorithm.

source
QuantumLattices.Frameworks.AlgorithmMethod
(alg::Algorithm)(id::Symbol; info::Bool=true, parameters::Parameters=Parameters{()}()) -> Tuple{Algorithm, Assignment}

Run an assignment specified by its id.

Optionally, the time of the run process can be informed by setting the info argument to be true.

source
QuantumLattices.Frameworks.CategorizedGeneratorType
CategorizedGenerator{V, C, A<:NamedTuple, B<:NamedTuple, P<:Parameters, D<:Boundary, S<:ExpansionStyle} <: Generator{V}

Categorized generator that groups the (representations of) quantum operators in a quantum lattice system into three categories, i.e., the constant, the alterable, and the boundary.

source
QuantumLattices.Frameworks.GeneratorMethod
Generator(constops, alterops::NamedTuple, boundops::NamedTuple, parameters::Parameters, boundary::Boundary, style::ExpansionStyle) -> CategorizedGenerator

Construct a CategorizedGenerator.

source
QuantumLattices.Frameworks.GeneratorMethod
Generator(operators::CategorizedGenerator{<:Operators}, bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, half::Bool) -> OperatorGenerator
+Generator(bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, boundary::Boundary=plain, style::ExpansionStyle=eager; half::Bool=false) -> OperatorGenerator

Construct an OperatorGenerator.

source
QuantumLattices.Frameworks.OperatorGeneratorType
OperatorGenerator(bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, boundary::Boundary=plain, style::ExpansionStyle=eager; half::Bool=false)

Construct a generator of quantum operators based on the input bonds, Hilbert space, terms and (twisted) boundary condition.

When the boundary condition is plain, the boundary operators will be set to be empty for simplicity and efficiency.

source
QuantumLattices.Frameworks.OperatorGeneratorType
OperatorGenerator{V<:Operators, CG<:CategorizedGenerator{V}, B<:Bond, H<:Hilbert, TS<:Tuple{Vararg{Term}}} <: Generator{V}

A generator of operators based on the terms, bonds and Hilbert space of a quantum lattice system.

source
Base.:*Method
*(cat::CategorizedGenerator, factor) -> CategorizedGenerator
+*(factor, cat::CategorizedGenerator) -> CategorizedGenerator

Multiply a categorized generator of (representations of) quantum operators with a factor.

source
Base.:+Method
+(cat₁::CategorizedGenerator, cat₂::CategorizedGenerator) -> CategorizedGenerator

Addition of two categorized generators of (representations of) quantum operators.

source
Base.eltypeMethod
eltype(gen::Generator)
+eltype(::Type{T}) where {T<:Generator}

Get the eltype of a Generator.

source
Base.emptyMethod
empty(cat::CategorizedGenerator) -> CategorizedGenerator
+empty!(cat::CategorizedGenerator) -> CategorizedGenerator

Get an empty copy of a categorized generator or empty a categorized generator of (representations of) quantum operators.

source
Base.emptyMethod
empty(gen::OperatorGenerator) -> OperatorGenerator
+empty!(gen::OperatorGenerator) -> OperatorGenerator

Get an empty copy of or empty an operator generator.

source
Base.isemptyMethod
isempty(cat::CategorizedGenerator) -> Bool

Judge whether a categorized generator is empty.

source
Base.isemptyMethod
isempty(gen::OperatorGenerator) -> Bool

Judge whether an OperatorGenerator is empty.

source
Base.iterateMethod
iterate(gen::Generator)
+iterate(::Generator, state)

Iterate over a Generator.

source
Base.matchMethod
match(params₁::Parameters, params₂::Parameters; atol=atol, rtol=rtol) -> Bool

Judge whether the second set of parameters matches the first.

source
Base.nameofMethod
nameof(alg::Algorithm, assign::Assignment) -> String

Get the name of the combination of an algorithm and an assignment.

source
Base.showMethod
show(io::IO, alg::Algorithm)

Show an algorithm.

Optionally, some parameters of the algorithm can be filtered by specifying the :select context in io. Besides, the maximum number of decimals of the parameters can also be specified by the :ndecimal context in io.

source
Base.valtypeMethod
valtype(assign::Assignment)
+valtype(::Type{<:Assignment})

Type of the data (result) of an assignment.

source
Base.valtypeMethod
valtype(formula::Formula)
+valtype(::Type{<:Formula{V}})

Get the valtype of a Formula.

source
Base.valtypeMethod
valtype(gen::Generator)
+valtype(::Type{<:Generator{V}}) where V

Get the valtype of a Generator.

source
QuantumLattices.Frameworks.prepare!Function
prepare!(alg::Algorithm, assign::Assignment, f::Function=assign->true) -> Tuple{Algorithm, Assignment}

Run the dependencies of an assignment.

Optionally, some dependencies can be filtered by specifying the f function.

source
QuantumLattices.Spatials.saveMethod
save(alg::Algorithm, assign::Assignment; delimited=false) -> Tuple{Algorithm, Assignment}

Save the data of an assignment registered on an algorithm.

source
QuantumLattices.add!Method
add!(alg::Algorithm, id::Symbol, action::Action; parameters::Parameters=Parameters{()}(), map::Function=identity, dependencies::Tuple=(), kwargs...) -> Tuple{Algorithm, Assignment}

Add an assignment on an algorithm by providing the contents of the assignment without the execution of it.

source
QuantumLattices.expand!Method
expand!(result, gen::Generator) -> typeof(result)

Expand the generator to add the (representations of) quantum operators in a quantum lattice system to result.

source
QuantumLattices.expandMethod
expand(cat::CategorizedGenerator, ::Lazy)

Expand a categorized generator to get the (representations of) quantum operators in a quantum lattice system.

source
QuantumLattices.expandMethod
expand(gen::Generator)
 expand(gen::Generator, ::Eager)
-expand(gen::Generator, ::Lazy)

Expand the generator to get the (representations of) quantum operators in a quantum lattice system.

source
QuantumLattices.expandMethod
expand(gen::OperatorGenerator, name::Symbol) -> Operators
+expand(gen::Generator, ::Lazy)

Expand the generator to get the (representations of) quantum operators in a quantum lattice system.

source
QuantumLattices.expandMethod
expand(gen::OperatorGenerator, name::Symbol) -> Operators
 expand(gen::OperatorGenerator, i::Int) -> Operators
-expand(gen::OperatorGenerator, name::Symbol, i::Int) -> Operators

Expand an operator generator to get:

  1. the operators of a specific term;
  2. the operators on a specific bond;
  3. the operators of a specific term on a specific bond.
source
QuantumLattices.reset!Method
reset!(cat::CategorizedGenerator, transformation::LinearTransformation, source::CategorizedGenerator{<:Operators}; kwargs...)

Reset a categorized generator by its source categorized generator of (representations of) quantum operators and the corresponding linear transformation.

source
QuantumLattices.reset!Method
reset!(gen::OperatorGenerator, bonds::AbstractVector{<:Bond}, hilbert::Hilbert; vectors::AbstractVector{<:AbstractVector}=gen.operators.boundary.vectors) -> OperatorGenerator

Reset an operator generator by a new lattice and the corresponding new hilbert space.

source
QuantumLattices.update!Method
update!(alg::Algorithm; parameters...) -> Algorithm

Update the parameters of an algorithm and its associated frontend.

source
QuantumLattices.update!Method
update!(assign::Assignment; parameters...) -> Assignment

Update the parameters of an assignment and the status of its associated action.

source
QuantumLattices.update!Method
update!(cat::CategorizedGenerator, transformation::LinearTransformation, source::CategorizedGenerator{<:Operators}; kwargs...) -> CategorizedGenerator

Update the parameters (including the boundary parameters) of a categorized generator based on its source categorized generator of (representations of) quantum operators and the corresponding linear transformation.

!!! Note The coefficients of boundops are also updated due to the change of the boundary parameters.

source
QuantumLattices.update!Method
update!(cat::CategorizedGenerator{<:OperatorSum}; parameters...) -> CategorizedGenerator

Update the parameters (including the boundary parameters) of a categorized generator of (representations of) quantum operators.

!!! Note The coefficients of boundops are also updated due to the change of the boundary parameters.

source
QuantumLattices.update!Method
update!(formula::Formula; parameters...) -> Formula

Update the parameters of a Formula in place and return itself after update.

source
QuantumLattices.update!Method
update!(gen::OperatorGenerator; parameters...) -> typeof(gen)

Update the coefficients of the terms in a generator.

source
QuantumLattices.updateMethod
update(params::NamedTuple; parameters...) -> Parameters

Update a set of Parameters and return the updated one.

source
RecipesBase.apply_recipeMethod
@recipe plot(pack::Tuple{Algorithm, Assignment})

Define the recipe for the visualization of an assignment of an algorithm.

source
+expand(gen::OperatorGenerator, name::Symbol, i::Int) -> Operators

Expand an operator generator to get:

  1. the operators of a specific term;
  2. the operators on a specific bond;
  3. the operators of a specific term on a specific bond.
source
QuantumLattices.reset!Method
reset!(cat::CategorizedGenerator, transformation::LinearTransformation, source::CategorizedGenerator{<:Operators}; kwargs...)

Reset a categorized generator by its source categorized generator of (representations of) quantum operators and the corresponding linear transformation.

source
QuantumLattices.reset!Method
reset!(gen::OperatorGenerator, bonds::AbstractVector{<:Bond}, hilbert::Hilbert; vectors::AbstractVector{<:AbstractVector}=gen.operators.boundary.vectors) -> OperatorGenerator

Reset an operator generator by a new lattice and the corresponding new hilbert space.

source
QuantumLattices.update!Method
update!(alg::Algorithm; parameters...) -> Algorithm

Update the parameters of an algorithm and its associated frontend.

source
QuantumLattices.update!Method
update!(assign::Assignment; parameters...) -> Assignment

Update the parameters of an assignment and the status of its associated action.

source
QuantumLattices.update!Method
update!(cat::CategorizedGenerator, transformation::LinearTransformation, source::CategorizedGenerator{<:Operators}; kwargs...) -> CategorizedGenerator

Update the parameters (including the boundary parameters) of a categorized generator based on its source categorized generator of (representations of) quantum operators and the corresponding linear transformation.

!!! Note The coefficients of boundops are also updated due to the change of the boundary parameters.

source
QuantumLattices.update!Method
update!(cat::CategorizedGenerator{<:OperatorSum}; parameters...) -> CategorizedGenerator

Update the parameters (including the boundary parameters) of a categorized generator of (representations of) quantum operators.

!!! Note The coefficients of boundops are also updated due to the change of the boundary parameters.

source
QuantumLattices.update!Method
update!(formula::Formula; parameters...) -> Formula

Update the parameters of a Formula in place and return itself after update.

source
QuantumLattices.update!Method
update!(gen::OperatorGenerator; parameters...) -> typeof(gen)

Update the coefficients of the terms in a generator.

source
QuantumLattices.updateMethod
update(params::NamedTuple; parameters...) -> Parameters

Update a set of Parameters and return the updated one.

source
RecipesBase.apply_recipeMethod
@recipe plot(pack::Tuple{Algorithm, Assignment})

Define the recipe for the visualization of an assignment of an algorithm.

source
diff --git a/dev/man/QuantumNumbers/index.html b/dev/man/QuantumNumbers/index.html index 3e2572b0..ed9b40c3 100644 --- a/dev/man/QuantumNumbers/index.html +++ b/dev/man/QuantumNumbers/index.html @@ -3,42 +3,43 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-89508993-1', {'page_path': location.pathname + location.search + location.hash}); -

Quantum numbers

Quantum numbers can be considered as the conserved labels for the bases of a Hilbert space when a quantum system hosts some symmetries. Here we only implement Abelian quantum numbers because non-Abelian ones are far more complicated yet much less used.

AbelianQuantumNumber

RepresentationSpace

Manual

QuantumLattices.QuantumNumbers.AbelianGradedSpaceType
AbelianGradedSpace(quantumnumbers::AbstractVector{<:AbelianQuantumNumber}, dimensions::AbstractVector{<:Integer}, dual::Bool=false; ordercheck::Bool=false, duplicatecheck::Bool=false, degeneracycheck::Bool=false)

Construct an Abelian graded space.

Here:

  • quantumnumbers specifies the Abelian quantum numbers labeling the irreducible representations of the corresponding Abelian group which must be sorted in the ascending order. Such an ordering should be manually guaranteed by the user. When and only when the keyword argument ordercheck is true, the constructor will check whether this condition is satisfied and raise an error if it doesn't. Besides, quantumnumbers must not contain duplicate Abelian quantum numbers, manually guaranteed by the user as well. This condition can be checked when and only when both ordercheck==true and duplicatecheck==true. An error will be raised if this check fails.
  • dimensions specifies the degenerate dimensions of the corresponding Abelian quantum numbers. Apparently, each degenerate dimension must be positive, which should also be manually guaranteed by the user. When and only when the keyword argument degeneracycheck is true, the constructor will check whether this condition is satisfied and raise an error if it doesn't.
  • dual specifies whether the graded space is the dual representation of the corresponding Abelian group, which roughly speaking, can be viewed as the direction of the arrow of the Abelian quantum numbers labeling the irreducible representations. We assume dual==true corresponds to the in-arrow and dual==false corresponds to the out-arrow.
source
QuantumLattices.QuantumNumbers.AbelianGradedSpaceMethod
AbelianGradedSpace(pairs; dual::Bool=false)
+

Quantum numbers

Quantum numbers can be considered as the conserved labels for the bases of a Hilbert space when a quantum system hosts some symmetries. Here we only implement Abelian quantum numbers because non-Abelian ones are far more complicated yet much less used.

AbelianQuantumNumber

RepresentationSpace

Manual

QuantumLattices.QuantumNumbers.AbelianGradedSpaceType
AbelianGradedSpace(quantumnumbers::AbstractVector{<:AbelianQuantumNumber}, dimensions::AbstractVector{<:Integer}, dual::Bool=false; ordercheck::Bool=false, duplicatecheck::Bool=false, degeneracycheck::Bool=false)

Construct an Abelian graded space.

Here:

  • quantumnumbers specifies the Abelian quantum numbers labeling the irreducible representations of the corresponding Abelian group which must be sorted in the ascending order. Such an ordering should be manually guaranteed by the user. When and only when the keyword argument ordercheck is true, the constructor will check whether this condition is satisfied and raise an error if it doesn't. Besides, quantumnumbers must not contain duplicate Abelian quantum numbers, manually guaranteed by the user as well. This condition can be checked when and only when both ordercheck==true and duplicatecheck==true. An error will be raised if this check fails.
  • dimensions specifies the degenerate dimensions of the corresponding Abelian quantum numbers. Apparently, each degenerate dimension must be positive, which should also be manually guaranteed by the user. When and only when the keyword argument degeneracycheck is true, the constructor will check whether this condition is satisfied and raise an error if it doesn't.
  • dual specifies whether the graded space is the dual representation of the corresponding Abelian group, which roughly speaking, can be viewed as the direction of the arrow of the Abelian quantum numbers labeling the irreducible representations. We assume dual==true corresponds to the in-arrow and dual==false corresponds to the out-arrow.
source
QuantumLattices.QuantumNumbers.AbelianGradedSpaceMethod
AbelianGradedSpace(pairs; dual::Bool=false)
 AbelianGradedSpace(pairs::Pair...; dual::Bool=false)
 AbelianGradedSpace{QN}(pairs; dual::Bool=false) where {QN<:AbelianQuantumNumber}
-AbelianGradedSpace{QN}(pairs::Pair...; dual::Bool=false) where {QN<:AbelianQuantumNumber}

Construct an Abelian graded space.

In this function, the Abelian quantum numbers will be sorted automatically, therefore, their orders need not be worried. Duplicate and dimension checks of the quantum numbers are also carried out and errors will be raised if either such checks fails.

source
QuantumLattices.QuantumNumbers.AbelianQuantumNumberProdMethod
AbelianQuantumNumberProd{T}(vs::Vararg{Number, N}) where {N, T<:NTuple{N, SimpleAbelianQuantumNumber}}
-AbelianQuantumNumberProd{T}(vs::NTuple{N, Number}) where {N, T<:NTuple{N, SimpleAbelianQuantumNumber}}

Construct a Deligne tensor product of simple Abelian quantum numbers by their values.

source
QuantumLattices.QuantumNumbers.ℤ₁Type
const ℤ₁ = ℤ{1}
+AbelianGradedSpace{QN}(pairs::Pair...; dual::Bool=false) where {QN<:AbelianQuantumNumber}

Construct an Abelian graded space.

In this function, the Abelian quantum numbers will be sorted automatically, therefore, their orders need not be worried. Duplicate and dimension checks of the quantum numbers are also carried out and errors will be raised if either such checks fails.

source
QuantumLattices.QuantumNumbers.AbelianQuantumNumberProdMethod
AbelianQuantumNumberProd{T}(vs::Vararg{Number, N}) where {N, T<:NTuple{N, SimpleAbelianQuantumNumber}}
+AbelianQuantumNumberProd{T}(vs::NTuple{N, Number}) where {N, T<:NTuple{N, SimpleAbelianQuantumNumber}}

Construct a Deligne tensor product of simple Abelian quantum numbers by their values.

source
QuantumLattices.QuantumNumbers.𝕂Type
const 𝕂 = AbelianQuantumNumberProd{<:Tuple{Vararg{ℤ}}}
 const 𝕂¹{N} = AbelianQuantumNumberProd{Tuple{ℤ{N}}}
 const 𝕂²{N₁, N₂} = AbelianQuantumNumberProd{Tuple{ℤ{N₁}, ℤ{N₂}}}
-const 𝕂³{N₁, N₂, N₃} = AbelianQuantumNumberProd{Tuple{ℤ{N₁}, ℤ{N₂}, ℤ{N₃}}}

Type alias for the Abelian quantum numbers of 1d, 2d and 3d momentum.

source
QuantumLattices.QuantumNumbers.𝕂¹Method
𝕂¹{N}(k::Integer) where N
+const 𝕂³{N₁, N₂, N₃} = AbelianQuantumNumberProd{Tuple{ℤ{N₁}, ℤ{N₂}, ℤ{N₃}}}

Type alias for the Abelian quantum numbers of 1d, 2d and 3d momentum.

source
QuantumLattices.QuantumNumbers.𝕂¹Method
𝕂¹{N}(k::Integer) where N
 𝕂²{N}(k₁::Integer, k₂::Integer) where N
 𝕂²{N₁, N₂}(k₁::Integer, k₂::Integer) where {N₁, N₂}
 𝕂³{N}(k₁::Integer, k₂::Integer, k₃::Integer) where N
-𝕂³{N₁, N₂, N₃}(k₁::Integer, k₂::Integer, k₃::Integer) where {N₁, N₂, N₃}

Construct 1d, 2d and 3d momentum.

source
Base.:+Method
+(qn::AbelianQuantumNumber) -> typeof(qn)

Overloaded + operator for AbelianQuantumNumber.

source
Base.:+Method
+(qn₁::QN, qn₂::QN, qns::QN...) where {QN<:AbelianQuantumNumberProd} -> QN

Overloaded + operator for AbelianQuantumNumberProd.

Note

To ensure type stability, two AbelianQuantumNumberProd can be added together if and only if they are of the same type.

source
Base.:+Method
+(qn₁::QN, qn₂::QN, qns::QN...) where {QN<:SimpleAbelianQuantumNumber} -> QN

Overloaded + operator for SimpleAbelianQuantumNumber.

Note

To ensure type stability, two SimpleAbelianQuantumNumber can be added together if and only if they are of the same type.

source
Base.:-Method
-(qn::AbelianQuantumNumberProd) -> typeof(qn)
--(qn₁::QN, qn₂::QN) where {QN<:AbelianQuantumNumberProd} -> QN

Overloaded - operator for AbelianQuantumNumberProd.

Note

To ensure type stability, a AbelianQuantumNumberProd can be subtracted by another AbelianQuantumNumberProd if and only if they are of the same type.

source
Base.:-Method
-(qn::SimpleAbelianQuantumNumber) -> typeof(qn)
--(qn₁::QN, qn₂::QN) where {QN<:SimpleAbelianQuantumNumber} -> QN

Overloaded - operator for SimpleAbelianQuantumNumber.

Note

To ensure type stability, a SimpleAbelianQuantumNumber can be subtracted by another SimpleAbelianQuantumNumber if and only if they are of the same type.

source
Base.adjointMethod
adjoint(gs::AbelianGradedSpace) -> typeof(gs)

Get the dual of an Abelian graded space.

source
Base.cumsumMethod
cumsum(rs::RepresentationSpace, i::Union{Integer, CartesianIndex}) -> Int

Get the accumulative degenerate dimension up to the ith Abelian quantum number contained in a representation space.

source
Base.cumsumMethod
cumsum(gs::AbelianGradedSpace{QN}, qn::QN) where {QN<:AbelianQuantumNumber} -> Int

Get the accumulative dimension of an Abelian graded space up to a certain Abelian quantum number contained in an Abelian graded space.

source
Base.getindexMethod
getindex(gs::AbelianGradedSpace, indexes::AbstractVector{<:Integer}) -> typeof(gs)
-getindex(gs::AbelianGradedSpace{QN}, quantumnumbers::AbstractVector{QN}) where {QN<:AbelianQuantumNumber} -> AbelianGradedSpace{QN}

Get a subset of an Abelian graded space.

source
Base.getindexMethod
getindex(::Type{Abelian}, ::Type{T}) where {T<:AbelianQuantumNumber} -> Type{T}

Overloaded [] for Abelian, i.e., the support of syntax Abelian[T] where T<:AbelianQuantumNumber, which is helpful for the construction of tensor producted Abelian quantum numbers.

source
Base.inMethod
in(qn::QN, gs::AbelianGradedSpace{QN}) where {QN<:AbelianQuantumNumber} -> Bool

Check whether an Abelian quantum number is contained in an Abelian graded space.

source
Base.invFunction
inv(qn::AbelianQuantumNumber, bool::Bool=true) -> typeof(qn)

Get the inverse of an Abelian quantum number qn if bool is true. Otherwise, return qn itself.

source
Base.lengthMethod
length(gs::AbelianGradedSpace) -> Int

Get the number of inequivalent irreducible representations (i.e., the Abelian quantum numbers) of an Abelian graded space.

source
Base.mergeMethod
merge(rs::AbelianGradedSpaceProd) -> Tuple{AbelianGradedSpace{eltype(rs)}, Dict{eltype(rs), Vector{NTuple{rank(rs), eltype(rs)}}}}

Get the decomposition of the direct product of several Abelian graded spaces and its corresponding fusion processes.

For a set of Abelian graded spaces (gs₁, gs₂, ...), their direct product space can contain several equivalent irreducible representations because for different sets of Abelian quantum numbers (qn₁, qn₂, ...) where qnᵢ∈gsᵢ, the fusion, i.e., ⊗(qn₁, qn₂, ...) may give the same result qn. This function returns the decomposition of the direct product of (gs₁, gs₂, ...) as well as all the fusion processes of each quantum number contained in the decomposition.

source
Base.pairsMethod
pairs(rs::RepresentationSpace, ::typeof(dimension)) -> RepresentationSpacePairs
-pairs(rs::RepresentationSpace, ::typeof(range)) -> RepresentationSpacePairs

Return an iterator that iterates over the pairs of the Abelian quantum numbers and their corresponding (slices of the) degenerate dimensions contained in a representation space.

source
Base.rangeMethod
range(gs::AbelianGradedSpace, qn::CartesianIndex) -> UnitRange{Int}
-range(gs::AbelianGradedSpace{QN}, qn::QN) where {QN<:AbelianQuantumNumber} -> UnitRange{Int}

Get the slice of the degenerate dimension of an Abelian quantum number contained in an Abelian graded space.

source
Base.rangeMethod
range(rs::AbelianGradedSpaceProd, i::CartesianIndex) -> AbstractVector{Int}

Get the slice of the degenerate dimension of the ith Abelian quantum number in the direct product of several Abelian graded spaces.

source
Base.rangeMethod
range(rs::AbelianGradedSpaceSum, i::CartesianIndex) -> UnitRange{Int}

Get the slice of the degenerate dimension of the ith Abelian quantum number in the direct sum of several Abelian graded spaces.

source
Base.rangeMethod
range(rs::RepresentationSpace, i::Integer)

Get the slice of the degenerate dimension of the ith Abelian quantum number contained in a representation space.

source
Base.rangeMethod
range(rs::AbelianGradedSpaceProd{N, QN}, qns::NTuple{N, QN}) where {N, QN<:AbelianQuantumNumber} -> AbstractVector{Int}

Get the slice of the degenerate dimension of the Abelian quantum number fused by qns in the direct product of several Abelian graded spaces.

source
Base.splitMethod
split(target::QN, rs::AbelianGradedSpaceProd{N, QN}; nmax::Real=20) where {N, QN<:AbelianQuantumNumber} -> Set{NTuple{N, QN}}

Find a set of splittings of the target Abelian quantum number with respect to the direct product of several Abelian graded spaces.

source
Base.zeroMethod
zero(qn::AbelianQuantumNumber) -> typeof(qn)
-zero(::Type{QN}) where {QN<:AbelianQuantumNumber} -> QN

Get the zero Abelian quantum number.

source
LinearAlgebra.rankMethod
rank(qn::AbelianQuantumNumberProd) -> Int
-rank(::Type{<:AbelianQuantumNumberProd}) -> Int

Get the rank of a Deligne tensor product of simple Abelian quantum numbers.

source
LinearAlgebra.rankMethod
rank(rs::CompositeAbelianGradedSpace) -> Int
-rank(::Type{<:CompositeAbelianGradedSpace{N}}) where N -> Int

Get the number of Abelian graded spaces in the direct sum.

source
QuantumLattices.:⊕Method
⊕(gses::AbelianGradedSpace...) -> AbelianGradedSpaceSum
+𝕂³{N₁, N₂, N₃}(k₁::Integer, k₂::Integer, k₃::Integer) where {N₁, N₂, N₃}

Construct 1d, 2d and 3d momentum.

source
Base.:+Method
+(qn::AbelianQuantumNumber) -> typeof(qn)

Overloaded + operator for AbelianQuantumNumber.

source
Base.:+Method
+(qn₁::QN, qn₂::QN, qns::QN...) where {QN<:AbelianQuantumNumberProd} -> QN

Overloaded + operator for AbelianQuantumNumberProd.

Note

To ensure type stability, two AbelianQuantumNumberProd can be added together if and only if they are of the same type.

source
Base.:+Method
+(qn₁::QN, qn₂::QN, qns::QN...) where {QN<:SimpleAbelianQuantumNumber} -> QN

Overloaded + operator for SimpleAbelianQuantumNumber.

Note

To ensure type stability, two SimpleAbelianQuantumNumber can be added together if and only if they are of the same type.

source
Base.:-Method
-(qn::AbelianQuantumNumberProd) -> typeof(qn)
+-(qn₁::QN, qn₂::QN) where {QN<:AbelianQuantumNumberProd} -> QN

Overloaded - operator for AbelianQuantumNumberProd.

Note

To ensure type stability, a AbelianQuantumNumberProd can be subtracted by another AbelianQuantumNumberProd if and only if they are of the same type.

source
Base.:-Method
-(qn::SimpleAbelianQuantumNumber) -> typeof(qn)
+-(qn₁::QN, qn₂::QN) where {QN<:SimpleAbelianQuantumNumber} -> QN

Overloaded - operator for SimpleAbelianQuantumNumber.

Note

To ensure type stability, a SimpleAbelianQuantumNumber can be subtracted by another SimpleAbelianQuantumNumber if and only if they are of the same type.

source
Base.adjointMethod
adjoint(gs::AbelianGradedSpace) -> typeof(gs)

Get the dual of an Abelian graded space.

source
Base.cumsumMethod
cumsum(rs::RepresentationSpace, i::Union{Integer, CartesianIndex}) -> Int

Get the accumulative degenerate dimension up to the ith Abelian quantum number contained in a representation space.

source
Base.cumsumMethod
cumsum(gs::AbelianGradedSpace{QN}, qn::QN) where {QN<:AbelianQuantumNumber} -> Int

Get the accumulative dimension of an Abelian graded space up to a certain Abelian quantum number contained in an Abelian graded space.

source
Base.getindexMethod
getindex(gs::AbelianGradedSpace, indexes::AbstractVector{<:Integer}) -> typeof(gs)
+getindex(gs::AbelianGradedSpace{QN}, quantumnumbers::AbstractVector{QN}) where {QN<:AbelianQuantumNumber} -> AbelianGradedSpace{QN}

Get a subset of an Abelian graded space.

source
Base.getindexMethod
getindex(qn::AbelianQuantumNumberProd, i::Integer) -> SimpleAbelianQuantumNumber

Get the ith simple Abelian quantum number in a Deligne tensor product.

source
Base.getindexMethod
getindex(::Type{Abelian}, ::Type{T}) where {T<:AbelianQuantumNumber} -> Type{T}

Overloaded [] for Abelian, i.e., the support of syntax Abelian[T] where T<:AbelianQuantumNumber, which is helpful for the construction of tensor producted Abelian quantum numbers.

source
Base.inMethod
in(qn::QN, gs::AbelianGradedSpace{QN}) where {QN<:AbelianQuantumNumber} -> Bool

Check whether an Abelian quantum number is contained in an Abelian graded space.

source
Base.invFunction
inv(qn::AbelianQuantumNumber, bool::Bool=true) -> typeof(qn)

Get the inverse of an Abelian quantum number qn if bool is true. Otherwise, return qn itself.

source
Base.lengthMethod
length(gs::AbelianGradedSpace) -> Int

Get the number of inequivalent irreducible representations (i.e., the Abelian quantum numbers) of an Abelian graded space.

source
Base.lengthMethod
length(qn::AbelianQuantumNumberProd) -> Int

Get the length of a Deligne tensor product.

source
Base.mergeMethod
merge(rs::AbelianGradedSpaceProd) -> Tuple{AbelianGradedSpace{eltype(rs)}, Dict{eltype(rs), Vector{NTuple{rank(rs), eltype(rs)}}}}

Get the decomposition of the direct product of several Abelian graded spaces and its corresponding fusion processes.

For a set of Abelian graded spaces (gs₁, gs₂, ...), their direct product space can contain several equivalent irreducible representations because for different sets of Abelian quantum numbers (qn₁, qn₂, ...) where qnᵢ∈gsᵢ, the fusion, i.e., ⊗(qn₁, qn₂, ...) may give the same result qn. This function returns the decomposition of the direct product of (gs₁, gs₂, ...) as well as all the fusion processes of each quantum number contained in the decomposition.

source
Base.pairsMethod
pairs(rs::RepresentationSpace, ::typeof(dimension)) -> RepresentationSpacePairs
+pairs(rs::RepresentationSpace, ::typeof(range)) -> RepresentationSpacePairs

Return an iterator that iterates over the pairs of the Abelian quantum numbers and their corresponding (slices of the) degenerate dimensions contained in a representation space.

source
Base.rangeMethod
range(gs::AbelianGradedSpace, qn::CartesianIndex) -> UnitRange{Int}
+range(gs::AbelianGradedSpace{QN}, qn::QN) where {QN<:AbelianQuantumNumber} -> UnitRange{Int}

Get the slice of the degenerate dimension of an Abelian quantum number contained in an Abelian graded space.

source
Base.rangeMethod
range(rs::AbelianGradedSpaceProd, i::CartesianIndex) -> AbstractVector{Int}

Get the slice of the degenerate dimension of the ith Abelian quantum number in the direct product of several Abelian graded spaces.

source
Base.rangeMethod
range(rs::AbelianGradedSpaceSum, i::CartesianIndex) -> UnitRange{Int}

Get the slice of the degenerate dimension of the ith Abelian quantum number in the direct sum of several Abelian graded spaces.

source
Base.rangeMethod
range(rs::RepresentationSpace, i::Integer)

Get the slice of the degenerate dimension of the ith Abelian quantum number contained in a representation space.

source
Base.rangeMethod
range(rs::AbelianGradedSpaceProd{N, QN}, qns::NTuple{N, QN}) where {N, QN<:AbelianQuantumNumber} -> AbstractVector{Int}

Get the slice of the degenerate dimension of the Abelian quantum number fused by qns in the direct product of several Abelian graded spaces.

source
Base.splitMethod
split(target::QN, rs::AbelianGradedSpaceProd{N, QN}; nmax::Real=20) where {N, QN<:AbelianQuantumNumber} -> Set{NTuple{N, QN}}

Find a set of splittings of the target Abelian quantum number with respect to the direct product of several Abelian graded spaces.

source
Base.valuesMethod
values(qn::AbelianQuantumNumberProd) -> NTuple{rank(qn), Number}

Get the values of the simple Abelian quantum numbers in a Deligne tensor product.

source
Base.valuesMethod
values(qn::SimpleAbelianQuantumNumber) -> Tuple{Number}

Get the value of a simple Abelian quantum number and return it as the sole element of a tuple.

source
Base.zeroMethod
zero(qn::AbelianQuantumNumber) -> typeof(qn)
+zero(::Type{QN}) where {QN<:AbelianQuantumNumber} -> QN

Get the zero Abelian quantum number.

source
LinearAlgebra.rankMethod
rank(qn::AbelianQuantumNumberProd) -> Int
+rank(::Type{<:AbelianQuantumNumberProd}) -> Int

Get the rank of a Deligne tensor product of simple Abelian quantum numbers.

source
LinearAlgebra.rankMethod
rank(rs::CompositeAbelianGradedSpace) -> Int
+rank(::Type{<:CompositeAbelianGradedSpace{N}}) where N -> Int

Get the number of Abelian graded spaces in the direct sum.

source
QuantumLattices.:⊕Method
⊕(gses::AbelianGradedSpace...) -> AbelianGradedSpaceSum
 ⊕(gs::AbelianGradedSpace, rs::AbelianGradedSpaceSum) -> AbelianGradedSpaceSum
 ⊕(rs::AbelianGradedSpaceSum, gs::AbelianGradedSpace) -> AbelianGradedSpaceSum
-⊕(rs₁::AbelianGradedSpaceSum, rs₂::AbelianGradedSpaceSum) -> AbelianGradedSpaceSum

Get the direct sum of some Abelian graded spaces.

source
QuantumLattices.:⊗Method
⊗(gses::AbelianGradedSpace...) -> AbelianGradedSpaceProd
+⊕(rs₁::AbelianGradedSpaceSum, rs₂::AbelianGradedSpaceSum) -> AbelianGradedSpaceSum

Get the direct sum of some Abelian graded spaces.

source
QuantumLattices.:⊗Method
⊗(gses::AbelianGradedSpace...) -> AbelianGradedSpaceProd
 ⊗(gs::AbelianGradedSpace, rs::AbelianGradedSpaceProd) -> AbelianGradedSpaceProd
 ⊗(rs::AbelianGradedSpaceProd, gs::AbelianGradedSpace) -> AbelianGradedSpaceProd
-⊗(rs₁::AbelianGradedSpaceProd, rs₂::AbelianGradedSpaceProd) -> AbelianGradedSpaceProd

Get the direct product of some Abelian graded spaces.

source
QuantumLattices.:⊗Method
⊗(qns::AbelianQuantumNumber...) -> eltype(qns)

Get the direct product of some AbelianQuantumNumbers.

source
QuantumLattices.:⊠Method
⊠(qns::SimpleAbelianQuantumNumber...) -> AbelianQuantumNumberProd
+⊗(rs₁::AbelianGradedSpaceProd, rs₂::AbelianGradedSpaceProd) -> AbelianGradedSpaceProd

Get the direct product of some Abelian graded spaces.

source
QuantumLattices.:⊗Method
⊗(qns::AbelianQuantumNumber...) -> eltype(qns)

Get the direct product of some AbelianQuantumNumbers.

source
QuantumLattices.:⊠Method
⊠(qns::SimpleAbelianQuantumNumber...) -> AbelianQuantumNumberProd
 ⊠(qn₁::SimpleAbelianQuantumNumber, qn₂::AbelianQuantumNumberProd) -> AbelianQuantumNumberProd
 ⊠(qn₁::AbelianQuantumNumberProd, qn₂::SimpleAbelianQuantumNumber) -> AbelianQuantumNumberProd
-⊠(qn₁::AbelianQuantumNumberProd, qn₂::AbelianQuantumNumberProd) -> AbelianQuantumNumberProd

Deligne tensor product of Abelian quantum numbers.

source
QuantumLattices.:⊠Method
⊠(QNS::Type{<:SimpleAbelianQuantumNumber}...) -> Type{AbelianQuantumNumberProd{Tuple{QNS...}}}
+⊠(qn₁::AbelianQuantumNumberProd, qn₂::AbelianQuantumNumberProd) -> AbelianQuantumNumberProd

Deligne tensor product of Abelian quantum numbers.

source
QuantumLattices.:⊠Method
⊠(QNS::Type{<:SimpleAbelianQuantumNumber}...) -> Type{AbelianQuantumNumberProd{Tuple{QNS...}}}
 ⊠(::Type{QN}, ::Type{AbelianQuantumNumberProd{T}}) where {QN<:SimpleAbelianQuantumNumber, T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} -> Type{AbelianQuantumNumberProd{Tuple{QN, fieldtypes(T)...}}}
 ⊠(::Type{AbelianQuantumNumberProd{T}}, ::Type{QN}) where {T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}, QN<:SimpleAbelianQuantumNumber} -> Type{AbelianQuantumNumberProd{Tuple{fieldtypes(T)...}, QN}}
-⊠(::Type{AbelianQuantumNumberProd{T₁}}, ::Type{AbelianQuantumNumberProd{T₂}}) where {T₁<:Tuple{Vararg{SimpleAbelianQuantumNumber}}, T₂<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} -> Type{AbelianQuantumNumberProd{Tuple{fieldtypes(T₁)..., fieldtypes(T₂)...}}}

Deligne tensor product of Abelian quantum numbers.

source
QuantumLattices.QuantumNumbers.findindexMethod
findindex(position::Integer, gs::AbelianGradedSpace, guess::Integer) -> Int

Find the index of an Abelian quantum number in an Abelian graded space beginning at guess whose position in the complete dimension range is position.

source
QuantumLattices.QuantumNumbers.periodMethod
period(qn::AbelianQuantumNumberProd, i::Integer) -> Number
-period(::Type{AbelianQuantumNumberProd{T}}, i::Integer) where {T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} -> Number

Get the period of the ith simple Abelian number contained in a Deligne tensor product.

source
QuantumLattices.QuantumNumbers.periodMethod
period(qn::SimpleAbelianQuantumNumber) -> Number
-period(::Type{QN}) where {QN<:SimpleAbelianQuantumNumber} -> Number

Get the period of a simple Abelian quantum number.

source
QuantumLattices.QuantumNumbers.periodsMethod
periods(qn::AbelianQuantumNumber) -> Tuple{Vararg{Number}}
-periods(::Type{QN}) where {QN<:AbelianQuantumNumber} -> Tuple{Vararg{Number}}

Get the periods of Abelian quantum numbers.

source
QuantumLattices.QuantumNumbers.regularize!Method
regularize!(quantumnumbers::Vector{<:AbelianQuantumNumber}, dimensions::Vector{Int}; check::Bool=false) -> Tuple{typeof(quantumnumbers), typeof(dimensions), Vector{Int}}

In place regularization of the input Abelian quantum numbers and their corresponding degenerate dimensions.

After the regularization, the Abelian quantum numbers will be sorted in the ascending order and duplicates will be merged together. The degenerate dimensions will be processed accordingly. When check is true, this function also check whether all input degenerate dimensions are positive. The regularized Abelian quantum numbers and degenerate dimensions, as well as the permutation vector that sorts the input Abelian quantum numbers, will be returned.

source
QuantumLattices.QuantumNumbers.regularizeMethod
regularize(quantumnumbers::AbstractVector{<:AbelianQuantumNumber}, dimension::AbstractVector{<:Integer}; check::Bool=false) -> Tuple{Vector{eltype(quantumnumbers)}, Vector{Int}, Vector{Int}}

Regularize of the input Abelian quantum numbers and their corresponding degenerate dimensions.

See regularize!.

source
QuantumLattices.decomposeMethod
decompose(rs::CompositeAbelianGradedSpace; expand::Bool=true) -> Tuple{AbelianGradedSpace{eltype(rs)}, Vector{Int}}

Decompose a composite of several Abelian graded spaces to the canonical one.

When expand is false, the corresponding permutation vector that sorts the Abelian quantum numbers will be returned as well. When expand is true, the expanded dimension indexes of the permutation vector that sorts the Abelian quantum numbers will be returned as well.

source
QuantumLattices.dimensionMethod
dimension(gs::AbelianGradedSpace, qn::CartesianIndex) -> Int
-dimension(gs::AbelianGradedSpace{QN}, qn::QN) where {QN<:AbelianQuantumNumber} -> Int

Get the degenerate dimension of an Abelian quantum number contained in an Abelian graded space.

source
QuantumLattices.dimensionMethod
dimension(rs::AbelianGradedSpaceProd, i::CartesianIndex) -> Int

Get the degenerate dimension of the ith Abelian quantum number in the direct product of several Abelian graded spaces.

source
QuantumLattices.dimensionMethod
dimension(rs::AbelianGradedSpaceProd) -> Int

Get the total dimension of the direct product of several Abelian graded spaces.

source
QuantumLattices.dimensionMethod
dimension(rs::AbelianGradedSpaceSum, i::CartesianIndex) -> Int

Get the degenerate dimension of the ith Abelian quantum number in the direct sum of several Abelian graded spaces.

source
QuantumLattices.dimensionMethod
dimension(rs::AbelianGradedSpaceSum) -> Int

Get the total dimension of the direct sum of several Abelian graded spaces.

source
QuantumLattices.dimensionMethod
dimension(rs::RepresentationSpace, i::Integer) -> Int

Get the degenerate dimension of the ith Abelian quantum number contained in a representation space.

source
QuantumLattices.dimensionMethod
dimension(rs::AbelianGradedSpaceProd{N, QN}, qns::NTuple{N, QN}) where {N, QN<:AbelianQuantumNumber} -> Int

Get the degenerate dimension of the Abelian quantum number fused by qns in the direct product of several Abelian graded spaces.

source
+⊠(::Type{AbelianQuantumNumberProd{T₁}}, ::Type{AbelianQuantumNumberProd{T₂}}) where {T₁<:Tuple{Vararg{SimpleAbelianQuantumNumber}}, T₂<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} -> Type{AbelianQuantumNumberProd{Tuple{fieldtypes(T₁)..., fieldtypes(T₂)...}}}

Deligne tensor product of Abelian quantum numbers.

source
QuantumLattices.QuantumNumbers.findindexMethod
findindex(position::Integer, gs::AbelianGradedSpace, guess::Integer) -> Int

Find the index of an Abelian quantum number in an Abelian graded space beginning at guess whose position in the complete dimension range is position.

source
QuantumLattices.QuantumNumbers.periodMethod
period(qn::AbelianQuantumNumberProd, i::Integer) -> Number
+period(::Type{AbelianQuantumNumberProd{T}}, i::Integer) where {T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} -> Number

Get the period of the ith simple Abelian number contained in a Deligne tensor product.

source
QuantumLattices.QuantumNumbers.periodMethod
period(qn::SimpleAbelianQuantumNumber) -> Number
+period(::Type{QN}) where {QN<:SimpleAbelianQuantumNumber} -> Number

Get the period of a simple Abelian quantum number.

source
QuantumLattices.QuantumNumbers.periodsMethod
periods(qn::AbelianQuantumNumber) -> Tuple{Vararg{Number}}
+periods(::Type{QN}) where {QN<:AbelianQuantumNumber} -> Tuple{Vararg{Number}}

Get the periods of Abelian quantum numbers.

source
QuantumLattices.QuantumNumbers.regularize!Method
regularize!(quantumnumbers::Vector{<:AbelianQuantumNumber}, dimensions::Vector{Int}; check::Bool=false) -> Tuple{typeof(quantumnumbers), typeof(dimensions), Vector{Int}}

In place regularization of the input Abelian quantum numbers and their corresponding degenerate dimensions.

After the regularization, the Abelian quantum numbers will be sorted in the ascending order and duplicates will be merged together. The degenerate dimensions will be processed accordingly. When check is true, this function also check whether all input degenerate dimensions are positive. The regularized Abelian quantum numbers and degenerate dimensions, as well as the permutation vector that sorts the input Abelian quantum numbers, will be returned.

source
QuantumLattices.QuantumNumbers.regularizeMethod
regularize(quantumnumbers::AbstractVector{<:AbelianQuantumNumber}, dimension::AbstractVector{<:Integer}; check::Bool=false) -> Tuple{Vector{eltype(quantumnumbers)}, Vector{Int}, Vector{Int}}

Regularize of the input Abelian quantum numbers and their corresponding degenerate dimensions.

See regularize!.

source
QuantumLattices.decomposeMethod
decompose(rs::CompositeAbelianGradedSpace; expand::Bool=true) -> Tuple{AbelianGradedSpace{eltype(rs)}, Vector{Int}}

Decompose a composite of several Abelian graded spaces to the canonical one.

When expand is false, the corresponding permutation vector that sorts the Abelian quantum numbers will be returned as well. When expand is true, the expanded dimension indexes of the permutation vector that sorts the Abelian quantum numbers will be returned as well.

source
QuantumLattices.dimensionMethod
dimension(gs::AbelianGradedSpace, qn::CartesianIndex) -> Int
+dimension(gs::AbelianGradedSpace{QN}, qn::QN) where {QN<:AbelianQuantumNumber} -> Int

Get the degenerate dimension of an Abelian quantum number contained in an Abelian graded space.

source
QuantumLattices.dimensionMethod
dimension(rs::AbelianGradedSpaceProd, i::CartesianIndex) -> Int

Get the degenerate dimension of the ith Abelian quantum number in the direct product of several Abelian graded spaces.

source
QuantumLattices.dimensionMethod
dimension(rs::AbelianGradedSpaceProd) -> Int

Get the total dimension of the direct product of several Abelian graded spaces.

source
QuantumLattices.dimensionMethod
dimension(rs::AbelianGradedSpaceSum, i::CartesianIndex) -> Int

Get the degenerate dimension of the ith Abelian quantum number in the direct sum of several Abelian graded spaces.

source
QuantumLattices.dimensionMethod
dimension(rs::AbelianGradedSpaceSum) -> Int

Get the total dimension of the direct sum of several Abelian graded spaces.

source
QuantumLattices.dimensionMethod
dimension(rs::RepresentationSpace, i::Integer) -> Int

Get the degenerate dimension of the ith Abelian quantum number contained in a representation space.

source
QuantumLattices.dimensionMethod
dimension(rs::AbelianGradedSpaceProd{N, QN}, qns::NTuple{N, QN}) where {N, QN<:AbelianQuantumNumber} -> Int

Get the degenerate dimension of the Abelian quantum number fused by qns in the direct product of several Abelian graded spaces.

source
QuantumLattices.valueMethod
value(qn::AbelianQuantumNumberProd, i::Integer) -> Number

Get the value of the ith simple Abelian quantum number in a Deligne tensor product.

source
diff --git a/dev/man/QuantumOperators/index.html b/dev/man/QuantumOperators/index.html index 0ba96a80..b4019505 100644 --- a/dev/man/QuantumOperators/index.html +++ b/dev/man/QuantumOperators/index.html @@ -3,14 +3,14 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-89508993-1', {'page_path': location.pathname + location.search + location.hash}); -

Quantum operators

Quantum operators form an algebra over a field, which are vector spaces with a bilinear operation (often called the "multiplication") between vectors defined.

With the help of the structure constants of the algebra, the result of the bilinear operation between any arbitrary two vectors can be expressed by a sum of individual ones. Therefore, in principle, an algebra can be represented by the complete basis set of its corresponding vector space and a rank-3 tensor encapsulating its structure constants. It is noted that the "bilinear operation" is not restricted to the usual multiplication. For example, it is the commutator, which is a composition of the usual multiplication and subtraction (for any A and B, the commutator [A, B] is defined as [A, B]≝AB-BA) that serves as the bilinear operator for Lie algebras.

In general, there are three basic operations on quantum operators, i.e. the scalar multiplication between a scalar and a quantum operator, the usual addition and the usual multiplication between quantum operators. Other complicated operations can be composed from these basic ones. These basic operations are implemented in this module.

OperatorUnit

OperatorUnit is the building block of quantum operators, which specifies the basis of the vector space of the corresponding algebra.

OperatorProd and OperatorSum

OperatorProd defines the product operator as an entity of basis quantum operators while OperatorSum defines the summation as an entity of OperatorProds. Both of them are subtypes of QuantumOperator, which is the abstract type for all quantum operators.

An OperatorProd must have two predefined contents:

  • value::Number: the coefficient of the quantum operator
  • id::ID: the id of the quantum operator

Arithmetic operations (+, -, *, /) between a scalar, an OperatorProd or an OperatorSum is defined. See Manual for details.

Manual

QuantumLattices.QuantumOperators.IDMethod
ID(id::OperatorIndex...)
+

Quantum operators

Quantum operators form an algebra over a field, which are vector spaces with a bilinear operation (often called the "multiplication") between vectors defined.

With the help of the structure constants of the algebra, the result of the bilinear operation between any arbitrary two vectors can be expressed by a sum of individual ones. Therefore, in principle, an algebra can be represented by the complete basis set of its corresponding vector space and a rank-3 tensor encapsulating its structure constants. It is noted that the "bilinear operation" is not restricted to the usual multiplication. For example, it is the commutator, which is a composition of the usual multiplication and subtraction (for any A and B, the commutator [A, B] is defined as [A, B]≝AB-BA) that serves as the bilinear operator for Lie algebras.

In general, there are three basic operations on quantum operators, i.e. the scalar multiplication between a scalar and a quantum operator, the usual addition and the usual multiplication between quantum operators. Other complicated operations can be composed from these basic ones. These basic operations are implemented in this module.

OperatorUnit

OperatorUnit is the building block of quantum operators, which specifies the basis of the vector space of the corresponding algebra.

OperatorProd and OperatorSum

OperatorProd defines the product operator as an entity of basis quantum operators while OperatorSum defines the summation as an entity of OperatorProds. Both of them are subtypes of QuantumOperator, which is the abstract type for all quantum operators.

An OperatorProd must have two predefined contents:

  • value::Number: the coefficient of the quantum operator
  • id::ID: the id of the quantum operator

Arithmetic operations (+, -, *, /) between a scalar, an OperatorProd or an OperatorSum is defined. See Manual for details.

Manual

QuantumLattices.QuantumOperators.IDMethod
ID(id::OperatorIndex...)
 ID(u::OperatorIndex, id::ID{OperatorIndex})
 ID(id::ID{OperatorIndex}, u::OperatorIndex)
-ID(id₁::ID{OperatorIndex}, id₂::ID{OperatorIndex})

Get the id from operator units/ids.

source
QuantumLattices.QuantumOperators.OperatorIndexType
OperatorIndex <: QuantumOperator

An operator index is the irreducible symbolic unit to completely represent a quantum operator.

It plays the role of the symbols as in usual computer algebras while it can host internal structures, which is convenient to represent quantum operators with complicated spatial and/or internal degrees of freedom.

source
QuantumLattices.QuantumOperators.OperatorPackType
OperatorPack{V, I} <: QuantumOperator

Entity that represent the pack of a number and an id of a quantum operator.

Basically, a concrete subtype should contain two predefined contents:

  • value::V: the coefficient of the pack
  • id::I: the id of the pack
source
QuantumLattices.QuantumOperators.OperatorSetType
OperatorSet{M<:OperatorPack} <: QuantumOperator

Set of OperatorPacks.

  1. The relation between two OperatorPacks in an OperatorSet can be viewed as addition.
  2. But in general, only iteration over OperatorPacks and length are supported.
  3. To use arithmetic operations, please refer to its subtype, OperatorSum.
source
QuantumLattices.QuantumOperators.OperatorIndexType
OperatorIndex <: QuantumOperator

An operator index is the irreducible symbolic unit to completely represent a quantum operator.

It plays the role of the symbols as in usual computer algebras while it can host internal structures, which is convenient to represent quantum operators with complicated spatial and/or internal degrees of freedom.

source
QuantumLattices.QuantumOperators.OperatorPackType
OperatorPack{V, I} <: QuantumOperator

Entity that represent the pack of a number and an id of a quantum operator.

Basically, a concrete subtype should contain two predefined contents:

  • value::V: the coefficient of the pack
  • id::I: the id of the pack
source
QuantumLattices.QuantumOperators.OperatorSetType
OperatorSet{M<:OperatorPack} <: QuantumOperator

Set of OperatorPacks.

  1. The relation between two OperatorPacks in an OperatorSet can be viewed as addition.
  2. But in general, only iteration over OperatorPacks and length are supported.
  3. To use arithmetic operations, please refer to its subtype, OperatorSum.
source
QuantumLattices.QuantumOperators.PermutationMethod
(permutation::Permutation)(m::OperatorProd; rev::Bool=false, kwargs...) -> OperatorSum

Permute the operator units of an OperatorProd to the descending order according to the table contained in permutation.

Note

To use this function, the user must implement a method of permute, which computes the result of the permutation of two operator units:

permute(u₁::OperatorIndex, u₂::OperatorIndex) -> Union{OperatorProd, OperatorSum}

Here, u₁ and u₂ are two arbitrary operator units contained in id(m).

source
QuantumLattices.QuantumOperators.TabledUnitSubstitutionType
TabledUnitSubstitution{U<:OperatorIndex, S<:OperatorSum, T<:AbstractDict{U, S}} <: UnitSubstitution{U, S}

A concrete unit substitution transformation, which stores every substitution of the old OperatorIndexs in its table as a dictionary.

source
QuantumLattices.QuantumOperators.UnitSubstitutionType
UnitSubstitution{U<:OperatorIndex, S<:OperatorSum} <: LinearTransformation

Unit substitution transformation, which substitutes each OperatorIndex in the old quantum operators to a new expression represented by an OperatorSum.

source
Base.:*Method
*(factor::Number, m::OperatorIndex) -> Operator
+OperatorSum{M}(ms::QuantumOperator...) where {M<:OperatorPack}

Get the sum of OperatorPacks.

source
QuantumLattices.QuantumOperators.PermutationMethod
(permutation::Permutation)(m::OperatorProd; rev::Bool=false, kwargs...) -> OperatorSum

Permute the operator units of an OperatorProd to the descending order according to the table contained in permutation.

Note

To use this function, the user must implement a method of permute, which computes the result of the permutation of two operator units:

permute(u₁::OperatorIndex, u₂::OperatorIndex) -> Union{OperatorProd, OperatorSum}

Here, u₁ and u₂ are two arbitrary operator units contained in id(m).

source
QuantumLattices.QuantumOperators.TabledUnitSubstitutionType
TabledUnitSubstitution{U<:OperatorIndex, S<:OperatorSum, T<:AbstractDict{U, S}} <: UnitSubstitution{U, S}

A concrete unit substitution transformation, which stores every substitution of the old OperatorIndexs in its table as a dictionary.

source
QuantumLattices.QuantumOperators.UnitSubstitutionType
UnitSubstitution{U<:OperatorIndex, S<:OperatorSum} <: LinearTransformation

Unit substitution transformation, which substitutes each OperatorIndex in the old quantum operators to a new expression represented by an OperatorSum.

source
Base.:*Method
*(factor::Number, m::OperatorIndex) -> Operator
 *(m::OperatorIndex, factor::Number) -> Operator
 *(m₁::OperatorIndex, m₂::OperatorIndex) -> Operator
 *(factor::Number, m::OperatorPack) -> OperatorPack
@@ -24,44 +24,44 @@
 *(ms::OperatorSum, m::OperatorIndex) -> OperatorSum
 *(m::OperatorPack, ms::OperatorSum) -> OperatorSum
 *(ms::OperatorSum, m::OperatorPack) -> OperatorSum
-*(ms₁::OperatorSum, ms₂::OperatorSum) -> OperatorSum

Overloaded * between quantum operators or a quantum operator and a number.

source
Base.:+Method
+(m::QuantumOperator) -> typeof(m)
+*(ms₁::OperatorSum, ms₂::OperatorSum) -> OperatorSum

Overloaded * between quantum operators or a quantum operator and a number.

source
Base.:+Method
+(m::QuantumOperator) -> typeof(m)
 +(m₁::QuantumOperator, m₂::QuantumOperator) -> OperatorSum
 +(factor::Number, m::QuantumOperator) -> OperatorSum
-+(m::QuantumOperator, factor::Number) -> OperatorSum

Overloaded + between quantum operators.

source
Base.:-Method
-(m::QuantumOperator) -> QuantumOperator
++(m::QuantumOperator, factor::Number) -> OperatorSum

Overloaded + between quantum operators.

source
Base.:-Method
-(m::QuantumOperator) -> QuantumOperator
 -(m₁::QuantumOperator, m₂::QuantumOperator) -> OperatorSum
 -(factor::Number, m::QuantumOperator) -> OperatorSum
--(m::QuantumOperator, factor::Number) -> OperatorSum

Overloaded - between quantum operators.

source
Base.:/Method
/(m::QuantumOperator, factor::Number) -> QuantumOperator

Overloaded / between a quantum operator and a number.

source
Base.://Method
//(m::QuantumOperator, factor::Number) -> QuantumOperator

Overloaded // between a quantum operator and a number.

source
Base.:^Method
^(m::QuantumOperator, n::Integer) -> QuantumOperator

Overloaded ^ between a quantum operator and an integer.

source
Base.adjointMethod
adjoint(id::ID{OperatorIndex}) -> ID

Get the adjoint of an id.

source
Base.adjointMethod
adjoint(opts::Operators) -> Operators

Get the adjoint of a set of operators.

source
Base.adjointMethod
adjoint(m::Operator) -> Operator

Get the adjoint of an operator.

source
Base.conjMethod
conj(m::OperatorIndex) -> OperatorIndex
+-(m::QuantumOperator, factor::Number) -> OperatorSum

Overloaded - between quantum operators.

source
Base.:/Method
/(m::QuantumOperator, factor::Number) -> QuantumOperator

Overloaded / between a quantum operator and a number.

source
Base.://Method
//(m::QuantumOperator, factor::Number) -> QuantumOperator

Overloaded // between a quantum operator and a number.

source
Base.:^Method
^(m::QuantumOperator, n::Integer) -> QuantumOperator

Overloaded ^ between a quantum operator and an integer.

source
Base.adjointMethod
adjoint(id::ID{OperatorIndex}) -> ID

Get the adjoint of an id.

source
Base.adjointMethod
adjoint(opts::Operators) -> Operators

Get the adjoint of a set of operators.

source
Base.adjointMethod
adjoint(m::Operator) -> Operator

Get the adjoint of an operator.

source
Base.conjMethod
conj(m::OperatorIndex) -> OperatorIndex
 conj(m::OperatorPack) -> OperatorPack
-conj(m::OperatorSum) -> OperatorSum

Get the conjugation.

source
Base.convertMethod
convert(::Type{M}, m::Number) where {M<:OperatorProd}

Convert a number to a quantum operator.

source
Base.convertMethod
convert(::Type{M}, u::OperatorIndex) where {M<:Operator}

Convert an operator index to an operator.

source
Base.convertMethod
convert(::Type{M}, m::OperatorPack) where {M<:OperatorPack}

Convert a quantum operator from one type to another.

source
Base.eltypeMethod
eltype(m::OperatorProd)
-eltype(::Type{M}) where {M<:OperatorProd}

Get the eltype of an OperatorProd.

source
Base.eltypeMethod
eltype(ms::OperatorSet)
-eltype(::Type{<:OperatorSet{M}}) where {M<:OperatorPack}

Get the eltype of an OperatorSet.

source
Base.emptyMethod
empty(ms::OperatorSum) -> typeof(ms)
-empty!(ms::OperatorSum) -> typeof(ms)

Get an empty copy or empty an OperatorSum.

source
Base.getindexMethod
getindex(m::OperatorProd, i::Integer) -> eltype(idtype(m))
-getindex(m::OperatorProd, slice) -> OperatorProd

Overloaded [].

source
Base.getindexMethod
getindex(ms::OperatorSum, index::Integer) -> eltype(ms)
+conj(m::OperatorSum) -> OperatorSum

Get the conjugation.

source
Base.convertMethod
convert(::Type{M}, m::Number) where {M<:OperatorProd}

Convert a number to a quantum operator.

source
Base.convertMethod
convert(::Type{M}, u::OperatorIndex) where {M<:Operator}

Convert an operator index to an operator.

source
Base.convertMethod
convert(::Type{M}, m::OperatorPack) where {M<:OperatorPack}

Convert a quantum operator from one type to another.

source
Base.eltypeMethod
eltype(m::OperatorProd)
+eltype(::Type{M}) where {M<:OperatorProd}

Get the eltype of an OperatorProd.

source
Base.eltypeMethod
eltype(ms::OperatorSet)
+eltype(::Type{<:OperatorSet{M}}) where {M<:OperatorPack}

Get the eltype of an OperatorSet.

source
Base.emptyMethod
empty(ms::OperatorSum) -> typeof(ms)
+empty!(ms::OperatorSum) -> typeof(ms)

Get an empty copy or empty an OperatorSum.

source
Base.getindexMethod
getindex(m::OperatorProd, i::Integer) -> eltype(idtype(m))
+getindex(m::OperatorProd, slice) -> OperatorProd

Overloaded [].

source
Base.getindexMethod
getindex(ms::OperatorSum, index::Integer) -> eltype(ms)
 getindex(ms::OperatorSum, indexes::AbstractVector{<:Integer}) -> typeof(ms)
-getindex(ms::OperatorSum, ::Colon) -> typeof(ms)

Overloaded [].

source
Base.getpropertyMethod
getproperty(id::ID{OperatorIndex}, name::Symbol)

Get the property of a composite id.

source
Base.haskeyMethod
haskey(ms::OperatorSum, id) -> Bool

Judge whether an OperatorSum contains an OperatorPack with the given id.

source
Base.isapproxMethod
isapprox(m₁::OperatorPack, m₂::OperatorPack; atol::Real=atol, rtol::Real=rtol) -> Bool

Compare two OperatorPacks and judge whether they are approximate to each other.

source
Base.isapproxMethod
isapprox(ms₁::OperatorSum, ms₂::OperatorSum; atol::Real=atol, rtol::Real=rtol) -> Bool

Compare two OperatorSums and judge whether they are approximate to each other.

source
Base.iszeroMethod
iszero(u::OperatorIndex) -> Bool

Judge whether an OperatorIndex is zero, which is defined to be always false.

source
Base.iszeroMethod
iszero(m::OperatorPack) -> Bool

Judge whether an OperatorPack is zero, i.e., its value is zero.

source
Base.iszeroMethod
iszero(ms::OperatorSet) -> Bool

Judge whether an OperatorSet is zero, i.e, it does not contain any OperatorPack.

source
Base.iszeroMethod
iszero(ms::OperatorSum) -> Bool

Judge whether an OperatorSum is zero, i.e, it does not contain any OperatorPack.

source
Base.iterateMethod
iterate(m::OperatorProd)
-iterate(m::OperatorProd, state)

Iterate over the components of the id of an OperatorProd.

source
Base.iterateMethod
iterate(ms::OperatorSum)
-iterate(ms::OperatorSum, state)

Iterate over the OperatorPacks contained in an OperatorSum.

source
Base.lengthMethod
length(m::OperatorProd) -> Int

Get the length of an OperatorProd.

source
Base.lengthMethod
length(ms::OperatorSum) -> Int

Get the number of OperatorPacks contained in an OperatorSum.

source
Base.map!Method
map!(f::Function, ms::OperatorSum; kwargs...) -> typeof(ms)

In place map of an OperatorSum by the function f elementally.

source
Base.oneMethod
one(::Type{M}) where {M<:OperatorProd}
-one(m::OperatorProd)

Get the identity quantum operator.

source
Base.propertynamesMethod
propertynames(::Type{I}) where I<:ID{OperatorIndex} -> Tuple{Vararg{Symbol}}

Get the property names of a composite id.

source
Base.replaceMethod
replace(m::OperatorPack, v) -> OperatorPack

Replace the value of an OperatorPack.

source
Base.replaceMethod
replace(m::QuantumOperator; kwargs...) -> typeof(m)

Return a copy of a concrete QuantumOperator with some of the field values replaced by the keyword arguments.

source
Base.showMethod
show(io::IO, ::MIME"text/latex", m::QuantumOperator)

Show a quantum operator.

source
Base.splitMethod
split(m::OperatorProd) -> Tuple{valtype(m), Vararg{Any}}

Split an OperatorProd into the coefficient and a sequence of the components of its id.

source
Base.valtypeMethod
valtype(m::OperatorPack)
-valtype(::Type{T}) where {T<:OperatorPack}

Get the type of the value of an OperatorPack.

source
Base.zeroMethod
zero(m::QuantumOperator)

Get a zero QuantumOperator.

source
Base.zeroMethod
zero(::Type{M}) where {M<:OperatorIndex} -> OperatorSum
+getindex(ms::OperatorSum, ::Colon) -> typeof(ms)

Overloaded [].

source
Base.getpropertyMethod
getproperty(id::ID{OperatorIndex}, name::Symbol)

Get the property of a composite id.

source
Base.haskeyMethod
haskey(ms::OperatorSum, id) -> Bool

Judge whether an OperatorSum contains an OperatorPack with the given id.

source
Base.isapproxMethod
isapprox(m₁::OperatorPack, m₂::OperatorPack; atol::Real=atol, rtol::Real=rtol) -> Bool

Compare two OperatorPacks and judge whether they are approximate to each other.

source
Base.isapproxMethod
isapprox(ms₁::OperatorSum, ms₂::OperatorSum; atol::Real=atol, rtol::Real=rtol) -> Bool

Compare two OperatorSums and judge whether they are approximate to each other.

source
Base.iszeroMethod
iszero(u::OperatorIndex) -> Bool

Judge whether an OperatorIndex is zero, which is defined to be always false.

source
Base.iszeroMethod
iszero(m::OperatorPack) -> Bool

Judge whether an OperatorPack is zero, i.e., its value is zero.

source
Base.iszeroMethod
iszero(ms::OperatorSet) -> Bool

Judge whether an OperatorSet is zero, i.e, it does not contain any OperatorPack.

source
Base.iszeroMethod
iszero(ms::OperatorSum) -> Bool

Judge whether an OperatorSum is zero, i.e, it does not contain any OperatorPack.

source
Base.iterateMethod
iterate(m::OperatorProd)
+iterate(m::OperatorProd, state)

Iterate over the components of the id of an OperatorProd.

source
Base.iterateMethod
iterate(ms::OperatorSum)
+iterate(ms::OperatorSum, state)

Iterate over the OperatorPacks contained in an OperatorSum.

source
Base.lengthMethod
length(m::OperatorProd) -> Int

Get the length of an OperatorProd.

source
Base.lengthMethod
length(ms::OperatorSum) -> Int

Get the number of OperatorPacks contained in an OperatorSum.

source
Base.map!Method
map!(f::Function, ms::OperatorSum; kwargs...) -> typeof(ms)

In place map of an OperatorSum by the function f elementally.

source
Base.oneMethod
one(::Type{M}) where {M<:OperatorProd}
+one(m::OperatorProd)

Get the identity quantum operator.

source
Base.propertynamesMethod
propertynames(::Type{I}) where I<:ID{OperatorIndex} -> Tuple{Vararg{Symbol}}

Get the property names of a composite id.

source
Base.replaceMethod
replace(m::OperatorPack, v) -> OperatorPack

Replace the value of an OperatorPack.

source
Base.replaceMethod
replace(m::QuantumOperator; kwargs...) -> typeof(m)

Return a copy of a concrete QuantumOperator with some of the field values replaced by the keyword arguments.

source
Base.showMethod
show(io::IO, ::MIME"text/latex", m::QuantumOperator)

Show a quantum operator.

source
Base.splitMethod
split(m::OperatorProd) -> Tuple{valtype(m), Vararg{Any}}

Split an OperatorProd into the coefficient and a sequence of the components of its id.

source
Base.valtypeMethod
valtype(m::OperatorPack)
+valtype(::Type{T}) where {T<:OperatorPack}

Get the type of the value of an OperatorPack.

source
Base.zeroMethod
zero(m::QuantumOperator)

Get a zero QuantumOperator.

source
Base.zeroMethod
zero(::Type{M}) where {M<:OperatorIndex} -> OperatorSum
 zero(::Type{M}) where {M<:OperatorPack} -> OperatorSum
-zero(::Type{M}) where {M<:OperatorSum} -> OperatorSum

Get the zero sum.

source
LaTeXStrings.latexstringMethod
latexstring(opts::OperatorSet) -> String

Get the string representation of a set of operators in the LaTeX format.

source
LinearAlgebra.dotMethod
dot(m₁::QuantumOperator, m₂::QuantumOperator)
+zero(::Type{M}) where {M<:OperatorSum} -> OperatorSum

Get the zero sum.

source
LaTeXStrings.latexstringMethod
latexstring(opts::OperatorSet) -> String

Get the string representation of a set of operators in the LaTeX format.

source
LinearAlgebra.dotMethod
dot(m₁::QuantumOperator, m₂::QuantumOperator)
 dot(m::QuantumOperator, c::Number)
-dot(c::Number, m::QuantumOperator)

Dot product between two QuantumOperators or between a QuantumOperator and a number.

source
LinearAlgebra.mul!Method
mul!(ms::OperatorSum, factor::Number) -> OperatorSum

Get the in-place multiplication of an OperatorSum with a number.

source
LinearAlgebra.rankMethod
rank(id::ID{OperatorIndex}) -> Int
-rank(::Type{<:ID{OperatorIndex, N}}) where N -> Int

Get the rank of an id.

source
LinearAlgebra.rankMethod
rank(m::OperatorProd) -> Int
-rank(::Type{M}) where {M<:OperatorProd} -> Int

Get the rank of an OperatorProd.

source
LinearAlgebra.mul!Method
mul!(ms::OperatorSum, factor::Number) -> OperatorSum

Get the in-place multiplication of an OperatorSum with a number.

source
LinearAlgebra.rankMethod
rank(id::ID{OperatorIndex}) -> Int
+rank(::Type{<:ID{OperatorIndex, N}}) where N -> Int

Get the rank of an id.

source
LinearAlgebra.rankMethod
rank(m::OperatorProd) -> Int
+rank(::Type{M}) where {M<:OperatorProd} -> Int

Get the rank of an OperatorProd.

source
QuantumLattices.QuantumOperators.operatortypeMethod
operatortype(::Type{M}) where {M<:OperatorIndex}
 operatortype(::Type{M}) where {M<:OperatorPack}
-operatortype(::Type{M}) where {M<:OperatorSet}

Get the corresponding OperatorPack type of a quantum operator.

source
QuantumLattices.QuantumOperators.scriptMethod
script(u::OperatorIndex, l::LaTeX, ::Val{:BD}) -> Any
 script(u::OperatorIndex, l::LaTeX, ::Val{:SP}) -> Tuple
-script(u::OperatorIndex, l::LaTeX, ::Val{:SB}) -> Tuple

Get the body/superscript/subscript of the LaTeX string representation of an operator index.

source
QuantumLattices.add!Method
add!(destination, transformation::LinearTransformation, op::OperatorPack; kwargs...) -> typeof(destination)
-add!(destination, transformation::LinearTransformation, op::OperatorSet; kwargs...) -> typeof(destination)

Add the result of the linear transformation on a quantum operator to the destination.

source
QuantumLattices.add!Method
add!(ms::OperatorSum) -> typeof(ms)
+script(u::OperatorIndex, l::LaTeX, ::Val{:SB}) -> Tuple

Get the body/superscript/subscript of the LaTeX string representation of an operator index.

source
QuantumLattices.add!Method
add!(destination, transformation::LinearTransformation, op::OperatorPack; kwargs...) -> typeof(destination)
+add!(destination, transformation::LinearTransformation, op::OperatorSet; kwargs...) -> typeof(destination)

Add the result of the linear transformation on a quantum operator to the destination.

source
QuantumLattices.add!Method
add!(ms::OperatorSum) -> typeof(ms)
 add!(ms::OperatorSum, m::Union{Number, OperatorIndex, OperatorPack}) -> typeof(ms)
-add!(ms::OperatorSum, mms::OperatorSum) -> typeof(ms)

Get the in-place addition of quantum operators.

source
QuantumLattices.div!Method
div!(ms::OperatorSum, factor::Number) -> OperatorSum

Get the in-place division of an OperatorSum with a number.

source
QuantumLattices.sub!Method
sub!(ms::OperatorSum) -> typeof(ms)
+add!(ms::OperatorSum, mms::OperatorSum) -> typeof(ms)

Get the in-place addition of quantum operators.

source
QuantumLattices.div!Method
div!(ms::OperatorSum, factor::Number) -> OperatorSum

Get the in-place division of an OperatorSum with a number.

source
QuantumLattices.sub!Method
sub!(ms::OperatorSum) -> typeof(ms)
 sub!(ms::OperatorSum, m::Union{Number, OperatorIndex, OperatorPack}) -> typeof(ms)
-sub!(ms::OperatorSum, mms::OperatorSum) -> typeof(ms)

Get the in-place subtraction of quantum operators.

source
QuantumLattices.update!Method
update!(m::QuantumOperator; parameters...) -> typeof(m)

Update the parameters of a QuantumOperator in place and return the updated one.

By default, the parameter update of a QuantumOperator does nothing.

source
+sub!(ms::OperatorSum, mms::OperatorSum) -> typeof(ms)

Get the in-place subtraction of quantum operators.

source
QuantumLattices.update!Method
update!(m::QuantumOperator; parameters...) -> typeof(m)

Update the parameters of a QuantumOperator in place and return the updated one.

By default, the parameter update of a QuantumOperator does nothing.

source
diff --git a/dev/man/QuantumSystems/index.html b/dev/man/QuantumSystems/index.html index 0132b17a..78850b4f 100644 --- a/dev/man/QuantumSystems/index.html +++ b/dev/man/QuantumSystems/index.html @@ -3,19 +3,19 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-89508993-1', {'page_path': location.pathname + location.search + location.hash}); -

Quantum Systems

QuantumLattices.QuantumSystems.blockConstant
*(f₁::Operator{<:Number, <:ID{FockIndex{:f}}}, f₂::Operator{<:Number, <:ID{FockIndex{:f}}}) -> Operator
+

Quantum Systems

QuantumLattices.QuantumSystems.blockConstant
*(f₁::Operator{<:Number, <:ID{FockIndex{:f}}}, f₂::Operator{<:Number, <:ID{FockIndex{:f}}}) -> Operator
 *(f₁::Operator{<:Number, <:ID{Index{<:FockIndex{:f}, Int}}}, f₂::Operator{<:Number, <:ID{Index{<:FockIndex{:f}, Int}}}) -> Operator
-*(f₁::Operator{<:Number, <:ID{CompositeIndex{<:Index{<:FockIndex{:f}, Int}}}}, f₂::Operator{<:Number, <:ID{CompositeIndex{<:Index{<:FockIndex{:f}, Int}}}}) -> Operator

Get the multiplication of two fermionic Fock operators.

source
QuantumLattices.DegreesOfFreedom.MatrixCouplingMethod
MatrixCoupling(F::Union{typeof(𝕗), typeof(𝕓), typeof(𝕕)}, sites::Union{NTuple{2, Ordinal}, Colon}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon})
-MatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{F}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon}) where {F<:FockIndex}

Construct a matrix coupling for Fock systems.

source
QuantumLattices.DegreesOfFreedom.MatrixCouplingMethod
MatrixCoupling(::typeof(𝕦), sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::Union{AbstractVector, Nothing}=nothing, cols::Union{AbstractVector, Nothing}=nothing)
-MatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{PhononIndex{:u}}, matrix::AbstractMatrix; rows::Union{AbstractVector, Nothing}=nothing, cols::Union{AbstractVector, Nothing}=nothing)

Construct a set of Couplings corresponding to the dynamical matrix of phonons.

source
QuantumLattices.DegreesOfFreedom.MatrixCouplingMethod
MatrixCoupling(::Type{<:𝕊}, sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::AbstractVector=SVector('x', 'y', 'z'), cols::AbstractVector=SVector('x', 'y', 'z'))
-MatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{<:SpinIndex}, matrix::AbstractMatrix; rows::AbstractVector=SVector('x', 'y', 'z'), cols::AbstractVector=SVector('x', 'y', 'z'))

Construct a matrix coupling for spin systems.

source
QuantumLattices.QuantumNumbers.GradedMethod
Graded(fock::Fock{:f})
+*(f₁::Operator{<:Number, <:ID{CompositeIndex{<:Index{<:FockIndex{:f}, Int}}}}, f₂::Operator{<:Number, <:ID{CompositeIndex{<:Index{<:FockIndex{:f}, Int}}}}) -> Operator

Get the multiplication of two fermionic Fock operators.

source
QuantumLattices.DegreesOfFreedom.MatrixCouplingMethod
MatrixCoupling(F::Union{typeof(𝕗), typeof(𝕓), typeof(𝕕)}, sites::Union{NTuple{2, Ordinal}, Colon}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon})
+MatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{F}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon}) where {F<:FockIndex}

Construct a matrix coupling for Fock systems.

source
QuantumLattices.DegreesOfFreedom.MatrixCouplingMethod
MatrixCoupling(::typeof(𝕦), sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::Union{AbstractVector, Nothing}=nothing, cols::Union{AbstractVector, Nothing}=nothing)
+MatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{PhononIndex{:u}}, matrix::AbstractMatrix; rows::Union{AbstractVector, Nothing}=nothing, cols::Union{AbstractVector, Nothing}=nothing)

Construct a set of Couplings corresponding to the dynamical matrix of phonons.

source
QuantumLattices.DegreesOfFreedom.MatrixCouplingMethod
MatrixCoupling(::Type{<:𝕊}, sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::AbstractVector=SVector('x', 'y', 'z'), cols::AbstractVector=SVector('x', 'y', 'z'))
+MatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{<:SpinIndex}, matrix::AbstractMatrix; rows::AbstractVector=SVector('x', 'y', 'z'), cols::AbstractVector=SVector('x', 'y', 'z'))

Construct a matrix coupling for spin systems.

source
QuantumLattices.QuantumNumbers.GradedMethod
Graded(fock::Fock{:f})
 Graded{ℤ₁}(fock::Fock{:f})
 Graded{ℕ}(fock::Fock{:f})
 Graded{𝕊ᶻ}(fock::Fock{:f})
 Graded{ℕ ⊠ 𝕊ᶻ}(fock::Fock{:f})
-Graded{𝕊ᶻ ⊠ ℕ}(fock::Fock{:f})

Decompose a local fermionic Fock space into an Abelian graded space that preserves 1, 2) no symmetry, 3) particle number symmetry, 4) spin-z component symmetry, and 5, 6) both particle-number and spin-z component symmetry.

source
QuantumLattices.QuantumNumbers.GradedMethod
Graded(spin::Spin)
+Graded{𝕊ᶻ ⊠ ℕ}(fock::Fock{:f})

Decompose a local fermionic Fock space into an Abelian graded space that preserves 1, 2) no symmetry, 3) particle number symmetry, 4) spin-z component symmetry, and 5, 6) both particle-number and spin-z component symmetry.

source
QuantumLattices.QuantumNumbers.GradedMethod
Graded(spin::Spin)
 Graded{ℤ₁}(spin::Spin)
-Graded{𝕊ᶻ}(spin::Spin)

Decompose a local spin space into an Abelian graded space that preserves 1, 2) no symmetry, and 3) spin-z component symmetry.

source
QuantumLattices.QuantumSystems.CoulombType
Coulomb(id::Symbol, value, bondkind, coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :))^2; ishermitian::Bool=true, amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Coulomb term.

Type alias for Term{:Coulomb, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.DMType
DM(
+Graded{𝕊ᶻ}(spin::Spin)

Decompose a local spin space into an Abelian graded space that preserves 1, 2) no symmetry, and 3) spin-z component symmetry.

source
QuantumLattices.QuantumSystems.CoulombType
Coulomb(id::Symbol, value, bondkind, coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :))^2; ishermitian::Bool=true, amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Coulomb term.

Type alias for Term{:Coulomb, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.DMType
DM(
     id::Symbol,
     value,
     bondkind,
@@ -23,9 +23,9 @@
     unit::Symbol=:degree,
     amplitude::Union{Function, Nothing}=nothing,
     ismodulatable::Bool=true
-)

DM term. Since DM term is antisymmetric on every bond, only the positive direction of a bond is needed. The negative direction of a bond can be handled automatically by this function.

Here, vectors specify the unit DM vector on every bond in the form [bond₁, bond₂, ...]=>v, where bondᵢ can be

  1. a Number specifying the azimuth angle of a bond in the 2-dimensional case, or
  2. a Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or
  3. an AbstractVector{<:Number} specifying the direction of a bond;

and v can be

  1. a Char of 'x', 'y' or 'z', indicating the unit DM vector on the set of bonds is along the x, y or z direction, or
  2. an AbstractVector{<:Number}, specifying the direction of the DM vector on the set of bonds.

Type alias for Term{:DM, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.ElasticType
Elastic(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Generic elastic energy of phonons.

Type alias for Term{:Elastic, id, V, B, C<:TermCoupling, A<:TermAmplitude}

source
QuantumLattices.QuantumSystems.FockIndexType
FockIndex{T, O<:Union{Int, Symbol, Colon}, S<:Union{Rational{Int}, Symbol, Colon}, N<:Union{Int, Symbol, Colon}} <: SimpleInternalIndex

Fock index, i.e., the internal index to specify the generators of a Fock space.

source
QuantumLattices.QuantumSystems.FockIndexMethod
FockIndex(orbital::Union{Int, Symbol, Colon}, spin::Union{Rational{Int}, Int, Symbol, Colon}, nambu::Union{Int, Symbol, Colon})
+)

DM term. Since DM term is antisymmetric on every bond, only the positive direction of a bond is needed. The negative direction of a bond can be handled automatically by this function.

Here, vectors specify the unit DM vector on every bond in the form [bond₁, bond₂, ...]=>v, where bondᵢ can be

  1. a Number specifying the azimuth angle of a bond in the 2-dimensional case, or
  2. a Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or
  3. an AbstractVector{<:Number} specifying the direction of a bond;

and v can be

  1. a Char of 'x', 'y' or 'z', indicating the unit DM vector on the set of bonds is along the x, y or z direction, or
  2. an AbstractVector{<:Number}, specifying the direction of the DM vector on the set of bonds.

Type alias for Term{:DM, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.ElasticType
Elastic(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Generic elastic energy of phonons.

Type alias for Term{:Elastic, id, V, B, C<:TermCoupling, A<:TermAmplitude}

source
QuantumLattices.QuantumSystems.FockIndexType
FockIndex{T, O<:Union{Int, Symbol, Colon}, S<:Union{Rational{Int}, Symbol, Colon}, N<:Union{Int, Symbol, Colon}} <: SimpleInternalIndex

Fock index, i.e., the internal index to specify the generators of a Fock space.

source
QuantumLattices.QuantumSystems.FockIndexMethod
FockIndex(orbital::Union{Int, Symbol, Colon}, spin::Union{Rational{Int}, Int, Symbol, Colon}, nambu::Union{Int, Symbol, Colon})
 FockIndex{T}(orbital::Union{Int, Symbol, Colon}, spin::Union{Rational{Int}, Int, Symbol, Colon}, nambu::Union{Int, Symbol, Colon}) where T
-FockIndex{T, O, S, N}(orbital::Union{Int, Symbol, Colon}, spin::Union{Rational{Int}, Symbol, Colon}, nambu::Union{Int, Symbol, Colon}) where {T, O, S, N}

Construct a Fock index.

source
QuantumLattices.QuantumSystems.HeisenbergType
Heisenberg(id::Symbol, value, bondkind; form::Symbol=Symbol("+-z"), amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Heisenberg term.

Type alias for Term{:Heisenberg, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.HookeType
Hooke(id::Symbol, value, bondkind; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Potential energy of phonons by the Hooke's law.

Type alias for Term{:Hooke, id, V, B, C<:TermCoupling, A<:TermAmplitude}

source
QuantumLattices.QuantumSystems.HoppingType
Hopping(id::Symbol, value, bondkind, coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :)); amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Hopping term.

Type alias for Term{:Hopping, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.HubbardType
Hubbard(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Hubbard term.

Type alias for Term{:Hubbard, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.InterOrbitalInterSpinType
InterOrbitalInterSpin(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Interorbital-interspin term.

Type alias for Term{:InterOrbitalInterSpin, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.InterOrbitalIntraSpinType
InterOrbitalIntraSpin(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Interorbital-intraspin term.

Type alias for Term{:InterOrbitalIntraSpin, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.IsingType
Ising(id::Symbol, value, bondkind, direction::Char; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Ising term.

Type alias for Term{:Ising, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.KineticType
Kinetic(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Kinetic energy of phonons.

Type alias for Term{:Kinetic, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.KitaevType
Kitaev(
+FockIndex{T, O, S, N}(orbital::Union{Int, Symbol, Colon}, spin::Union{Rational{Int}, Symbol, Colon}, nambu::Union{Int, Symbol, Colon}) where {T, O, S, N}

Construct a Fock index.

source
QuantumLattices.QuantumSystems.HeisenbergType
Heisenberg(id::Symbol, value, bondkind; form::Symbol=Symbol("+-z"), amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Heisenberg term.

Type alias for Term{:Heisenberg, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.HookeType
Hooke(id::Symbol, value, bondkind; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Potential energy of phonons by the Hooke's law.

Type alias for Term{:Hooke, id, V, B, C<:TermCoupling, A<:TermAmplitude}

source
QuantumLattices.QuantumSystems.HoppingType
Hopping(id::Symbol, value, bondkind, coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :)); amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Hopping term.

Type alias for Term{:Hopping, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.HubbardType
Hubbard(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Hubbard term.

Type alias for Term{:Hubbard, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.InterOrbitalInterSpinType
InterOrbitalInterSpin(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Interorbital-interspin term.

Type alias for Term{:InterOrbitalInterSpin, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.InterOrbitalIntraSpinType
InterOrbitalIntraSpin(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Interorbital-intraspin term.

Type alias for Term{:InterOrbitalIntraSpin, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.IsingType
Ising(id::Symbol, value, bondkind, direction::Char; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Ising term.

Type alias for Term{:Ising, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.KineticType
Kinetic(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Kinetic energy of phonons.

Type alias for Term{:Kinetic, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.KitaevType
Kitaev(
     id::Symbol, value, bondkind;
     x::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},
     y::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},
@@ -33,19 +33,19 @@
     unit::Symbol=:degree,
     amplitude::Union{Function, Nothing}=nothing,
     ismodulatable::Bool=true
-)

Kitaev term. Since Kitaev term is symmetric on every bond, only one direction of a bond is needed. The inverse direction of a bond can be handled automatically by this function.

Here, x, y and z assign the x-bonds, y-bonds, and z-bonds, respectively, with each kind of bond can be

  1. a Number specifying the azimuth angle of a bond in the 2-dimensional case, or
  2. a Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or
  3. an AbstractVector{<:Number} specifying the direction of a bond.

Type alias for Term{:Kitaev, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.OnsiteType
Onsite(id::Symbol, value, coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :)); ishermitian::Bool=true, amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Onsite term.

Type alias for Term{:Onsite, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.PairHoppingType
PairHopping(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Pair-hopping term.

Type alias for Term{:PairHopping, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.PairingType
Pairing(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Pairing term.

Type alias for Term{:Pairing, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.SingleIonAnisotropyType
SingleIonAnisotropy(id::Symbol, value, direction::Char; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)
-SingleIonAnisotropy(id::Symbol, value, matrix::AbstractMatrix{<:Number}; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Single ion anisotropy term.

Type alias for Term{:SingleIonAnisotropy, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.SpinFlipType
SpinFlip(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Spin-flip term.

Type alias for Term{:SpinFlip, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.SpinIndexMethod
SpinIndex(tag::Union{Char, Symbol, Colon})
+)

Kitaev term. Since Kitaev term is symmetric on every bond, only one direction of a bond is needed. The inverse direction of a bond can be handled automatically by this function.

Here, x, y and z assign the x-bonds, y-bonds, and z-bonds, respectively, with each kind of bond can be

  1. a Number specifying the azimuth angle of a bond in the 2-dimensional case, or
  2. a Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or
  3. an AbstractVector{<:Number} specifying the direction of a bond.

Type alias for Term{:Kitaev, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.OnsiteType
Onsite(id::Symbol, value, coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :)); ishermitian::Bool=true, amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Onsite term.

Type alias for Term{:Onsite, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.PairHoppingType
PairHopping(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Pair-hopping term.

Type alias for Term{:PairHopping, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.PairingType
Pairing(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Pairing term.

Type alias for Term{:Pairing, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.SingleIonAnisotropyType
SingleIonAnisotropy(id::Symbol, value, direction::Char; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)
+SingleIonAnisotropy(id::Symbol, value, matrix::AbstractMatrix{<:Number}; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Single ion anisotropy term.

Type alias for Term{:SingleIonAnisotropy, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.SpinFlipType
SpinFlip(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Spin-flip term.

Type alias for Term{:SpinFlip, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.SpinIndexMethod
SpinIndex(tag::Union{Char, Symbol, Colon})
 SpinIndex{S}(tag::Union{Char, Symbol, Colon}) where S
-SpinIndex{S, T}(tag::Union{Char, Symbol, Colon}) where {S, T}

Construct a spin index.

source
QuantumLattices.QuantumSystems.SpinTermType
SpinTerm(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Generic spin term.

Type alias for Term{:SpinTerm, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.SpinTermType
SpinTerm(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)

Generic spin term.

Type alias for Term{:SpinTerm, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.ZeemanType
Zeeman(
     id::Symbol, value, direction::Char, g::Number=1;
     amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true
 )
 Zeeman(
     id::Symbol, value, direction::Union{AbstractVector{<:Number}, Tuple{Number, Number}}, g::Union{Number, AbstractMatrix{<:Number}}=1;
     unit::Symbol=:degree, amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true
-)

Zeeman term.

Type alias for Term{:Zeeman, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.ΓType
Γ(
     id::Symbol, value, bondkind;
     x::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},
     y::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},
@@ -53,7 +53,7 @@
     unit::Symbol=:degree,
     amplitude::Union{Function, Nothing}=nothing,
     ismodulatable::Bool=true
-)

Γ Term. Since Γ term is symmetric on every bond, only one direction of a bond is needed. The inverse direction of a bond can be handled automatically by this function.

Here, x, y and z assign the x-bonds, y-bonds, and z-bonds, respectively, with each kind of bond can be

  1. a Number specifying the azimuth angle of a bond in the 2-dimensional case, or
  2. a Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or
  3. an AbstractVector{<:Number} specifying the direction of a bond.

Type alias for Term{:Γ, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.Γ′Type
Γ′(
+)

Γ Term. Since Γ term is symmetric on every bond, only one direction of a bond is needed. The inverse direction of a bond can be handled automatically by this function.

Here, x, y and z assign the x-bonds, y-bonds, and z-bonds, respectively, with each kind of bond can be

  1. a Number specifying the azimuth angle of a bond in the 2-dimensional case, or
  2. a Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or
  3. an AbstractVector{<:Number} specifying the direction of a bond.

Type alias for Term{:Γ, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.Γ′Type
Γ′(
     id::Symbol, value, bondkind;
     x::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},
     y::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},
@@ -61,64 +61,64 @@
     unit::Symbol=:degree,
     amplitude::Union{Function, Nothing}=nothing,
     ismodulatable::Bool=true
-)

Γ′ Term. Since Γ′ term is symmetric on every bond, only one direction of a bond is needed. The inverse direction of a bond can be handled automatically by this function.

Here, x, y and z assign the x-bonds, y-bonds, and z-bonds, respectively, with each bond can be

  1. a Number specifying the azimuth angle of a bond in the 2-dimensional case, or
  2. a Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or
  3. an AbstractVector{<:Number} specifying the direction of a bond.

Type alias for Term{:Γ′, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.𝕊Type
𝕊(tag) -> SpinIndex
+)

Γ′ Term. Since Γ′ term is symmetric on every bond, only one direction of a bond is needed. The inverse direction of a bond can be handled automatically by this function.

Here, x, y and z assign the x-bonds, y-bonds, and z-bonds, respectively, with each bond can be

  1. a Number specifying the azimuth angle of a bond in the 2-dimensional case, or
  2. a Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or
  3. an AbstractVector{<:Number} specifying the direction of a bond.

Type alias for Term{:Γ′, id, V, B, C<:TermCoupling, A<:TermAmplitude}.

source
QuantumLattices.QuantumSystems.𝕊Type
𝕊(tag) -> SpinIndex
 𝕊(site, tag) -> Index{<:SpinIndex}
 𝕊(site, tag, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:SpinIndex}}
 
 𝕊{S}(tag) where S -> SpinIndex{S}
 𝕊{S}(site, tag) where S -> Index{<:SpinIndex{S}}
-𝕊{S}(site, tag, rcoordinate, icoordinate) where S -> CoordinatedIndex{<:Index{<:SpinIndex{S}}}

Convenient construction of SpinIndex, Index{<:SpinIndex}, CoordinatedIndex{<:Index{<:SpinIndex}}.

source
QuantumLattices.QuantumSystems.@DM_strMacro
DM"x" => SparseMatrixCSC([0 0 0; 0 0 1; 0 -1 0])
+𝕊{S}(site, tag, rcoordinate, icoordinate) where S -> CoordinatedIndex{<:Index{<:SpinIndex{S}}}

Convenient construction of SpinIndex, Index{<:SpinIndex}, CoordinatedIndex{<:Index{<:SpinIndex}}.

source
QuantumLattices.QuantumSystems.@DM_strMacro
DM"x" => SparseMatrixCSC([0 0 0; 0 0 1; 0 -1 0])
 DM"y" => SparseMatrixCSC([0 0 -1; 0 0 0; 1 0 0])
-DM"z" => SparseMatrixCSC([0 1 0; -1 0 0; 0 0 0])

DM coupling matrix.

source
QuantumLattices.QuantumSystems.@L_strMacro
L"x" => SparseMatrixCSC([0 0 0; 0 0 1im; 0 -1im 0])
 L"y" => SparseMatrixCSC([0 0 -1im; 0 0 0; 1im 0 0])
-L"z" => SparseMatrixCSC([0 1im 0; -1im 0 0; 0 0 0])

Three-dimensional rotation generators.

source
QuantumLattices.QuantumSystems.@σ_strMacro
σ"0" => SparseMatrixCSC([1 0; 0 1])
 σ"x" => SparseMatrixCSC([0 1; 1 0])
 σ"y" => SparseMatrixCSC([0 -1im; 1im 0])
 σ"z" => SparseMatrixCSC([1 0; 0 -1])
 σ"+" => SparseMatrixCSC([0 1; 0 0])
 σ"-" => SparseMatrixCSC([0 0; 1 0])
 σ"11" => SparseMatrixCSC([1 0; 0 0])
-σ"22" => SparseMatrixCSC([0 0; 0 1])

Pauli matrix σ⁰, σˣ, σʸ, σᶻ, σ⁺, σ⁻, σ¹¹, σ²².

source
Base.angleMethod
angle(id::CoordinatedIndex{<:Index{<:FockIndex}}, vectors::AbstractVector{<:AbstractVector{<:Number}}, values::AbstractVector{<:Number}) -> Complex{<:Number}

Get the twist phase.

source
QuantumLattices.QuantumOperators.matrixMethod
matrix(index::SpinIndex{S, Char}, dtype::Type{<:Number}=Complex{Float}) where S -> Matrix{dtype}
+σ"22" => SparseMatrixCSC([0 0; 0 1])

Pauli matrix σ⁰, σˣ, σʸ, σᶻ, σ⁺, σ⁻, σ¹¹, σ²².

source
Base.angleMethod
angle(id::CoordinatedIndex{<:Index{<:FockIndex}}, vectors::AbstractVector{<:AbstractVector{<:Number}}, values::AbstractVector{<:Number}) -> Complex{<:Number}

Get the twist phase.

source
QuantumLattices.QuantumOperators.matrixMethod
matrix(index::SpinIndex{S, Char}, dtype::Type{<:Number}=Complex{Float}) where S -> Matrix{dtype}
 matrix(index::Index{<:SpinIndex}, dtype::Type{<:Number}=Complex{Float}) -> Matrix{dtype}
-matrix(index::CompositeIndex{<:Index{<:SpinIndex}}, dtype::Type{<:Number}=Complex{Float}) -> Matrix{dtype}

Get the matrix representation of an index acting on the local 𝕊ᶻ space.

source
QuantumLattices.QuantumOperators.scriptMethod
script(index::FockIndex, ::Val{:orbital}; kwargs...) -> String
+matrix(index::CompositeIndex{<:Index{<:SpinIndex}}, dtype::Type{<:Number}=Complex{Float}) -> Matrix{dtype}

Get the matrix representation of an index acting on the local 𝕊ᶻ space.

source
QuantumLattices.QuantumOperators.scriptMethod
script(index::FockIndex, ::Val{:orbital}; kwargs...) -> String
 script(index::FockIndex, ::Val{:spin}; kwargs...) -> String
 script(index::FockIndex, ::Val{:spinsym}; kwargs...) -> String
-script(index::FockIndex, ::Val{:nambu}; kwargs...) -> String

Get the requested script of a Fock index.

source
QuantumLattices.QuantumSystems.totalspinMethod
totalspin(::SpinIndex) -> Rational{Int}/Int/Colon
 totalspin(::Type{<:SpinIndex}) -> Rational{Int}/Int/Colon/Float64
 
 totalspin(::Index{<:SpinIndex}) -> Rational{Int}/Int/Colon
 totalspin(::Type{<:Index{<:SpinIndex}}) -> Rational{Int}/Int/Colon/Float64
 
 totalspin(::CompositeIndex{<:Index{<:SpinIndex}}) -> Rational{Int}/Int/Colon
-totalspin(::Type{<:CompositeIndex{<:Index{<:SpinIndex}}}) -> Rational{Int}/Int/Colon/Float64

Get the total spin.

source
QuantumLattices.QuantumSystems.𝕊ᵀ𝕊Method
𝕊ᵀ𝕊(sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::AbstractVector=SVector('x', 'y', 'z'), cols::AbstractVector=SVector('x', 'y', 'z')) -> MatrixCoupling

Construct a matrix coupling for spin system.

source
QuantumLattices.QuantumSystems.𝕓Function
𝕓(orbital, spin, nambu) -> FockIndex{:b}
+totalspin(::Type{<:CompositeIndex{<:Index{<:SpinIndex}}}) -> Rational{Int}/Int/Colon/Float64

Get the total spin.

source
QuantumLattices.QuantumSystems.𝕊ᵀ𝕊Method
𝕊ᵀ𝕊(sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::AbstractVector=SVector('x', 'y', 'z'), cols::AbstractVector=SVector('x', 'y', 'z')) -> MatrixCoupling

Construct a matrix coupling for spin system.

source
QuantumLattices.QuantumSystems.𝕓Function
𝕓(orbital, spin, nambu) -> FockIndex{:b}
 𝕓(site, orbital, spin, nambu) -> Index{<:FockIndex{:b}}
-𝕓(site, orbital, spin, nambu, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:FockIndex{:b}}}

Convenient construction of FockIndex{:b}, Index{<:FockIndex{:b}}, CoordinatedIndex{<:Index{<:FockIndex{:b}}}.

source
QuantumLattices.QuantumSystems.𝕕Function
𝕕(orbital, spin, nambu) -> FockIndex{:}
+𝕓(site, orbital, spin, nambu, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:FockIndex{:b}}}

Convenient construction of FockIndex{:b}, Index{<:FockIndex{:b}}, CoordinatedIndex{<:Index{<:FockIndex{:b}}}.

source
QuantumLattices.QuantumSystems.𝕕Function
𝕕(orbital, spin, nambu) -> FockIndex{:}
 𝕕(site, orbital, spin, nambu) -> Index{<:FockIndex{:}}
-𝕕(site, orbital, spin, nambu, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:FockIndex{:}}}

Convenient construction of FockIndex{:}, Index{<:FockIndex{:}}, CoordinatedIndex{<:Index{<:FockIndex{:}}}.

source
QuantumLattices.QuantumSystems.𝕗Function
𝕗(orbital, spin, nambu) -> FockIndex{:f}
+𝕕(site, orbital, spin, nambu, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:FockIndex{:}}}

Convenient construction of FockIndex{:}, Index{<:FockIndex{:}}, CoordinatedIndex{<:Index{<:FockIndex{:}}}.

source
QuantumLattices.QuantumSystems.𝕗Function
𝕗(orbital, spin, nambu) -> FockIndex{:f}
 𝕗(site, orbital, spin, nambu) -> Index{<:FockIndex{:f}}
-𝕗(site, orbital, spin, nambu, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:FockIndex{:f}}}

Convenient construction of FockIndex{:f}, Index{<:FockIndex{:f}}, CoordinatedIndex{<:Index{<:FockIndex{f}}}.

source
QuantumLattices.QuantumSystems.𝕗⁺𝕗Method
𝕗⁺𝕗(sites::Union{NTuple{2, Ordinal}, Colon}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon}) -> MatrixCoupling
+𝕗(site, orbital, spin, nambu, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:FockIndex{:f}}}

Convenient construction of FockIndex{:f}, Index{<:FockIndex{:f}}, CoordinatedIndex{<:Index{<:FockIndex{f}}}.

source
QuantumLattices.QuantumSystems.𝕗⁺𝕗Method
𝕗⁺𝕗(sites::Union{NTuple{2, Ordinal}, Colon}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon}) -> MatrixCoupling
 𝕓⁺𝕓(sites::Union{NTuple{2, Ordinal}, Colon}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon}) -> MatrixCoupling
-𝕕⁺𝕕(sites::Union{NTuple{2, Ordinal}, Colon}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon}) -> MatrixCoupling

Construct a matrix coupling for Fock systems.

source
QuantumLattices.QuantumSystems.𝕡Method
𝕡(direction) -> PhononIndex{:p}
+𝕕⁺𝕕(sites::Union{NTuple{2, Ordinal}, Colon}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon}) -> MatrixCoupling

Construct a matrix coupling for Fock systems.

source
QuantumLattices.QuantumSystems.𝕡Method
𝕡(direction) -> PhononIndex{:p}
 𝕡(site, direction) -> Index{<:PhononIndex{:p}}
-𝕡(site, direction, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:PhononIndex{:p}}}

Convenient construction of SpinIndex{:p}, Index{<:SpinIndex{:p}}, CoordinatedIndex{<:Index{<:SpinIndex{:p}}}.

source
QuantumLattices.QuantumSystems.𝕦Method
𝕦(direction) -> PhononIndex{:u}
+𝕡(site, direction, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:PhononIndex{:p}}}

Convenient construction of SpinIndex{:p}, Index{<:SpinIndex{:p}}, CoordinatedIndex{<:Index{<:SpinIndex{:p}}}.

source
QuantumLattices.QuantumSystems.𝕦Method
𝕦(direction) -> PhononIndex{:u}
 𝕦(site, direction) -> Index{<:PhononIndex{:u}}
-𝕦(site, direction, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:PhononIndex{:u}}}

Convenient construction of SpinIndex{:u}, Index{<:SpinIndex{:u}}, CoordinatedIndex{<:Index{<:SpinIndex{:u}}}.

source
QuantumLattices.QuantumSystems.𝕦ᵀ𝕦Method
𝕦ᵀ𝕦(sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::Union{AbstractVector, Nothing}=nothing, cols::Union{AbstractVector, Nothing}=nothing) -> MatrixCoupling

Construct a set of Couplings corresponding to the dynamical matrix of phonons.

source
QuantumLattices.expandMethod
expand(pnc::Coupling{<:Number, <:Pattern{<:InternalPattern{<:NTuple{2, PhononIndex{:u}}}}}, ::Val{:Hooke}, bond::Bond, hilbert::Hilbert) -> VectorSpace

Expand the default phonon potential coupling on a given bond.

source
QuantumLattices.kindMethod
kind(index::PhononIndex) -> Symbol
+𝕦(site, direction, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:PhononIndex{:u}}}

Convenient construction of SpinIndex{:u}, Index{<:SpinIndex{:u}}, CoordinatedIndex{<:Index{<:SpinIndex{:u}}}.

source
QuantumLattices.QuantumSystems.𝕦ᵀ𝕦Method
𝕦ᵀ𝕦(sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::Union{AbstractVector, Nothing}=nothing, cols::Union{AbstractVector, Nothing}=nothing) -> MatrixCoupling

Construct a set of Couplings corresponding to the dynamical matrix of phonons.

source
QuantumLattices.expandMethod
expand(pnc::Coupling{<:Number, <:Pattern{<:InternalPattern{<:NTuple{2, PhononIndex{:u}}}}}, ::Val{:Hooke}, bond::Bond, hilbert::Hilbert) -> VectorSpace

Expand the default phonon potential coupling on a given bond.

source
QuantumLattices.kindMethod
kind(index::PhononIndex) -> Symbol
 kind(::Type{<:PhononIndex{K}}) where K -> Symbol
 
 kind(index::Index{<:PhononIndex}) -> Symbol
 kind(::Type{<:Index{<:PhononIndex{K}}}) where K -> Symbol
 
 kind(index::CoordinatedIndex{<:Index{<:PhononIndex}}) -> Symbol
-kind(::Type{<:CoordinatedIndex{<:Index{<:PhononIndex{K}}}}) where K -> Symbol

Get the kind of a phonon index.

source
QuantumLattices.permuteMethod
permute(id₁::FockIndex, id₂::FockIndex) -> Tuple{Vararg{Operator}}

Permute two Fock indexes and get the result.

source
QuantumLattices.permuteMethod
permute(id₁::PhononIndex, id₂::PhononIndex) -> Tuple{Vararg{Operator}}

Permute two phonon indexes and get the result.

source
QuantumLattices.permuteMethod
permute(id₁::SpinIndex, id₂::SpinIndex) -> Tuple{Vararg{Operator}}

Permute two spin indexes and get the result.

source
+kind(::Type{<:CoordinatedIndex{<:Index{<:PhononIndex{K}}}}) where K -> Symbol

Get the kind of a phonon index.

source
QuantumLattices.permuteMethod
permute(id₁::FockIndex, id₂::FockIndex) -> Tuple{Vararg{Operator}}

Permute two Fock indexes and get the result.

source
QuantumLattices.permuteMethod
permute(id₁::PhononIndex, id₂::PhononIndex) -> Tuple{Vararg{Operator}}

Permute two phonon indexes and get the result.

source
QuantumLattices.permuteMethod
permute(id₁::SpinIndex, id₂::SpinIndex) -> Tuple{Vararg{Operator}}

Permute two spin indexes and get the result.

source
diff --git a/dev/man/Spatials/index.html b/dev/man/Spatials/index.html index fe2f40da..bcf803f5 100644 --- a/dev/man/Spatials/index.html +++ b/dev/man/Spatials/index.html @@ -4,19 +4,19 @@ gtag('js', new Date()); gtag('config', 'UA-89508993-1', {'page_path': location.pathname + location.search + location.hash});

Spatials

QuantumLattices.Spatials.heatmapConstant
@recipe plot(reciprocalspace::BrillouinZone, data::AbstractMatrix{<:Number})
-@recipe plot(reciprocalspace::ReciprocalZone, data::AbstractMatrix{<:Number})

Define the recipe for the heatmap visualization of data on a Brillouin/reciprocal zone.

source
QuantumLattices.Spatials.lineConstant
@recipe plot(path::ReciprocalPath, data::AbstractVector{<:Number})
-@recipe plot(path::ReciprocalPath, data::AbstractMatrix{<:Number})

Define the recipe for the line visualization of data along a reciprocal path.

source
QuantumLattices.QuantumNumbers.𝕂²Method
𝕂²{N₁, N₂}(momentum::AbstractVector{<:Number}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}; atol=atol, rtol=rtol) where {N₁, N₂}

Construct a 2d quantum momentum by the coordinates.

source
QuantumLattices.QuantumNumbers.𝕂³Method
𝕂³{N₁, N₂, N₃}(momentum::AbstractVector{<:Number}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}; atol=atol, rtol=rtol) where {N₁, N₂, N₃}

Construct a 3d quantum momentum by the coordinates.

source
QuantumLattices.QuantumNumbers.𝕂¹Method
𝕂¹{N}(momentum::AbstractVector{<:Number}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}; atol=atol, rtol=rtol) where N

Construct a 1d quantum momentum by the coordinates.

source
QuantumLattices.Spatials.AbstractLatticeType
AbstractLattice{N, D<:Number, M}

Abstract type of a unitcell-described lattice.

It should have the following contents:

  • name::Symbol: the name of the lattice
  • coordinates::Matrix{D}: the coordinates of the lattice
  • vectors::SVector{M, SVector{N, D}}: the translation vectors of the lattice
source
QuantumLattices.Spatials.BrillouinZoneMethod
BrillouinZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, nk)
+@recipe plot(reciprocalspace::ReciprocalZone, data::AbstractMatrix{<:Number})

Define the recipe for the heatmap visualization of data on a Brillouin/reciprocal zone.

source
QuantumLattices.Spatials.lineConstant
@recipe plot(path::ReciprocalPath, data::AbstractVector{<:Number})
+@recipe plot(path::ReciprocalPath, data::AbstractMatrix{<:Number})

Define the recipe for the line visualization of data along a reciprocal path.

source
QuantumLattices.QuantumNumbers.𝕂²Method
𝕂²{N₁, N₂}(momentum::AbstractVector{<:Number}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}; atol=atol, rtol=rtol) where {N₁, N₂}

Construct a 2d quantum momentum by the coordinates.

source
QuantumLattices.QuantumNumbers.𝕂³Method
𝕂³{N₁, N₂, N₃}(momentum::AbstractVector{<:Number}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}; atol=atol, rtol=rtol) where {N₁, N₂, N₃}

Construct a 3d quantum momentum by the coordinates.

source
QuantumLattices.QuantumNumbers.𝕂¹Method
𝕂¹{N}(momentum::AbstractVector{<:Number}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}; atol=atol, rtol=rtol) where N

Construct a 1d quantum momentum by the coordinates.

source
QuantumLattices.Spatials.AbstractLatticeType
AbstractLattice{N, D<:Number, M}

Abstract type of a unitcell-described lattice.

It should have the following contents:

  • name::Symbol: the name of the lattice
  • coordinates::Matrix{D}: the coordinates of the lattice
  • vectors::SVector{M, SVector{N, D}}: the translation vectors of the lattice
source
QuantumLattices.Spatials.BrillouinZoneMethod
BrillouinZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, nk)
 BrillouinZone{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, nk) where K
 BrillouinZone(::Type{P}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}) where {P<:𝕂}
-BrillouinZone{K}(::Type{P}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}) where {K, P<:𝕂}

Construct a Brillouin zone.

source
QuantumLattices.Spatials.LatticeType
Lattice{N, D<:Number, M} <: AbstractLattice{N, D, M}

Simplest lattice.

A simplest lattice can be constructed from its coordinates and translation vectors.

source
QuantumLattices.Spatials.LatticeMethod
Lattice(lattice::AbstractLattice, ranges::NTuple{N, Int}, boundaries::NTuple{N, Union{Char, String, Symbol}}=ntuple(i->'O', Val(N)); mode::Symbol=:nonnegative) where N
-Lattice(lattice::AbstractLattice, ranges::NTuple{N, UnitRange{Int}}, boundaries::NTuple{N, Union{Char, String, Symbol}}=ntuple(i->'O', Val(N))) where N

Construct a lattice from the translations of another.

source
QuantumLattices.Spatials.LatticeMethod
Lattice(coordinates::NTuple{N, Number}...; name::Symbol=:lattice, vectors::Union{AbstractVector{<:AbstractVector{<:Number}}, Nothing}=nothing) where N
-Lattice(coordinates::AbstractVector{<:Number}...; name::Symbol=:lattice, vectors::Union{AbstractVector{<:AbstractVector{<:Number}}, Nothing}=nothing)

Construct a lattice.

source
QuantumLattices.Spatials.NeighborsMethod
Neighbors(lattice::AbstractLattice, nneighbor::Integer; coordination::Integer=12)

Get the neighbor vs. bond length map of a lattice up to the nneighborth order.

source
QuantumLattices.Spatials.PointMethod
Point(site::Integer, rcoordinate::SVector{N, D}, icoordinate::SVector{N, D}) where {N, D<:Number}
+BrillouinZone{K}(::Type{P}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}) where {K, P<:𝕂}

Construct a Brillouin zone.

source
QuantumLattices.Spatials.LatticeType
Lattice{N, D<:Number, M} <: AbstractLattice{N, D, M}

Simplest lattice.

A simplest lattice can be constructed from its coordinates and translation vectors.

source
QuantumLattices.Spatials.LatticeMethod
Lattice(lattice::AbstractLattice, ranges::NTuple{N, Int}, boundaries::NTuple{N, Union{Char, String, Symbol}}=ntuple(i->'O', Val(N)); mode::Symbol=:nonnegative) where N
+Lattice(lattice::AbstractLattice, ranges::NTuple{N, UnitRange{Int}}, boundaries::NTuple{N, Union{Char, String, Symbol}}=ntuple(i->'O', Val(N))) where N

Construct a lattice from the translations of another.

source
QuantumLattices.Spatials.LatticeMethod
Lattice(coordinates::NTuple{N, Number}...; name::Symbol=:lattice, vectors::Union{AbstractVector{<:AbstractVector{<:Number}}, Nothing}=nothing) where N
+Lattice(coordinates::AbstractVector{<:Number}...; name::Symbol=:lattice, vectors::Union{AbstractVector{<:AbstractVector{<:Number}}, Nothing}=nothing)

Construct a lattice.

source
QuantumLattices.Spatials.NeighborsMethod
Neighbors(lattice::AbstractLattice, nneighbor::Integer; coordination::Integer=12)

Get the neighbor vs. bond length map of a lattice up to the nneighborth order.

source
QuantumLattices.Spatials.PointMethod
Point(site::Integer, rcoordinate::SVector{N, D}, icoordinate::SVector{N, D}) where {N, D<:Number}
 Point(site::Integer, rcoordinate::NTuple{N, <:Number}, icoordinate::NTuple{N, <:Number}=ntuple(i->0, Val(N))) where N
-Point(site::Integer, rcoordinate::AbstractVector{<:Number}, icoordinate::AbstractVector{<:Number}=zero(SVector{length(rcoordinate), Int}))

Construct a labeled point.

source
QuantumLattices.Spatials.ReciprocalCurveMethod
ReciprocalCurve(curve::AbstractVector{<:NTuple{N, Number}}) where N
+Point(site::Integer, rcoordinate::AbstractVector{<:Number}, icoordinate::AbstractVector{<:Number}=zero(SVector{length(rcoordinate), Int}))

Construct a labeled point.

source
QuantumLattices.Spatials.ReciprocalCurveMethod
ReciprocalCurve(curve::AbstractVector{<:NTuple{N, Number}}) where N
 ReciprocalCurve(curve::AbstractVector{<:AbstractVector{<:Number}})
 ReciprocalCurve{K}(curve::AbstractVector{<:NTuple{N, Number}}) where {K, N}
-ReciprocalCurve{K}(curve::AbstractVector{<:AbstractVector{<:Number}}) where K

Construct a curve in the reciprocal space.

source
QuantumLattices.Spatials.ReciprocalPathMethod
ReciprocalPath(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, contents::NamedTuple{(:points, :labels), <:Tuple{<:Tuple, <:Tuple}}; length=100, ends=nothing)
+ReciprocalCurve{K}(curve::AbstractVector{<:AbstractVector{<:Number}}) where K

Construct a curve in the reciprocal space.

source
QuantumLattices.Spatials.ReciprocalPathMethod
ReciprocalPath(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, contents::NamedTuple{(:points, :labels), <:Tuple{<:Tuple, <:Tuple}}; length=100, ends=nothing)
 ReciprocalPath{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, contents::NamedTuple{(:points, :labels), <:Tuple{<:Tuple, <:Tuple}}; length=100, ends=nothing) where K
 
 ReciprocalPath(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, points::NTuple{N, Number}...; labels=points, length=100, ends=nothing) where N
@@ -27,7 +27,7 @@
 ReciprocalPath(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, segments::Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}...; labels=segments, length=100, ends=nothing) where N
 ReciprocalPath(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, segments::Tuple{Vararg{Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}}}; labels=segments, length=100, ends=nothing) where N
 ReciprocalPath{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, segments::Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}...; labels=segments, length=100, ends=nothing) where {K, N}
-ReciprocalPath{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, segments::Tuple{Vararg{Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}}}; labels=segments, length=100, ends=nothing) where {K, N}

Construct a path in the reciprocal space.

Note
  1. For connected segments,

    • when length is an integer, it specifies the length of each segment except for the last whose length will be length+1;
    • when ends is nothing, the start point will be included while the end point will be not for each segment except for the last both points of which will be included.
  2. For disconnected segments, they can be partitioned into several connected parts, and the rules for connected segments apply for each of such connected parts.

With the above rules, all the points along the assigned path will be counted once and only once with the largest homogeneity.

source
QuantumLattices.Spatials.ReciprocalZoneMethod
ReciprocalZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}; length=100, ends=(true, false))
+ReciprocalPath{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, segments::Tuple{Vararg{Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}}}; labels=segments, length=100, ends=nothing) where {K, N}

Construct a path in the reciprocal space.

Note
  1. For connected segments,

    • when length is an integer, it specifies the length of each segment except for the last whose length will be length+1;
    • when ends is nothing, the start point will be included while the end point will be not for each segment except for the last both points of which will be included.
  2. For disconnected segments, they can be partitioned into several connected parts, and the rules for connected segments apply for each of such connected parts.

With the above rules, all the points along the assigned path will be counted once and only once with the largest homogeneity.

source
QuantumLattices.Spatials.ReciprocalZoneMethod
ReciprocalZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}; length=100, ends=(true, false))
 ReciprocalZone{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}; length=100, ends=(true, false)) where K
 
 ReciprocalZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::Pair{<:Number, <:Number}...; length=100, ends=(true, false))
@@ -37,43 +37,43 @@
 ReciprocalZone{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::AbstractVector{<:Pair{<:Number, <:Number}}; length=100, ends=(true, false)) where K
 
 ReciprocalZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::Tuple{Vararg{Pair{<:Number, <:Number}}}; length=100, ends=(true, false))
-ReciprocalZone{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::Tuple{Vararg{Pair{<:Number, <:Number}}}; length=100, ends=(true, false)) where K

Construct a rectangular zone in the reciprocal space.

source
QuantumLattices.Spatials.@hexagon_strMacro
hexagon"P₁-P₂-P₃-..."
+ReciprocalZone{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::Tuple{Vararg{Pair{<:Number, <:Number}}}; length=100, ends=(true, false)) where K

Construct a rectangular zone in the reciprocal space.

source
QuantumLattices.Spatials.@hexagon_strMacro
hexagon"P₁-P₂-P₃-..."
 hexagon"P₁-P₂-P₃-..., 120°"
-hexagon"P₁-P₂-P₃-..., 60°"

Construct a tuple of start-stop point pairs for the hexagonal reciprocal space.

source
Base.eltypeMethod
eltype(bond::Bond)
-eltype(::Type{<:Bond{K, P} where K}) where {P<:Point}

Get the point type contained in a generic bond.

source
Base.getindexMethod
getindex(lattice::AbstractLattice, i::Integer) -> SVector

Get the ith coordinate.

source
Base.getindexMethod
getindex(bond::Bond, i::Integer) -> Point

Get the ith point contained in a generic bond.

source
Base.iterateFunction
iterate(bond::Bond, state=1)

Iterate over the points contained in a generic bond.

source
Base.lengthMethod
length(lattice::AbstractLattice) -> Int

Get the number of points contained in a lattice.

source
Base.lengthMethod
length(bond::Bond) -> Int

Get the number of points contained in a generic bond.

source
Base.stepMethod
step(path::ReciprocalPath, i::Integer) -> scalartype(path)

Get the step between the ith and the (i+1)th points in the path.

source
QuantumLattices.Spatials.bonds!Method
bonds!(bonds::Vector, lattice::AbstractLattice, nneighbor::Integer; coordination::Integer=12)
-bonds!(bonds::Vector, lattice::AbstractLattice, neighbors::Neighbors) -> typeof(bonds)

Get the required bonds of a lattice and append them to the input bonds.

source
QuantumLattices.Spatials.bondsMethod
bonds(lattice::AbstractLattice, nneighbor::Integer; coordination::Integer=12) -> Vector{Bond{Int, Point{dimension(lattice), scalartype(lattice)}}}
-bonds(lattice::AbstractLattice, neighbors::Neighbors) -> Vector{Bond{keytype(neighbors), Point{dimension(lattice), scalartype(lattice)}}}

Get the required bonds of a lattice.

source
QuantumLattices.Spatials.directionMethod
direction(v::Char, args...) -> SVector{3, <:Number}
+hexagon"P₁-P₂-P₃-..., 60°"

Construct a tuple of start-stop point pairs for the hexagonal reciprocal space.

source
Base.eltypeMethod
eltype(bond::Bond)
+eltype(::Type{<:Bond{K, P} where K}) where {P<:Point}

Get the point type contained in a generic bond.

source
Base.getindexMethod
getindex(lattice::AbstractLattice, i::Integer) -> SVector

Get the ith coordinate.

source
Base.getindexMethod
getindex(bond::Bond, i::Integer) -> Point

Get the ith point contained in a generic bond.

source
Base.iterateFunction
iterate(bond::Bond, state=1)

Iterate over the points contained in a generic bond.

source
Base.lengthMethod
length(lattice::AbstractLattice) -> Int

Get the number of points contained in a lattice.

source
Base.lengthMethod
length(bond::Bond) -> Int

Get the number of points contained in a generic bond.

source
Base.stepMethod
step(path::ReciprocalPath, i::Integer) -> scalartype(path)

Get the step between the ith and the (i+1)th points in the path.

source
QuantumLattices.Spatials.bonds!Method
bonds!(bonds::Vector, lattice::AbstractLattice, nneighbor::Integer; coordination::Integer=12)
+bonds!(bonds::Vector, lattice::AbstractLattice, neighbors::Neighbors) -> typeof(bonds)

Get the required bonds of a lattice and append them to the input bonds.

source
QuantumLattices.Spatials.bondsMethod
bonds(lattice::AbstractLattice, nneighbor::Integer; coordination::Integer=12) -> Vector{Bond{Int, Point{dimension(lattice), scalartype(lattice)}}}
+bonds(lattice::AbstractLattice, neighbors::Neighbors) -> Vector{Bond{keytype(neighbors), Point{dimension(lattice), scalartype(lattice)}}}

Get the required bonds of a lattice.

source
QuantumLattices.Spatials.directionMethod
direction(v::Char, args...) -> SVector{3, <:Number}
 direction(v::Number, unit::Symbol) -> SVector{2, <:Number}
 direction(v::Tuple{Number, Number}, unit::Symbol) -> SVector{3, <:Number}
-direction(v::AbstractVector{<:Number}, args...) -> AbstractVector{<:Number}

Get the unit vector that specifies the direction of a vector.

source
QuantumLattices.Spatials.distanceMethod
distance(p₁::AbstractVector{<:Number}, p₂::AbstractVector{<:Number}) -> Number

Get the distance between two points.

Note

Compared to norm(p₁-p₂), this function avoids the memory allocation for p₁-p₂, thus is more efficient.

source
QuantumLattices.Spatials.distanceMethod
distance(path::ReciprocalPath) -> scalartype(path)
+direction(v::AbstractVector{<:Number}, args...) -> AbstractVector{<:Number}

Get the unit vector that specifies the direction of a vector.

source
QuantumLattices.Spatials.distanceMethod
distance(p₁::AbstractVector{<:Number}, p₂::AbstractVector{<:Number}) -> Number

Get the distance between two points.

Note

Compared to norm(p₁-p₂), this function avoids the memory allocation for p₁-p₂, thus is more efficient.

source
QuantumLattices.Spatials.distanceMethod
distance(path::ReciprocalPath) -> scalartype(path)
 distance(path::ReciprocalPath, i::Integer) -> scalartype(path)
-distance(path::ReciprocalPath, i::Integer, j::Integer) -> scalartype(path)

Get the distance

  1. of the total path,
  2. from the start point to the ith point in the path,
  3. from the ith point to the jth point in the path (when i is greater than j, the value is negative).
source
QuantumLattices.Spatials.interlinksMethod
interlinks(cluster₁::AbstractMatrix{<:Number}, cluster₂::AbstractMatrix{<:Number}, neighbors::Neighbors) -> Vector{Tuple{Int, Int, Int}}

Use kdtree to get the intercluster nearest neighbors.

source
QuantumLattices.Spatials.isintratriangleMethod
isintratriangle(
+distance(path::ReciprocalPath, i::Integer, j::Integer) -> scalartype(path)

Get the distance

  1. of the total path,
  2. from the start point to the ith point in the path,
  3. from the ith point to the jth point in the path (when i is greater than j, the value is negative).
source
QuantumLattices.Spatials.interlinksMethod
interlinks(cluster₁::AbstractMatrix{<:Number}, cluster₂::AbstractMatrix{<:Number}, neighbors::Neighbors) -> Vector{Tuple{Int, Int, Int}}

Use kdtree to get the intercluster nearest neighbors.

source
QuantumLattices.Spatials.isintratriangleMethod
isintratriangle(
     p::AbstractVector{<:Number}, p₁::AbstractVector{<:Number}, p₂::AbstractVector{<:Number}, p₃::AbstractVector{<:Number};
     vertexes::NTuple{3, Bool}=(true, true, true), edges::NTuple{3, Bool}=(true, true, true), atol::Real=atol, rtol::Real=rtol
-) -> Bool

Judge whether a point belongs to the interior of a triangle whose vertexes are p₁, 'p₂' and p₃ with the give tolerance. vertexes and edges define whether the interior should contain the vertexes or edges, respectively.

Note
  1. The vertexes are in the order (p₁, p₂, p₃) and the edges are in the order (p₁p₂, p₂p₃, p₃p₁).
  2. The edges do not contain the vertexes.
source
QuantumLattices.Spatials.isonlineMethod
isonline(
+) -> Bool

Judge whether a point belongs to the interior of a triangle whose vertexes are p₁, 'p₂' and p₃ with the give tolerance. vertexes and edges define whether the interior should contain the vertexes or edges, respectively.

Note
  1. The vertexes are in the order (p₁, p₂, p₃) and the edges are in the order (p₁p₂, p₂p₃, p₃p₁).
  2. The edges do not contain the vertexes.
source
QuantumLattices.Spatials.isonlineMethod
isonline(
     p::AbstractVector{<:Number}, p₁::AbstractVector{<:Number}, p₂::AbstractVector{<:Number};
     ends::Tuple{Bool, Bool}=(true, true), atol::Real=atol, rtol::Real=rtol
-) -> Bool

Judge whether a point is on a line segment whose end points are p₁ and p₂ with the given tolerance. ends defines whether the line segment should contain its ends.

source
QuantumLattices.Spatials.isparallelMethod
isparallel(v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}; atol::Real=atol, rtol::Real=rtol) -> Int

Judge whether two vectors are parallel to each other with the given tolerance, 0 for not parallel, 1 for parallel and -1 for antiparallel.

source
QuantumLattices.Spatials.issubordinateMethod
issubordinate(coordinate::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}; atol::Real=atol, rtol::Real=rtol) -> Bool

Judge whether a coordinate belongs to a lattice defined by vectors with the given tolerance.

source
QuantumLattices.Spatials.minimumlengthsFunction
minimumlengths(cluster::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, nneighbor::Integer=1; coordination::Integer=12) -> Vector{Float}
-minimumlengths(cluster::AbstractMatrix{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, nneighbor::Integer=1; coordination::Integer=12) -> Vector{Float}

Use kdtree to search the lowest several minimum bond lengths within a lattice translated by a cluster.

When the translation vectors are not empty, the lattice will be considered periodic in the corresponding directions. Otherwise the lattice will be open in all directions. To search for the bonds across the periodic boundaries, the cluster will be pre-translated to become a supercluster, which has open boundaries but is large enough to contain all the nearest neighbors within the required order. The coordination parameter sets the average number of each order of nearest neighbors. If it is to small, larger bond lengths may not be searched, and the result will contain Inf. This is a sign that you may need a larger coordination. Another situation that Inf appears in the result occurs when the minimum lengths are searched in open lattices. Indeed, the cluster may be too small so that the required order just goes beyond it. In this case the warning message can be safely ignored.

source
QuantumLattices.Spatials.rotateMethod
rotate(vector::AbstractVector{<:Number}, angle::Number; axis::Tuple{Union{AbstractVector{<:Number}, Nothing}, Tuple{<:Number, <:Number}}=(nothing, (0, 0))) -> AbstractVector{<:Number}
-rotate(cluster::AbstractMatrix{<:Number}, angle::Number; axis::Tuple{Union{AbstractVector{<:Number}, Nothing}, Tuple{<:Number, <:Number}}=(nothing, (0, 0))) -> AbstractMatrix{<:Number}

Get a rotated vector/cluster of the original one by a certain angle around an axis.

The axis is determined by a point it gets through (nothing can be used to denote the origin), and its polar as well as azimuth angles in radians. The default axis is the z axis.

Note
  1. The result is given by the Rodrigues' rotation formula.
  2. Only 2 and 3 dimensional vectors can be rotated.
  3. When the input vectors are 2 dimensional, both the polar and azimuth of the axis must be 0.
source
QuantumLattices.Spatials.saveMethod
save(filename::AbstractString, path::ReciprocalPath, data::Union{AbstractVector{<:Number}, AbstractMatrix{<:Number}})
+) -> Bool

Judge whether a point is on a line segment whose end points are p₁ and p₂ with the given tolerance. ends defines whether the line segment should contain its ends.

source
QuantumLattices.Spatials.isparallelMethod
isparallel(v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}; atol::Real=atol, rtol::Real=rtol) -> Int

Judge whether two vectors are parallel to each other with the given tolerance, 0 for not parallel, 1 for parallel and -1 for antiparallel.

source
QuantumLattices.Spatials.issubordinateMethod
issubordinate(coordinate::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}; atol::Real=atol, rtol::Real=rtol) -> Bool

Judge whether a coordinate belongs to a lattice defined by vectors with the given tolerance.

source
QuantumLattices.Spatials.minimumlengthsFunction
minimumlengths(cluster::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, nneighbor::Integer=1; coordination::Integer=12) -> Vector{Float}
+minimumlengths(cluster::AbstractMatrix{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, nneighbor::Integer=1; coordination::Integer=12) -> Vector{Float}

Use kdtree to search the lowest several minimum bond lengths within a lattice translated by a cluster.

When the translation vectors are not empty, the lattice will be considered periodic in the corresponding directions. Otherwise the lattice will be open in all directions. To search for the bonds across the periodic boundaries, the cluster will be pre-translated to become a supercluster, which has open boundaries but is large enough to contain all the nearest neighbors within the required order. The coordination parameter sets the average number of each order of nearest neighbors. If it is to small, larger bond lengths may not be searched, and the result will contain Inf. This is a sign that you may need a larger coordination. Another situation that Inf appears in the result occurs when the minimum lengths are searched in open lattices. Indeed, the cluster may be too small so that the required order just goes beyond it. In this case the warning message can be safely ignored.

source
QuantumLattices.Spatials.rotateMethod
rotate(vector::AbstractVector{<:Number}, angle::Number; axis::Tuple{Union{AbstractVector{<:Number}, Nothing}, Tuple{<:Number, <:Number}}=(nothing, (0, 0))) -> AbstractVector{<:Number}
+rotate(cluster::AbstractMatrix{<:Number}, angle::Number; axis::Tuple{Union{AbstractVector{<:Number}, Nothing}, Tuple{<:Number, <:Number}}=(nothing, (0, 0))) -> AbstractMatrix{<:Number}

Get a rotated vector/cluster of the original one by a certain angle around an axis.

The axis is determined by a point it gets through (nothing can be used to denote the origin), and its polar as well as azimuth angles in radians. The default axis is the z axis.

Note
  1. The result is given by the Rodrigues' rotation formula.
  2. Only 2 and 3 dimensional vectors can be rotated.
  3. When the input vectors are 2 dimensional, both the polar and azimuth of the axis must be 0.
source
QuantumLattices.Spatials.saveMethod
save(filename::AbstractString, path::ReciprocalPath, data::Union{AbstractVector{<:Number}, AbstractMatrix{<:Number}})
 save(filename::AbstractString, path::ReciprocalPath, y::AbstractVector{<:Number}, data::Union{AbstractMatrix{<:Number}, AbstractArray{<:Number, 3}})
-save(filename::AbstractString, reciprocalspace::Union{BrillouinZone, ReciprocalZone}, data::Union{AbstractMatrix{<:Number}, AbstractArray{<:Number, 3}})

Save data to delimited files.

source
QuantumLattices.Spatials.selectpathMethod
selectpath(brillouinzone::BrillouinZone, contents::NamedTuple{(:points, :labels), <:Tuple{<:Tuple, <:Tuple}}; ends=nothing, atol::Real=atol, rtol::Real=rtol) -> Tuple(ReciprocalPath, Vector{Int})
+save(filename::AbstractString, reciprocalspace::Union{BrillouinZone, ReciprocalZone}, data::Union{AbstractMatrix{<:Number}, AbstractArray{<:Number, 3}})

Save data to delimited files.

source
QuantumLattices.Spatials.selectpathMethod
selectpath(brillouinzone::BrillouinZone, contents::NamedTuple{(:points, :labels), <:Tuple{<:Tuple, <:Tuple}}; ends=nothing, atol::Real=atol, rtol::Real=rtol) -> Tuple(ReciprocalPath, Vector{Int})
 selectpath(brillouinzone::BrillouinZone, points::NTuple{N, Number}...; labels=points, ends=nothing, atol::Real=atol, rtol::Real=rtol) where N -> Tuple(ReciprocalPath, Vector{Int})
 selectpath(brillouinzone::BrillouinZone, points::Tuple{Vararg{NTuple{N, Number}}}; labels=points, ends=nothing, atol::Real=atol, rtol::Real=rtol) where N -> Tuple(ReciprocalPath, Vector{Int})
 selectpath(brillouinzone::BrillouinZone, segments::Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}...; labels=segments, ends=nothing, atol::Real=atol, rtol::Real=rtol) where N -> Tuple(ReciprocalPath, Vector{Int})
-selectpath(brillouinzone::BrillouinZone, segments::Tuple{Vararg{Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}}}; labels=segments, ends=nothing, atol::Real=atol, rtol::Real=rtol) where N -> Tuple(ReciprocalPath, Vector{Int})

Select a path from a BrillouinZone. Return a ReciprocalPath and the positions of the equivalent points in the BrillouinZone.

Note
  1. For connected segments, the start point will be included while the stop point will be not for each segment except for the last both points of which will be included if ends is nothing.
  2. For disconnected segments, they can be partitioned into several connected parts, and the rule for connected segments applies for each of such connected parts.

With the above rules, all the points along the assigned path will be counted once and only once.

source
QuantumLattices.Spatials.setupMethod
@recipe plot(path::ReciprocalPath, y::AbstractVector{<:Number}, data::AbstractArray{<:Number, 3}; subtitles=nothing, subtitlefontsize=8, nrow=nothing, ncol=nothing, clims=nothing)
+selectpath(brillouinzone::BrillouinZone, segments::Tuple{Vararg{Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}}}; labels=segments, ends=nothing, atol::Real=atol, rtol::Real=rtol) where N -> Tuple(ReciprocalPath, Vector{Int})

Select a path from a BrillouinZone. Return a ReciprocalPath and the positions of the equivalent points in the BrillouinZone.

Note
  1. For connected segments, the start point will be included while the stop point will be not for each segment except for the last both points of which will be included if ends is nothing.
  2. For disconnected segments, they can be partitioned into several connected parts, and the rule for connected segments applies for each of such connected parts.

With the above rules, all the points along the assigned path will be counted once and only once.

source
QuantumLattices.Spatials.setupMethod
@recipe plot(path::ReciprocalPath, y::AbstractVector{<:Number}, data::AbstractArray{<:Number, 3}; subtitles=nothing, subtitlefontsize=8, nrow=nothing, ncol=nothing, clims=nothing)
 @recipe plot(reciprocalspace::BrillouinZone, data::AbstractArray{<:Number, 3}; subtitles=nothing, subtitlefontsize=8, nrow=nothing, ncol=nothing, clims=nothing)
-@recipe plot(reciprocalspace::ReciprocalZone, data::AbstractArray{<:Number, 3}; subtitles=nothing, subtitlefontsize=8, nrow=nothing, ncol=nothing, clims=nothing)

Define the recipe for the heatmap visualization of a series of data on

  1. the x-y plain with the x axis being a reciprocal path,
  2. a Brillouin zone,
  3. a reciprocal zone.
source
QuantumLattices.Spatials.shrinkMethod
shrink(reciprocalzone::ReciprocalZone{K}, ranges::Vararg{OrdinalRange{<:Integer}, N}) where {K, N} -> ReciprocalZone

Shrink a reciprocal zone.

source
QuantumLattices.Spatials.tileMethod
tile(cluster::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, translations) -> AbstractMatrix{<:Number}
-tile(cluster::AbstractMatrix{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, translations) -> AbstractMatrix{<:Number}

Tile a supercluster by translations of the input cluster.

Basically, the final supercluster is composed of several parts, each of which is a translation of the original cluster, with the translation vectors specified by vectors and each set of the translation indices contained in translations. When translation vectors are empty, a copy of the original cluster will be returned.

source
QuantumLattices.Spatials.translateMethod
translate(cluster::AbstractVector{<:Number}, vector::AbstractVector{<:Number}) -> AbstractVector{<:Number}
-translate(cluster::AbstractMatrix{<:Number}, vector::AbstractVector{<:Number}) -> AbstractMatrix{<:Number}

Get the translated cluster of the original one by a vector.

source
QuantumLattices.Spatials.volumeMethod
volume(vectors::AbstractVector{<:AbstractVector{<:Number}}) -> Number
+@recipe plot(reciprocalspace::ReciprocalZone, data::AbstractArray{<:Number, 3}; subtitles=nothing, subtitlefontsize=8, nrow=nothing, ncol=nothing, clims=nothing)

Define the recipe for the heatmap visualization of a series of data on

  1. the x-y plain with the x axis being a reciprocal path,
  2. a Brillouin zone,
  3. a reciprocal zone.
source
QuantumLattices.Spatials.shrinkMethod
shrink(reciprocalzone::ReciprocalZone{K}, ranges::Vararg{OrdinalRange{<:Integer}, N}) where {K, N} -> ReciprocalZone

Shrink a reciprocal zone.

source
QuantumLattices.Spatials.tileMethod
tile(cluster::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, translations) -> AbstractMatrix{<:Number}
+tile(cluster::AbstractMatrix{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, translations) -> AbstractMatrix{<:Number}

Tile a supercluster by translations of the input cluster.

Basically, the final supercluster is composed of several parts, each of which is a translation of the original cluster, with the translation vectors specified by vectors and each set of the translation indices contained in translations. When translation vectors are empty, a copy of the original cluster will be returned.

source
QuantumLattices.Spatials.translateMethod
translate(cluster::AbstractVector{<:Number}, vector::AbstractVector{<:Number}) -> AbstractVector{<:Number}
+translate(cluster::AbstractMatrix{<:Number}, vector::AbstractVector{<:Number}) -> AbstractMatrix{<:Number}

Get the translated cluster of the original one by a vector.

source
QuantumLattices.Spatials.volumeMethod
volume(vectors::AbstractVector{<:AbstractVector{<:Number}}) -> Number
 volume(v::AbstractVector{<:Number}) -> Number
 volume(v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}) -> Number
-volume(v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}, v₃::AbstractVector{<:Number}) -> Number

Get the volume spanned by the input vectors.

source
QuantumLattices.decomposeMethod
decompose(m::AbstractMatrix{<:Number}, m₀::AbstractMatrix{<:Number}) -> Number
+volume(v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}, v₃::AbstractVector{<:Number}) -> Number

Get the volume spanned by the input vectors.

source
QuantumLattices.decomposeMethod
decompose(m::AbstractMatrix{<:Number}, m₀::AbstractMatrix{<:Number}) -> Number
 decompose(m::AbstractMatrix{<:Number}, ms::Tuple{Vararg{AbstractMatrix{<:Number}}}) -> Tuple{Vararg{Number}}
-decompose(m::AbstractMatrix{<:Number}, ms::AbstractVector{<:AbstractMatrix{<:Number}}) -> Vector{<:Number}

Decompose a matrix.

source
QuantumLattices.decomposeMethod
decompose(v₀::AbstractVector{<:Number}, v₁::AbstractVector{<:Number}) -> Number
+decompose(m::AbstractMatrix{<:Number}, ms::AbstractVector{<:AbstractMatrix{<:Number}}) -> Vector{<:Number}

Decompose a matrix.

source
QuantumLattices.decomposeMethod
decompose(v₀::AbstractVector{<:Number}, v₁::AbstractVector{<:Number}) -> Number
 decompose(v₀::AbstractVector{<:Number}, v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}) -> Tuple{Number, Number}
 decompose(v₀::AbstractVector{<:Number}, v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}, v₃::AbstractVector{<:Number}) -> Tuple{Number, Number, Number}
-decompose(v₀::AbstractVector{<:Number}, vs::AbstractVector{<:AbstractVector{<:Number}}) -> Vector{<:Number}

Decompose a vector with respect to input basis vectors.

source
QuantumLattices.dimensionMethod
dimension(lattice::AbstractLattice) -> Int
-dimension(::Type{<:AbstractLattice{N}}) where N -> Int

Get the space dimension of the lattice.

source
QuantumLattices.dimensionMethod
dimension(bond::Bond) -> Int
-dimension(::Type{<:Bond{K, P} where K}) where {P<:Point} -> Int

Get the space dimension of a concrete bond.

source
QuantumLattices.dimensionMethod
dimension(point::Point) -> Int
-dimension(::Type{<:Point{N}}) where N -> Int

Get the spatial dimension of a point.

source
QuantumLattices.expandMethod
expand(momentum::𝕂, reciprocals::AbstractVector{<:AbstractVector{<:Number}}) -> eltype(reciprocals)

Expand the momentum from integral values to real values with the given reciprocals.

source
RecipesBase.apply_recipeFunction
@recipe plot(lattice::AbstractLattice, neighbors::Union{Int, Neighbors}, filter::Function=bond->true; siteon=false)

Define the recipe for the visualization of a lattice.

source
RecipesBase.apply_recipeMethod
@recipe plot(path::ReciprocalPath, y::AbstractVector{<:Number}, data::AbstractMatrix{<:Number})

Define the recipe for the heatmap visualization of data on the x-y plain with the x axis being a reciprocal path.

source
+decompose(v₀::AbstractVector{<:Number}, vs::AbstractVector{<:AbstractVector{<:Number}}) -> Vector{<:Number}

Decompose a vector with respect to input basis vectors.

source
QuantumLattices.dimensionMethod
dimension(lattice::AbstractLattice) -> Int
+dimension(::Type{<:AbstractLattice{N}}) where N -> Int

Get the space dimension of the lattice.

source
QuantumLattices.dimensionMethod
dimension(bond::Bond) -> Int
+dimension(::Type{<:Bond{K, P} where K}) where {P<:Point} -> Int

Get the space dimension of a concrete bond.

source
QuantumLattices.dimensionMethod
dimension(point::Point) -> Int
+dimension(::Type{<:Point{N}}) where N -> Int

Get the spatial dimension of a point.

source
QuantumLattices.expandMethod
expand(momentum::𝕂, reciprocals::AbstractVector{<:AbstractVector{<:Number}}) -> eltype(reciprocals)

Expand the momentum from integral values to real values with the given reciprocals.

source
RecipesBase.apply_recipeFunction
@recipe plot(lattice::AbstractLattice, neighbors::Union{Int, Neighbors}, filter::Function=bond->true; siteon=false)

Define the recipe for the visualization of a lattice.

source
RecipesBase.apply_recipeMethod
@recipe plot(path::ReciprocalCurve)

Define the recipe for the visualization of a reciprocal curve.

source
RecipesBase.apply_recipeMethod
@recipe plot(path::ReciprocalPath, y::AbstractVector{<:Number}, data::AbstractMatrix{<:Number})

Define the recipe for the heatmap visualization of data on the x-y plain with the x axis being a reciprocal path.

source
RecipesBase.apply_recipeMethod
@recipe plot(path::ReciprocalPath)

Define the recipe for the visualization of a reciprocal path.

source
RecipesBase.apply_recipeMethod
@recipe plot(reciprocalspace::ReciprocalSpace)

Define the recipe for the visualization of a reciprocal space.

source
diff --git a/dev/man/Toolkit/index.html b/dev/man/Toolkit/index.html index d29b61a7..84319765 100644 --- a/dev/man/Toolkit/index.html +++ b/dev/man/Toolkit/index.html @@ -3,14 +3,14 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-89508993-1', {'page_path': location.pathname + location.search + location.hash}); -

Toolkit

This module contains the toolkit of the package.

The constants, types, macros, functions defined in this module will not be exported by the package. Instead, they serve as the prerequisites. The range of the contents are quite wide, but basically, they fall into two categories:

  • Utilities, such as global constants and miscellaneous tiny useful functions;
  • Basic data structures as supplements to the Julia.Base and other common packages.

Utilities

QuantumLattices.Toolkit.tostrFunction
tostr(number, ::Integer=5) -> String
+

Toolkit

This module contains the toolkit of the package.

The constants, types, macros, functions defined in this module will not be exported by the package. Instead, they serve as the prerequisites. The range of the contents are quite wide, but basically, they fall into two categories:

  • Utilities, such as global constants and miscellaneous tiny useful functions;
  • Basic data structures as supplements to the Julia.Base and other common packages.

Utilities

QuantumLattices.Toolkit.tostrFunction
tostr(number, ::Integer=5) -> String
 tostr(number::Integer, n::Integer=5) -> String
 tostr(number::Rational, n::Integer=5) -> String
 tostr(number::AbstractFloat, n::Integer=5) -> String
-tostr(number::Complex, n::Integer=5) -> String

Convert a number to a string with at most n decimal places.

source
tostr(value::Symbol) -> String
+tostr(number::Complex, n::Integer=5) -> String

Convert a number to a string with at most n decimal places.

source
tostr(value::Symbol) -> String
 tostr(value::Colon) -> String
-tostr(value::Char) -> String

Convert a single value to string.

source
QuantumLattices.idFunction
id(od::OrderedDict, i) -> keytype(od)

Get the ith key of an OrderedDict.

source
id(m::OperatorPack) -> idtype(m)

Get the id of an OperatorPack.

source
id(term::Term) -> Symbol
-id(::Type{<:Term) -> Symbol

Get the id of a term.

source
QuantumLattices.valueFunction
value(od::OrderedDict, i) -> valtype(od)

Get the ith value of an OrderedDict.

source
value(m::OperatorPack) -> valtype(m)

Get the value of an OperatorPack.

source
value(term::Term) -> valtype(term)

Get the value of a term.

source

Combinatorics

The combinations and permutations of an indexable object are implemented, with duplicate elements allowed or not. Compared to another Julia package Combinatorics, the iterators return tuples instead of vectors, which could greatly decrease the memory allocation times and improves the code efficiency.

Combinatorics{M, C} is the abstract type of all combinatorial algorithms. It has two type parameters:

  • M: the number of elements to be taken
  • C: the type of the collection of candidate elements

To avoid memory allocation, the iteration of a concrete combinatorial algorithm returns a tuple, whose length is M and eltype is eltype(C).

Combinations and DuplicateCombinations

Combinations{M, C} and DuplicateCombinations{M, C} generate all the combinations of M elements from an indexable collection whose type is C, with the differences being that the former forbids duplicate elements in the combinations while the latter allows.

All combinations of 2 integers taken from 1 to 3 without duplicate:

Combinations{2}(1:3) |> collect
3-element Vector{Tuple{Int64, Int64}}:
+tostr(value::Char) -> String

Convert a single value to string.

source
QuantumLattices.idFunction
id(od::OrderedDict, i) -> keytype(od)

Get the ith key of an OrderedDict.

source
id(m::OperatorPack) -> idtype(m)

Get the id of an OperatorPack.

source
id(term::Term) -> Symbol
+id(::Type{<:Term) -> Symbol

Get the id of a term.

source
QuantumLattices.valueFunction
value(od::OrderedDict, i) -> valtype(od)

Get the ith value of an OrderedDict.

source
value(m::OperatorPack) -> valtype(m)

Get the value of an OperatorPack.

source
value(qn::SimpleAbelianQuantumNumber) -> Number

Get the value of a simple Abelian quantum number.

source
value(qn::AbelianQuantumNumberProd, i::Integer) -> Number

Get the value of the ith simple Abelian quantum number in a Deligne tensor product.

source
value(term::Term) -> valtype(term)

Get the value of a term.

source

Combinatorics

The combinations and permutations of an indexable object are implemented, with duplicate elements allowed or not. Compared to another Julia package Combinatorics, the iterators return tuples instead of vectors, which could greatly decrease the memory allocation times and improves the code efficiency.

Combinatorics{M, C} is the abstract type of all combinatorial algorithms. It has two type parameters:

  • M: the number of elements to be taken
  • C: the type of the collection of candidate elements

To avoid memory allocation, the iteration of a concrete combinatorial algorithm returns a tuple, whose length is M and eltype is eltype(C).

Combinations and DuplicateCombinations

Combinations{M, C} and DuplicateCombinations{M, C} generate all the combinations of M elements from an indexable collection whose type is C, with the differences being that the former forbids duplicate elements in the combinations while the latter allows.

All combinations of 2 integers taken from 1 to 3 without duplicate:

Combinations{2}(1:3) |> collect
3-element Vector{Tuple{Int64, Int64}}:
  (1, 2)
  (1, 3)
  (2, 3)

All combinations of 2 integers taken from 1 to 3 with duplicate allowed:

DuplicateCombinations{2}(1:3) |> collect
6-element Vector{Tuple{Int64, Int64}}:
@@ -34,7 +34,7 @@
  (2, 3)
  (3, 1)
  (3, 2)
- (3, 3)

Manual

Traits

Trait functions and trait types that are useful to the package are defined.

Generally speaking, traits in Julia could fall into two categories according to their usages, the first may be term as "type helpers" and the second are usually called "Holy traits" named after Tim Holy. Type helpers aim at the inquiry, alteration and computation of the compile-time information of types, while Holy traits can be applied as an alternative to multi-inheritance by use of the Julia multidispatch feature.

Type helpers

Type helpers are important for the generic programming in Julia, especially in the design of generic interfaces and abstract types.

Let's see a simple situation, i.e. the elemental addition of two vectors of numbers. The numbers can assume different types and the type of the result depends on both of them, for example, the result between two vectors of integers is a vector of integers while that between a vector of integers and a vector of floats is a vector of floats. Of course, one can explicitly define every elemental addition function between any two different types of vectors of numbers, like this:

# wrong design pattern
+ (3, 3)

Manual

Traits

Trait functions and trait types that are useful to the package are defined.

Generally speaking, traits in Julia could fall into two categories according to their usages, the first may be term as "type helpers" and the second are usually called "Holy traits" named after Tim Holy. Type helpers aim at the inquiry, alteration and computation of the compile-time information of types, while Holy traits can be applied as an alternative to multi-inheritance by use of the Julia multidispatch feature.

Type helpers

Type helpers are important for the generic programming in Julia, especially in the design of generic interfaces and abstract types.

Let's see a simple situation, i.e. the elemental addition of two vectors of numbers. The numbers can assume different types and the type of the result depends on both of them, for example, the result between two vectors of integers is a vector of integers while that between a vector of integers and a vector of floats is a vector of floats. Of course, one can explicitly define every elemental addition function between any two different types of vectors of numbers, like this:

# wrong design pattern
 
 function elementaladdition(v₁::Vector{Int64}, v₂::Vector{Int64})
     result = Int[]
@@ -211,14 +211,14 @@
 a₁ = ConcreteTypeWithEquivalence(("a", "b", "c"), [1, 2, 3])
 a₂ = ConcreteTypeWithEquivalence(("a", "b", "c"), [1.0, 2.0, 3.0])
 a₁ == a₂
true

Here, the type Equivalence is the Holy trait that helps the abstract type TypeWithEquivalence to implement the == function, which applies equally to any other types.

Type stability and the generated function trick

However, the story does not end up here. If you are concerned about the code efficiency, you may find that the above implementation is not type stable:

using BenchmarkTools
-@benchmark $a₁ == $a₂
BenchmarkTools.Trial: 10000 samples with 954 evaluations.
- Range (minmax):   90.735 ns 13.906 μs   GC (min … max):  0.00% … 98.62%
- Time  (median):      98.181 ns                GC (median):     0.00%
- Time  (mean ± σ):   122.331 ns ± 306.306 ns   GC (mean ± σ):  15.42% ±  6.66%
+@benchmark $a₁ == $a₂
BenchmarkTools.Trial: 10000 samples with 957 evaluations.
+ Range (minmax):   92.428 ns 13.110 μs   GC (min … max):  0.00% … 98.69%
+ Time  (median):      99.306 ns                GC (median):     0.00%
+ Time  (mean ± σ):   121.305 ns ± 272.474 ns   GC (mean ± σ):  14.27% ±  7.20%
 
-   ▃▅▇█▅▃▁   ▁                                      ▁▃▃▁       ▂
-  ████████▇▆███▇▇▇▅▅▅▆▆▆▆▅▆▄▃▄▃▄▁▄▁▁▃▁▃▁▃▄▆▆▅▄▅▅▃▆▇█████▆▆▆▆▇ █
-  90.7 ns       Histogram: log(frequency) by time        186 ns <
+  ▁▅▇██▇▅▂▁ ▁▁                                      ▁▃▃▂       ▂
+  █████████████▇█▇▆▇▆▄▅▅▃▄▃▅▁▅▃▁▁▃▄▁▄▁▁▄▁▁▄▁▁▃▁▁▁▁▅█████▆▅▇▆▄ █
+  92.4 ns       Histogram: log(frequency) by time        184 ns <
 
  Memory estimate: 256 bytes, allocs estimate: 6.

The memory allocation occurs when the == function tries to compare the values of getfield(o₁, i) and getfield(o₂, i) because in principle the types of these values depend on the runtime value of the variable i. To ensure type stability, the generated function trick can be utilized:

struct EfficientEquivalence end
 const efficientequivalence = EfficientEquivalence()
@@ -245,16 +245,16 @@
 a₁ = ConcreteTypeWithEfficientEquivalence(("a", "b", "c"), [1, 2, 3])
 a₂ = ConcreteTypeWithEfficientEquivalence(("a", "b", "c"), [1.0, 2.0, 3.0])
 a₁ == a₂
true
@benchmark $a₁ == $a₂
BenchmarkTools.Trial: 10000 samples with 997 evaluations.
- Range (minmax):  21.596 ns58.796 ns   GC (min … max): 0.00% … 0.00%
- Time  (median):     22.550 ns               GC (median):    0.00%
- Time  (mean ± σ):   22.656 ns ±  1.101 ns   GC (mean ± σ):  0.00% ± 0.00%
+ Range (minmax):  21.594 ns44.385 ns   GC (min … max): 0.00% … 0.00%
+ Time  (median):     21.616 ns               GC (median):    0.00%
+ Time  (mean ± σ):   21.717 ns ±  0.947 ns   GC (mean ± σ):  0.00% ± 0.00%
 
-                  █            ▁                             ▁
-  █▇▁▁▁▁▁▁▁▁▁▁▁▁▃▁█▁▁▃▁▃▁▁▁▃▃█▇▁▁▁▁▃▁▁▁▁▁▁▁▁▃▁▃▁▃▄▄▅▄▄▄▅▁▇ █
-  21.6 ns      Histogram: log(frequency) by time        25 ns <
+  █                                                            
+  █▆▇▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂▁▁▂▂▁▁▁▁▁▁▁▁▁▁▁▁▂▂▂▂▂▂▁▂▂▂▂ ▂
+  21.6 ns         Histogram: frequency by time        23.1 ns <
 
- Memory estimate: 0 bytes, allocs estimate: 0.

At runtime of the generated == function, it compares the values of getfield(o₁, 1) and getfield(o₂, 1), getfield(o₁, 2) and getfield(o₂, 2), etc., whose types are known at compile time. Therefore, type stability could be ensured.

EfficientOperations

EfficientOperations is a Holy trait defined in this module that packs several common operations, such as ==/isequal, </isless, isapprox and replace, to help other (abstract) types to implement such functions by passing efficientoperations as the first argument, just as illustrated above. See the manual for more detailed information.

Manual

For traits with types themselves:

QuantumLattices.Toolkit.fulltypeFunction
fulltype(::Type{T}, ::Type{PS}, ubs::Tuple{Vararg{Bool}}=isparameterbounds(T, PS)) where {T, PS<:Tuple}
-fulltype(::Type{T}, ::Type{PS}, ubs::Tuple{Vararg{Bool}}=isparameterbounds(T, PS)) where {T, PS<:NamedTuple}

Get the full type of type T with the type parameters replaced by those of PS.

Here, ubs determines whether the new type parameter should be considered as the upper bound accordingly.

source
Core.DataTypeType
DataType <: Type{T}

DataType represents explicitly declared types that have names, explicitly declared supertypes, and, optionally, parameters. Every concrete value in the system is an instance of some DataType.

Examples

julia> typeof(Real)
+ Memory estimate: 0 bytes, allocs estimate: 0.

At runtime of the generated == function, it compares the values of getfield(o₁, 1) and getfield(o₂, 1), getfield(o₁, 2) and getfield(o₂, 2), etc., whose types are known at compile time. Therefore, type stability could be ensured.

EfficientOperations

EfficientOperations is a Holy trait defined in this module that packs several common operations, such as ==/isequal, </isless, isapprox and replace, to help other (abstract) types to implement such functions by passing efficientoperations as the first argument, just as illustrated above. See the manual for more detailed information.

Manual

For traits with types themselves:

QuantumLattices.Toolkit.fulltypeFunction
fulltype(::Type{T}, ::Type{PS}, ubs::Tuple{Vararg{Bool}}=isparameterbounds(T, PS)) where {T, PS<:Tuple}
+fulltype(::Type{T}, ::Type{PS}, ubs::Tuple{Vararg{Bool}}=isparameterbounds(T, PS)) where {T, PS<:NamedTuple}

Get the full type of type T with the type parameters replaced by those of PS.

Here, ubs determines whether the new type parameter should be considered as the upper bound accordingly.

source
Core.DataTypeType
DataType <: Type{T}

DataType represents explicitly declared types that have names, explicitly declared supertypes, and, optionally, parameters. Every concrete value in the system is an instance of some DataType.

Examples

julia> typeof(Real)
 DataType
 
 julia> typeof(Int)
@@ -267,13 +267,13 @@
 
 julia> typeof(Point)
 DataType
source
Base.supertypeFunction
supertype(T::DataType)

Return the supertype of DataType T.

Examples

julia> supertype(Int32)
-Signed
source
supertype(T, termination::Symbol) -> DataType

Get the supertype of T till termination.

source

For traits with type parameters:

For traits with type parameters:

QuantumLattices.Toolkit.isparameterboundFunction
isparameterbound(::Type{T}, i::Integer, D) where T -> Bool
 isparameterbound(::Type{T}, name::Symbol, D) where T -> Bool

For a type T, judge whether a type D should be considered as the upper bound of one of its type parameters.

Note

The default implementations of this function is

isparameterbound(::Type{}, ::Val{}, ::Type{D}) where D = !isconcretetype(D)
-isparameterbound(::Type{}, ::Val{}, ::Any) = false
source
QuantumLattices.Toolkit.isparameterboundsFunction
isparameterbounds(::Type{T}, ::Type{PS}) where {T, PS<:Tuple} -> Tuple{Vararg{Bool}}
-isparameterbounds(::Type{T}, ::Type{PS}) where {T, PS<:NamedTuple} -> Tuple{Vararg{Bool}}

For a type T, judge whether the types specified by PS should be considered as the upper bounds of its corresponding type parameters.

source
QuantumLattices.Toolkit.parameterpairFunction
parameterpair(::Type{T}, name::Symbol) where T
-parameterpair(::Type{T}, i::Integer) where T

For type T, get the name-type pair of one of its type parameters.

The result is stored in the type parameters of a Pair.

source
QuantumLattices.Toolkit.parameterpairsFunction
parameterpairs(::Type{T}) where T

For a type T, get the name-type pairs of all its type parameters.

The return types are stored in the type parameters of a NamedTuple.

source
QuantumLattices.Toolkit.promoteparametersFunction
promoteparameters(::Type{T₁}, ::Type{T₂}) where {T₁<:NamedTuple, T₂<:NamedTuple}

Promote the types specified by two named tuples with the same names accordingly.

The result is stored in the type parameters of a NamedTuple.

source
QuantumLattices.Toolkit.reparameterFunction
reparameter(::Type{T}, i::Integer, P, ub::Bool=isparameterbound(T, i, P)) where T
-reparameter(::Type{T}, name::Symbol, P, ub::Bool=isparameterbound(T, name, P)) where T

For a type T, replace the type of its ith type parameter with P. Here, ub determines whether P should be considered as the upper bound.

source

For traits with type contents:

QuantumLattices.Toolkit.contenttypeFunction
contenttype(::Type{T}, name::Symbol) where T
-contenttype(::Type{T}, ::Val{name}) where {T, name}

For a type T, get the type of a predefined content by the name.

source
source
QuantumLattices.Toolkit.isparameterboundsFunction
isparameterbounds(::Type{T}, ::Type{PS}) where {T, PS<:Tuple} -> Tuple{Vararg{Bool}}
+isparameterbounds(::Type{T}, ::Type{PS}) where {T, PS<:NamedTuple} -> Tuple{Vararg{Bool}}

For a type T, judge whether the types specified by PS should be considered as the upper bounds of its corresponding type parameters.

source
QuantumLattices.Toolkit.parameterpairFunction
parameterpair(::Type{T}, name::Symbol) where T
+parameterpair(::Type{T}, i::Integer) where T

For type T, get the name-type pair of one of its type parameters.

The result is stored in the type parameters of a Pair.

source
QuantumLattices.Toolkit.parameterpairsFunction
parameterpairs(::Type{T}) where T

For a type T, get the name-type pairs of all its type parameters.

The return types are stored in the type parameters of a NamedTuple.

source
QuantumLattices.Toolkit.promoteparametersFunction
promoteparameters(::Type{T₁}, ::Type{T₂}) where {T₁<:NamedTuple, T₂<:NamedTuple}

Promote the types specified by two named tuples with the same names accordingly.

The result is stored in the type parameters of a NamedTuple.

source
QuantumLattices.Toolkit.reparameterFunction
reparameter(::Type{T}, i::Integer, P, ub::Bool=isparameterbound(T, i, P)) where T
+reparameter(::Type{T}, name::Symbol, P, ub::Bool=isparameterbound(T, name, P)) where T

For a type T, replace the type of its ith type parameter with P. Here, ub determines whether P should be considered as the upper bound.

source

For traits with type contents:

QuantumLattices.Toolkit.contenttypeFunction
contenttype(::Type{T}, name::Symbol) where T
+contenttype(::Type{T}, ::Val{name}) where {T, name}

For a type T, get the type of a predefined content by the name.

source
QuantumLattices.Toolkit.dissolveFunction
dissolve(m, f::Function=identity, args...; kwargs...) -> Tuple

Convert m to a tuple by the function f applied elementally to its contents with the extra positional arguments (args) and keyword arguments (kwargs).

To each content of m, the underlying interface of the dissolve function when f is applied is as follows:

dissolve(m, Val(name), f, args...; kwargs...)

Here, name is the name of the corresponding content of m.

Basically, the rule of how f operates on each field of m can be overridden by redefining the above dissolve function.

Note

The default dissolve function ignores the operation of function f and just return the content value of m.

source
dissolve(m, ::Val{name}, f::Function, args...; kwargs...) where name

Dissolve the content specified by name of m by the function f applied with the extra positional arguments (args) and keyword arguments (kwargs).

source

For traits with type operations:

Composite structures

In principle, Julia is not an object-oriented programming language. For example, only abstract types can be inherited so that subtype cannot inherit fields from their parents. Therefore, Julia prefers composition over inheritance. However, to make a new concrete type behaves much alike another one, tedious repetitions of redefining the generic interfaces are usually not avoidable, especially for the basic types in Julia base. In this module, we implement to such composited types, CompositeVector and CompositeDict, for the sake of future usages.

CompositeVector

A composite vector can be considered as a vector that is implemented by including a concrete subtype of AbstractVector as its data attribute, and it itself is a subtype of AbstractVector.

To take full advantages of the Julia base, the following interfaces are redefined:

  • inquiry of info: size, length
  • comparison between objects: ==, isequal
  • obtainment of old elements: getindex
  • operation of old elements: setindex!
  • addition of new elements: push!, pushfirst!, insert!, append!, prepend!
  • removal of old elements: splice!, deleteat!, pop!, popfirst!, empty!
  • construction of new objects: empty, reverse, similar
  • iteration: iterate, keys, values, pairs

Note that arithmetic operations and logical operations excluding == and isequal are not supported.

CompositeDict

A composite dict can be considered as a dict that is implemented by including a concrete subtype of AbstractDict as its data attribute and it itself is a subtype of AbstractDict.

To take full advantages of the Julia base, the following interfaces are redefined:

  • inquiry of info: isempty, length, haskey, in
  • comparison between objects: ==, isequal
  • obtainment of old elements: get, getkey, getindex
  • operation and addition of elements: push!, get!, setindex!
  • removal of old elements: pop!, delete!, empty!
  • construction of new objects: merge, empty
  • iteration: iterate, keys, values, pairs

Manual

Vector spaces

A vector space is a linear space, in which the addition of vectors and multiplication of a vector by a scalar are defined.

Vector spaces are frequently encountered in physics, e.g. the Hilbert space in quantum mechanics. In this submodule, we only implement those with finite dimensions. We want to remark that in our implementation, a vector space is a subtype of an abstract vector, therefore, the bases always possess a order, which means, two vector spaces are not considered to be equal to each other even if their corresponding actual mathematical spaces are the same but the orders of the bases are different.

VectorSpace

VectorSpace{B} is the abstraction of a vector space, which has only one type parameter:

  • B<:Any: the type of the bases of the vector space

Basically, a subtype should implement the following 2 methods:

  1. Base.length(vs::VectorSpace) -> Int
    Get the dimension of a vector space
  2. Base.getindex(vs::VectorSpace{B}, i::Int)  where B -> B
    Get the ith basis of a vector space

Other features include

  • comparison: == and isequal
  • iteration: iterate
  • inquiry: size and in
  • search: searchsortedfirst

Manual

Predefined types of vector spaces:

Predefined types of vector space style:

QuantumLattices.Toolkit.VectorSpaceDirectProductedType
VectorSpaceDirectProducted{Order} <: VectorSpaceStyle

Vector space style which indicates that a vector space is the direct product of its sub-components.

The type parameter Order must be either :forward or :backward:

  1. :forward: the direct product iterates over the first sub-component first like a Julia array;
  2. :backward: the direct product iterates over the last sub-component first like a C/C++ array.
source
+getcontent(m, ::Val{name}) where name

Get the value of the predefined content of m.

source
QuantumLattices.Toolkit.hascontentFunction
hascontent(::Type{T}, name::Symbol) where T -> Bool

For a type T, judge whether it has a predefined content specified by name.

source
QuantumLattices.Toolkit.dissolveFunction
dissolve(m, f::Function=identity, args...; kwargs...) -> Tuple

Convert m to a tuple by the function f applied elementally to its contents with the extra positional arguments (args) and keyword arguments (kwargs).

To each content of m, the underlying interface of the dissolve function when f is applied is as follows:

dissolve(m, Val(name), f, args...; kwargs...)

Here, name is the name of the corresponding content of m.

Basically, the rule of how f operates on each field of m can be overridden by redefining the above dissolve function.

Note

The default dissolve function ignores the operation of function f and just return the content value of m.

source
dissolve(m, ::Val{name}, f::Function, args...; kwargs...) where name

Dissolve the content specified by name of m by the function f applied with the extra positional arguments (args) and keyword arguments (kwargs).

source

For traits with type operations:

QuantumLattices.Toolkit.efficientoperationsConstant
efficientoperations

Indicate that the efficient operations, i.e. "=="/"isequal", "<"/"isless" or "replace", will be used.

source

Composite structures

In principle, Julia is not an object-oriented programming language. For example, only abstract types can be inherited so that subtype cannot inherit fields from their parents. Therefore, Julia prefers composition over inheritance. However, to make a new concrete type behaves much alike another one, tedious repetitions of redefining the generic interfaces are usually not avoidable, especially for the basic types in Julia base. In this module, we implement to such composited types, CompositeVector and CompositeDict, for the sake of future usages.

CompositeVector

A composite vector can be considered as a vector that is implemented by including a concrete subtype of AbstractVector as its data attribute, and it itself is a subtype of AbstractVector.

To take full advantages of the Julia base, the following interfaces are redefined:

Note that arithmetic operations and logical operations excluding == and isequal are not supported.

CompositeDict

A composite dict can be considered as a dict that is implemented by including a concrete subtype of AbstractDict as its data attribute and it itself is a subtype of AbstractDict.

To take full advantages of the Julia base, the following interfaces are redefined:

Manual

QuantumLattices.Toolkit.CompositeDictType
CompositeDict{K, V}

A composite dict can be considered as a dict that is implemented by including a concrete subtype of AbstractDict as its data attribute.

source
QuantumLattices.Toolkit.CompositeVectorType
CompositeVector{T}

A composite vector can be considered as a vector that is implemented by including a concrete subtype of AbstractVector as its data attribute.

source

Vector spaces

A vector space is a linear space, in which the addition of vectors and multiplication of a vector by a scalar are defined.

Vector spaces are frequently encountered in physics, e.g. the Hilbert space in quantum mechanics. In this submodule, we only implement those with finite dimensions. We want to remark that in our implementation, a vector space is a subtype of an abstract vector, therefore, the bases always possess a order, which means, two vector spaces are not considered to be equal to each other even if their corresponding actual mathematical spaces are the same but the orders of the bases are different.

VectorSpace

VectorSpace{B} is the abstraction of a vector space, which has only one type parameter:

Basically, a subtype should implement the following 2 methods:

  1. Base.length(vs::VectorSpace) -> Int
    Get the dimension of a vector space
  2. Base.getindex(vs::VectorSpace{B}, i::Int)  where B -> B
    Get the ith basis of a vector space

Other features include

Manual

Predefined types of vector spaces:

QuantumLattices.Toolkit.VectorSpaceType
VectorSpace{B} <: AbstractVector{B}

Abstract vector space.

source
QuantumLattices.Toolkit.NamedVectorSpaceType
NamedVectorSpace{B} <: VectorSpace{B}

Abstract named vector space.

source
QuantumLattices.Toolkit.SimpleNamedVectorSpaceType
SimpleNamedVectorSpace{N, B} <: NamedVectorSpace{B}

Abstract simple named vector space.

source
QuantumLattices.Toolkit.ParameterSpaceType
ParameterSpace{N, T, B} <: SimpleNamedVectorSpace{N, B}

Parameter space.

source
QuantumLattices.Toolkit.NamedVectorSpaceProdType
NamedVectorSpaceProd{Order, T<:Tuple{Vararg{SimpleNamedVectorSpace}}, B<:Tuple} <: CompositeNamedVectorSpace{T, B}

Direct producted named vector space.

source
QuantumLattices.Toolkit.NamedVectorSpaceZipType
NamedVectorSpaceZip{T<:Tuple{Vararg{SimpleNamedVectorSpace}}, B<:Tuple} <: CompositeNamedVectorSpace{T, B}

Zipped named vector space.

source

Predefined types of vector space style:

QuantumLattices.Toolkit.VectorSpaceStyleType
VectorSpaceStyle

Style of a concrete type of vector space.

source
QuantumLattices.Toolkit.VectorSpaceGeneralType
VectorSpaceGeneral <: VectorSpaceStyle

Default vector space style.

source
QuantumLattices.Toolkit.VectorSpaceEnumerativeType
VectorSpaceEnumerative <: VectorSpaceStyle

Enumerative vector space style, which indicates that the vector space has a predefined content named contents that contains all its bases.

source
QuantumLattices.Toolkit.VectorSpaceCartesianType
VectorSpaceCartesian <: VectorSpaceStyle

Cartesian vector space style, which indicates that every basis in it could be represented by a Cartesian index.

source
QuantumLattices.Toolkit.VectorSpaceDirectProductedType
VectorSpaceDirectProducted{Order} <: VectorSpaceStyle

Vector space style which indicates that a vector space is the direct product of its sub-components.

The type parameter Order must be either :forward or :backward:

  1. :forward: the direct product iterates over the first sub-component first like a Julia array;
  2. :backward: the direct product iterates over the last sub-component first like a C/C++ array.
source
QuantumLattices.Toolkit.VectorSpaceDirectSummedType
VectorSpaceDirectSummed <: VectorSpaceStyle

Vector space style which indicates that a vector space is the direct sum of its sub-components.

source
QuantumLattices.Toolkit.VectorSpaceZippedType
VectorSpaceZipped <: VectorSpaceStyle

Vector space style which indicates that a vector space is the zip of its sub-components.

source
diff --git a/dev/objects.inv b/dev/objects.inv index 1e222f985967d26849dcf1fa0d57e92cd645db73..ba26c51db3fe64349600bcc4addfb111456b8af7 100644 GIT binary patch delta 13715 zcmV;EHEhbxYO-sPk$<+k3$SNNT`2h?LJ#IeY!R{~%A}1&KkOh`l_b+jW|k|n)TRXi z)9!gP_N`&`Qvpr@Jxt_o!LAoIy0N+` zN!Q(FQ3{$7Q&O$kvN@`*R#nx%ygWw#EV`TY=>f@*sUmk!|Kt`P-X*;m8rxyFUN&`m z)$iYQ?bT6zd4E~0s&*JT)JUp#3(>GBam!-Cn`XSqudB9Nl|#3BdHHfl|LPOR4UxE8 zh^u%o9lyR+F5Z;wyjm1Px2)&AbLI1Ps3)MMvCvJTUzF$7e>^7ZZm1S7*TZr>^nU8# zBXc!b@KU6n?F0`h13;MI@>2Hhh`KoMtvHJt0jmCEif~Y5Qtjw!``c+%VAny9K+V zYy_p+!!ky)vGryr`OqS?@1B zgP83eo5LWjG507~>%tnc*geL4h|wD}^2=WpJAYeGE-&kOjRr_pnAly~Lwx0uCr(RD z0v&k$&Vc5lz1rz6cN)ag>Up*Ew7jXC0ga|K>Ev>M)TivRpgrOx#Cj~$9=8MqJf=?D zQ&SAYaS(mc&C6z|soqr0-p+A1f4x(-3-ZT_5aCj~cM2N6RC<~{*oXQeEebl80$(oB z{eME--#SFAr|avX+UbWCI`h`6%KyQ|1BHBGODysoA~x&@v0;aa4S4=96~?fU9rUX- z@r4|~JK_M|>6F7$N1eM4badR*CRuA2F+TPMUB&&KZyNmp(&(f`FR{S8lT7G9 zI7Z!$+hqyUtMrd2lJt+naDC4`t-2U&ztADM#+@z8)nI)(+JB@_ znrv}#b!V>2yq-@8NWF+QB=^#z`?vLQEza(FSMif{qg#^70k~@+2&i3eoqhG;?ngWQ z5^;%K3C8_V&%T=NezrT?eWZ6l`YiAzA%gt6=`Q4IJM7R-sM`{4uBq3V+7Vu8R#&tE zUt{KNd>&rl-}t+d<#~iZ#T+$I?|+0&NZAmtUXaAr>8ft$HTq&bXOwuMk`;w7ysrf$ zhr!vV7zVzeEv9c<^s4K!iD5U-Nz1MC+a(q)%8RGo<+>%B_Rg@X zk#yplSWK%Bw8+%r@d{c6r&SPITT~a@S*nVhXTKY&9DN5(nd8%nzSMvhpnur&Es}-G zdc$9eH!XPYeA|oOT?0e{$qGvqJ0+SPETE&ky1tMHbH6O-rr7sh#?A*;(18`$P_w>} z2R9wq7PtK!$$?nLokaE_?LFjlRxCbzlXhriA*pS@Ap;%iHx=HqH|u7o(X?Jyt9rnz z%lo+UFy3j_!*uUlSIrXZR)6F}4*1Gasz1Tq!k(tHjh`;$(_3Fw->$2EAUY@Blo#kk zBh0Ae`djkMI&8LRIIJ_Gvf^D!I-_=5*4frkby=cG*jcSHQ>@7uuP^6KE>YHdL3+nh z?c7|mTT~1gVGQtzubj9zGY`-VP51$J(8_KHw9x>?;*jtVx&bz|0Dsgz^zUwQt@p}_ zv~3o>qmVLyPNJqMZ3aYU^lNlrbgMJWzXCkuD4-RA#xt^BEv1Hb3bJ#fTiTNI*OT|8 zq51qGPrK%JX9%mxxLrZpiG{PbbFr?Q1ztiI4Yq+0`RTnaD&7#wn=u0s!!CI1g0!ac zmbpAJ8$cgsSt0qf9e;L8B;?n_dXc_06E=z7XCeCB`gJuB3F2%hiE3;ve0INJ_t6ov zTva`yLH3DbJJ`bG&en@=sDN!n{Q@xm4LKF?;?dm-_5q7VyQnVf7736BkMTLV1S@~j}TDg`nug~Ap)>UI=AG(9_oUv#>|Gwk!`Bg0R{ zz1)tFtNBWJS~qA14rH#TUI=<$crDny37`O54Xg#3dAbQ$gSUlub18g6v z`_C-~oGq(4`hUXp_h_M0!|DcEgVGtb;%-46RS#!1eX2}~WUhgu+LSVFuMz5XJwSFA z^^TW_)=;yvsCUH1AeMeKxf^v&8J)pisr|n1(DV`n9CX&k6(_%0XpXchq(!ZE=GSF=RT1lo zxz{gl@qgtS$%L3N5gq`~lDYE<z-_L);(l^65LxA z7N@oHaH^U#DgAl;aAKT?9thH#E-khWXZ^_0@qY~>z6ax~|kA#l9qBve=sg^slpIa{&DAofVR8mn*DQ_B-^W?_XdK z$$VgK?GGs_$5Ta^<0uWIq_=!k6@yvsl_0Wmob$ ze6|mKhl&d1bP5j6-OT#op&&RX0tyuG`;qZ64!P$)Pc8 z1mTfb3l^JKj`_ZhIY@#OnSz3SecGmdAvWy`_Rn@f7CE~9HQuK9JiDq^VpG0|5DL;q zqwK~P)^2q(Dp@*`9~&7I=g!EEsIRY}@*}X3jiBhhQpD3kQeA6u+q3s$A_iSJlO;yt69X*KDTvz)$H%jhQ7E zEiCux)ZmF&)HhYzV^vFC%deEhEdF9V;n%BjQ7wo+26F_w%t>>(>d{Xr8Ienn_^vljLN=#poUh&yjkbn8Z&;Rhx z#`CG7%;A&SqX)AmyR*;k%?@^fKILI}2jiL7O-YxX_tb<2&u4)-yt4EMxhmMfgVghs z^Tv1{pEQU<1b z3FFflvqOdcjJ2uAE`OEt0@6 zw)B@}`}(-X5erd=d6LOXC^5{&_BE2VR#!x;nZ(9q^?$|m8r@z-dlf2A)JAk!SlKJF z7oi3%kpHJ!Pm)G}-bTEZdlb&M6`Q8+`}GA^CDQk+a|37XU|=v~cX7n#jc z^*BDOMiJ;k<`3%$&EP@q-ju_fyCq&AP_;&tVM5pL1q@*WDjKib%So*Utwx zUlHJu`vf|~0R0|a^$Rrmv7-?6oH;sac;hIx$CqvOa`hbJ?)0q^vN{TeK#)AY;5?UX zVabG8bLqLsVL7CS+3tPGRVky;cnU`W7~Yo{#D4{T>!3{mk}VV^+w+DFLEjQ06lxJ~ zVOY#QCpPQ9M{~giQ^X0|D>|BTzUnf~*bna+mTcJtKGjGkF><`H=)K*$L_AIVIbNO@ z=`?E)% z+J6EGz&>2ZY`IwcLKPD!OVmN=>9`u87j=&d5fSRmg}4cbYk&RIPd|(_F-T+tbEIsjF$wboFR^xM08vDBLTRfKyfu;&&mQSdV5w{EUm*R?NFkHHG888q1D|VSQ zQoYF7)iGmK_@pT)k~P7uSWbF%Aoj5mHJNB-BrnBB4I^9loDqlN%BX znkvltBTibx?g4@UMlYT&zpoKjzFq`Wlq?xQryZklq}jQ zh;kzME+EQrnC!aJ@g*Z{q$;(Lwj0AY886dMMaE*LV4fO%^;lFGK=?dyzvdK{;v6=nkxNT2*9Db7SvK6}=oo7|PP4i0u50x0!l_mw{V+=&Gb-rNxY#^J}IxPT@q3`tzEp|G*7-=myPCE zLqopwf<)r0EXurkM-%1QF z@^pic6IqBS1Ns$Z$RLR_sXT`mF50`__2fsoisGjf(n$E&MTWCZ=DZESV1EeTt$HGP zl*?sv`}ZV1#I%j$KKAELzQ^}!{ma}HV)>kui6{beZW@g?^9V&xK}I!k$zRp z-vCnbF|a0L9J-03YpcZbLx0SBYVc2>q|5nDyj>VByQOewn^B~sL!Bnk33S>A^-B_;u{j%&kwPbuxagC#Sjv8e&V)@`&>7- zPIG?hT@cK*Zqq#q%YU}qWIl;-EAr0eKoi)2=qkpq)m?swIKv-4+Aid;pR`|p{3t$# zRcmGhw2rx(ek?@I1DZ{~cj)`hc0W@r;16cIkLZ4Y?tbjO`zgLVLEtR#s2xkYiI!f$ zonR>x=^e0Q$H3YRI8(my5`;)%ze=8)*F%*#eNDG+1iL24XMcr5GN3i)Bw2Eyw+q2Y zb*MD%EY_j)bbWDAt{lz@uUXZS>N3%@fM^$oEs+&k{D!{6ZdKhmDu9G!&gXUd} zgK1kh4~)Gb_wKSm>SsItcw(8wilGEeb1cSeQ#8K)c(noJHgVX^sfe$Uy27d03a5|v zM4bDkRRxM9<}QT>}(gtg>hJBwNMLzLr4E}Tf9^ed6Pn?jr6D#p(AWdUeW?~PbI#IT20D^!s zLJa)yaOAE6;jK_xC77}gxDUZ`s7H?{;gu5r3nMR#V9Vb5{miWeB+LlI+7mVzKpz0O zQIYaL=-XZ23~>q`5hV}IEpD#v6b}<%UWxP5D}Shpo>UilzfqTZuVcft0(y`Sip0zJ zO$k5ZG?mrEQ-E^&6UnX<0p-`8BNis|WF+@HInvaN=RoF!uk@^hU%eAJ9jRkeVd1%w zMBytVH!4!9aDyqZe|*e}Dq?3vwKFSxWozB^IFUDGh?b#Rs{+b%alGit`By+*Ri^mK z2Y^w2qeTf=XPYG920m7PUN3SuT8d5%U7TD0C?}$D(PSO%yob z;|ZpqtZYUDE6s)-kkuX50Shm!j0}*~oeYswzBAF=4xe)#%T;@b_b#jRrs>Z)<{v|y zwshNI4m|;Em?(>$pqDG@``&((urKDs4u1vCN`Ga921f&_-Jt9&sEk;R0-$J+@dK;D zK*>~PM~~th5ik)$I4XjI#?n^HrktzTItQS{!HKlzImpfr1Q7#nTlP6dBEww-y_ml^ z5Vf^s6#?bsoeHkDg`7)0(-`|rgccZqJqbX-3Bd-qk0q0+`Q0suc0d-ogtMB-JAbO& z;zoFnfDWhPJw|kr2n_jrsm9ru0cjZ{n?1azll1vY((@6e}`OMVg$i5}D~4H5}33Kk3%M zsiVI?wyl4j={oBexE zM;^-lFnt)a<=l;oV+JBy@ynLCb>)GSXzt;$Id_t!uD^nag!{^56% zVeJpeiHiQaAM^FCDh?ZfMFRyKAY8Qb`>*DmkytL61H{ap?aud+put+>m}Tbqurh9g zIXtW!UE^F|Kz6P;U)Lz;()l|DyvM)8xt`y33Liljwsa2Z&gT|yJ-4&K`u#^}3XvdF z{Q{6*BK<{-0%9q#2Wy72z<;2FxXyp&l9Q)2Kzb^eeLXu;LUdIUV~0x-$&+HLT0}a< z$RpJez(1i-rEN3~yF~-*nd?W1C*prSlS0um5_>fA%Ugp|b{>G!lJWV%hXe-_X;+>> zBG5A#niO@){_ubPSuf=D^AA5r0TUg;ii|ly-cl)hBGO1O#l58iGk>9+UbDm9*}*PQ z28td0yMRo}WdcAr-FQ+|KzJ3yVRlDlt)de_h?$K1_$N#bKFMsmy>pna;xy zT-;n|8fT~NuUB>Z+J8~KPL_7i&p2{}=|~Jf`z4kdl?>$Dg{oUW!#{HtiaI=vkAdu8 zyJ8;8N)w@jse_*ZS*N)3SyPQ5pJ}Mqbs&aTj5A z97EodWHk+^LUnLVW4mAj$$2RQry^Bw0>~$SG3r487z9vEOn>^Mn;8NqObignG1dox zm?qAJ0tOOSuxWITTf&A=NJQV4tBZQT;xGCeSBuC{T9mJZE2<`b729PrOTuvB- zc+HwSXJ%d9Ou3=lx~9o6TIW|nRPFj@BwAImmuw_x6)tEd;#ZaKo$m!C7s?W$G%a+) z#SIJ%b?SNrYJdJa%w#bt>1?>Ql7E2-I|U>fMy;o3`GY{xZWOvZ%b!{|o((Z&1lp5m z2mt`U#d$dXH;VP>@ruSSa0e?o1XCke(P(8yDnfWjdR%8GjFo4y*RU8T2XV8?hGik% zjdP!9QjIaIIk0C#qA|Zyw2|Y#n?{b`t45CZZ1Euf|9}0Ic8>>cyT=2!-Q(Z0Nksqs zAlg}$Y*P)VoP%71o60=r^A@T+y{~ST!>#AoiDB<55vO<^B^VKm1QiJRr0EsyT%Oeo zr-#+o>{Gaw9e{Y(@WUx{Wx$40=LZs-P1{QasDv5Q}DCGV6JHb=t zL1;AmALwdkrdw4r`M7fJ>S}9NtdFU`hM~z}q>w)7O(BJh>53CFI`$WgNeQJHg){DF z2q5+_Y*x`?gX4kQ zsDBpZW)WDN#2jT7@hC)2ZDH*~S&`yN&3x&SmRcn~_HDCS@6xEfr+hh!yS8tD(=p~K z(JVmN_OhwEwuWg)vx$tiMR+4hBXu!fK&jBMxP{n(@qR@>+QRp&;buf zgNB+^vsim%W)&?K=4I_**OOL&9yHW~K~fbUYW{-K$Dy9=Hq4Zs^)8niZL7mnAy8`G z+Ctl~7WD?k6j4j)XO>=G%>nmM_Ni%F`Gd2;n{xHRFMs>{ zAAhi2uscUy6XN0qcYK9 z@&LUu`2#mmE4qIb zl;C8e)Zn*>1Ag*Q;BSq*ieD0e7=H<>q}97XYyIYEpsq1&7@kY|H1WBvoQwQ*sL2gI z$J-`R0UImw!hh1HSt35S{um>pV1MxJiq}m5 z`Pefh#MB5N%Q>IfZ^TNrQ%Fvln%kc`G9x*5IJXa-@b^(DOinRWEDXpFqXsOcA(zc8 zF)F20?6PGf+-MZxnDQ@LHq&V_C3YDYAdhJfU&5`&D{010wc;pMSfc zRSo0KB?>t_7DiD2q*UK$g%0^hZp!5^tYPG&)I)^SC8!U-H zh`(7kK-T*d(4s}pmHR$eV?l^yhQl!l!J)X<8wNo)Ql5lx6U=(6TC2WXqcz11R#KV4 z8-v}_10=Xv;!BpyB`;XQv{PYfmZ?hDZRqCF8bSdUx@mxnk{gxBgR@3LvpA2$TT_*{ zndpj70J|1!c0y@?r+-Wfx~jxE02hc&i@&EkhVS#N7zCwQg;IA|L_`w8X-A<^w8E$) ztc5^Q_5{9bzrL8Lhz6pRR768C4^o}P5kn`|kjy>7%!IoSge_5CQDC*f=Xb5=cR!HX zF6{RAt@ignQ1TbC1Q|p^euJZO;8F!_k(v3~0VG$f%B1zDtRcJ1fV!$Qg-VT1aKg4C?8e$VTXh!{ z^e~r2MxE_ir%=#^yPhGit?U|x(3vMPSX5U43Oz2~Qh$$f(dJCcDMV}LDW&q@G&rY^ z_i!P!A3hrC()|robzB?JOfQ*d&fuwa#h3bq)z8z)q+v+VqbP-lM2r1TE2H+6BA@zJ zSE43l1#&$ClVD!~0w27rDC7J)#-6xfth0oq7|DIXlvIJx+~3}O8|9nI)}nF?t^#Cj zMJloI>VK-bTB8FKY0qw41&Exn+VQ0_T17U8E8%kF?aMatLo2mRsH#IWPerde*&zk{ZBTvs$2pOk}?Ohaig+b zI}d}puUph3>aA?A8YdeM)@aMQlLrHb2JB|?spZ|KY!z~d(3G_}i(87&D#FjW_LH1u z#GO(ZHcQg0(u>5*82rLJ6KN*(3uQMlrsrrV;vCPFz<*mv9Fs0OY;oi*bQhOq<`B1( zJ%0;qcT>#)cDi7z5sw>DlM1FcT02r~c+}5frY(wEa|)HCdWC*q7QUVjmb2JP%@ZCQ ztT>7m66{&$Ymn*mYHDs$Yv>&{Iuc)4Y85+gOl*8XQu^H^eDvC~5~cz>EjX)qBo{LK z%?zHM3Y@j5S9-)??SF+L$W}sMi?YSCV^BD+E`$u z(ZyJ!Y-G?Qm-~bnd<=@yNcy17l`S4^%svMWLzz#PNV7SsopPc)Y1cRS%hXm(O)=Rv^uhVpnwKkp?(=Tun@& zvd~SNvPtcNUlSl@{pG$KxL6$zR)6=1N8Qxu=WC!?-NSu&;#im|Q9vY^BN;$Bl)l$YNZk zX;=?^CwYe=i@j!cHPhnaMXI2PvK^fWdne$aEW3~-g3l~WCeUm7eSNcb2Y-Z)u~BKH zV{B6~YvuDV!X+|OO_~qyeGy$N6EHibS{*rwp+lXfKCCJ?+-b#Ug8>VVS7dB}_8Q4f z48k+LxB@4yu$H>@8T(=7b0Wo)cO7TV_b8uTel8q}0vdXgJ zPMa1tDKoD5N?QJp%oI9CYJZQ^yu!So^cc5d9H{H@9^uhgY&lZusmTIE{NfR3#R-f! zI1<~0K$ko_H@K{0>amczYww>UmAiYm;BnKHUdz7@N$`g%Cq*JF*o1Hda@67U*FXLA z2Y1?=bQc>Kd*!t4XDwGdPd=2VZ8A05p_c%uRN?$=DIq(q^lSp1PJea6#Ww_st@jh% ziT3y`6rbnCrK#pxEwn~;5z!S+o=Pmf4^Fz#va zu5dKTnrT$rvyvr5S@1wDEMRb!mfUgXBCTpYXe%PkmSw$?m8bwiA0BFV`JsrQ1^|1Y z?4=O)nf568+3shegMSd14wPpy<*W2Aq9iZV6F;v+ykmZDHrOa8Mnh-} z%6g1JG!&9?Le9s{a_p4XyGpNn&?tFD$22gdHZ+#i2B^c%Ie&4m(t0e;BuYlZ8MgBy zf|M2evaMdOo_8y6mdVJ~Z_t`~l1du8R#>BL)iyTGo$kBf83&?8Y13&TQc}m7{xT!u z!-+*mjP(1+DHPW1(BbrNdY2bYH>EB ztWa7TQH*A~R)5|#Bezm&9{{q$&#pheuD&a;x;AXFj9{^|hxaUU0b6CgFlDB4{yIly zsu#9og!9s4`7Oae-8ELGgOR4?QA&qLR>7#JfMsP5E0g z*D>G~BVAZ@W_mbFSVS&*r`gRgN4PTeWo&4@2hALzCx6Ma4uNV;&RJ9Xa?4fbouuUc zdT+@hlCxFZcR0k*kyTl@*sn$Tofb$bQ~Ga$={kG2o!J_$&dZXmUSt;SMO+Rmf%m1p zxk+BtJqXhxYkTo+P%iiO1rDXvbh*eaQYreX%jJ_8eDkJk)_TQ>Y0~g2bZ6-?zk0gK z6p2_+_*eTrtI|Yyfw9KYMI0%{ky8A6Z%3p35 z&rhB|VQ12Z9}H;E-feJJ&JRAqXxdCWp6mi2>@S)70d=HUK|Y)9?&9udyT_zMk|E=f zM9n&_f3K_CK4Tpk&!(?CpWEwL8nBOr;raOS9)AO^BnfaCUan)vv@9-)RdCFL9oV2E zC0*@pWjT0ZCSwQ`_CJEc=QHqZibF+?L3wez*1Kk1Q$Z^F9}GUPPt3DIi#3%{w7Amf)0nGxsE?7iJY!ja5 z*s)k$q>6C5KQ}?C-%RMPTdChrShd5@(HF}<`m#Gq zjL@>=PIU#KwlYJMBKU~h-lTz87Wh|&w&)#+vLG;dYbEHTQd1f8=H^NvqYTT=N6$AQ zJF8R!jxya`2Zge47f=;W>|G8->VJ=|FayTblc|RW#J$k5vH01^0f{FOQfHZ!@jc}S zWL`+WQj3RVgYHNggjo4SL)x+Y0^x;C40YWlhWhkCOs=`4e`T0eJYraurj=BBFjDt2 z-nd5mq}mh&K_?xC9|)P{MO9y2Uv$D{Y=LGY^yFCLE|98MObEj3riazVxqr#Zrm3*Q z^s=s+MQ@8NCsJfN5$xc^be_Q(4l-<;&~R)q<^&RBPAoQY0=d>)*$}uqeuT)?bF{Bd zBg@`XBzj*ikuuAJ5fx)tUNH)t-VCVV5NmG}XYkXi?yD9_wpW`tiy`WPGa1O%0HNBV zFr8k>%ayDeCn9>s>Z%Oo)qkXksvTliT=r>_AxS1sVue`H5Frr^$~*0;OU;M)R%XRl zGjW(9uS(2P#{TvewU#2aZt);*4JYIJ`zVG|^et?Hrzb zY@vLj>^_ST8LK7B{?(UBNgpcODghlayR>6}*?O|rt53yW2fCDcz<;3{Pl3|JZx3j~ zEcAUJ@5yRJkN0Aw!Hl7+2b8tHpITQAT+**{gI;)QUI42clP6`8ExHQn1-)_-t0XIg zTRn&R2$S+onzkI5m+wSL2Bc@`^QGToLQ7U2J`z&}iZ&DBp4M=NKHHb+&e@lid{32^ zHkFM}KH!$O5|J!ijDKg}P%OzwY&}LNDn?LQwox+GlcvO#6(gYS)Csq~xsg=_BTLlU zPtL5Wv}rtRb7nNV8?TQ^FApJ=b|ax-wB~EpjL_71XGX!u{MHoIv|2YtNGJMIic!~Q zSyom+(hAF*n!ixTzdb&I<1yXH-tm&~X!tfD8@F7yGS=2(KIbB zf&>607HH?&Er0znwRETjDLadSl$|M%vNKCe8;K`7OUIL)fq1erPzZ{3pGy1X6bNTu z7c&v%W-4}Z0y_Zb3kLl-VMUql+3<{bphvkb;WSD1OeEms#Sjd!Yf_Q+Ov%G3%Nbbm zSF|~f)a7xo{b|FCp+4OQLUg1s6P^jiC=8JCSlJcaa(^i8L)}Bb%9PVYqcDq(QL7iJ zFX&7P${_r12h}7ZDA=2W^E%=BNoo`X!w=|E3O=uE(TTQ+(h-?>L3KRSq0L5M(w4+! z!e@xaGqNLG`H}7@)aYVZq$I}D^(q$v2^Ojby%PGxL2z1`F{)oJ=$#MumKc87Zx?$_ ziH?K*BY$ivr}t>F*hlw2;FV+_-4lgm;@ThZKt7^J%Ti?jJ zMSmjgy&S3t8E+AmMqtIOE}#aotdsywF$e-WDK6H&G<_j4Db2=fn{zE^y9qP5?%no$rDc+{$qxRI8Ab%_}0 zH)i=yH2gd5hq2fWk2x?1`Sp~4w$r*ssQzyISx%l-)4vn08tqQpnq?V?Gs%Sy0s+HR zVxiChgYTtieb!N^dnKaG)y^R46kA@FCC^|$5?h(Uo)vo$7POnDYO*a@nRY6@-+$>W zRS8LG^i+NsS!npWq;Esil?$9MV`Nsp&;Rm=%|w+ynLTnxmAhV!iR3ZLL#{7pl!%n? z&PkSyEC#}$blmc+Wyk{202w-?)`tS8hyV$|F1nT}SmSFPXzFZ~y~xfvr{W%>6-*=X zoQ9pCQUOjmNmn;Bx%K3S3B|7f6@St0(@#wW;#aYXqU{hL^GSrXUgNURCtbVW)_pgu zy5()g>0p;yV@uA=nKofDH@JtHR?{s=<^TS-fBly~0^p8}0nH8%X8XIW)cK=N!&CnZ zv7tEFpNr8hs%9w1xFcDGo`65nZ#zj8XTm0wJn4qvbuMx3xOl*hNmNZ5kbevH)W<&j8^zR+m|_blrx2bR9Tood>DyENW-Qo;QfdY64fV?<-Va6l!P4> zrz#s&i%GMk^5kLxP5}7##D51*(e_MNOL7t(+o$5GtY@s2mo1hn#~aR|as(TyM4;?& z-TrS!e?_ip(+vOwYDI}k71|xQNgn92F1IXKZsCeMd`9XRc=Eu&Jp+CVxX4vnIpaHMEs< zH;Xk09sGvj2i>I^a)LyPNXMB)M2kM5B15X@OiwcsZ;RvE!tii7Qg*UrvH)?wCuV^S z0`-gSy2~j6H{trqQE6#ZXaD$fifqi6tBZQT*t}s?PUbiIvlK=qblU8HqRA!Ul9XIi z*CM1DM)5612xzE9hJW_DfB(@3+r{ZNUU3=>4Bz0WF$Jdfc5nSoL&f0>?-+%5+$H?9 z>t5sVqJXFwnj529rmT4A47?UOoDVqWz{tU_AimHW3Y^#}gP?f;VywA_In(fan5(UY z6&SuH?kfE$mj!nu6DTf6ir6y!Ig*}+FyPaL&yPv4uJjOX7=Krx`ZW1oweqNGaWEs3 zP#&&Go??31qAV3f%YnQPCo5pZG2(1f z(qdU5wR-XZ!hbK!A_(}nN=!pf=zt{<7~fVC)ANC?g%B9$1Jtf2Fh#Yiv4KMoRyAt! z+lX0Bn)zbvYVwd0!8vArtqny3SshLg3gl624dG^zsyCpDYf4e>@-|>9V1=zDJT`1YI2tAk=u|>#|D3dl8e%L{>DoLi5%q&-C$)*JX z)9!gP=FKqt)WGaw&_7@nv%v1Y?dt-)zoGpL`X_AM^F+jnTUM5)2QVyFX5@*;$cPi? z@||&tfUx~VS@%YTcDVp-JPnnR7GdOK4Mvz)ff=CbL4SNUC07t6eBmM<<|Ecjn-;4yKXUxAOVxyq*>FtZNqKtaYw@*^cytv@{mFN%XV)toYAIY~6Lm{KcwUth&}u z9ew0>#x7?U@_N?r8^~*rZU169FP4FRKtuWxlvyWixfr>gUPL`Ldj!-n3nD9q2-9dOPDkvzGt12%jzUx>dVBK-y@0J2Ng=)Su;b zep#F>o3D#m=;P{bZ)f~>wh$M#uJii#S<_Un$_^3&m&theAFS=mRbF?iYjne4_itz7 z3fKss-GB4d^?Bi>BJTDyYJP!H5Ny_ZR$f<(m^b%vDD3|2?9k>YU~I^$vG4XH7Z(_X zBgsFkr~5m%v;Oa`vtoJOPRWXx&YJ5*ReU!kOz)bkjdFJTylLsb(-w@U%Fl~xWY+r| z&mbl{N9HhCYsx(`(K@q+tagtvA8Pc*jQr-e*?)BF@x?_sE6D))3RAmFdq}Qa_QXj} zNst4topxkC>dR?!F|7zsD`&;@Nq${c9T`n-(izJANuPa>8SjxUA<<(7d)!hK=$IO9 zPmM7U$3gU2Gs~-KRlF{$-RV&?do|7LIs4;SiEt_1I|Ys3fSxAz_OQNKi;RyYqn9&s zKYvsAw+_haY1*OMAnPC4Qj2`b#D=L78>T{Rp!0tL7{f+(&~MYk z7j^(o)d4(hz+tY&7kiwO&RqvOIc`dmthI{-AN!22;`Y|pmHq&0bX=2{nA6?KCbVN5 zqpa84WeL*@`ll1g`X^$zzUQ8lWFIVNSAREbh*t#}AYZ;?tOfU0_-&>-W@Ec5veF}l zpRN{*W=TK$DaP0dIn_d)Eo{e3n_d+2tP&`Uv6%znnE2Ls&&VN1o;QyjjrwGsqi*ITDwe6aK3v|SJ` zF;s$af7H`2COe<(Om-gX9k4z#dP#{OzpI+_ezhGmWG9q$PBz!r>kM{87n;=-Zy?v0 zd7GYx=kz!Iu55W8(oZoX4d9*734hr)q^lPtv30U6>sd*@SSuMNU8rnD(F^Zt0rkU> zY*P(`UeFfPH#K?HRbIugn`f-$*4fR1iWd2KS(V)ln^F3zmt1lp?Dt|-GfjKiElVPu z_$HRp$`ma&wRF6SRwij>jMf&{#ik3W$a(g=p~~@h(3Ckjt>jB}bOEY8Uw;!>C@(ks zrDW4g_Aa-*>fJR!B9JVpR58uT^iTnv?A6tIe=xU;d}fM$?_}(9U>P4+Mh!Kq^ZwxG z1KX0ezr%hYmT@PMef0Job~*!#kKCjU8Cghb+pE|>yYh8G_w4nm>Pj-LSH-gI=<4!5 z4j!gE&3c&covWf+P~D1s$bXJrS@h~paJPu3`E1jtv;OI=&x>zXMcXl*lWxj$a-uP2 zluP|Bd1f6pTQVHc8B#(@U$s|mdE6Nm0cE;<=d6P?2^q#TasZ={N z*X$M-L)I_`_{3L9T%DQwWQIok08_HE>yB(RM6ozvJcMt6O)UV}hkyRvEw1%WIgz%_ zqIVQg2FOWNRk_W8*o=Nj4vc1bO8HlSha3j9BGh=s)~lt|@J>;7Zgk6AO8$EMjx;o% zU*t(s-Auc%s!ZEuyq#J&yVLVkSiu(m{{u^>C(8Z&>73>3+jCNjJlr<4diCop$!guhH?I~oE z0?#gSd z=^JfHTP+dk=d4qC;dF)YSj)3Q$U+KiSb)NoIO?Xr56#a`dw;*b71Li>?K`Hw6?Bt3kA2GtU=8zmrBVYz%PCI4mChRzqwb(EaBY z15OvkjC|qpdw;UfxnXsKtO0b!t+-p5N7chwO`oceB86+W%z z(Hd%Y7I;T(3})#kle?deK8k2& zI#3^fw_t`V#s<1(+MIVe+5N*EiV0hl_bq%aU6b*?fw$3+58tWIY{-eW@VX~B#~EWA zZlg^AlVjRwr2E711zabd4VBP94%+hy=Ag4SsW|z~LNlUO5iM#ton7ViWx=c~=3YO) zp_fY{6Ms^|On5*%OXkjJlr!q~XOx*K#bg5KHyNXxNy^gkbdt|rQH$tNkt2>?=2>SA zGTC5jkK7|XOOw#!1bD$Ag-~>tyk%MQvwlbXy-{;h-#wL+ME7i)i|#Q4l;Yk{SRB{N zBdKcAWbeAl6);jCYCbaI2J?|&hbcK zXODK}_h7Q-S;L;#&W<1LvI}psud7|M#jc1h;4;hDW0^eIXLQKF$CC$#AWtJu12LJm6bE5`Q~I*XpArFB zFz4ddX-SV*W%4297@u+*w8WPrOqP0ckp6X+Yz{!)y|pB=?P5u_%67^>`rbM9kjy&K z*8Y$^<#?)O@(sFtdihJV`GU0mP7FZlk$;50ZfEe9Jr?`mLMW2XAr=0qwJZHtW=;LI zF%HLic68kn0NsKGCC2xCv22WfPKz$#1$zRZA3_3OwmL}S)?fel^DoGnF`*OzDwCr- zlZS_shaXKIK8RW5&!_|IJ7vIz+~-v1IrJyLeb7`*E$_Wx?&pdu3jW7i(o8NZPJdi+ zsMANg{ax(;yuKQ6h8#xqL=iSvsl_GXIK4q_+$_H z4h0v;`4k=yZb5B6M444;*>?6>{{4-;_8{ERN0h!BLYBV*C5^91#VuYp)#|zs1KeMh zRn@G@`m3fM#(W?-GBk}KJ`(GrQ-2f1k=z?G%s5C<2>H}srY-#EYT-W@|7>S$p^)oe z(xpz%gv(;77WVUqgEf6LU`0Q-R`m1!7Q4OLE`hXga4Aahv$8Jo<$qpvS)4EP zTg$wDC1y$v{Dgnhm|1esqOy}t4WEd4d0o^kRaf9zehC({`b#K9zgy<>V$OUT)ILm? zIcwgpdh)ZEFWK)$yO>7hJR_Ax6&Nj8>o1YTZe79Opx+LFh`CevEkqLS?=udLy{BLP z#F19|iu8)0#)ACwPrv@dzkeFfr-}myk0%fBO&;$|KDjg5-$DB950qOJ6TGT&zU;gw z4>ou?3&LqMNCxj$g*bSKikouY7|+v_hERw+U=Ab>i9+cTgnq{-5KI3S=0QZisb+m} z5LGhgt(FM#`I4z=VpG?MxL}K_$%N@{s~zIPt5OLu^mra}81y744}Ty;fJoj_udS(p zkbNF4k^=%z;b5#HLL~2_5d51E`(O)Z!j~V%glTSDz|A3Zr}e?4S)Ha74UDT^CPpTx zLQX&1VDYNBX|RcW{uYM{{~2qS=(_~x1!_5Xu+J$&!5zP&P5?0! z_so>7GBBJ|40W5z-G3yZ%c2uZGL?e0S<5-#0I6zu5_MBy_wApa0(4lTd&qF;f?XSw zVqQL{nx;pR8A)_8$CN6oynHSd#~7JqOu+=;P3==PpCCrz%~MU|d9yn&mjzp; z{iHrk*5kdy0kitlnnEx%cHg1$JlH4GqlSvj=F{+b{p&yeOMl>e4iI3{*8R!eeYu{2 zU1^OKs2P{sYrt*GO0?FY#;k;`UwpGFU*{F!a$Un^3Mna2Yf^8kX2TkVUAcPf4M4iB zS-cGXKKl8s&^+5cu*W%O=LRs(YekAL;r^#@hUGHjd<2XyeLNnDVsrtW`>M#h>wJO8 z3z4Soj>0giTz}28G_G+kC0Qk6i}W@{^Uff1l+i7)gmdz0si>W$+y0!b`YlKf`I3d( zxm0fCm3q5U6i3jzK(%7;ur=dQ%$EK_ zR$oG|(d}itSEcd|h=k{-0Ck-@CHu74wzd!%lyTkLIV(Bn=kDj?#9 z3sJlf?A#DY}cXggcyX}@LP94Hk6RcGQy zD?}t)T!c5-2a}Jf)opx1VJO>V4{ZK*6KC08QDhVOaQ>02dahf@rJ;X~dN@5;Au&xAzt z-j^|i<**(mJ9pKq3r3;w6zN+w{1GvJeEQZwEgL&+f!gVLLx<>V9jky^#9J6Pq)(X@ z_wUJENKuV&!upbrCZ8>vfrj1tcMRKZ-vyQ3SbrxmlC83Fz1h7WJWcz#zJ#mDaoy}f zF&pegze{)j&g&XQO`R71q+Zyay$E-x)4aL+>yN)oHU4ey?FeDbBufWIzuMm9;e)Bg zIT7~ZI%f0v{5>c*ah9k>eQ)VD#$g{QHt{<*Ru>MHwUm=zp|hG>$aOF^gP^HXU19ce=FWQms>^86e83 zkgh~g&RBcLErq71yP_-(B^Z)^vKsy#+dlVZ4y?Q;eEJXkGXOS!MVO1{?BpskM*CU2&b4!oN(*MCci z?{Zp{Z&rDw`Jp77U3#OAmBe!VXcs|)jlrk%fdCJbfmzplQOA}DA`t4>AbrL|+K}w* zS0>1t+sZJ@p?&9hQC?o1qZX4GlYgNx1aQttbgSQ9=x?P4=U4ZIFFZ=w4}MY%4KN7B zBS)vQM>Tyu(EvPxWq(=S{^`X$1?EV#+oR&@3;ijE#Xl*0eoZd#P+$B8XDiipEF&nq2^}s~MlM zs{6?l;=x&dUSS3p$JYlGpis)F#49G8=at{*2oOEa4`z`xE{x+`)8>(7kkIB1!*Y-E zNge&d8OOoh`24@ltJPQlCx1XI3ey1KjU0iJZaUH6jhsk8Al70dTpGJmg?AW7BZL8@ zU$-_N;~DhZR&5L5kAL|e|9dne;NIl%-O2vPll}d0-(($>&0OcxS`)g8!+wO=QNr#V zP#&fe+9n2dhFOC1v$r5rR0_@@AXHjWV*DSf16v?|h6%*aEP>dF>3?LMr$L&n7wnh3 zc%Irl4}norzW$+l{X@Ac5_UsyO!l1U8$#NLl!X&FSL!opTQv{iev)54pMTBb&gEg8 z64I+Z3oJ2FasX`$obbBQb{siC?}A~Ob<6N!Sg@9c_faHkl@o0Uz(EX%uVVUI&BX_V z!~OK(cGmy;S^M?Nhkx<$m0B|+*m9k_>Bn2tJdoLxdxyX8WakrLN541OdC2zzcK0Li z-3RpU2tl35qjsFy+%^pJXIhB=EpRE6uA0YUBYF>8(xQ-< zdY`Z|5egv+1W>@Rh%@L%c6(d~pd6A0KCvU34P&B`y6}h#N6f?-?sj&+XgsT7W`nuu z-idcr;`t_4h<`E5A*Z|YO{@ZDtyxpkAk`YrQDSe%-P>Z2`q|EvB3B55Lkwk@oFg@6 zo1*dU*H;@T`jdvUoT#{!URO9#TjAu#0XHq^n(*?g`aRze9WFW z^dynk9e}P2!|Y2|MSa;x9BmXV7d|oZMdkunQ{uirD1SldQgDmJiS@nE{-+Oz=0w?; zq>V_)dmk$qdd$2hVcBN3ERwP*_|?1Q+&@7b4@m_y+=mkHP#?=@g8A9?O+0U;9A(VT zc4k~iM_en~WQ0ar5wB=m3}mesF7FL;i^L(27kRl%^-1pj`r|(vehPjR`NXSrP^5cz z5T^z_aeqSMPOQYEK|PIKIS``|)d|?D0jL7aw9v`J!;x1B1<7J^aNacid5HPPP^T^3Hkg}E0W?O+PN(P%mGpgYzm~AC=EM#t z9+Xzf2r!P$E9FLo4}$!t)u@1$1{ps<9DfbBOjUODSkN`XE@B8r#bNM>++tDXGl&s% z0An1SNPAv_1^s{)HQ>4ypJPn~xr?9|yBG(ywzez~P>$b15VkGkT<96R#BV0F;7ILJ z00K^^Ho|=@nFQt@x1ihsS?B`K7S`W^a*G=Y9{IH}_;M=VV~tJ{fgztRV4#l~)_*o& zWRv@Mbdo+_Nm>qYhqol>(O$n0241 z49b~$SgjWGK2b}b?jlXjheRfNUJgeL`OmsFaO@cJk8JCoCx(0s1GmF2yGaXogwb|r z)?Ht!AY_FlC4rTyDqG~u1*=RxtA7eCgd|39wL~^vYAdh}#`0;n%~tLZrGE!MNStvi zE{-Y9fH>%EFjfix;6xZUK>C@##jM}v@FxF}(|m_=NQ@sxZ8>)%1F4Y+UAi-pv_pQ( zy{BnVYvyF*BsI&EQmdkZat%n)U;p^?KmGc{??;OnIAA9#`R{Jb*SD%8Y<~b2jTA<} zaM8~1znnEjdb(gH5i={bJ8MXS25XIDGB8_+mB|{-1Y%|STF>=`3LJf@DYSzOJ|twd}i_1GdsJg-+x4=kO(rxdx-oJ=`Ru#2uq1QSO+)@3_67C z{8uSCc~b7DCzRRKb1Wr9iGL+AcD%$-e^QK9<430$d89f5{YMn4w2h`=w|M3W;rapb zMDnkvy-@U&#U8Es<*h-1ormDG`UDorhlB?bX;+?NBGA)5G%4zo{o()ot6m`K*B^f9 z1x#`T0~vFK?5Dl#Nk|jHl=hYm%)~N-O%8S@`#VT^C2{cYATp_x34ajbbmOU25#d!0 zN7x;~$YVAbmAImI)EG)5OAGUEH9*#--%h}Jj2T;#Vln9RNS8B}zGH-hI)L0HE{zUq z5J)wPxx$Ttp&D0t`>MFHeV7hki^DPtsZ5Y;o6f@!UEESuIg(qc2y6<#Lz)4nx_Kjj{(q#vgdt9XAOO_F*KnXh z;tDp6-Em9U5Js8E{bG4uc2w*pf79v@1C%B3m1vdG#IItzDmf=wM+fL93`5!unmcD+ zVBI{rq0GRhsWRHu077H!dSon07T9Sv5-f`sC{uB>pnK*f?4~JqsZQ&UT~U-B}1>Ep;)(lo4o8k|6{F2Q1Db zamP`tM~{;?-XrZ`R}H2fUizwbpm>5^@^ z;go%tYjRVW`+QzX$kW^6dePl@j-43x4v9F$>nOp9VKcZuC?`#?Q0MaK4sfr*HRWRzHfJsAC zijYKg%71h?jiUmzo|au+ydGdhkV@VODYI*d@#2fZnTk}+LzLPjJ0!m%)+^rm=4fB^!CJq#NTGb{2-b$75eY43y&49`eYa69$ju@!K#950 zEPvurNTAZf_=U1D#gm%&(ljl!I)dWc4raXzqjDhlau#>3Un8d@c9gi|JtH+1U%02z zL!=$mfxv#rAk@k;4AIpTS?w=#6rBen0$=^Ihd%56-j}E^_vQ0Y_L%5xV>xLf!~phk z7p&SedVI-p?8#@EMc6vCU`=-9FcT4?uYbu#L5V(9e;XC3DnO-S_r@> zfQb%YQ2IFF`DcSb`HARqO!2llh!lg24qIDV+ICNFrFFTpk+0pGOer3WpX_oD8M?km9)cz1R8j{ok~AKYD*V6Mx=+U+K8&rf3b?h${nqT-e*K=YQ+6 zwOpFj?%p1MbBPn*CHXi~M(dS{0hOKk( zso-Ore*%HaahZs*tkv5u`e{c}})XqJlOCJL11+)2wH) z+|IBZv-&j(#!0d}svYssV{58((jxhgBPp#l3^+e-OQmj5Rtccj#S`^~vSLaj7zWl+ zDkPXjTSso2!5O@b1UIoc9F1-Aq-kE69)K7Vq&nEdl_V#EodR;y)Y|^kkADM_TZeP= z@SXTB3YPU74l7!QWOso9M`_4oGs_F4l!`sJjBOi@0$itji9JQv%Mc|?eKHS>BMb%*x#szS2Xr-1(~dam5{!5Rrlcz-b*cS%AFa8p+T z%59`93E>X}Kn`lapRdT8k~(lN_S20aZs~yrQYZdgBx4yCbYLpNl$xaq>skQcJX%96 zP(fFZ*(jyid3})6nh+<+Bk9(J*ifOa&=bI}Njp}RL!(onFI*Pt9KZ|Jrp3?m9V7So zAS^#9HUa7%tB6KMIDhRZG>T3b6^*qJM$VqlcWqbaBNf3Ql#+^IDCWVci#TH7)Eeq@ zM+igW&OK#q?5_ZLYVi3T>-nAc`)n0<`@2^AyYGYiLn4925Su2L0B@9?wzAEn6~J1! zbI&q2T6ZzvYH~k2-hOt>euDJwdgwnlbqgTHw7b%b-eo~lQ zj>5sl41dEmqJ(Cp2E5P3IgTheeU<`B_b`>_@9&~*D| zr8_+|cpV3x9e*60>ZJ2kHSj_Ph8H%#VFX0NeodoW@KOU}k(v3`5kyq1%B1xN){tE$ z0In)cp@JxXC;TbG!m7QqRW|{kaHTA=*4eIgiUlvY>k%T`%C13(op~w)MRAFsxl>BH zvbdrDY2|dj1QM2SeiCJQE2QTknuhrj5n1qw;amUj#D4~pqMg2|lcMGJ)V6{mjk!X- z86Wc3g{=n+E%}L%wN-&o=}$+5koMKJJW#yOAt-N%r!G2qwEKa}f&1Z_&i}8l>hanj zCwl2abHSWgS9~dqL>&bv2xe0Q=>{l0mXGY zvIL{@GJ6crJjEx?dNnAyLD`ly88R7eUSC#Dj(-*`M>gcnFyt{dU^l-@tzB+ONe)};WDDIjq?rfQEx-W~=3%M_2;WeuM8xAp)E+>~Mr##d<#7LinKs9} zVt+gVmBHGWbhNB zyRfge^M~Jk`8{H+*d0elq>6a<3 zGzwAD%(81L1UTSi7y=}KrEBM3NBIp6C}O0M7HcC<$npd zTaz3Lch`8i4Zzg_lE&s8439LLMJbAh&j##JXRQ6{DlU0(kf4<(XFRkfk{AcrA6*%b z5sn^Ly-_KPeAA|EQoA(O2$)cRVJZg#R7XCQE#XnuC3$&?M+WMKZX=e}DU#7uRv(DP z-*Ry1wI+OdQpO*!mMAx~d~$b{uMT>>AQ(>cddEkrRJXT96I3)G!{q& z42VZWC6hu}|HI0*{|)a1w7jr#zO^Y%~LcLnA}d zj^eq@Qo?dvsmv4toomDMuNmB0?%CySz zsFjR0Tjb@kuNH-vIO$NEiw{(kGy=v#rA|QDXVm26Cp(|04np84RFWGgS*CXpC3Bh( zf?1(r8i(gWGf7Q+d4JFh4AQUv_;Ub%6d=Hu^?h>S4%4@Wge*mCTfT@THGS7*O;qh` zp1%P@!T2qkhWybr9cj8K<+@X@pS8h524y{tAQ~(xIHBa@X32EU>s{s1JusSKg~2qq zsWvo`;{~aeE;(_q8hR{1CQ3S`*{Fv{{eTtwqAp%6pEXNwMt{c0)o;+6coHxgyH?rZ zZKXao*`4mSky!VRG7;rk56olP z=5<|Ol@&ZHRb2ksEDIw)fr0;#akDhH&!BKw8x>4ux&-e!Ak$E49|)$!&#phcD!$7v zn>uW(jbO2p`+s*VasexCIX7jdeD-RH%v8>8$%y8vi7$`2N3^}NTg^?T6sMlYgh>rF zlEno}#Rb0WNj>za_mRprTT$))Og8zqY_4NqJ4W)X=q&Dd&a8;M?M{QEVUBR+tsAhR z^&T{Hgq||aIs}RtJ7-Pl%Pm)#cajp}>%Aq5NX}Mq-+$qNf@YR^SyPW5=XYALWS{l_0tg4#gSVIqu7 zd)0g^4}Z-U+u5_@XO9K<|KRyYJ}c-SLzop!cY#Z5b49U9N3uREV>?Wi{uA1M>>(W6}fj7bue26)nrFe9$I zs8+#|2!RlTij*m}x9y9gD}$6kxrqNUq`#bjr+;Ix?|uy6#qG-HnjH%QVe~%)L|>nn zrNh9^r2gi?gmAODRj$NQ|0N`~Gj_vn#<+K-Tf1o1y+9gJemaqCGjOPMG1~LCgySFob&b>Y;*&QK;H2R9qGvnFVrP zv51h^rhK}wW3jqO72$NxX@dH^ndn}(`hUF15M0vdbyG*1TVM#@m<49^7`&wVGOjnX zLW9ZCa-9|z+&hYjZY6o>*}c0SkhXw^o8aDwr%*HaAxa8)aCYI()VXc?wbuxG8iK4i-YaoniF?sc$b3 zA--<43pAdaO+7Xs=>v?70Uw-xjrnmf6-QW}-cbfN;REt3I&?@j3=(^{9B|vZh2{E%VJXwV4ZZ>`KwOr=S6vWb>1k4 zodsEp(4At5yC8zGHNA0g)A*pKI44D3RRwidU6e&NZ*7s~xEEQD6+1XKT^D#{{Q!Fx zHXK`wImX18V~b53V~!116uy*14+*()M)vhdWPxsu18(yLQE+4s959d!OMmyT)0-eU z@?&i<>I{BTlx6dAZU7)08!DMdgYvzZ^9cutV&M z%kRr_>GY{~M5zlhL`($3GW&We=*l6!>GO`m3=n3hC5V+7u)n?KcYBdq*Miww)cq$FTeZ2_D< zW|ubNFI!Jmd-aL>YhRaA_obu!2~r;R%|1`mM85B%-M-$-qup3(aKO;v0cGv)C)SmH zm-Gv6@C#4O3uvWT_GF*jiLXL_L9b0Cs(C8mR?kwshM94irY*;1aDO`nNoe$3ZoWiq zLTDM3v5iHvprXx4sFM|*%gy$0xwE^arD=om(x&pZ^$)n^tweN#6ywD=R7-LcTaVER zL}-C!8zoacu5wztE&^E09W$%z>%LA~WVuZH$%$1VGmU3$&WvVv)n5 zwr#4{ab6r%vtF0qd9-k9LK&Ud#E3$R&L`6cg#F8}Km2}_n18Un`|J<$-(8 z)=z&77K*eWPp2`Er&9oVI<-W`HStcT>3FA86z_D33S{A3O;|$N%v%rNTwC+hx^VE( zXypNco2{Qr1b^7qbZOKSoJJK&PeBGpC9K#I6a);d7^)%+35YPiu?iOs);ex5C)TH% z=?;#|1a@+OMh%6{mn{aDOX0y9g-LXbPdQKhh|YA90+{V~F^wWbqP;ozl@o-WqzGZ) z>VP%`P*+V&&VfzT3>b(4gX0+wL$n6cXu+Hwa)x+3n149joSpGKF0-Fjjo(JQzR z2v9F7@=D~Fgf?j-6-{S=}AKramR@;1dM-|)b zZ;IBSjkq#2h}{_c#H=8sw3)fQPoo9y?eQ0pw(&jwIy7bgSj*)TeF4jdtbQeH0xsUM zN?sxl0e_0<^RP!Z14i&&r`=7JlyKQPESXeI^8xD7R60~~lw;ZGX<~#-S%}3Lo#3mY zAfp)&jP4d13Nx*j{i;y}j}LLf+lVtNyTHtD{%O=9JcAOs+Ta^4d8^qx9Q_|>KM2sB zVB!A3OoVbdQHaFA>;`=Wg!8!i2QC6C%>c{RvwyY>qpgRthD}mDGGR0tKe3h@#h@9=Bz^5u}MhH~=y+ z!+!z-b_q|an*n^@3KAIJd(>G#u_VI<3y@p$mtTMXzvw@jl`vQUPitmW!&~R>h^6!% zK44bnyOaGrc+s*!4k)FEJZe?f+ek~ly2Q-d8?%=un#-NenOJm&#}yL6LOYBa3Imj{)XJiW>1b+%h3F3Ij0YmSlXnodEsN3?RjJ(d!*A!dc zAWNRXfO>S~0QL;*MO4tPs-hZf!5V0%()%6HQk9UzLr;Y^Ad81wm;7y*x^hmFAgq}c z?bAR1w3%4p$CHQdSYg-836VTTd2sULO^Qe!{ynyAWHAr{hLe_OEyED%Lm!|sYJYtI zKtzOV9d~TiLcto(q2;M9XV{DEoLvwt5UpSuiMuq!0hbDB%09ljg~_dDKTI%vfvAXf zpMGi(N?*h(inbeholl~q^^(>DK5pv0x@?PgB`Bh|Lyp#$W?8+0gzCuC{d{(yTd$K z|g(! zVjJ_t^1SRQHm_Ueqxp^g)C(gcI&Jno*5s0KF+-`TYcb9Oqxgm*1T@s5KzrT2`|$nk z>|~p+I1L6yZ%EV_fT_LNUA@&%arDAlLE)`*2|sC?S2RE{ zogx%5gN0HzeW3%m+2Xuu6Jv97YPWL;7HX*Co5vbF(PGC5?fh8v3mGF;}>RXdwN_YCKqRP z(8TtFZ^Lxs5tb=#Hrt44syCIz*rs|$uR>PLEK?hbk+C}5K!6NT4h;cel*${ZnrKQQ z?h+fw+E@0@$R{#G=pKMXKu=eB`>K#o0g)xf&`Bb91Ee(3(!-eQ2kHC&1G7p;L#(TJ A`~Uy| diff --git a/dev/search_index.js b/dev/search_index.js index 9da6e63b..46eeb153 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"advanced topics/ManageProjects/","page":"Manage projects","title":"Manage projects","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"advanced topics/ManageProjects/#Manage-projects","page":"Manage projects","title":"Manage projects","text":"","category":"section"},{"location":"man/QuantumSystems/","page":"Quantum Systems","title":"Quantum Systems","text":"CurrentModule = QuantumLattices.QuantumSystems","category":"page"},{"location":"man/QuantumSystems/#Quantum-Systems","page":"Quantum Systems","title":"Quantum Systems","text":"","category":"section"},{"location":"man/QuantumSystems/","page":"Quantum Systems","title":"Quantum Systems","text":"Modules = [QuantumSystems]\nOrder = [:module, :constant, :type, :macro, :function]","category":"page"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.FockTerm","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.FockTerm","text":"FockTerm\n\nType alias for Union{Onsite, Hopping, Pairing, Hubbard, InterOrbitalInterSpin, InterOrbitalIntraSpin, SpinFlip, PairHopping, Coulomb}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.PhononTerm","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.PhononTerm","text":"PhononTerm\n\nType alias for Union{Kinetic, Hooke, Elastic}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.annihilation","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.annihilation","text":"annihilation\n\nIndicate that the nambu index is annihilation.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.block","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.block","text":"*(f₁::Operator{<:Number, <:ID{FockIndex{:f}}}, f₂::Operator{<:Number, <:ID{FockIndex{:f}}}) -> Operator\n*(f₁::Operator{<:Number, <:ID{Index{<:FockIndex{:f}, Int}}}, f₂::Operator{<:Number, <:ID{Index{<:FockIndex{:f}, Int}}}) -> Operator\n*(f₁::Operator{<:Number, <:ID{CompositeIndex{<:Index{<:FockIndex{:f}, Int}}}}, f₂::Operator{<:Number, <:ID{CompositeIndex{<:Index{<:FockIndex{:f}, Int}}}}) -> Operator\n\nGet the multiplication of two fermionic Fock operators.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.creation","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.creation","text":"creation\n\nIndicate that the nambu index is creation.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.latexofbosons","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.latexofbosons","text":"latexofbosons\n\nDefault LaTeX format of a bosonic index.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.latexoffermions","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.latexoffermions","text":"latexoffermions\n\nDefault LaTeX format of a fermionic index.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.latexofparticles","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.latexofparticles","text":"latexofparticles\n\nDefault LaTeX format of a wildcard Fock index.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.latexofphonons","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.latexofphonons","text":"latexofphonons\n\nDefault LaTeX format of a phonon index.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.latexofspins","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.latexofspins","text":"latexofspins\n\nDefault LaTeX format of a spin index.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.DegreesOfFreedom.MatrixCoupling-Tuple{Union{typeof(𝕓), typeof(𝕕), typeof(𝕗)}, Union{Colon, Tuple{Ordinal, Ordinal}}, Union{Colon, AbstractMatrix}, Union{Colon, AbstractMatrix}, Union{Colon, AbstractMatrix}}","page":"Quantum Systems","title":"QuantumLattices.DegreesOfFreedom.MatrixCoupling","text":"MatrixCoupling(F::Union{typeof(𝕗), typeof(𝕓), typeof(𝕕)}, sites::Union{NTuple{2, Ordinal}, Colon}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon})\nMatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{F}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon}) where {F<:FockIndex}\n\nConstruct a matrix coupling for Fock systems.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.DegreesOfFreedom.MatrixCoupling-Tuple{typeof(𝕦), Union{Colon, Tuple{Ordinal, Ordinal}}, AbstractMatrix}","page":"Quantum Systems","title":"QuantumLattices.DegreesOfFreedom.MatrixCoupling","text":"MatrixCoupling(::typeof(𝕦), sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::Union{AbstractVector, Nothing}=nothing, cols::Union{AbstractVector, Nothing}=nothing)\nMatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{PhononIndex{:u}}, matrix::AbstractMatrix; rows::Union{AbstractVector, Nothing}=nothing, cols::Union{AbstractVector, Nothing}=nothing)\n\nConstruct a set of Couplings corresponding to the dynamical matrix of phonons.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.DegreesOfFreedom.MatrixCoupling-Union{Tuple{S}, Tuple{Type{S}, Union{Colon, Tuple{Ordinal, Ordinal}}, AbstractMatrix}} where S<:𝕊","page":"Quantum Systems","title":"QuantumLattices.DegreesOfFreedom.MatrixCoupling","text":"MatrixCoupling(::Type{<:𝕊}, sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::AbstractVector=SVector('x', 'y', 'z'), cols::AbstractVector=SVector('x', 'y', 'z'))\nMatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{<:SpinIndex}, matrix::AbstractMatrix; rows::AbstractVector=SVector('x', 'y', 'z'), cols::AbstractVector=SVector('x', 'y', 'z'))\n\nConstruct a matrix coupling for spin systems.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumNumbers.Graded-Tuple{Fock{:f}}","page":"Quantum Systems","title":"QuantumLattices.QuantumNumbers.Graded","text":"Graded(fock::Fock{:f})\nGraded{ℤ₁}(fock::Fock{:f})\nGraded{ℕ}(fock::Fock{:f})\nGraded{𝕊ᶻ}(fock::Fock{:f})\nGraded{ℕ ⊠ 𝕊ᶻ}(fock::Fock{:f})\nGraded{𝕊ᶻ ⊠ ℕ}(fock::Fock{:f})\n\nDecompose a local fermionic Fock space into an Abelian graded space that preserves 1, 2) no symmetry, 3) particle number symmetry, 4) spin-z component symmetry, and 5, 6) both particle-number and spin-z component symmetry.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumNumbers.Graded-Tuple{Spin}","page":"Quantum Systems","title":"QuantumLattices.QuantumNumbers.Graded","text":"Graded(spin::Spin)\nGraded{ℤ₁}(spin::Spin)\nGraded{𝕊ᶻ}(spin::Spin)\n\nDecompose a local spin space into an Abelian graded space that preserves 1, 2) no symmetry, and 3) spin-z component symmetry.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Coulomb","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Coulomb","text":"Coulomb(id::Symbol, value, bondkind, coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :))^2; ishermitian::Bool=true, amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nCoulomb term.\n\nType alias for Term{:Coulomb, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.DM","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.DM","text":"DM(\n id::Symbol,\n value,\n bondkind,\n vectors::Pair{<:AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}}, <:Union{Char, AbstractVector{<:Number}}}...;\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing,\n ismodulatable::Bool=true\n)\n\nDM term. Since DM term is antisymmetric on every bond, only the positive direction of a bond is needed. The negative direction of a bond can be handled automatically by this function.\n\nHere, vectors specify the unit DM vector on every bond in the form [bond₁, bond₂, ...]=>v, where bondᵢ can be\n\na Number specifying the azimuth angle of a bond in the 2-dimensional case, or\na Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or\nan AbstractVector{<:Number} specifying the direction of a bond;\n\nand v can be\n\na Char of 'x', 'y' or 'z', indicating the unit DM vector on the set of bonds is along the x, y or z direction, or\nan AbstractVector{<:Number}, specifying the direction of the DM vector on the set of bonds.\n\nType alias for Term{:DM, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Elastic","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Elastic","text":"Elastic(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nGeneric elastic energy of phonons.\n\nType alias for Term{:Elastic, id, V, B, C<:TermCoupling, A<:TermAmplitude}\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Fock","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Fock","text":"Fock{T} <: SimpleInternal{FockIndex{T, Int, Rational{Int}, Int}}\n\nFock space of Fock generators at a single point.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.FockIndex","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.FockIndex","text":"FockIndex{T, O<:Union{Int, Symbol, Colon}, S<:Union{Rational{Int}, Symbol, Colon}, N<:Union{Int, Symbol, Colon}} <: SimpleInternalIndex\n\nFock index, i.e., the internal index to specify the generators of a Fock space.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.FockIndex-Tuple{Union{Colon, Int64, Symbol}, Union{Colon, Rational{Int64}, Int64, Symbol}, Union{Colon, Int64, Symbol}}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.FockIndex","text":"FockIndex(orbital::Union{Int, Symbol, Colon}, spin::Union{Rational{Int}, Int, Symbol, Colon}, nambu::Union{Int, Symbol, Colon})\nFockIndex{T}(orbital::Union{Int, Symbol, Colon}, spin::Union{Rational{Int}, Int, Symbol, Colon}, nambu::Union{Int, Symbol, Colon}) where T\nFockIndex{T, O, S, N}(orbital::Union{Int, Symbol, Colon}, spin::Union{Rational{Int}, Symbol, Colon}, nambu::Union{Int, Symbol, Colon}) where {T, O, S, N}\n\nConstruct a Fock index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Heisenberg","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Heisenberg","text":"Heisenberg(id::Symbol, value, bondkind; form::Symbol=Symbol(\"+-z\"), amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nHeisenberg term.\n\nType alias for Term{:Heisenberg, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Hooke","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Hooke","text":"Hooke(id::Symbol, value, bondkind; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nPotential energy of phonons by the Hooke's law.\n\nType alias for Term{:Hooke, id, V, B, C<:TermCoupling, A<:TermAmplitude}\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Hopping","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Hopping","text":"Hopping(id::Symbol, value, bondkind, coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :)); amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nHopping term.\n\nType alias for Term{:Hopping, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Hubbard","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Hubbard","text":"Hubbard(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nHubbard term.\n\nType alias for Term{:Hubbard, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.InterOrbitalInterSpin","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.InterOrbitalInterSpin","text":"InterOrbitalInterSpin(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nInterorbital-interspin term.\n\nType alias for Term{:InterOrbitalInterSpin, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.InterOrbitalIntraSpin","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.InterOrbitalIntraSpin","text":"InterOrbitalIntraSpin(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nInterorbital-intraspin term.\n\nType alias for Term{:InterOrbitalIntraSpin, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Ising","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Ising","text":"Ising(id::Symbol, value, bondkind, direction::Char; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nIsing term.\n\nType alias for Term{:Ising, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Kinetic","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Kinetic","text":"Kinetic(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nKinetic energy of phonons.\n\nType alias for Term{:Kinetic, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Kitaev","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Kitaev","text":"Kitaev(\n id::Symbol, value, bondkind;\n x::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n y::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n z::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing,\n ismodulatable::Bool=true\n)\n\nKitaev term. Since Kitaev term is symmetric on every bond, only one direction of a bond is needed. The inverse direction of a bond can be handled automatically by this function.\n\nHere, x, y and z assign the x-bonds, y-bonds, and z-bonds, respectively, with each kind of bond can be\n\na Number specifying the azimuth angle of a bond in the 2-dimensional case, or\na Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or\nan AbstractVector{<:Number} specifying the direction of a bond.\n\nType alias for Term{:Kitaev, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Onsite","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Onsite","text":"Onsite(id::Symbol, value, coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :)); ishermitian::Bool=true, amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nOnsite term.\n\nType alias for Term{:Onsite, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.PairHopping","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.PairHopping","text":"PairHopping(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nPair-hopping term.\n\nType alias for Term{:PairHopping, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Pairing","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Pairing","text":"Pairing(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nPairing term.\n\nType alias for Term{:Pairing, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Phonon","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Phonon","text":"Phonon{K} <: SimpleInternal{PhononIndex{K, Char}}\n\nPhonon space of lattice vibration generators at a single point.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Phonon-Tuple{Integer}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Phonon","text":"Phonon(ndirection::Integer)\nPhonon{K}(ndirection::Integer) where K\n\nConstruct a phonon space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.PhononIndex","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.PhononIndex","text":"PhononIndex{K, D<:Union{Char, Symbol, Colon}} <: SimpleInternalIndex\n\nPhonon index, i.e., the internal index to specify the generators of the vibration of a lattice point.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.PhononIndex-Union{Tuple{Union{Colon, Char, Symbol}}, Tuple{D}, Tuple{K}} where {K, D}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.PhononIndex","text":"PhononIndex{K}(direction::Union{Char, Symbol, Colon}) where K\nPhononIndex{K, D}(direction::Union{Char, Symbol, Colon}) where {K, D}\n\nConstruct a phonon index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.SingleIonAnisotropy","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.SingleIonAnisotropy","text":"SingleIonAnisotropy(id::Symbol, value, direction::Char; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\nSingleIonAnisotropy(id::Symbol, value, matrix::AbstractMatrix{<:Number}; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nSingle ion anisotropy term.\n\nType alias for Term{:SingleIonAnisotropy, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Spin","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Spin","text":"Spin{S} <: SimpleInternal{SpinIndex{S, Char}}\n\nSpin space of spin generators at a single point.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.SpinFlip","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.SpinFlip","text":"SpinFlip(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nSpin-flip term.\n\nType alias for Term{:SpinFlip, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.SpinIndex","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.SpinIndex","text":"SpinIndex{S, T<:Union{Char, Symbol, Colon}} <: SimpleInternalIndex\n\nSpin index, i.e., the internal index to specify the generators of a spin space.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.SpinIndex-Tuple{Union{Colon, Char, Symbol}}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.SpinIndex","text":"SpinIndex(tag::Union{Char, Symbol, Colon})\nSpinIndex{S}(tag::Union{Char, Symbol, Colon}) where S\nSpinIndex{S, T}(tag::Union{Char, Symbol, Colon}) where {S, T}\n\nConstruct a spin index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.SpinTerm","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.SpinTerm","text":"SpinTerm(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nGeneric spin term.\n\nType alias for Term{:SpinTerm, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Zeeman","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Zeeman","text":"Zeeman(\n id::Symbol, value, direction::Char, g::Number=1;\n amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true\n)\nZeeman(\n id::Symbol, value, direction::Union{AbstractVector{<:Number}, Tuple{Number, Number}}, g::Union{Number, AbstractMatrix{<:Number}}=1;\n unit::Symbol=:degree, amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true\n)\n\nZeeman term.\n\nType alias for Term{:Zeeman, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Γ","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Γ","text":"Γ(\n id::Symbol, value, bondkind;\n x::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n y::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n z::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing,\n ismodulatable::Bool=true\n)\n\nΓ Term. Since Γ term is symmetric on every bond, only one direction of a bond is needed. The inverse direction of a bond can be handled automatically by this function.\n\nHere, x, y and z assign the x-bonds, y-bonds, and z-bonds, respectively, with each kind of bond can be\n\na Number specifying the azimuth angle of a bond in the 2-dimensional case, or\na Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or\nan AbstractVector{<:Number} specifying the direction of a bond.\n\nType alias for Term{:Γ, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Γ′","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Γ′","text":"Γ′(\n id::Symbol, value, bondkind;\n x::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n y::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n z::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing,\n ismodulatable::Bool=true\n)\n\nΓ′ Term. Since Γ′ term is symmetric on every bond, only one direction of a bond is needed. The inverse direction of a bond can be handled automatically by this function.\n\nHere, x, y and z assign the x-bonds, y-bonds, and z-bonds, respectively, with each bond can be\n\na Number specifying the azimuth angle of a bond in the 2-dimensional case, or\na Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or\nan AbstractVector{<:Number} specifying the direction of a bond.\n\nType alias for Term{:Γ′, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕊","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕊","text":"𝕊(tag) -> SpinIndex\n𝕊(site, tag) -> Index{<:SpinIndex}\n𝕊(site, tag, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:SpinIndex}}\n\n𝕊{S}(tag) where S -> SpinIndex{S}\n𝕊{S}(site, tag) where S -> Index{<:SpinIndex{S}}\n𝕊{S}(site, tag, rcoordinate, icoordinate) where S -> CoordinatedIndex{<:Index{<:SpinIndex{S}}}\n\nConvenient construction of SpinIndex, Index{<:SpinIndex}, CoordinatedIndex{<:Index{<:SpinIndex}}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.@DM_str-Tuple{String}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.@DM_str","text":"DM\"x\" => SparseMatrixCSC([0 0 0; 0 0 1; 0 -1 0])\nDM\"y\" => SparseMatrixCSC([0 0 -1; 0 0 0; 1 0 0])\nDM\"z\" => SparseMatrixCSC([0 1 0; -1 0 0; 0 0 0])\n\nDM coupling matrix.\n\n\n\n\n\n","category":"macro"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.@Heisenberg_str-Tuple{String}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.@Heisenberg_str","text":"Heisenberg\"\" => SparseMatrixCSC([1 0 0; 0 1 0; 0 0 1])\n\nHeisenberg coupling matrix.\n\n\n\n\n\n","category":"macro"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.@Ising_str-Tuple{String}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.@Ising_str","text":"Ising\"x\" => SparseMatrixCSC([1 0 0; 0 0 0; 0 0 0])\nIsing\"y\" => SparseMatrixCSC([0 0 0; 0 1 0; 0 0 0])\nIsing\"z\" => SparseMatrixCSC([0 0 0; 0 0 0; 0 0 1])\n\nIsing coupling matrix.\n\n\n\n\n\n","category":"macro"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.@L_str-Tuple{String}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.@L_str","text":"L\"x\" => SparseMatrixCSC([0 0 0; 0 0 1im; 0 -1im 0])\nL\"y\" => SparseMatrixCSC([0 0 -1im; 0 0 0; 1im 0 0])\nL\"z\" => SparseMatrixCSC([0 1im 0; -1im 0 0; 0 0 0])\n\nThree-dimensional rotation generators.\n\n\n\n\n\n","category":"macro"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.@Γ_str-Tuple{String}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.@Γ_str","text":"Γ\"x\" => SparseMatrixCSC([0 0 0; 0 0 1; 0 1 0])\nΓ\"y\" => SparseMatrixCSC([0 0 1; 0 0 0; 1 0 0])\nΓ\"z\" => SparseMatrixCSC([0 1 0; 1 0 0; 0 0 0])\n\nΓ coupling matrix.\n\n\n\n\n\n","category":"macro"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.@Γ′_str-Tuple{String}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.@Γ′_str","text":"Γ′\"x\" => SparseMatrixCSC([0 1 1; 1 0 0; 1 0 0])\nΓ′\"y\" => SparseMatrixCSC([0 1 0; 1 0 1; 0 1 0])\nΓ′\"z\" => SparseMatrixCSC([0 0 1; 0 0 1; 1 1 0])\n\nΓ′ coupling matrix.\n\n\n\n\n\n","category":"macro"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.@σ_str-Tuple{String}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.@σ_str","text":"σ\"0\" => SparseMatrixCSC([1 0; 0 1])\nσ\"x\" => SparseMatrixCSC([0 1; 1 0])\nσ\"y\" => SparseMatrixCSC([0 -1im; 1im 0])\nσ\"z\" => SparseMatrixCSC([1 0; 0 -1])\nσ\"+\" => SparseMatrixCSC([0 1; 0 0])\nσ\"-\" => SparseMatrixCSC([0 0; 1 0])\nσ\"11\" => SparseMatrixCSC([1 0; 0 0])\nσ\"22\" => SparseMatrixCSC([0 0; 0 1])\n\nPauli matrix σ⁰, σˣ, σʸ, σᶻ, σ⁺, σ⁻, σ¹¹, σ²².\n\n\n\n\n\n","category":"macro"},{"location":"man/QuantumSystems/#Base.angle-Tuple{CoordinatedIndex{<:Index{<:FockIndex}}, AbstractVector{<:AbstractVector{<:Number}}, AbstractVector{<:Number}}","page":"Quantum Systems","title":"Base.angle","text":"angle(id::CoordinatedIndex{<:Index{<:FockIndex}}, vectors::AbstractVector{<:AbstractVector{<:Number}}, values::AbstractVector{<:Number}) -> Complex{<:Number}\n\nGet the twist phase.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.DegreesOfFreedom.patternrule-Union{Tuple{N}, Tuple{NTuple{N, Colon}, Val, Type{<:FockIndex}, Val{:nambu}}} where N","page":"Quantum Systems","title":"QuantumLattices.DegreesOfFreedom.patternrule","text":"patternrule(nambus::NTuple{N, Colon}, ::Val{}, ::Type{<:FockIndex}, ::Val{:nambu}) where N -> NTuple{N, Int}\n\nDefault pattern rule for the :nambu attribute of Fock indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumOperators.matrix-Union{Tuple{SpinIndex{S, Char}}, Tuple{S}, Tuple{SpinIndex{S, Char}, Type{<:Number}}} where S","page":"Quantum Systems","title":"QuantumLattices.QuantumOperators.matrix","text":"matrix(index::SpinIndex{S, Char}, dtype::Type{<:Number}=Complex{Float}) where S -> Matrix{dtype}\nmatrix(index::Index{<:SpinIndex}, dtype::Type{<:Number}=Complex{Float}) -> Matrix{dtype}\nmatrix(index::CompositeIndex{<:Index{<:SpinIndex}}, dtype::Type{<:Number}=Complex{Float}) -> Matrix{dtype}\n\nGet the matrix representation of an index acting on the local 𝕊ᶻ space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumOperators.script-Tuple{FockIndex, Val{:orbital}}","page":"Quantum Systems","title":"QuantumLattices.QuantumOperators.script","text":"script(index::FockIndex, ::Val{:orbital}; kwargs...) -> String\nscript(index::FockIndex, ::Val{:spin}; kwargs...) -> String\nscript(index::FockIndex, ::Val{:spinsym}; kwargs...) -> String\nscript(index::FockIndex, ::Val{:nambu}; kwargs...) -> String\n\nGet the requested script of a Fock index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumOperators.script-Union{Tuple{K}, Tuple{PhononIndex{K, Colon}, Val{:direction}}} where K","page":"Quantum Systems","title":"QuantumLattices.QuantumOperators.script","text":"script(index::PhononIndex, ::Val{:direction}; kwargs...) -> String\n\nGet the requested script of a phonon index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumOperators.script-Union{Tuple{S}, Tuple{SpinIndex{S, Colon}, Val{:tag}}} where S","page":"Quantum Systems","title":"QuantumLattices.QuantumOperators.script","text":"script(index::SpinIndex, ::Val{:tag}; kwargs...) -> String\n\nGet the requested script of a spin index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.isannihilation-Tuple{FockIndex}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.isannihilation","text":"isannihilation(index::FockIndex) -> Bool\nisannihilation(index::Index) -> Bool\nisannihilation(index::CompositeIndex) -> Bool\n\nJudge whether the nambu index is annihilation.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.iscreation-Tuple{FockIndex}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.iscreation","text":"iscreation(index::FockIndex) -> Bool\niscreation(index::Index) -> Bool\niscreation(index::CompositeIndex) -> Bool\n\nJudge whether the nambu index is creation.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.isnormalordered-Tuple{Operator{<:Number, <:NTuple{N, CompositeIndex{<:Index{<:FockIndex}}} where N}}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.isnormalordered","text":"isnormalordered(opt::Operator{<:Number, <:ID{CompositeIndex{<:Index{<:FockIndex}}}}) -> Bool\n\nJudge whether an operator is normal ordered.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.totalspin-Tuple{SpinIndex}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.totalspin","text":"totalspin(::SpinIndex) -> Rational{Int}/Int/Colon\ntotalspin(::Type{<:SpinIndex}) -> Rational{Int}/Int/Colon/Float64\n\ntotalspin(::Index{<:SpinIndex}) -> Rational{Int}/Int/Colon\ntotalspin(::Type{<:Index{<:SpinIndex}}) -> Rational{Int}/Int/Colon/Float64\n\ntotalspin(::CompositeIndex{<:Index{<:SpinIndex}}) -> Rational{Int}/Int/Colon\ntotalspin(::Type{<:CompositeIndex{<:Index{<:SpinIndex}}}) -> Rational{Int}/Int/Colon/Float64\n\nGet the total spin.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.totalspin-Tuple{Spin}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.totalspin","text":"totalspin(::Spin) -> Rational{Int}/Int/Colon\ntotalspin(::Type{<:Spin}) -> Rational{Int}/Int/Colon\n\nGet the total spin.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕊ᵀ𝕊-Tuple{Union{Colon, Tuple{Ordinal, Ordinal}}, AbstractMatrix}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕊ᵀ𝕊","text":"𝕊ᵀ𝕊(sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::AbstractVector=SVector('x', 'y', 'z'), cols::AbstractVector=SVector('x', 'y', 'z')) -> MatrixCoupling\n\nConstruct a matrix coupling for spin system.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕓","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕓","text":"𝕓(orbital, spin, nambu) -> FockIndex{:b}\n𝕓(site, orbital, spin, nambu) -> Index{<:FockIndex{:b}}\n𝕓(site, orbital, spin, nambu, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:FockIndex{:b}}}\n\nConvenient construction of FockIndex{:b}, Index{<:FockIndex{:b}}, CoordinatedIndex{<:Index{<:FockIndex{:b}}}.\n\n\n\n\n\n","category":"function"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕕","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕕","text":"𝕕(orbital, spin, nambu) -> FockIndex{:}\n𝕕(site, orbital, spin, nambu) -> Index{<:FockIndex{:}}\n𝕕(site, orbital, spin, nambu, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:FockIndex{:}}}\n\nConvenient construction of FockIndex{:}, Index{<:FockIndex{:}}, CoordinatedIndex{<:Index{<:FockIndex{:}}}.\n\n\n\n\n\n","category":"function"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕗","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕗","text":"𝕗(orbital, spin, nambu) -> FockIndex{:f}\n𝕗(site, orbital, spin, nambu) -> Index{<:FockIndex{:f}}\n𝕗(site, orbital, spin, nambu, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:FockIndex{:f}}}\n\nConvenient construction of FockIndex{:f}, Index{<:FockIndex{:f}}, CoordinatedIndex{<:Index{<:FockIndex{f}}}.\n\n\n\n\n\n","category":"function"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕗⁺𝕗-Tuple{Union{Colon, Tuple{Ordinal, Ordinal}}, Union{Colon, AbstractMatrix}, Union{Colon, AbstractMatrix}, Union{Colon, AbstractMatrix}}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕗⁺𝕗","text":"𝕗⁺𝕗(sites::Union{NTuple{2, Ordinal}, Colon}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon}) -> MatrixCoupling\n𝕓⁺𝕓(sites::Union{NTuple{2, Ordinal}, Colon}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon}) -> MatrixCoupling\n𝕕⁺𝕕(sites::Union{NTuple{2, Ordinal}, Colon}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon}) -> MatrixCoupling\n\nConstruct a matrix coupling for Fock systems.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕡-Tuple{Any}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕡","text":"𝕡(direction) -> PhononIndex{:p}\n𝕡(site, direction) -> Index{<:PhononIndex{:p}}\n𝕡(site, direction, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:PhononIndex{:p}}}\n\nConvenient construction of SpinIndex{:p}, Index{<:SpinIndex{:p}}, CoordinatedIndex{<:Index{<:SpinIndex{:p}}}.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕦-Tuple{Any}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕦","text":"𝕦(direction) -> PhononIndex{:u}\n𝕦(site, direction) -> Index{<:PhononIndex{:u}}\n𝕦(site, direction, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:PhononIndex{:u}}}\n\nConvenient construction of SpinIndex{:u}, Index{<:SpinIndex{:u}}, CoordinatedIndex{<:Index{<:SpinIndex{:u}}}.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕦ᵀ𝕦-Tuple{Union{Colon, Tuple{Ordinal, Ordinal}}, AbstractMatrix}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕦ᵀ𝕦","text":"𝕦ᵀ𝕦(sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::Union{AbstractVector, Nothing}=nothing, cols::Union{AbstractVector, Nothing}=nothing) -> MatrixCoupling\n\nConstruct a set of Couplings corresponding to the dynamical matrix of phonons.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.expand-Tuple{Coupling{<:Number, <:Pattern{<:InternalPattern{var\"#s119\", P, N} where {var\"#s119\"<:Tuple{PhononIndex{:u}, PhononIndex{:u}}, P, N}}}, Val{:Hooke}, Bond, Hilbert}","page":"Quantum Systems","title":"QuantumLattices.expand","text":"expand(pnc::Coupling{<:Number, <:Pattern{<:InternalPattern{<:NTuple{2, PhononIndex{:u}}}}}, ::Val{:Hooke}, bond::Bond, hilbert::Hilbert) -> VectorSpace\n\nExpand the default phonon potential coupling on a given bond.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.kind-Tuple{PhononIndex}","page":"Quantum Systems","title":"QuantumLattices.kind","text":"kind(index::PhononIndex) -> Symbol\nkind(::Type{<:PhononIndex{K}}) where K -> Symbol\n\nkind(index::Index{<:PhononIndex}) -> Symbol\nkind(::Type{<:Index{<:PhononIndex{K}}}) where K -> Symbol\n\nkind(index::CoordinatedIndex{<:Index{<:PhononIndex}}) -> Symbol\nkind(::Type{<:CoordinatedIndex{<:Index{<:PhononIndex{K}}}}) where K -> Symbol\n\nGet the kind of a phonon index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.kind-Tuple{Phonon}","page":"Quantum Systems","title":"QuantumLattices.kind","text":"kind(pn::Phonon)\nkind(::Type{<:Phonon{K}}) where K\n\nGet the kind of a phonon space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.permute-Tuple{FockIndex{:f}, FockIndex{:f}}","page":"Quantum Systems","title":"QuantumLattices.permute","text":"permute(id₁::FockIndex, id₂::FockIndex) -> Tuple{Vararg{Operator}}\n\nPermute two Fock indexes and get the result.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.permute-Tuple{PhononIndex, PhononIndex}","page":"Quantum Systems","title":"QuantumLattices.permute","text":"permute(id₁::PhononIndex, id₂::PhononIndex) -> Tuple{Vararg{Operator}}\n\nPermute two phonon indexes and get the result.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.permute-Tuple{SpinIndex, SpinIndex}","page":"Quantum Systems","title":"QuantumLattices.permute","text":"permute(id₁::SpinIndex, id₂::SpinIndex) -> Tuple{Vararg{Operator}}\n\nPermute two spin indexes and get the result.\n\n\n\n\n\n","category":"method"},{"location":"advanced topics/Transformations/","page":"Transformations","title":"Transformations","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"advanced topics/Transformations/#Transformations","page":"Transformations","title":"Transformations","text":"","category":"section"},{"location":"man/Frameworks/","page":"Frameworks","title":"Frameworks","text":"CurrentModule = QuantumLattices.Frameworks","category":"page"},{"location":"man/Frameworks/#Frameworks","page":"Frameworks","title":"Frameworks","text":"","category":"section"},{"location":"man/Frameworks/","page":"Frameworks","title":"Frameworks","text":"Modules = [Frameworks]\nOrder = [:module, :constant, :type, :macro, :function]","category":"page"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.OneOrMore","page":"Frameworks","title":"QuantumLattices.Frameworks.OneOrMore","text":"const OneOrMore{A} = Union{A, Tuple{A, Vararg{A}}}\n\nOne or more something.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.OneOrMore-Tuple{Any}","page":"Frameworks","title":"QuantumLattices.Frameworks.OneOrMore","text":"OneOrMore(x) -> Tuple{typeof(x)}\nOneOrMore(x::Tuple) -> typeof(x)\n\nIf x is a tuple, return itself; if not, return (x,).\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.eager","page":"Frameworks","title":"QuantumLattices.Frameworks.eager","text":"const eager = Eager()\n\nSingleton instance of Eager.\n\n\n\n\n\n","category":"constant"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.lazy","page":"Frameworks","title":"QuantumLattices.Frameworks.lazy","text":"const lazy = Lazy()\n\nSingleton instance of Lazy.\n\n\n\n\n\n","category":"constant"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Action","page":"Frameworks","title":"QuantumLattices.Frameworks.Action","text":"Action\n\nAbstract type for all actions.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Algorithm","page":"Frameworks","title":"QuantumLattices.Frameworks.Algorithm","text":"Algorithm{F<:Frontend, P<:Parameters, M<:Function} <: Function\n\nAn algorithm associated with an frontend.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Algorithm-Tuple{Assignment}","page":"Frameworks","title":"QuantumLattices.Frameworks.Algorithm","text":"(alg::Algorithm)(assign::Assignment) -> Tuple{Algorithm, Assignment}\n(assign::Assignment)(alg::Algorithm) -> Tuple{Algorithm, Assignment}\n\nRun an assignment based on an algorithm.\n\nThe difference between these two methods is that the first uses the parameters of assign as the current parameters while the second uses those of alg.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Algorithm-Tuple{Symbol, Action}","page":"Frameworks","title":"QuantumLattices.Frameworks.Algorithm","text":"(alg::Algorithm)(id::Symbol, action::Action; info::Bool=true, kwargs...) -> Tuple{Algorithm, Assignment}\n\nAdd an assignment on a algorithm by providing the contents of the assignment, and run this assignment.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Algorithm-Tuple{Symbol, Frontend}","page":"Frameworks","title":"QuantumLattices.Frameworks.Algorithm","text":"Algorithm(name::Symbol, frontend::Frontend; din::String=\".\", dout::String=\".\", parameters::Parameters=Parameters(frontend), map::Function=identity)\n\nConstruct an algorithm.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Algorithm-Tuple{Symbol}","page":"Frameworks","title":"QuantumLattices.Frameworks.Algorithm","text":"(alg::Algorithm)(id::Symbol; info::Bool=true, parameters::Parameters=Parameters{()}()) -> Tuple{Algorithm, Assignment}\n\nRun an assignment specified by its id.\n\nOptionally, the time of the run process can be informed by setting the info argument to be true.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Assignment","page":"Frameworks","title":"QuantumLattices.Frameworks.Assignment","text":"Assignment{A<:Action, P<:Parameters, M<:Function, N, D} <: Function\n\nAn assignment associated with an action.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.CategorizedGenerator","page":"Frameworks","title":"QuantumLattices.Frameworks.CategorizedGenerator","text":"CategorizedGenerator{V, C, A<:NamedTuple, B<:NamedTuple, P<:Parameters, D<:Boundary, S<:ExpansionStyle} <: Generator{V}\n\nCategorized generator that groups the (representations of) quantum operators in a quantum lattice system into three categories, i.e., the constant, the alterable, and the boundary.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Eager","page":"Frameworks","title":"QuantumLattices.Frameworks.Eager","text":"Eager <: ExpansionStyle\n\nEager expansion style with eager computation so that similar terms are combined in the final result.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.ExpansionStyle","page":"Frameworks","title":"QuantumLattices.Frameworks.ExpansionStyle","text":"ExpansionStyle\n\nExpansion style of a generator of (representations of) quantum operators. It has two singleton subtypes, Eager and Lazy.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Formula","page":"Frameworks","title":"QuantumLattices.Frameworks.Formula","text":"Formula{V, F<:Function, P<:Parameters}\n\nRepresentation of a quantum lattice system with an explicit analytical formula.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Formula-Tuple","page":"Frameworks","title":"QuantumLattices.Frameworks.Formula","text":"(formula::Formula)(args...; kwargs...) -> valtype(formula)\n\nGet the result of a Formula.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Frontend","page":"Frameworks","title":"QuantumLattices.Frameworks.Frontend","text":"Frontend\n\nFrontend of algorithms applied to a quantum lattice system.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Generator","page":"Frameworks","title":"QuantumLattices.Frameworks.Generator","text":"Generator{V}\n\nGenerator of (representations of) quantum operators in a quantum lattice system.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Generator-Tuple{Any, NamedTuple, NamedTuple, NamedTuple{Names, T} where {Names, T<:Tuple{Vararg{Number}}}, Boundary, ExpansionStyle}","page":"Frameworks","title":"QuantumLattices.Frameworks.Generator","text":"Generator(constops, alterops::NamedTuple, boundops::NamedTuple, parameters::Parameters, boundary::Boundary, style::ExpansionStyle) -> CategorizedGenerator\n\nConstruct a CategorizedGenerator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Generator-Tuple{CategorizedGenerator{<:Operators}, Vector{<:Bond}, Hilbert, Union{Tuple{Term, Vararg{Term}}, Term}, Bool}","page":"Frameworks","title":"QuantumLattices.Frameworks.Generator","text":"Generator(operators::CategorizedGenerator{<:Operators}, bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, half::Bool) -> OperatorGenerator\nGenerator(bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, boundary::Boundary=plain, style::ExpansionStyle=eager; half::Bool=false) -> OperatorGenerator\n\nConstruct an OperatorGenerator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Lazy","page":"Frameworks","title":"QuantumLattices.Frameworks.Lazy","text":"Lazy <: ExpansionStyle\n\nLazy expansion style with lazy computation so that similar terms are not combined in the final result.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.OperatorGenerator","page":"Frameworks","title":"QuantumLattices.Frameworks.OperatorGenerator","text":"OperatorGenerator(bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, boundary::Boundary=plain, style::ExpansionStyle=eager; half::Bool=false)\n\nConstruct a generator of quantum operators based on the input bonds, Hilbert space, terms and (twisted) boundary condition.\n\nWhen the boundary condition is plain, the boundary operators will be set to be empty for simplicity and efficiency.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.OperatorGenerator-2","page":"Frameworks","title":"QuantumLattices.Frameworks.OperatorGenerator","text":"OperatorGenerator{V<:Operators, CG<:CategorizedGenerator{V}, B<:Bond, H<:Hilbert, TS<:Tuple{Vararg{Term}}} <: Generator{V}\n\nA generator of operators based on the terms, bonds and Hilbert space of a quantum lattice system.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Parameters","page":"Frameworks","title":"QuantumLattices.Frameworks.Parameters","text":"Parameters{Names}(values::Number...) where Names\n\nA NamedTuple that contains the key-value pairs.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Parameters-Tuple{Boundary}","page":"Frameworks","title":"QuantumLattices.Frameworks.Parameters","text":"Parameters(bound::Boundary)\n\nGet the parameters of the twisted boundary condition.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Parameters-Tuple{CategorizedGenerator}","page":"Frameworks","title":"QuantumLattices.Frameworks.Parameters","text":"Parameters(cat::CategorizedGenerator)\n\nGet the complete set of parameters of a categorized generator of (representations of) quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Parameters-Tuple{Formula}","page":"Frameworks","title":"QuantumLattices.Frameworks.Parameters","text":"Parameters(formula::Formula) -> Parameters\n\nGet the parameters of a Formula.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Parameters-Tuple{OperatorGenerator}","page":"Frameworks","title":"QuantumLattices.Frameworks.Parameters","text":"Parameters(gen::OperatorGenerator) -> Parameters\n\nGet the parameters of an OperatorGenerator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Parameters-Tuple{OperatorSet}","page":"Frameworks","title":"QuantumLattices.Frameworks.Parameters","text":"Parameters(ops::OperatorSet) -> NamedTuple{(), Tuple{}}\n\nGet the parameters of an OperatorSet, which is defined to be an empty NamedTuple.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.QuantumOperators.LinearTransformation-Tuple{CategorizedGenerator}","page":"Frameworks","title":"QuantumLattices.QuantumOperators.LinearTransformation","text":"(transformation::LinearTransformation)(cat::CategorizedGenerator; kwargs...) -> CategorizedGenerator\n\nApply a linear transformation to a categorized generator of (representations of) quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.QuantumOperators.Transformation-Tuple{OperatorGenerator}","page":"Frameworks","title":"QuantumLattices.QuantumOperators.Transformation","text":"(transformation::Transformation)(gen::OperatorGenerator; kwargs...) -> CategorizedGenerator\n\nGet the transformation applied to a generator of quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.:*-Tuple{CategorizedGenerator, Any}","page":"Frameworks","title":"Base.:*","text":"*(cat::CategorizedGenerator, factor) -> CategorizedGenerator\n*(factor, cat::CategorizedGenerator) -> CategorizedGenerator\n\nMultiply a categorized generator of (representations of) quantum operators with a factor.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.:+-Tuple{CategorizedGenerator, CategorizedGenerator}","page":"Frameworks","title":"Base.:+","text":"+(cat₁::CategorizedGenerator, cat₂::CategorizedGenerator) -> CategorizedGenerator\n\nAddition of two categorized generators of (representations of) quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.eltype-Tuple{Generator}","page":"Frameworks","title":"Base.eltype","text":"eltype(gen::Generator)\neltype(::Type{T}) where {T<:Generator}\n\nGet the eltype of a Generator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.empty-Tuple{CategorizedGenerator}","page":"Frameworks","title":"Base.empty","text":"empty(cat::CategorizedGenerator) -> CategorizedGenerator\nempty!(cat::CategorizedGenerator) -> CategorizedGenerator\n\nGet an empty copy of a categorized generator or empty a categorized generator of (representations of) quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.empty-Tuple{OperatorGenerator}","page":"Frameworks","title":"Base.empty","text":"empty(gen::OperatorGenerator) -> OperatorGenerator\nempty!(gen::OperatorGenerator) -> OperatorGenerator\n\nGet an empty copy of or empty an operator generator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.isempty-Tuple{CategorizedGenerator}","page":"Frameworks","title":"Base.isempty","text":"isempty(cat::CategorizedGenerator) -> Bool\n\nJudge whether a categorized generator is empty.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.isempty-Tuple{OperatorGenerator}","page":"Frameworks","title":"Base.isempty","text":"isempty(gen::OperatorGenerator) -> Bool\n\nJudge whether an OperatorGenerator is empty.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.iterate-Tuple{Generator}","page":"Frameworks","title":"Base.iterate","text":"iterate(gen::Generator)\niterate(::Generator, state)\n\nIterate over a Generator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.match-Tuple{NamedTuple{Names, T} where {Names, T<:Tuple{Vararg{Number}}}, NamedTuple{Names, T} where {Names, T<:Tuple{Vararg{Number}}}}","page":"Frameworks","title":"Base.match","text":"match(params₁::Parameters, params₂::Parameters; atol=atol, rtol=rtol) -> Bool\n\nJudge whether the second set of parameters matches the first.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.nameof-Tuple{Algorithm, Assignment}","page":"Frameworks","title":"Base.nameof","text":"nameof(alg::Algorithm, assign::Assignment) -> String\n\nGet the name of the combination of an algorithm and an assignment.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.show-Tuple{IO, Algorithm}","page":"Frameworks","title":"Base.show","text":"show(io::IO, alg::Algorithm)\n\nShow an algorithm.\n\nOptionally, some parameters of the algorithm can be filtered by specifying the :select context in io. Besides, the maximum number of decimals of the parameters can also be specified by the :ndecimal context in io.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.summary-Tuple{Algorithm}","page":"Frameworks","title":"Base.summary","text":"summary(alg::Algorithm)\n\nProvide a summary of an algorithm.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.valtype-Tuple{Assignment}","page":"Frameworks","title":"Base.valtype","text":"valtype(assign::Assignment)\nvaltype(::Type{<:Assignment})\n\nType of the data (result) of an assignment.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.valtype-Tuple{Formula}","page":"Frameworks","title":"Base.valtype","text":"valtype(formula::Formula)\nvaltype(::Type{<:Formula{V}})\n\nGet the valtype of a Formula.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.valtype-Tuple{Generator}","page":"Frameworks","title":"Base.valtype","text":"valtype(gen::Generator)\nvaltype(::Type{<:Generator{V}}) where V\n\nGet the valtype of a Generator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.prepare!","page":"Frameworks","title":"QuantumLattices.Frameworks.prepare!","text":"prepare!(alg::Algorithm, assign::Assignment, f::Function=assign->true) -> Tuple{Algorithm, Assignment}\n\nRun the dependencies of an assignment.\n\nOptionally, some dependencies can be filtered by specifying the f function.\n\n\n\n\n\n","category":"function"},{"location":"man/Frameworks/#QuantumLattices.QuantumOperators.scalartype-Union{Tuple{Type{F}}, Tuple{F}} where F<:Formula","page":"Frameworks","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(::Type{F}) where {F<:Formula}\n\nGet the scalar type of a Formula.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.QuantumOperators.scalartype-Union{Tuple{Type{T}}, Tuple{T}} where T<:Generator","page":"Frameworks","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(::Type{T}) where {T<:Generator}\n\nGet the scalar type of a Generator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Spatials.save-Tuple{Algorithm, Assignment}","page":"Frameworks","title":"QuantumLattices.Spatials.save","text":"save(alg::Algorithm, assign::Assignment; delimited=false) -> Tuple{Algorithm, Assignment}\n\nSave the data of an assignment registered on an algorithm.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.add!-Tuple{Algorithm, Symbol, Action}","page":"Frameworks","title":"QuantumLattices.add!","text":"add!(alg::Algorithm, id::Symbol, action::Action; parameters::Parameters=Parameters{()}(), map::Function=identity, dependencies::Tuple=(), kwargs...) -> Tuple{Algorithm, Assignment}\n\nAdd an assignment on an algorithm by providing the contents of the assignment without the execution of it.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.expand!-Tuple{Any, Generator}","page":"Frameworks","title":"QuantumLattices.expand!","text":"expand!(result, gen::Generator) -> typeof(result)\n\nExpand the generator to add the (representations of) quantum operators in a quantum lattice system to result.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.expand-Tuple{CategorizedGenerator, Lazy}","page":"Frameworks","title":"QuantumLattices.expand","text":"expand(cat::CategorizedGenerator, ::Lazy)\n\nExpand a categorized generator to get the (representations of) quantum operators in a quantum lattice system.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.expand-Tuple{Generator}","page":"Frameworks","title":"QuantumLattices.expand","text":"expand(gen::Generator)\nexpand(gen::Generator, ::Eager)\nexpand(gen::Generator, ::Lazy)\n\nExpand the generator to get the (representations of) quantum operators in a quantum lattice system.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.expand-Tuple{OperatorGenerator, Symbol}","page":"Frameworks","title":"QuantumLattices.expand","text":"expand(gen::OperatorGenerator, name::Symbol) -> Operators\nexpand(gen::OperatorGenerator, i::Int) -> Operators\nexpand(gen::OperatorGenerator, name::Symbol, i::Int) -> Operators\n\nExpand an operator generator to get:\n\nthe operators of a specific term;\nthe operators on a specific bond;\nthe operators of a specific term on a specific bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.reset!-Tuple{CategorizedGenerator, LinearTransformation, CategorizedGenerator{<:Operators}}","page":"Frameworks","title":"QuantumLattices.reset!","text":"reset!(cat::CategorizedGenerator, transformation::LinearTransformation, source::CategorizedGenerator{<:Operators}; kwargs...)\n\nReset a categorized generator by its source categorized generator of (representations of) quantum operators and the corresponding linear transformation.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.reset!-Tuple{OperatorGenerator, AbstractVector{<:Bond}, Hilbert}","page":"Frameworks","title":"QuantumLattices.reset!","text":"reset!(gen::OperatorGenerator, bonds::AbstractVector{<:Bond}, hilbert::Hilbert; vectors::AbstractVector{<:AbstractVector}=gen.operators.boundary.vectors) -> OperatorGenerator\n\nReset an operator generator by a new lattice and the corresponding new hilbert space.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.update!-Tuple{Algorithm}","page":"Frameworks","title":"QuantumLattices.update!","text":"update!(alg::Algorithm; parameters...) -> Algorithm\n\nUpdate the parameters of an algorithm and its associated frontend.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.update!-Tuple{Assignment}","page":"Frameworks","title":"QuantumLattices.update!","text":"update!(assign::Assignment; parameters...) -> Assignment\n\nUpdate the parameters of an assignment and the status of its associated action.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.update!-Tuple{CategorizedGenerator, LinearTransformation, CategorizedGenerator{<:Operators}}","page":"Frameworks","title":"QuantumLattices.update!","text":"update!(cat::CategorizedGenerator, transformation::LinearTransformation, source::CategorizedGenerator{<:Operators}; kwargs...) -> CategorizedGenerator\n\nUpdate the parameters (including the boundary parameters) of a categorized generator based on its source categorized generator of (representations of) quantum operators and the corresponding linear transformation.\n\n!!! Note The coefficients of boundops are also updated due to the change of the boundary parameters.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.update!-Tuple{CategorizedGenerator{<:OperatorSum}}","page":"Frameworks","title":"QuantumLattices.update!","text":"update!(cat::CategorizedGenerator{<:OperatorSum}; parameters...) -> CategorizedGenerator\n\nUpdate the parameters (including the boundary parameters) of a categorized generator of (representations of) quantum operators.\n\n!!! Note The coefficients of boundops are also updated due to the change of the boundary parameters.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.update!-Tuple{Formula}","page":"Frameworks","title":"QuantumLattices.update!","text":"update!(formula::Formula; parameters...) -> Formula\n\nUpdate the parameters of a Formula in place and return itself after update.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.update!-Tuple{OperatorGenerator}","page":"Frameworks","title":"QuantumLattices.update!","text":"update!(gen::OperatorGenerator; parameters...) -> typeof(gen)\n\nUpdate the coefficients of the terms in a generator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.update-Tuple{NamedTuple}","page":"Frameworks","title":"QuantumLattices.update","text":"update(params::NamedTuple; parameters...) -> Parameters\n\nUpdate a set of Parameters and return the updated one.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#RecipesBase.apply_recipe-Tuple{AbstractDict{Symbol, Any}, Tuple{Algorithm, Assignment}}","page":"Frameworks","title":"RecipesBase.apply_recipe","text":"@recipe plot(pack::Tuple{Algorithm, Assignment})\n\nDefine the recipe for the visualization of an assignment of an algorithm.\n\n\n\n\n\n","category":"method"},{"location":"advanced topics/HybridSystems/","page":"Hybrid systems","title":"Hybrid systems","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"advanced topics/HybridSystems/#Hybrid-systems","page":"Hybrid systems","title":"Hybrid systems","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"CurrentModule = QuantumLattices.Toolkit\nDocTestFilters = [r\"var\\\".*\\\"\", r\"generic function with [0-9]* method\", r\".*s \\(.*\\% GC\\)\", r\"evals/sample:.*\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../../src/\")\n using QuantumLattices.Toolkit\n import QuantumLattices.Toolkit: isparameterbound, parameternames, contentnames, getcontent\nend","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"push!(LOAD_PATH, \"../../../src/\")\nusing QuantumLattices.Toolkit","category":"page"},{"location":"man/Toolkit/#Toolkit","page":"Toolkit","title":"Toolkit","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"This module contains the toolkit of the package.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The constants, types, macros, functions defined in this module will not be exported by the package. Instead, they serve as the prerequisites. The range of the contents are quite wide, but basically, they fall into two categories:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Utilities, such as global constants and miscellaneous tiny useful functions;\nBasic data structures as supplements to the Julia.Base and other common packages.","category":"page"},{"location":"man/Toolkit/#Utilities","page":"Toolkit","title":"Utilities","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"atol\nrtol\nFloat\nconcatenate\ntostr\nsubscript\nsuperscript\ndelta\nid\nvalue\nDirectSummedIndices\nSegment","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.atol","page":"Toolkit","title":"QuantumLattices.Toolkit.atol","text":"Absolute tolerance for float numbers.\n\n\n\n\n\n","category":"constant"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.rtol","page":"Toolkit","title":"QuantumLattices.Toolkit.rtol","text":"Relative tolerance for float numbers.\n\n\n\n\n\n","category":"constant"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.Float","page":"Toolkit","title":"QuantumLattices.Toolkit.Float","text":"Default float type.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.concatenate","page":"Toolkit","title":"QuantumLattices.Toolkit.concatenate","text":"concatenate(ts::Tuple...) -> Tuple\n\nConcatenate tuples.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.tostr","page":"Toolkit","title":"QuantumLattices.Toolkit.tostr","text":"tostr(number, ::Integer=5) -> String\ntostr(number::Integer, n::Integer=5) -> String\ntostr(number::Rational, n::Integer=5) -> String\ntostr(number::AbstractFloat, n::Integer=5) -> String\ntostr(number::Complex, n::Integer=5) -> String\n\nConvert a number to a string with at most n decimal places.\n\n\n\n\n\ntostr(value::Symbol) -> String\ntostr(value::Colon) -> String\ntostr(value::Char) -> String\n\nConvert a single value to string.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.subscript","page":"Toolkit","title":"QuantumLattices.Toolkit.subscript","text":"subscript(i::Integer) -> String\n\nConvert an integer to the subscript.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.superscript","page":"Toolkit","title":"QuantumLattices.Toolkit.superscript","text":"superscript(i::Integer) -> String\n\nConvert an integer to the superscript.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.delta","page":"Toolkit","title":"QuantumLattices.Toolkit.delta","text":"delta(i, j) -> Int\n\nKronecker delta function.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.id","page":"Toolkit","title":"QuantumLattices.id","text":"id(od::OrderedDict, i) -> keytype(od)\n\nGet the ith key of an OrderedDict.\n\n\n\n\n\nid(m::OperatorPack) -> idtype(m)\n\nGet the id of an OperatorPack.\n\n\n\n\n\nid(term::Term) -> Symbol\nid(::Type{<:Term) -> Symbol\n\nGet the id of a term.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.value","page":"Toolkit","title":"QuantumLattices.value","text":"value(od::OrderedDict, i) -> valtype(od)\n\nGet the ith value of an OrderedDict.\n\n\n\n\n\nvalue(m::OperatorPack) -> valtype(m)\n\nGet the value of an OperatorPack.\n\n\n\n\n\nvalue(term::Term) -> valtype(term)\n\nGet the value of a term.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.DirectSummedIndices","page":"Toolkit","title":"QuantumLattices.Toolkit.DirectSummedIndices","text":"DirectSummedIndices{T<:Tuple{Vararg{OrdinalRange{Int, Int}}}} <: AbstractVector{CartesianIndex{3}}\n\nDirect sum of indexes.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.Segment","page":"Toolkit","title":"QuantumLattices.Toolkit.Segment","text":"Segment{S} <: AbstractVector{S}\n\nA segment.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#Combinatorics","page":"Toolkit","title":"Combinatorics","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The combinations and permutations of an indexable object are implemented, with duplicate elements allowed or not. Compared to another Julia package Combinatorics, the iterators return tuples instead of vectors, which could greatly decrease the memory allocation times and improves the code efficiency.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Combinatorics{M, C} is the abstract type of all combinatorial algorithms. It has two type parameters:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"M: the number of elements to be taken\nC: the type of the collection of candidate elements","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"To avoid memory allocation, the iteration of a concrete combinatorial algorithm returns a tuple, whose length is M and eltype is eltype(C).","category":"page"},{"location":"man/Toolkit/#Combinations-and-DuplicateCombinations","page":"Toolkit","title":"Combinations and DuplicateCombinations","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Combinations{M, C} and DuplicateCombinations{M, C} generate all the combinations of M elements from an indexable collection whose type is C, with the differences being that the former forbids duplicate elements in the combinations while the latter allows.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"All combinations of 2 integers taken from 1 to 3 without duplicate:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Combinations{2}(1:3) |> collect","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"All combinations of 2 integers taken from 1 to 3 with duplicate allowed:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"DuplicateCombinations{2}(1:3) |> collect","category":"page"},{"location":"man/Toolkit/#Permutations-and-DuplicatePermutations","page":"Toolkit","title":"Permutations and DuplicatePermutations","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Permutations{M, C} and DuplicatePermutations{M, C} generate all the permutations of M elements from an indexable collection whose type is C, with the differences being that the former forbids duplicate elements in the permutations while the latter allows.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"All permutations of 2 integers taken from 1 to 3 without duplicate:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Permutations{2}(1:3) |> collect","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"All permutations of 2 integers taken from 1 to 3 with duplicate allowed:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"DuplicatePermutations{2}(1:3) |> collect","category":"page"},{"location":"man/Toolkit/#Manual","page":"Toolkit","title":"Manual","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Combinatorics\nCombinations\nDuplicateCombinations\nPermutations\nDuplicatePermutations","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.Combinatorics","page":"Toolkit","title":"QuantumLattices.Toolkit.Combinatorics","text":"Combinatorics{M, C}\n\nAbstract combinatorial algorithms.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.Combinations","page":"Toolkit","title":"QuantumLattices.Toolkit.Combinations","text":"Combinations{M}(contents::C) where {M, C}\n\nCombinations of M elements from contents. Duplicates are not allowed.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.DuplicateCombinations","page":"Toolkit","title":"QuantumLattices.Toolkit.DuplicateCombinations","text":"DuplicateCombinations{M}(contents::C) where {M, C}\n\nCombinations of M elements from contents. Duplicates are allowed.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.Permutations","page":"Toolkit","title":"QuantumLattices.Toolkit.Permutations","text":"Permutations{M}(contents::C) where {M, C}\n\nPermutations of M elements from contents. Duplicates are not allowed.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.DuplicatePermutations","page":"Toolkit","title":"QuantumLattices.Toolkit.DuplicatePermutations","text":"DuplicatePermutations{M}(contents::C) where {M, C}\n\nPermutations of M elements from contents. Duplicates are allowed.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#Traits","page":"Toolkit","title":"Traits","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Trait functions and trait types that are useful to the package are defined.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Generally speaking, traits in Julia could fall into two categories according to their usages, the first may be term as \"type helpers\" and the second are usually called \"Holy traits\" named after Tim Holy. Type helpers aim at the inquiry, alteration and computation of the compile-time information of types, while Holy traits can be applied as an alternative to multi-inheritance by use of the Julia multidispatch feature.","category":"page"},{"location":"man/Toolkit/#Type-helpers","page":"Toolkit","title":"Type helpers","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Type helpers are important for the generic programming in Julia, especially in the design of generic interfaces and abstract types.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Let's see a simple situation, i.e. the elemental addition of two vectors of numbers. The numbers can assume different types and the type of the result depends on both of them, for example, the result between two vectors of integers is a vector of integers while that between a vector of integers and a vector of floats is a vector of floats. Of course, one can explicitly define every elemental addition function between any two different types of vectors of numbers, like this:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"# wrong design pattern\n\nfunction elementaladdition(v₁::Vector{Int64}, v₂::Vector{Int64})\n result = Int[]\n ...\nend\nfunction elementaladdition(v₁::Vector{Int64}, v₂::Vector{Float64})\n result = Float64[]\n ...\nend\n...\n...","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Writing down all such methods is already a heavy repetition. What's worse, you will quickly find that a lot more functions, such as the elemental subtraction, elemental multiplication and elemental division, are waiting for you to implement. This is a total disaster.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The correct strategy is to define the promotion rule of any two types of numbers and use it to define the type of the result:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"# correct design pattern\n\npromotion(::Type{Int64}, ::Type{Int64}) = Int64\npromotion(::Type{Int64}, ::Type{Float64}) = Float64\n...\n...\n\nfunction elementaladdition(v₁::Vector{T₁}, v₂::Vector{T₂}) where {T₁<:Number, T₂<:Number}\n result = promotion(T₁, T₂)[]\n ...\nend\nfunction elementalsubtraction(v₁::Vector{T₁}, v₂::Vector{T₂}) where {T₁<:Number, T₂<:Number}\n result = promotion(T₁, T₂)[]\n ...\nend\n...\n...","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The promotion rule applies equally to all the arithmetic operations on numbers. Therefore, tedious code repetition could be avoided with it. In fact, similar promotion rules have already been defined in Julia base, and the default implementations of arithmetic operations in Julia are indeed based on them (see Base.promote_rule and Base.promote_type). When new user-defined numeric types are introduced, the only things you need to do is to add new promotion rules and implement a few basic arithmetic functions for these new types. Then quite a lot of generic codes could apply to them without any modification.","category":"page"},{"location":"man/Toolkit/#Type-helpers-with-type-parameters","page":"Toolkit","title":"Type helpers with type parameters","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The input and output types of a promotion rule are known at compile time, thus, the promotion rule is a trait function aiming at the computation of compile-time information of types. Trait functions dealing with the inquiries of compile-time information of types are also widely used in Julia, such as the eltype function of Vector:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> eltype(Vector{String})\nString","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"For a user-defined parametric type, it is also useful to provide an inquiry function to access to the type parameters:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> struct Hi{T<:Number}\n content::T\n end\n contenttype(::Type{Hi{T}}) where T<:Number = T\n contenttype(Hi{Int64})\nInt64","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"However, the above defined function contenttype could not apply to a UnionAll type, such as Hi{<:Real}:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> contenttype(Hi{<:Real})\nERROR: MethodError: no method matching contenttype(::Type{Hi{<:Real}})\n[...]","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"In fact in Julia base, all such inquiry functions, e.g., the eltype function, work poor for the UnionAll types:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> eltype(Vector{<:Real})\nAny","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"In concept, eltype(Vector{<:Real} should return Real instead of Any as every element in Vector{<:Real} is indeed a real number. Similarly, we expect that contenttype(Hi{<:Real}) should also give us Real. Unfortunately, functions defined in the similar form like this could never achieve such goals. Julia base doesn't provide generic functions to access or change the information of the parameters of a type. In this module, we try to fill this gap with a set of generic trait functions.","category":"page"},{"location":"man/Toolkit/#Access-or-change-the-type-parameters-by-their-position-orders","page":"Toolkit","title":"Access or change the type parameters by their position orders","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The most direct information of the parameters of a type is their position orders. We provide parametertype to access to them by such information:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parametertype(Hi{<:Real}, 1)\nReal\n\njulia> parametertype(Vector{<:Real}, 1)\nReal\n\njulia> parametertype(Vector{<:Real}, 2)\n1","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"You can use parametercount to inquire the total number of the parameters of a type:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parametercount(Hi)\n1\n\njulia> parametercount(Vector)\n2","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"It is noted that Vector has 2 type parameters because it is just a type alias for Array{T, 1} where T.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"To change the parameters of a type, reparameter can be used:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> reparameter(Hi{Int64}, 1, Real)\nHi{<:Real}\n\njulia> reparameter(Vector{Int64}, 1, Real)\nVector{<:Real} (alias for Array{<:Real, 1})\n\njulia> reparameter(Vector{<:Real}, 2, 3)\nArray{<:Real, 3}\n\njulia> reparameter(Hi{Int64}, 1, Real, false)\nHi{Real}\n\njulia> reparameter(Hi{Int64}, 1, Real, true)\nHi{<:Real}","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"We want to remark that by providing the fourth positional argument with the true value, a UnionAll type could be generated. When the fourth positional argument is omitted, it is actually determined by another trait function, i.e., isparameterbound. This function judges whether an input type should be considered as the upper bound of the new parameter of a type. By default, it is defined to be","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"isparameterbound(::Type{}, ::Val{}, ::Type{D}) where D = !isconcretetype(D)\nisparameterbound(::Type{}, ::Val{}, ::Any) = false","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"This function can be overloaded to change the behavior for a certain type:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> isparameterbound(::Type{<:Vector}, ::Val{1}, ::Type{D}) where D = false;\n\njulia> reparameter(Vector, 1, Real)\nVector{Real} (alias for Array{Real, 1})","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The second positional argument of isparameterbound must be of type Val because in principle you should be able to assign different behaviors for different parameters of a type separately. If it is of type Integer, a single overloading would change the behaviors for all.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Besides, you can inquire all the parameters of a type by parametertypes:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parametertypes(Hi{<:Real})\nTuple{Real}\n\njulia> parametertypes(Vector{Int64})\nTuple{Int64, 1}","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The obtained type parameters are stored as those of a Tuple.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"At the same time, you can change all the parameters of a type by fulltype:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> fulltype(Hi{Int64}, Tuple{Real})\nHi{<:Real}\n\njulia> fulltype(Hi{Int64}, Tuple{Real}, (false,))\nHi{Real}\n\njulia> fulltype(Vector{Int64}, Tuple{Real, 2})\nMatrix{Real} (alias for Array{Real, 2})\n\njulia> fulltype(Vector{Int64}, Tuple{Real, 2}, (true, false))\nMatrix{<:Real} (alias for Array{<:Real, 2})","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Like reparameter, the last positional argument of fulltype could determine whether the corresponding types specified by the type parameters of the input Tuple should be considered as the upper bounds of the new parameters of a type. When this argument is omitted, it is determined by another trait function isparameterbounds, which successively calls the isparameterbound function to determine the behaviors for all the parameters of a type as the literal indicates.","category":"page"},{"location":"man/Toolkit/#Associate-type-parameters-with-names","page":"Toolkit","title":"Associate type parameters with names","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Sometimes, it is more convenient to associate names with the parameters of a type, and then access or change them by their names. This can be done by overloading the parameternames trait function for a certain type:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parameternames(::Type{<:Hi}) = (:content,)\nparameternames (generic function with 3 methods)","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Now, you can inquire the name of a type parameter by parametername with the given position order or vice versa by parameterorder:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parametername(Hi, 1)\n:content\n\njulia> parameterorder(Hi, :content)\n1","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"You can also inquire whether a type has a parameter with the given name by hasparameter:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> hasparameter(Hi, :content)\ntrue\n\njulia> hasparameter(Hi, :others)\nfalse","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"And parametertype and reparameter can be applied by the name of a type parameter instead of its position order:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parametertype(Hi{<:Real}, :content)\nReal\n\njulia> reparameter(Hi{Int}, :content, Real)\nHi{<:Real}\n\njulia> reparameter(Hi{Int}, :content, Real, false)\nHi{Real}","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"To change the reparameter behavior when its last positional argument is omitted, you should overload the isparameterbound function accordingly, e.g.:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> isparameterbound(::Type{<:Hi}, ::Val{:content}, ::Type{D}) where D = false;\n\njulia> reparameter(Hi{Int}, :content, Real)\nHi{Real}","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"note: Note\nAccessing or altering a parameter of a type by its name is independent from that by its position order. Thus, even the following methodisparameterbound(::Type{<:Hi}, ::Val{1}, D)has been overloaded, it doesn't affect the result of the function call likereparameter(Hi{Int}, :content, Real)Rather, it only affect the result of the function call likereparameter(Hi{Int}, 1, Real)To change the default behavior of the former function call, you must overload the following method manually as wellisparameterbound(::Type{<:Hi}, ::Val{:content}, D)","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"A new trait function parameterpair is provided to inquire the name-type pair of a parameter of a type:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parameterpair(Hi{<:Real}, 1)\nPair{:content, Real}\n\njulia> parameterpair(Hi{<:Real}, :content)\nPair{:content, Real}","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"And a new trait function parameterpairs can be used to inquire all the name-type pairs of the parameters of a type:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parameterpairs(Hi{<:Real})\n@NamedTuple{content::Real}","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The parameters of a type can be altered all at once by giving the name-type pairs to fulltype:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> fulltype(Hi{Int}, NamedTuple{(:content,), Tuple{Real}}, (false,))\nHi{Real}\n\njulia> fulltype(Hi{Int}, NamedTuple{(:content,), Tuple{Real}}, (true,))\nHi{<:Real}\n\njulia> fulltype(Hi{Int}, NamedTuple{(:content,), Tuple{Real}})\nHi{Real}","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Here, the last positional argument can be omitted whose default value would be determined by the isparameterbounds function which successively calls the isparameterbound function on each of the named parameter. Note that similar to the situation of the reparameter function in this subsubsection, the isparameterbound function called here is also the version that takes the parameter name as the input rather than that of the position order.","category":"page"},{"location":"man/Toolkit/#Type-helpers-with-predefined-contents","page":"Toolkit","title":"Type helpers with predefined contents","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Julia abstract types don't have any field or attribute. They are only tags on the type tree. However, we may expect sometimes an abstract type to possess some kind of predefined content so that the design of some methods could be highly simplified. For example, we may need an abstract type that describes a composite vector. Apparently, it should have a field that is the vector contained in it. Of course, we can appoint a fixed field name with it and force every concrete subtype must contain such a field. In such a design pattern, the name of this field in every concrete subtype must be kept unchanged, which may be annoying when it conflicts with that of another field. What's worse, a predefined content of an abstract type is not always limited to a certain field. Maybe we need more than one fields to construct such a content. The just mentioned design pattern cannot deal with such situations.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Here, we provide a set of trait functions to help the design of abstract types with predefined contents. We take the case of composite vector for illustration, and the generalization to other situations is straightforward. First, the trait function contentnames should be overloaded to define the names of the predefined contents:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> abstract type CompositeVector{T} end\n contentnames(::Type{<:CompositeVector}) = (:content,);","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Then you can inquire the total number of predefined contents by contentcount, inquire the name of a predefined content with its position order by contentname, and judge whether a type has a predefined content with a given name by hascontent:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> contentcount(CompositeVector)\n1\n\njulia> contentname(CompositeVector, 1)\n:content\n\njulia> hascontent(CompositeVector, :content)\ntrue\n\njulia> hascontent(CompositeVector, :value)\nfalse","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The key is the interface getcontent, which defines how to get the value of the predefined content. For the simple case when the predefined content just corresponds to a field, and also the field name of the predefined content coincides with the content name, the overloading of getcontent can be omitted, e.g.:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> struct AnotherCompositeVector{T} <: CompositeVector{T}\n content::Vector{T}\n end;\n\njulia> v = AnotherCompositeVector([1, 2, 3])\n getcontent(v, :content)\n3-element Vector{Int64}:\n 1\n 2\n 3","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"For the cases when a predefined contents does not share the same name with a certain field, or even it is not limited to only one certain field, you must implement your own getcontent manually. Let's see two typical examples:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> struct DifferentFieldName{T} <: CompositeVector{T}\n data::Vector{T}\n end\n getcontent(v::DifferentFieldName, ::Val{:content}) = v.data;\n\njulia> struct BeyondSingleField{T} <: CompositeVector{T}\n firsthalf::Vector{T}\n secondhalf::Vector{T}\n end\n getcontent(v::BeyondSingleField, ::Val{:content}) = [v.firsthalf; v.secondhalf];\n\njulia> v = DifferentFieldName([1, 2, 3])\n getcontent(v, :content)\n3-element Vector{Int64}:\n 1\n 2\n 3\n\njulia> v = BeyondSingleField([1, 2, 3], [4, 5, 6])\n getcontent(v, :content)\n6-element Vector{Int64}:\n 1\n 2\n 3\n 4\n 5\n 6","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Note that for the method overloading of getcontent, the second argument is of type Val{:content}. This is convenient because in principle an abstract type could have more than only one predefined content, thus, the behaviors of the getcontent function could be defined separately for different predefined contents in this way. In fact, the function call getcontent(m, contentname) is just an alias for getcontent(m, contentname|>Val).","category":"page"},{"location":"man/Toolkit/#Holy-traits","page":"Toolkit","title":"Holy traits","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"As an emergent feature of Julia, basically speaking, a Holy trait is a Julia type that could direct the generic function of a user-defined type to a certain implementation based on the Julia multi-dispatch mechanism. For different user-defined types, they could be assigned with different Holy traits, leading to different implementations of the same generic interface. Since the information of Holy traits are known at compile time, such design pattern doesn't affect the runtime efficiency as long as type stability is ensured.","category":"page"},{"location":"man/Toolkit/#Alternative-of-multi-inheritance","page":"Toolkit","title":"Alternative of multi-inheritance","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Maybe the most common application of Holy traits is to serve as the alternative of multi-inheritance. Let's see a simple scenario. You have defined an abstract type. It is natural to demand that for every concrete subtype of it, a pair of instances could be compared and judge whether they are equivalent to each other by the value. Unfortunately, for a new user-defined type, the default == function in Julia actually judges whether they are the same object, but not equal to each other by the value. Therefore, you need to define your own == function for this abstract type. However, you may need define a lot of abstract types when you are developing a Julia package. It is annoying if such simple functions must be written for each of them. In other languages like Python, this could be solved with the help of multi-inheritance. But Julia does not support multi-inheritance. The common way is to use Holy traits. For example, the above issue could be solved like this:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"struct Equivalence end\nconst equivalence = Equivalence()\nfunction Base.:(==)(::Equivalence, o₁, o₂)\n n₁, n₂ = fieldcount(typeof(o₁)), fieldcount(typeof(o₂))\n n₁≠n₂ && return false\n for i = 1:n₁\n getfield(o₁, i)≠getfield(o₂, i) && return false\n end\n return true\nend\n\nabstract type TypeWithEquivalence end\nBase.:(==)(o₁::TypeWithEquivalence, o₂::TypeWithEquivalence) = ==(equivalence, o₁, o₂);\n\nstruct ConcreteTypeWithEquivalence{F₁, F₂} <: TypeWithEquivalence\n f₁::F₁\n f₂::F₂\nend;\n\na₁ = ConcreteTypeWithEquivalence((\"a\", \"b\", \"c\"), [1, 2, 3])\na₂ = ConcreteTypeWithEquivalence((\"a\", \"b\", \"c\"), [1.0, 2.0, 3.0])\na₁ == a₂","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Here, the type Equivalence is the Holy trait that helps the abstract type TypeWithEquivalence to implement the == function, which applies equally to any other types.","category":"page"},{"location":"man/Toolkit/#Type-stability-and-the-generated-function-trick","page":"Toolkit","title":"Type stability and the generated function trick","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"However, the story does not end up here. If you are concerned about the code efficiency, you may find that the above implementation is not type stable:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"using BenchmarkTools\n@benchmark $a₁ == $a₂","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The memory allocation occurs when the == function tries to compare the values of getfield(o₁, i) and getfield(o₂, i) because in principle the types of these values depend on the runtime value of the variable i. To ensure type stability, the generated function trick can be utilized:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"struct EfficientEquivalence end\nconst efficientequivalence = EfficientEquivalence()\n@generated function Base.:(==)(::EfficientEquivalence, o₁, o₂)\n n₁, n₂ = fieldcount(o₁), fieldcount(o₂)\n n₁≠n₂ && return false\n expr = :(getfield(o₁, 1) == getfield(o₂, 1))\n for i = 2:n₁\n expr = Expr(:&&, expr, :(getfield(o₁, $i) == getfield(o₂, $i)))\n end\n return expr\nend\n\nabstract type TypeWithEfficientEquivalence end\nfunction Base.:(==)(o₁::TypeWithEfficientEquivalence, o₂::TypeWithEfficientEquivalence)\n return ==(efficientequivalence, o₁, o₂)\nend\n\nstruct ConcreteTypeWithEfficientEquivalence{F₁, F₂} <: TypeWithEfficientEquivalence\n f₁::F₁\n f₂::F₂\nend\n\na₁ = ConcreteTypeWithEfficientEquivalence((\"a\", \"b\", \"c\"), [1, 2, 3])\na₂ = ConcreteTypeWithEfficientEquivalence((\"a\", \"b\", \"c\"), [1.0, 2.0, 3.0])\na₁ == a₂","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"@benchmark $a₁ == $a₂","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"At runtime of the generated == function, it compares the values of getfield(o₁, 1) and getfield(o₂, 1), getfield(o₁, 2) and getfield(o₂, 2), etc., whose types are known at compile time. Therefore, type stability could be ensured.","category":"page"},{"location":"man/Toolkit/#EfficientOperations","page":"Toolkit","title":"EfficientOperations","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"EfficientOperations is a Holy trait defined in this module that packs several common operations, such as ==/isequal, DataType/UnionAll\n\nGet the \"raw part\" of a type. That is, the type without all its type parameters.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#Core.DataType","page":"Toolkit","title":"Core.DataType","text":"DataType <: Type{T}\n\nDataType represents explicitly declared types that have names, explicitly declared supertypes, and, optionally, parameters. Every concrete value in the system is an instance of some DataType.\n\nExamples\n\njulia> typeof(Real)\nDataType\n\njulia> typeof(Int)\nDataType\n\njulia> struct Point\n x::Int\n y\n end\n\njulia> typeof(Point)\nDataType\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#Base.supertype","page":"Toolkit","title":"Base.supertype","text":"supertype(T::DataType)\n\nReturn the supertype of DataType T.\n\nExamples\n\njulia> supertype(Int32)\nSigned\n\n\n\n\n\nsupertype(T, termination::Symbol) -> DataType\n\nGet the supertype of T till termination.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"For traits with type parameters:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"hasparameter\nisparameterbound\nisparameterbounds\nparametercount\nparametername\nparameternames\nparameterorder\nparameterpair\nparameterpairs\nparametertype\nparametertypes\npromoteparameters\nreparameter","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.hasparameter","page":"Toolkit","title":"QuantumLattices.Toolkit.hasparameter","text":"hasparameter(::Type{T}, name::Symbol) where T -> Bool\n\nFor type T, judge whether it has a type parameter specified by name.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.isparameterbound","page":"Toolkit","title":"QuantumLattices.Toolkit.isparameterbound","text":"isparameterbound(::Type{T}, i::Integer, D) where T -> Bool\nisparameterbound(::Type{T}, name::Symbol, D) where T -> Bool\n\nFor a type T, judge whether a type D should be considered as the upper bound of one of its type parameters.\n\nnote: Note\nThe default implementations of this function isisparameterbound(::Type{}, ::Val{}, ::Type{D}) where D = !isconcretetype(D)\nisparameterbound(::Type{}, ::Val{}, ::Any) = false\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.isparameterbounds","page":"Toolkit","title":"QuantumLattices.Toolkit.isparameterbounds","text":"isparameterbounds(::Type{T}, ::Type{PS}) where {T, PS<:Tuple} -> Tuple{Vararg{Bool}}\nisparameterbounds(::Type{T}, ::Type{PS}) where {T, PS<:NamedTuple} -> Tuple{Vararg{Bool}}\n\nFor a type T, judge whether the types specified by PS should be considered as the upper bounds of its corresponding type parameters.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parametercount","page":"Toolkit","title":"QuantumLattices.Toolkit.parametercount","text":"parametercount(::Type{T}) where T -> Int\n\nFor a type T, get the number of its type parameters.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parametername","page":"Toolkit","title":"QuantumLattices.Toolkit.parametername","text":"parametername(::Type{T}, i::Integer) where T -> Symbol\n\nFor a type T, get the name of its ith type parameter.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parameternames","page":"Toolkit","title":"QuantumLattices.Toolkit.parameternames","text":"parameternames(::Type{T}) where T -> Tuple{Vararg{Symbol}}\n\nFor a type T, get the names of all its type parameters.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parameterorder","page":"Toolkit","title":"QuantumLattices.Toolkit.parameterorder","text":"parameterorder(::Type{T}, name::Symbol) where T -> Int\n\nFor a type T, get the order of one of its type parameters.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parameterpair","page":"Toolkit","title":"QuantumLattices.Toolkit.parameterpair","text":"parameterpair(::Type{T}, name::Symbol) where T\nparameterpair(::Type{T}, i::Integer) where T\n\nFor type T, get the name-type pair of one of its type parameters.\n\nThe result is stored in the type parameters of a Pair.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parameterpairs","page":"Toolkit","title":"QuantumLattices.Toolkit.parameterpairs","text":"parameterpairs(::Type{T}) where T\n\nFor a type T, get the name-type pairs of all its type parameters.\n\nThe return types are stored in the type parameters of a NamedTuple.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parametertype","page":"Toolkit","title":"QuantumLattices.Toolkit.parametertype","text":"parametertype(::Type{T}, name::Symbol) where T\nparametertype(::Type{T}, i::Integer) where T\n\nFor a type T, get the type of one of its type parameters.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parametertypes","page":"Toolkit","title":"QuantumLattices.Toolkit.parametertypes","text":"parametertypes(::Type{T}) where T\n\nFor a type T, get the types of all its type parameters.\n\nThe returned types are stored in the type parameters of a Tuple.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.promoteparameters","page":"Toolkit","title":"QuantumLattices.Toolkit.promoteparameters","text":"promoteparameters(::Type{T₁}, ::Type{T₂}) where {T₁<:NamedTuple, T₂<:NamedTuple}\n\nPromote the types specified by two named tuples with the same names accordingly.\n\nThe result is stored in the type parameters of a NamedTuple.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.reparameter","page":"Toolkit","title":"QuantumLattices.Toolkit.reparameter","text":"reparameter(::Type{T}, i::Integer, P, ub::Bool=isparameterbound(T, i, P)) where T\nreparameter(::Type{T}, name::Symbol, P, ub::Bool=isparameterbound(T, name, P)) where T\n\nFor a type T, replace the type of its ith type parameter with P. Here, ub determines whether P should be considered as the upper bound. \n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"For traits with type contents:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"contentcount\ncontentname\ncontentnames\ncontentorder\ncontenttype\ncontenttypes\ngetcontent\nhascontent\ndissolve","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.contentcount","page":"Toolkit","title":"QuantumLattices.Toolkit.contentcount","text":"contentcount(::Type{T}) where T -> Int\n\nFor a type T, get the number of its predefined contents.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.contentname","page":"Toolkit","title":"QuantumLattices.Toolkit.contentname","text":"contentname(::Type{T}, i::Integer) where T -> Symbol\n\nFor a type T, get the name of its ith predefined content.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.contentnames","page":"Toolkit","title":"QuantumLattices.Toolkit.contentnames","text":"contentnames(::Type{T}) where T -> Tuple{Vararg{Symbol}}\n\nFor a type T, define the names of its predefined contents.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.contentorder","page":"Toolkit","title":"QuantumLattices.Toolkit.contentorder","text":"contentorder(::Type{T}, name::Symbol) where T -> Int\n\nFor a type T, get the position order of a predefined content by the name.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.contenttype","page":"Toolkit","title":"QuantumLattices.Toolkit.contenttype","text":"contenttype(::Type{T}, name::Symbol) where T\ncontenttype(::Type{T}, ::Val{name}) where {T, name}\n\nFor a type T, get the type of a predefined content by the name.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.contenttypes","page":"Toolkit","title":"QuantumLattices.Toolkit.contenttypes","text":"contenttypes(::Type{T}) where T\n\nFor a type T, get the types of its predefined contents.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.getcontent","page":"Toolkit","title":"QuantumLattices.Toolkit.getcontent","text":"getcontent(m, i::Integer)\ngetcontent(m, name::Symbol)\ngetcontent(m, ::Val{name}) where name\n\nGet the value of the predefined content of m. \n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.hascontent","page":"Toolkit","title":"QuantumLattices.Toolkit.hascontent","text":"hascontent(::Type{T}, name::Symbol) where T -> Bool\n\nFor a type T, judge whether it has a predefined content specified by name.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.dissolve","page":"Toolkit","title":"QuantumLattices.Toolkit.dissolve","text":"dissolve(m, f::Function=identity, args...; kwargs...) -> Tuple\n\nConvert m to a tuple by the function f applied elementally to its contents with the extra positional arguments (args) and keyword arguments (kwargs). \n\nTo each content of m, the underlying interface of the dissolve function when f is applied is as follows:\n\ndissolve(m, Val(name), f, args...; kwargs...)\n\nHere, name is the name of the corresponding content of m.\n\nBasically, the rule of how f operates on each field of m can be overridden by redefining the above dissolve function.\n\nnote: Note\nThe default dissolve function ignores the operation of function f and just return the content value of m.\n\n\n\n\n\ndissolve(m, ::Val{name}, f::Function, args...; kwargs...) where name\n\nDissolve the content specified by name of m by the function f applied with the extra positional arguments (args) and keyword arguments (kwargs).\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"For traits with type operations:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"efficientoperations","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.efficientoperations","page":"Toolkit","title":"QuantumLattices.Toolkit.efficientoperations","text":"efficientoperations\n\nIndicate that the efficient operations, i.e. \"==\"/\"isequal\", \"<\"/\"isless\" or \"replace\", will be used.\n\n\n\n\n\n","category":"constant"},{"location":"man/Toolkit/#Composite-structures","page":"Toolkit","title":"Composite structures","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"In principle, Julia is not an object-oriented programming language. For example, only abstract types can be inherited so that subtype cannot inherit fields from their parents. Therefore, Julia prefers composition over inheritance. However, to make a new concrete type behaves much alike another one, tedious repetitions of redefining the generic interfaces are usually not avoidable, especially for the basic types in Julia base. In this module, we implement to such composited types, CompositeVector and CompositeDict, for the sake of future usages.","category":"page"},{"location":"man/Toolkit/#CompositeVector","page":"Toolkit","title":"CompositeVector","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"A composite vector can be considered as a vector that is implemented by including a concrete subtype of AbstractVector as its data attribute, and it itself is a subtype of AbstractVector.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"To take full advantages of the Julia base, the following interfaces are redefined:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"inquiry of info: size, length\ncomparison between objects: ==, isequal\nobtainment of old elements: getindex\noperation of old elements: setindex!\naddition of new elements: push!, pushfirst!, insert!, append!, prepend!\nremoval of old elements: splice!, deleteat!, pop!, popfirst!, empty!\nconstruction of new objects: empty, reverse, similar\niteration: iterate, keys, values, pairs","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Note that arithmetic operations and logical operations excluding == and isequal are not supported.","category":"page"},{"location":"man/Toolkit/#CompositeDict","page":"Toolkit","title":"CompositeDict","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"A composite dict can be considered as a dict that is implemented by including a concrete subtype of AbstractDict as its data attribute and it itself is a subtype of AbstractDict.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"To take full advantages of the Julia base, the following interfaces are redefined:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"inquiry of info: isempty, length, haskey, in\ncomparison between objects: ==, isequal\nobtainment of old elements: get, getkey, getindex\noperation and addition of elements: push!, get!, setindex!\nremoval of old elements: pop!, delete!, empty!\nconstruction of new objects: merge, empty\niteration: iterate, keys, values, pairs","category":"page"},{"location":"man/Toolkit/#Manual-3","page":"Toolkit","title":"Manual","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"CompositeDict\nCompositeVector","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.CompositeDict","page":"Toolkit","title":"QuantumLattices.Toolkit.CompositeDict","text":"CompositeDict{K, V}\n\nA composite dict can be considered as a dict that is implemented by including a concrete subtype of AbstractDict as its data attribute.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.CompositeVector","page":"Toolkit","title":"QuantumLattices.Toolkit.CompositeVector","text":"CompositeVector{T}\n\nA composite vector can be considered as a vector that is implemented by including a concrete subtype of AbstractVector as its data attribute.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#Vector-spaces","page":"Toolkit","title":"Vector spaces","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"A vector space is a linear space, in which the addition of vectors and multiplication of a vector by a scalar are defined.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Vector spaces are frequently encountered in physics, e.g. the Hilbert space in quantum mechanics. In this submodule, we only implement those with finite dimensions. We want to remark that in our implementation, a vector space is a subtype of an abstract vector, therefore, the bases always possess a order, which means, two vector spaces are not considered to be equal to each other even if their corresponding actual mathematical spaces are the same but the orders of the bases are different.","category":"page"},{"location":"man/Toolkit/#VectorSpace","page":"Toolkit","title":"VectorSpace","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"VectorSpace{B} is the abstraction of a vector space, which has only one type parameter:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"B<:Any: the type of the bases of the vector space","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Basically, a subtype should implement the following 2 methods:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Base.length(vs::VectorSpace) -> Int\nGet the dimension of a vector space\nBase.getindex(vs::VectorSpace{B}, i::Int) where B -> B\nGet the ith basis of a vector space","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Other features include","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"comparison: == and isequal\niteration: iterate\ninquiry: size and in\nsearch: searchsortedfirst","category":"page"},{"location":"man/Toolkit/#Manual-4","page":"Toolkit","title":"Manual","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Predefined types of vector spaces:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"VectorSpace\nNamedVectorSpace\nSimpleNamedVectorSpace\nParameterSpace\nNamedVectorSpaceProd\nNamedVectorSpaceZip","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpace","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpace","text":"VectorSpace{B} <: AbstractVector{B}\n\nAbstract vector space.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.NamedVectorSpace","page":"Toolkit","title":"QuantumLattices.Toolkit.NamedVectorSpace","text":"NamedVectorSpace{B} <: VectorSpace{B}\n\nAbstract named vector space.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.SimpleNamedVectorSpace","page":"Toolkit","title":"QuantumLattices.Toolkit.SimpleNamedVectorSpace","text":"SimpleNamedVectorSpace{N, B} <: NamedVectorSpace{B}\n\nAbstract simple named vector space.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.ParameterSpace","page":"Toolkit","title":"QuantumLattices.Toolkit.ParameterSpace","text":"ParameterSpace{N, T, B} <: SimpleNamedVectorSpace{N, B}\n\nParameter space.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.NamedVectorSpaceProd","page":"Toolkit","title":"QuantumLattices.Toolkit.NamedVectorSpaceProd","text":"NamedVectorSpaceProd{Order, T<:Tuple{Vararg{SimpleNamedVectorSpace}}, B<:Tuple} <: CompositeNamedVectorSpace{T, B}\n\nDirect producted named vector space.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.NamedVectorSpaceZip","page":"Toolkit","title":"QuantumLattices.Toolkit.NamedVectorSpaceZip","text":"NamedVectorSpaceZip{T<:Tuple{Vararg{SimpleNamedVectorSpace}}, B<:Tuple} <: CompositeNamedVectorSpace{T, B}\n\nZipped named vector space.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Predefined types of vector space style:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"VectorSpaceStyle\nVectorSpaceGeneral\nVectorSpaceEnumerative\nVectorSpaceCartesian\nVectorSpaceDirectProducted\nVectorSpaceDirectSummed\nVectorSpaceZipped","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpaceStyle","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpaceStyle","text":"VectorSpaceStyle\n\nStyle of a concrete type of vector space.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpaceGeneral","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpaceGeneral","text":"VectorSpaceGeneral <: VectorSpaceStyle\n\nDefault vector space style.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpaceEnumerative","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpaceEnumerative","text":"VectorSpaceEnumerative <: VectorSpaceStyle\n\nEnumerative vector space style, which indicates that the vector space has a predefined content named contents that contains all its bases.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpaceCartesian","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpaceCartesian","text":"VectorSpaceCartesian <: VectorSpaceStyle\n\nCartesian vector space style, which indicates that every basis in it could be represented by a Cartesian index.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpaceDirectProducted","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpaceDirectProducted","text":"VectorSpaceDirectProducted{Order} <: VectorSpaceStyle\n\nVector space style which indicates that a vector space is the direct product of its sub-components.\n\nThe type parameter Order must be either :forward or :backward:\n\n:forward: the direct product iterates over the first sub-component first like a Julia array;\n:backward: the direct product iterates over the last sub-component first like a C/C++ array.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpaceDirectSummed","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpaceDirectSummed","text":"VectorSpaceDirectSummed <: VectorSpaceStyle\n\nVector space style which indicates that a vector space is the direct sum of its sub-components.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpaceZipped","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpaceZipped","text":"VectorSpaceZipped <: VectorSpaceStyle\n\nVector space style which indicates that a vector space is the zip of its sub-components.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/","page":"Quantum numbers","title":"Quantum numbers","text":"CurrentModule = QuantumLattices.QuantumNumbers","category":"page"},{"location":"man/QuantumNumbers/#Quantum-numbers","page":"Quantum numbers","title":"Quantum numbers","text":"","category":"section"},{"location":"man/QuantumNumbers/","page":"Quantum numbers","title":"Quantum numbers","text":"Quantum numbers can be considered as the conserved labels for the bases of a Hilbert space when a quantum system hosts some symmetries. Here we only implement Abelian quantum numbers because non-Abelian ones are far more complicated yet much less used.","category":"page"},{"location":"man/QuantumNumbers/#AbelianQuantumNumber","page":"Quantum numbers","title":"AbelianQuantumNumber","text":"","category":"section"},{"location":"man/QuantumNumbers/#RepresentationSpace","page":"Quantum numbers","title":"RepresentationSpace","text":"","category":"section"},{"location":"man/QuantumNumbers/#qnmanual","page":"Quantum numbers","title":"Manual","text":"","category":"section"},{"location":"man/QuantumNumbers/","page":"Quantum numbers","title":"Quantum numbers","text":"Modules = [QuantumNumbers]\nOrder = [:module, :constant, :type, :macro, :function]","category":"page"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.Abelian","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.Abelian","text":"const Abelian = AbelianQuantumNumber\n\nType alias for AbelianQuantumNumber.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianGradedSpace","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianGradedSpace","text":"AbelianGradedSpace(quantumnumbers::AbstractVector{<:AbelianQuantumNumber}, dimensions::AbstractVector{<:Integer}, dual::Bool=false; ordercheck::Bool=false, duplicatecheck::Bool=false, degeneracycheck::Bool=false)\n\nConstruct an Abelian graded space.\n\nHere:\n\nquantumnumbers specifies the Abelian quantum numbers labeling the irreducible representations of the corresponding Abelian group which must be sorted in the ascending order. Such an ordering should be manually guaranteed by the user. When and only when the keyword argument ordercheck is true, the constructor will check whether this condition is satisfied and raise an error if it doesn't. Besides, quantumnumbers must not contain duplicate Abelian quantum numbers, manually guaranteed by the user as well. This condition can be checked when and only when both ordercheck==true and duplicatecheck==true. An error will be raised if this check fails.\ndimensions specifies the degenerate dimensions of the corresponding Abelian quantum numbers. Apparently, each degenerate dimension must be positive, which should also be manually guaranteed by the user. When and only when the keyword argument degeneracycheck is true, the constructor will check whether this condition is satisfied and raise an error if it doesn't.\ndual specifies whether the graded space is the dual representation of the corresponding Abelian group, which roughly speaking, can be viewed as the direction of the arrow of the Abelian quantum numbers labeling the irreducible representations. We assume dual==true corresponds to the in-arrow and dual==false corresponds to the out-arrow.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianGradedSpace-2","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianGradedSpace","text":"AbelianGradedSpace{QN<:AbelianQuantumNumber} <: RepresentationSpace{QN}\n\nA quantum representation space of an Abelian group that has been decomposed into the direct sum of its irreducible representations.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianGradedSpace-Tuple{Any}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianGradedSpace","text":"AbelianGradedSpace(pairs; dual::Bool=false)\nAbelianGradedSpace(pairs::Pair...; dual::Bool=false)\nAbelianGradedSpace{QN}(pairs; dual::Bool=false) where {QN<:AbelianQuantumNumber}\nAbelianGradedSpace{QN}(pairs::Pair...; dual::Bool=false) where {QN<:AbelianQuantumNumber}\n\nConstruct an Abelian graded space.\n\nIn this function, the Abelian quantum numbers will be sorted automatically, therefore, their orders need not be worried. Duplicate and dimension checks of the quantum numbers are also carried out and errors will be raised if either such checks fails.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianGradedSpaceProd","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianGradedSpaceProd","text":"AbelianGradedSpaceProd{N, QN<:AbelianQuantumNumber} <: CompositeAbelianGradedSpace{N, QN}\n\nDirect product of Abelian graded spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianGradedSpaceSum","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianGradedSpaceSum","text":"AbelianGradedSpaceSum{N, QN<:AbelianQuantumNumber} <: CompositeAbelianGradedSpace{N, QN}\n\nDirect sum of Abelian graded spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianQuantumNumber","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianQuantumNumber","text":"AbelianQuantumNumber\n\nAbstract type of Abelian quantum numbers.\n\nAn Abelian quantum number is the label of a irreducible representation of an Abelian group acted on a quantum representation space. \n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd","text":"AbelianQuantumNumberProd{T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} <: AbelianQuantumNumber\n\nDeligne tensor product of simple Abelian quantum numbers.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd-Union{NTuple{N, Number}, Tuple{T}, Tuple{N}} where {N, T<:NTuple{N, SimpleAbelianQuantumNumber}}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd","text":"AbelianQuantumNumberProd{T}(vs::Vararg{Number, N}) where {N, T<:NTuple{N, SimpleAbelianQuantumNumber}}\nAbelianQuantumNumberProd{T}(vs::NTuple{N, Number}) where {N, T<:NTuple{N, SimpleAbelianQuantumNumber}}\n\nConstruct a Deligne tensor product of simple Abelian quantum numbers by their values.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.CompositeAbelianGradedSpace","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.CompositeAbelianGradedSpace","text":"CompositeAbelianGradedSpace{N, QN<:AbelianQuantumNumber} <: RepresentationSpace{QN}\n\nAbstract type of composite Abelian graded spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.Graded","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.Graded","text":"const Graded = AbelianGradedSpace\n\nType alias for AbelianGradedSpace.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.Momenta","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.Momenta","text":"Momenta{P<:𝕂} <: RepresentationSpace{P}\n\nComplete allowed set of momenta.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.RepresentationSpace","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.RepresentationSpace","text":"RepresentationSpace{QN<:AbelianQuantumNumber} <: VectorSpace{QN}\n\nAbstract type of quantum representation spaces of Abelian groups.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.SimpleAbelianQuantumNumber","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.SimpleAbelianQuantumNumber","text":"SimpleAbelianQuantumNumber <: AbelianQuantumNumber\n\nAbstract type of simple Abelian quantum numbers. That is, it contains only one label.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.ℕ","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.ℕ","text":"ℕ <: <: 𝕌₁\n\nConcrete Abelian quantum number of the particle number.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.ℤ","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.ℤ","text":"ℤ{N} <: SimpleAbelianQuantumNumber\n\nℤₙ quantum numbers.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.ℤ₁","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.ℤ₁","text":"const ℤ₁ = ℤ{1}\nconst ℤ₂ = ℤ{2}\nconst ℤ₃ = ℤ{3}\nconst ℤ₄ = ℤ{4}\n\nAlias for ℤ₁/ℤ₂/ℤ₃/ℤ₄ quantum numbers.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.𝕂","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.𝕂","text":"const 𝕂 = AbelianQuantumNumberProd{<:Tuple{Vararg{ℤ}}}\nconst 𝕂¹{N} = AbelianQuantumNumberProd{Tuple{ℤ{N}}}\nconst 𝕂²{N₁, N₂} = AbelianQuantumNumberProd{Tuple{ℤ{N₁}, ℤ{N₂}}}\nconst 𝕂³{N₁, N₂, N₃} = AbelianQuantumNumberProd{Tuple{ℤ{N₁}, ℤ{N₂}, ℤ{N₃}}}\n\nType alias for the Abelian quantum numbers of 1d, 2d and 3d momentum.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.𝕂¹-Union{Tuple{Integer}, Tuple{N}} where N","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.𝕂¹","text":"𝕂¹{N}(k::Integer) where N\n𝕂²{N}(k₁::Integer, k₂::Integer) where N\n𝕂²{N₁, N₂}(k₁::Integer, k₂::Integer) where {N₁, N₂}\n𝕂³{N}(k₁::Integer, k₂::Integer, k₃::Integer) where N\n𝕂³{N₁, N₂, N₃}(k₁::Integer, k₂::Integer, k₃::Integer) where {N₁, N₂, N₃}\n\nConstruct 1d, 2d and 3d momentum.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.𝕊ᶻ","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.𝕊ᶻ","text":"𝕊ᶻ <: 𝕌₁\n\nConcrete Abelian quantum number of the z-component of a spin.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.𝕌₁","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.𝕌₁","text":"𝕌₁ <: SimpleAbelianQuantumNumber\n\nAbstract type of 𝕌₁ quantum numbers.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#Base.:+-Tuple{AbelianQuantumNumber}","page":"Quantum numbers","title":"Base.:+","text":"+(qn::AbelianQuantumNumber) -> typeof(qn)\n\nOverloaded + operator for AbelianQuantumNumber.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.:+-Union{Tuple{QN}, Tuple{QN, QN, Vararg{QN}}} where QN<:AbelianQuantumNumberProd","page":"Quantum numbers","title":"Base.:+","text":"+(qn₁::QN, qn₂::QN, qns::QN...) where {QN<:AbelianQuantumNumberProd} -> QN\n\nOverloaded + operator for AbelianQuantumNumberProd.\n\nnote: Note\nTo ensure type stability, two AbelianQuantumNumberProd can be added together if and only if they are of the same type.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.:+-Union{Tuple{QN}, Tuple{QN, QN, Vararg{QN}}} where QN<:SimpleAbelianQuantumNumber","page":"Quantum numbers","title":"Base.:+","text":"+(qn₁::QN, qn₂::QN, qns::QN...) where {QN<:SimpleAbelianQuantumNumber} -> QN\n\nOverloaded + operator for SimpleAbelianQuantumNumber.\n\nnote: Note\nTo ensure type stability, two SimpleAbelianQuantumNumber can be added together if and only if they are of the same type.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.:--Tuple{AbelianQuantumNumberProd}","page":"Quantum numbers","title":"Base.:-","text":"-(qn::AbelianQuantumNumberProd) -> typeof(qn)\n-(qn₁::QN, qn₂::QN) where {QN<:AbelianQuantumNumberProd} -> QN\n\nOverloaded - operator for AbelianQuantumNumberProd.\n\nnote: Note\nTo ensure type stability, a AbelianQuantumNumberProd can be subtracted by another AbelianQuantumNumberProd if and only if they are of the same type.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.:--Tuple{SimpleAbelianQuantumNumber}","page":"Quantum numbers","title":"Base.:-","text":"-(qn::SimpleAbelianQuantumNumber) -> typeof(qn)\n-(qn₁::QN, qn₂::QN) where {QN<:SimpleAbelianQuantumNumber} -> QN\n\nOverloaded - operator for SimpleAbelianQuantumNumber.\n\nnote: Note\nTo ensure type stability, a SimpleAbelianQuantumNumber can be subtracted by another SimpleAbelianQuantumNumber if and only if they are of the same type.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.adjoint-Tuple{AbelianGradedSpace}","page":"Quantum numbers","title":"Base.adjoint","text":"adjoint(gs::AbelianGradedSpace) -> typeof(gs)\n\nGet the dual of an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.cumsum-Tuple{RepresentationSpace, Union{Integer, CartesianIndex}}","page":"Quantum numbers","title":"Base.cumsum","text":"cumsum(rs::RepresentationSpace, i::Union{Integer, CartesianIndex}) -> Int\n\nGet the accumulative degenerate dimension up to the ith Abelian quantum number contained in a representation space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.cumsum-Union{Tuple{QN}, Tuple{AbelianGradedSpace{QN}, QN}} where QN<:AbelianQuantumNumber","page":"Quantum numbers","title":"Base.cumsum","text":"cumsum(gs::AbelianGradedSpace{QN}, qn::QN) where {QN<:AbelianQuantumNumber} -> Int\n\nGet the accumulative dimension of an Abelian graded space up to a certain Abelian quantum number contained in an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.getindex-Tuple{AbelianGradedSpace, AbstractVector{<:Integer}}","page":"Quantum numbers","title":"Base.getindex","text":"getindex(gs::AbelianGradedSpace, indexes::AbstractVector{<:Integer}) -> typeof(gs)\ngetindex(gs::AbelianGradedSpace{QN}, quantumnumbers::AbstractVector{QN}) where {QN<:AbelianQuantumNumber} -> AbelianGradedSpace{QN}\n\nGet a subset of an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.getindex-Union{Tuple{T}, Tuple{Type{AbelianQuantumNumber}, Type{T}}} where T<:AbelianQuantumNumber","page":"Quantum numbers","title":"Base.getindex","text":"getindex(::Type{Abelian}, ::Type{T}) where {T<:AbelianQuantumNumber} -> Type{T}\n\nOverloaded [] for Abelian, i.e., the support of syntax Abelian[T] where T<:AbelianQuantumNumber, which is helpful for the construction of tensor producted Abelian quantum numbers.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.in-Union{Tuple{QN}, Tuple{QN, AbelianGradedSpace{QN}}} where QN<:AbelianQuantumNumber","page":"Quantum numbers","title":"Base.in","text":"in(qn::QN, gs::AbelianGradedSpace{QN}) where {QN<:AbelianQuantumNumber} -> Bool\n\nCheck whether an Abelian quantum number is contained in an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.inv","page":"Quantum numbers","title":"Base.inv","text":"inv(qn::AbelianQuantumNumber, bool::Bool=true) -> typeof(qn)\n\nGet the inverse of an Abelian quantum number qn if bool is true. Otherwise, return qn itself.\n\n\n\n\n\n","category":"function"},{"location":"man/QuantumNumbers/#Base.length-Tuple{AbelianGradedSpace}","page":"Quantum numbers","title":"Base.length","text":"length(gs::AbelianGradedSpace) -> Int\n\nGet the number of inequivalent irreducible representations (i.e., the Abelian quantum numbers) of an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.merge-Tuple{AbelianGradedSpaceProd}","page":"Quantum numbers","title":"Base.merge","text":"merge(rs::AbelianGradedSpaceProd) -> Tuple{AbelianGradedSpace{eltype(rs)}, Dict{eltype(rs), Vector{NTuple{rank(rs), eltype(rs)}}}}\n\nGet the decomposition of the direct product of several Abelian graded spaces and its corresponding fusion processes.\n\nFor a set of Abelian graded spaces (gs₁, gs₂, ...), their direct product space can contain several equivalent irreducible representations because for different sets of Abelian quantum numbers (qn₁, qn₂, ...) where qnᵢ∈gsᵢ, the fusion, i.e., ⊗(qn₁, qn₂, ...) may give the same result qn. This function returns the decomposition of the direct product of (gs₁, gs₂, ...) as well as all the fusion processes of each quantum number contained in the decomposition.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.pairs-Tuple{RepresentationSpace, typeof(dimension)}","page":"Quantum numbers","title":"Base.pairs","text":"pairs(rs::RepresentationSpace, ::typeof(dimension)) -> RepresentationSpacePairs\npairs(rs::RepresentationSpace, ::typeof(range)) -> RepresentationSpacePairs\n\nReturn an iterator that iterates over the pairs of the Abelian quantum numbers and their corresponding (slices of the) degenerate dimensions contained in a representation space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.range-Tuple{AbelianGradedSpace, CartesianIndex}","page":"Quantum numbers","title":"Base.range","text":"range(gs::AbelianGradedSpace, qn::CartesianIndex) -> UnitRange{Int}\nrange(gs::AbelianGradedSpace{QN}, qn::QN) where {QN<:AbelianQuantumNumber} -> UnitRange{Int}\n\nGet the slice of the degenerate dimension of an Abelian quantum number contained in an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.range-Tuple{AbelianGradedSpaceProd, CartesianIndex}","page":"Quantum numbers","title":"Base.range","text":"range(rs::AbelianGradedSpaceProd, i::CartesianIndex) -> AbstractVector{Int}\n\nGet the slice of the degenerate dimension of the ith Abelian quantum number in the direct product of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.range-Tuple{AbelianGradedSpaceSum, CartesianIndex}","page":"Quantum numbers","title":"Base.range","text":"range(rs::AbelianGradedSpaceSum, i::CartesianIndex) -> UnitRange{Int}\n\nGet the slice of the degenerate dimension of the ith Abelian quantum number in the direct sum of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.range-Tuple{RepresentationSpace, Integer}","page":"Quantum numbers","title":"Base.range","text":"range(rs::RepresentationSpace, i::Integer)\n\nGet the slice of the degenerate dimension of the ith Abelian quantum number contained in a representation space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.range-Union{Tuple{QN}, Tuple{N}, Tuple{AbelianGradedSpaceProd{N, QN}, NTuple{N, QN}}} where {N, QN<:AbelianQuantumNumber}","page":"Quantum numbers","title":"Base.range","text":"range(rs::AbelianGradedSpaceProd{N, QN}, qns::NTuple{N, QN}) where {N, QN<:AbelianQuantumNumber} -> AbstractVector{Int}\n\nGet the slice of the degenerate dimension of the Abelian quantum number fused by qns in the direct product of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.split-Union{Tuple{QN}, Tuple{N}, Tuple{QN, AbelianGradedSpaceProd{N, QN}}} where {N, QN<:AbelianQuantumNumber}","page":"Quantum numbers","title":"Base.split","text":"split(target::QN, rs::AbelianGradedSpaceProd{N, QN}; nmax::Real=20) where {N, QN<:AbelianQuantumNumber} -> Set{NTuple{N, QN}}\n\nFind a set of splittings of the target Abelian quantum number with respect to the direct product of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.zero-Tuple{AbelianQuantumNumber}","page":"Quantum numbers","title":"Base.zero","text":"zero(qn::AbelianQuantumNumber) -> typeof(qn)\nzero(::Type{QN}) where {QN<:AbelianQuantumNumber} -> QN\n\nGet the zero Abelian quantum number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#LinearAlgebra.rank-Tuple{AbelianQuantumNumberProd}","page":"Quantum numbers","title":"LinearAlgebra.rank","text":"rank(qn::AbelianQuantumNumberProd) -> Int\nrank(::Type{<:AbelianQuantumNumberProd}) -> Int\n\nGet the rank of a Deligne tensor product of simple Abelian quantum numbers.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#LinearAlgebra.rank-Tuple{QuantumLattices.QuantumNumbers.CompositeAbelianGradedSpace}","page":"Quantum numbers","title":"LinearAlgebra.rank","text":"rank(rs::CompositeAbelianGradedSpace) -> Int\nrank(::Type{<:CompositeAbelianGradedSpace{N}}) where N -> Int\n\nGet the number of Abelian graded spaces in the direct sum.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.:⊕-Tuple{Vararg{AbelianGradedSpace}}","page":"Quantum numbers","title":"QuantumLattices.:⊕","text":"⊕(gses::AbelianGradedSpace...) -> AbelianGradedSpaceSum\n⊕(gs::AbelianGradedSpace, rs::AbelianGradedSpaceSum) -> AbelianGradedSpaceSum\n⊕(rs::AbelianGradedSpaceSum, gs::AbelianGradedSpace) -> AbelianGradedSpaceSum\n⊕(rs₁::AbelianGradedSpaceSum, rs₂::AbelianGradedSpaceSum) -> AbelianGradedSpaceSum\n\nGet the direct sum of some Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.:⊗-Tuple{Vararg{AbelianGradedSpace}}","page":"Quantum numbers","title":"QuantumLattices.:⊗","text":"⊗(gses::AbelianGradedSpace...) -> AbelianGradedSpaceProd\n⊗(gs::AbelianGradedSpace, rs::AbelianGradedSpaceProd) -> AbelianGradedSpaceProd\n⊗(rs::AbelianGradedSpaceProd, gs::AbelianGradedSpace) -> AbelianGradedSpaceProd\n⊗(rs₁::AbelianGradedSpaceProd, rs₂::AbelianGradedSpaceProd) -> AbelianGradedSpaceProd\n\nGet the direct product of some Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.:⊗-Tuple{Vararg{AbelianQuantumNumber}}","page":"Quantum numbers","title":"QuantumLattices.:⊗","text":"⊗(qns::AbelianQuantumNumber...) -> eltype(qns)\n\nGet the direct product of some AbelianQuantumNumbers.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.:⊠-Tuple{Vararg{SimpleAbelianQuantumNumber}}","page":"Quantum numbers","title":"QuantumLattices.:⊠","text":"⊠(qns::SimpleAbelianQuantumNumber...) -> AbelianQuantumNumberProd\n⊠(qn₁::SimpleAbelianQuantumNumber, qn₂::AbelianQuantumNumberProd) -> AbelianQuantumNumberProd\n⊠(qn₁::AbelianQuantumNumberProd, qn₂::SimpleAbelianQuantumNumber) -> AbelianQuantumNumberProd\n⊠(qn₁::AbelianQuantumNumberProd, qn₂::AbelianQuantumNumberProd) -> AbelianQuantumNumberProd\n\nDeligne tensor product of Abelian quantum numbers.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.:⊠-Tuple{Vararg{Type{<:SimpleAbelianQuantumNumber}}}","page":"Quantum numbers","title":"QuantumLattices.:⊠","text":"⊠(QNS::Type{<:SimpleAbelianQuantumNumber}...) -> Type{AbelianQuantumNumberProd{Tuple{QNS...}}}\n⊠(::Type{QN}, ::Type{AbelianQuantumNumberProd{T}}) where {QN<:SimpleAbelianQuantumNumber, T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} -> Type{AbelianQuantumNumberProd{Tuple{QN, fieldtypes(T)...}}}\n⊠(::Type{AbelianQuantumNumberProd{T}}, ::Type{QN}) where {T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}, QN<:SimpleAbelianQuantumNumber} -> Type{AbelianQuantumNumberProd{Tuple{fieldtypes(T)...}, QN}}\n⊠(::Type{AbelianQuantumNumberProd{T₁}}, ::Type{AbelianQuantumNumberProd{T₂}}) where {T₁<:Tuple{Vararg{SimpleAbelianQuantumNumber}}, T₂<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} -> Type{AbelianQuantumNumberProd{Tuple{fieldtypes(T₁)..., fieldtypes(T₂)...}}}\n\nDeligne tensor product of Abelian quantum numbers.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.findindex-Tuple{Integer, AbelianGradedSpace, Integer}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.findindex","text":"findindex(position::Integer, gs::AbelianGradedSpace, guess::Integer) -> Int\n\nFind the index of an Abelian quantum number in an Abelian graded space beginning at guess whose position in the complete dimension range is position.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.period-Tuple{AbelianQuantumNumberProd, Integer}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.period","text":"period(qn::AbelianQuantumNumberProd, i::Integer) -> Number\nperiod(::Type{AbelianQuantumNumberProd{T}}, i::Integer) where {T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} -> Number\n\nGet the period of the ith simple Abelian number contained in a Deligne tensor product.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.period-Tuple{SimpleAbelianQuantumNumber}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.period","text":"period(qn::SimpleAbelianQuantumNumber) -> Number\nperiod(::Type{QN}) where {QN<:SimpleAbelianQuantumNumber} -> Number\n\nGet the period of a simple Abelian quantum number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.periods-Tuple{AbelianQuantumNumber}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.periods","text":"periods(qn::AbelianQuantumNumber) -> Tuple{Vararg{Number}}\nperiods(::Type{QN}) where {QN<:AbelianQuantumNumber} -> Tuple{Vararg{Number}}\n\nGet the periods of Abelian quantum numbers.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.regularize!-Tuple{Vector{<:AbelianQuantumNumber}, Vector{Int64}}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.regularize!","text":"regularize!(quantumnumbers::Vector{<:AbelianQuantumNumber}, dimensions::Vector{Int}; check::Bool=false) -> Tuple{typeof(quantumnumbers), typeof(dimensions), Vector{Int}}\n\nIn place regularization of the input Abelian quantum numbers and their corresponding degenerate dimensions.\n\nAfter the regularization, the Abelian quantum numbers will be sorted in the ascending order and duplicates will be merged together. The degenerate dimensions will be processed accordingly. When check is true, this function also check whether all input degenerate dimensions are positive. The regularized Abelian quantum numbers and degenerate dimensions, as well as the permutation vector that sorts the input Abelian quantum numbers, will be returned. \n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.regularize-Tuple{AbstractVector{<:AbelianQuantumNumber}, AbstractVector{<:Integer}}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.regularize","text":"regularize(quantumnumbers::AbstractVector{<:AbelianQuantumNumber}, dimension::AbstractVector{<:Integer}; check::Bool=false) -> Tuple{Vector{eltype(quantumnumbers)}, Vector{Int}, Vector{Int}}\n\nRegularize of the input Abelian quantum numbers and their corresponding degenerate dimensions.\n\nSee regularize!.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.decompose-Tuple{QuantumLattices.QuantumNumbers.CompositeAbelianGradedSpace}","page":"Quantum numbers","title":"QuantumLattices.decompose","text":"decompose(rs::CompositeAbelianGradedSpace; expand::Bool=true) -> Tuple{AbelianGradedSpace{eltype(rs)}, Vector{Int}}\n\nDecompose a composite of several Abelian graded spaces to the canonical one.\n\nWhen expand is false, the corresponding permutation vector that sorts the Abelian quantum numbers will be returned as well. When expand is true, the expanded dimension indexes of the permutation vector that sorts the Abelian quantum numbers will be returned as well.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Tuple{AbelianGradedSpace, CartesianIndex}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(gs::AbelianGradedSpace, qn::CartesianIndex) -> Int\ndimension(gs::AbelianGradedSpace{QN}, qn::QN) where {QN<:AbelianQuantumNumber} -> Int\n\nGet the degenerate dimension of an Abelian quantum number contained in an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Tuple{AbelianGradedSpaceProd, CartesianIndex}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(rs::AbelianGradedSpaceProd, i::CartesianIndex) -> Int\n\nGet the degenerate dimension of the ith Abelian quantum number in the direct product of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Tuple{AbelianGradedSpaceProd}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(rs::AbelianGradedSpaceProd) -> Int\n\nGet the total dimension of the direct product of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Tuple{AbelianGradedSpaceSum, CartesianIndex}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(rs::AbelianGradedSpaceSum, i::CartesianIndex) -> Int\n\nGet the degenerate dimension of the ith Abelian quantum number in the direct sum of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Tuple{AbelianGradedSpaceSum}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(rs::AbelianGradedSpaceSum) -> Int\n\nGet the total dimension of the direct sum of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Tuple{AbelianGradedSpace}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(gs::AbelianGradedSpace) -> Int\n\nGet the total dimension of an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Tuple{RepresentationSpace, Integer}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(rs::RepresentationSpace, i::Integer) -> Int\n\nGet the degenerate dimension of the ith Abelian quantum number contained in a representation space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Union{Tuple{QN}, Tuple{N}, Tuple{AbelianGradedSpaceProd{N, QN}, NTuple{N, QN}}} where {N, QN<:AbelianQuantumNumber}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(rs::AbelianGradedSpaceProd{N, QN}, qns::NTuple{N, QN}) where {N, QN<:AbelianQuantumNumber} -> Int\n\nGet the degenerate dimension of the Abelian quantum number fused by qns in the direct product of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\n using SymPy: symbols\nend","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Couplings-among-different-degrees-of-freedom","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Now we arrive at the final step toward the complete description of a quantum lattice system, i.e., the terms that represent the couplings among different degrees of freedom.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Ingredients-of-terms-in-Hamiltonians","page":"Couplings among different degrees of freedom","title":"Ingredients of terms in Hamiltonians","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"In this package, the type Term is the representation of a term in lattice Hamiltonians.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"As is well-known, different quantum lattice models have different terms. For example, the Hubbard model consists of an usual hopping term tsum_ijc^_ic_j + hc and a Hubbard term Usum_i c^_i c_i c^_ic_i while the transverse-field Ising model contains an Ising term Jsum_ijS^z_iS^z_j as well as a transverse-field term hsum_iS^x_i. Despite the rich diversity of the terms in quantum lattice models, they host common ingredients:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Overall coefficient: every term has an overall coefficient, e.g., the hopping amplitude t for the usual hopping term, the Hubbard interaction strength U for the Hubbard term, etc.\nKind of bonds to be summed over: as the natural result of lattice symmetry, every term contains a summation over some kind of generic bonds, e.g., the usual hopping term sums over the nearest-neighbor bonds ij, the Hubbard term sums over all individual points (namely the 1-point bonds), etc.\nCoupling pattern: in the body of the summation over bonds, every term contains a coupling pattern that can be represented by a certain combination of operators, e.g., the coupling pattern of the usual hopping term can be represented by c^_ic_j, of the Hubbard term can be represented by c^_i c_i c^_ic_i, etc.\nHermiticity: to guarantee the Hamiltonian to be Hermitian, the Hermitian conjugate (h.c.) of non-Hermitian terms must be added, e.g., the Hermitian conjugate of the usual hopping term must be added in the expression of the lattice Hamiltonian while that of the Hubbard term need not.\nBond-dependent amplitude (optional): the amplitude of a term can be dependent on the generic bonds, e.g., the staggered local chemical potential Δsum_i(-1)^ic^_ic_i depends on the site index of a point, the p+ip pairing potential Δsum_ije^iϕ_ijc^_ic^_j + hc depends on the azimuth angle ϕ_ij of the bond ij, etc.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Such common ingredients determine the underlying organization of Term. In fact, all of them manifest themselves in the basic construction function of Term shown as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Term{termkind}(\n id::Symbol, value, bondkind, coupling, ishermitian::Bool;\n amplitude::Union{Function, Nothing}=nothing\n) where termkind","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"where termkind must be a Symbol, value is the overall coefficient which should be a real number, coupling specifies the coupling pattern of the term which can accept an instance of Coupling, or an iterator of Couplings, or a function that returns a Coupling or an iterator of Couplings, and the keyword argument amplitude specifies the bond dependency of the amplitude if it is not nothing. Here, the new type Coupling is the building block of the coupling pattern, which will be discussed in detail in the following section. It is also noted that an extra id is also assigned with each term which can be used for fast lookup for later convenience.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Coupling-patterns","page":"Couplings among different degrees of freedom","title":"Coupling patterns","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Before the further discussion of Term, we at first turn to the coupling patterns, which lie at the center of the constructions of Terms.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Coupling:-building-block-of-coupling-patterns","page":"Couplings among different degrees of freedom","title":"Coupling: building block of coupling patterns","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Coupling uses a set of Indexes together with a coefficient to represent the coupling pattern, as the following construction function implies:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Coupling([value, ]indexes::Index...)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Here, when value is omitted, it will be set to 1.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Let's see a typical example, which represents the coupling pattern of the usual hopping term tsum_ijc^_ic_j + hc:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling(Index(1ˢᵗ, FockIndex(:, :, 2)), Index(2ⁿᵈ, FockIndex(:, :, 1)))\n∑[𝕕(1ˢᵗ, :, :, 2) 𝕕(2ⁿᵈ, :, :, 1)]","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"There are several differences of the Indexes here compared to those introduced in the previous page of Internal degrees of freedom:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The site attributes are not the site indexes of the points in a lattice, instead, they are the ordinals of the points contained in a bond. In fact, in the expression of c^_ic_j, i is always the first site of a bond while j is always the second, thus, the site attributes here are 1ˢᵗ and 2ⁿᵈ for the first Index and the second Index, respectively. Here, 1ˢᵗ and 2ⁿᵈ are instances of Ordinal, and an arbitrary ordinal can be obtained by an integer followed by the corresponding special constants, e.g., 1ˢᵗ, 2ⁿᵈ, 3ʳᵈ, 4ᵗʰ, 5ᵗʰ, etc.\nThe internal attributes are initialized by special FockIndex instances, which do not have the type parameter :f or :b to specify the statistics, and whose orbital and spin attributes are initialized by the : operator rather than integers. Without the statistics of :f or :b, FockIndex could suit for both fermionic and bosonic quantum lattice systems, as the coupling pattern of an usual hopping term is the same for both kinds of systems. Here, 𝕕 (\\bbd) is the function that is convenient to construct and display instances of FockIndex suitable for both fermionic and bosonic statistics. When the : operator is used in the initialization for either the orbital or the spin attribute, the default rule applies in the coupling pattern, that orbitals or spins are summed diagonally, i.e., c^_ic_jsum_ασc^_iασc_jασ. This rule is in fact a tradition in the literature of condensed matter physics. This implicit summation in the construction of a Coupling is made explicit in its string representation by the ∑ symbol, as can be seen in the above example.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Similarly, the total spin of SpinIndex can be omitted during the construction of the coupling patterns of spin terms, meaning that it suits any allowable value of total spins, e.g., the coupling pattern of the spin-flip term of any total spin Jsum_ijS^+_iS^-_j + hc is as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling(1//2, Index(1ˢᵗ, SpinIndex('+')), Index(2ⁿᵈ, SpinIndex('-')))\n1//2 𝕊(1ˢᵗ, '+') 𝕊(2ⁿᵈ, '-')","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Note that in this coupling pattern, there is no summation symbol ∑ in the string representation because all indexes are definite. Therefore, the summation symbol ∑ in the string representation of a coupling pattern only reflects the summation over local internal degrees of freedom, but not the summation over bonds.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The diagonal summation rule also applies to the direction attribute of PhononIndex if initialized by the : operator, e.g., the the coupling pattern of the phonon kinetic term frac12Msum_i p^2_i can be constructed as:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling(𝕡(1ˢᵗ, :), 𝕡(1ˢᵗ, :))\n∑[𝕡(1ˢᵗ, :) 𝕡(1ˢᵗ, :)]","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Of course, more specific coupling patterns can be initialized with more specific internal indexes, e.g., the coupling pattern of the orbital-1 spin-down hopping term of fermions tsum_ijc^_i 1 c_j 1 + hc is","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling(𝕗(1ˢᵗ, 1, -1//2, 2), 𝕗(2ⁿᵈ, 1, -1//2, 1))\n𝕗(1ˢᵗ, 1, -1//2, 2) 𝕗(2ⁿᵈ, 1, -1//2, 1)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"When all Indexes are of the same type, a Coupling can be initialized in different simpler ways:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"# Coupling pattern for Fock systems\nCoupling(\n [value, ]\n sites::Union{Colon, NTuple{N, Ordinal}},\n ::Type{<:FockIndex},\n orbitals::Union{NTuple{N, Int}, Colon},\n spins::Union{NTuple{N, Union{Rational{Int}, Int}}, Colon},\n nambus::Union{NTuple{N, Int}, Colon}\n) where N\nCoupling(\n [value, ]\n ::Union{typeof(𝕗), typeof(𝕓), typeof(𝕕)},\n sites::Union{Colon, NTuple{N, Ordinal}},\n orbitals::Union{NTuple{N, Int}, Colon},\n spins::Union{NTuple{N, Union{Rational{Int}, Int}}, Colon},\n nambus::Union{NTuple{N, Int}, Colon}\n) where N\n\n# Coupling pattern for spin systems\nCoupling(\n [value, ]\n sites::Union{Colon, NTuple{N, Ordinal}},\n ::Type{<:SpinIndex},\n tags::NTuple{N, Char}\n) where N\nCoupling(\n [value, ]\n ::Type{<:𝕊},\n sites::Union{Colon, NTuple{N, Ordinal}},\n tags::NTuple{N, Char}\n) where N\n\n# Coupling pattern for phonon systems\nCoupling(\n [value, ]\n sites::Union{Colon, NTuple{N, Ordinal}},\n ::Type{<:Union{PhononIndex{:u}, PhononIndex{:p}}},\n directions::Union{Colon, NTuple{N, Char}}\n) where N\nCoupling(\n [value, ]\n ::Union{typeof(𝕦), typeof(𝕡)},\n sites::Union{Colon, NTuple{N, Ordinal}},\n directions::Union{Colon, NTuple{N, Char}}\n) where N","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Here, as is usual, when value is omitted, the coefficient of the Coupling will be set to be 1.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"See examples:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling((1ˢᵗ, 1ˢᵗ, 2ⁿᵈ, 2ⁿᵈ), FockIndex, :, :, (2, 2, 1, 1))\n∑[𝕕(1ˢᵗ, :, :, 2) 𝕕(1ˢᵗ, :, :, 2) 𝕕(2ⁿᵈ, :, :, 1) 𝕕(2ⁿᵈ, :, :, 1)]\n\njulia> Coupling(𝕕, (1ˢᵗ, 1ˢᵗ, 2ⁿᵈ, 2ⁿᵈ), :, :, (2, 2, 1, 1))\n∑[𝕕(1ˢᵗ, :, :, 2) 𝕕(1ˢᵗ, :, :, 2) 𝕕(2ⁿᵈ, :, :, 1) 𝕕(2ⁿᵈ, :, :, 1)]\n\njulia> Coupling((1ˢᵗ, 2ⁿᵈ), SpinIndex, ('z', 'z'))\n𝕊(1ˢᵗ, 'z') 𝕊(2ⁿᵈ, 'z')\n\njulia> Coupling(𝕊, (1ˢᵗ, 2ⁿᵈ), ('z', 'z'))\n𝕊(1ˢᵗ, 'z') 𝕊(2ⁿᵈ, 'z')\n\njulia> Coupling((1ˢᵗ, 1ˢᵗ), PhononIndex{:p}, :)\n∑[𝕡(1ˢᵗ, :) 𝕡(1ˢᵗ, :)]\n\njulia> Coupling(𝕡, (1ˢᵗ, 1ˢᵗ), :)\n∑[𝕡(1ˢᵗ, :) 𝕡(1ˢᵗ, :)]","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"A Coupling can be multiplied with a number:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> coupling = Coupling(1//2, 𝕊(1ˢᵗ, '+'), 𝕊(2ⁿᵈ, '-'));\n\njulia> coupling * 3\n3//2 𝕊(1ˢᵗ, '+') 𝕊(2ⁿᵈ, '-')\n\njulia> 3 * coupling\n3//2 𝕊(1ˢᵗ, '+') 𝕊(2ⁿᵈ, '-')","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Two Couplings can be multiplied together:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> cp₁ = Coupling(𝕕, (1ˢᵗ, 1ˢᵗ), (:, :), (1//2, 1//2), (2, 1));\n\njulia> cp₂ = Coupling(𝕕, (1ˢᵗ, 1ˢᵗ), (:, :), (-1//2, -1//2), (2, 1));\n\njulia> cp₁ * cp₂\n∑[𝕕(1ˢᵗ, :, 1//2, 2) 𝕕(1ˢᵗ, :, 1//2, 1)] ⊗ ∑[𝕕(1ˢᵗ, :, -1//2, 2) 𝕕(1ˢᵗ, :, -1//2, 1)]","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"It is noted that due to the implicit summation of the orbital index in the coupling pattern, the above product is not equal to the coupling pattern of the Hubbard term Usum_i c^_i c_i c^_ic_i:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> cp₁ = Coupling(𝕕, (1ˢᵗ, 1ˢᵗ), :, (1//2, 1//2), (2, 1));\n\njulia> cp₂ = Coupling(𝕕, (1ˢᵗ, 1ˢᵗ), :, (-1//2, -1//2), (2, 1));\n\njulia> cp = Coupling(𝕕, (1ˢᵗ, 1ˢᵗ, 1ˢᵗ, 1ˢᵗ), :, (1//2, 1//2, -1//2, -1//2), (2, 1, 2, 1)) # Hubbard coupling pattern\n∑[𝕕(1ˢᵗ, :, 1//2, 2) 𝕕(1ˢᵗ, :, 1//2, 1) 𝕕(1ˢᵗ, :, -1//2, 2) 𝕕(1ˢᵗ, :, -1//2, 1)]\n\njulia> cp == cp₁ * cp₂\nfalse","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Default-rules-in-coupling-patterns","page":"Couplings among different degrees of freedom","title":"Default rules in coupling patterns","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"As has been shown in the previous subsection, some attributes of the internal attribute of Index can be initialized by the : operator during the construction of a coupling pattern. For the orbital and spin attributes of FockIndex, and for the direction attribute of PhononIndex, the default rule is that such indexes will be summed diagonally in the coupling pattern. In fact, the site attribute of Index and the nambu attribute of FockIndex also support the : initialization, but with different default rules.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Let's return to the example of the coupling pattern of the usual hopping term, i.e., c^dagger_ic_j. Apparently, the site attributes are always (1ˢᵗ, 2ⁿᵈ) and the nambu attributes are always (2, 1) as long as the coupling pattern belongs to an usual hopping term. In fact, for most common terms in condensed matter, such attributes in the coupling pattern usually depends only on their kinds other than the concrete instances. Therefore, we could define them outside the construction functions of Coupling or Term by separate functions, and just leave them to the default rules.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"All predefined default rules can be found in the section of Specialized terms. If you need a term that is beyond such default rules, or you just think that such rules are too complicated to remember, it is recommended to explicitly writing them out in the coupling pattern.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Coupling-patterns-with-constraints","page":"Couplings among different degrees of freedom","title":"Coupling patterns with constraints","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The default rules cannot handle complicated summation conditions on the local internal degrees of freedom in the coupling pattern. For example, for the interorbital-interspin Hubbard term in a multi-orbital Hubbard model, which can be written as Usum_isum_αβtextandσσ c^_iασ c_iασ c^_iβσ c_iβσ, it is impossible to specify its coupling pattern by a single Coupling in the usual way as introduced in previous subsections. Although the coupling pattern of a Term can also be an iterator of Couplings, it would be quite complicated to write down all the expressions by the manual expansion of the summation over α, β, σ and σ. In fact, we have provided a simple way to specify a coupling pattern like this with the help of the macro @pattern:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"@pattern(index₁, index₂, ...[; constraint=...])","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"For example, the coupling pattern of the above interorbital-interspin Hubbard term can be constructed as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling(@pattern(\n 𝕕(:, α, σ, 2), 𝕕(:, α, σ, 1), 𝕕(:, β, σ′, 2), 𝕕(:, β, σ′, 1);\n constraint=α<β && σ≠σ′\n )\n )\n∑[𝕕(:, α, σ, 2) 𝕕(:, α, σ, 1) 𝕕(:, β, σ′, 2) 𝕕(:, β, σ′, 1)](α < β && σ ≠ σ′)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The keyword argument constraint can be omitted if there are no constraints in the summation, e.g., for a special kind of phonon potential Vsum_ijfrac12sum_μνu_i^μ u_j^ν, the coupling pattern can be written as","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling(1//2, @pattern 𝕦(:, μ) 𝕦(:, ν))\n1//2 ∑[𝕦(:, μ) 𝕦(:, ν)]","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The Indexes in the @pattern macro can be of different types, e.g., for a fabricated term just for illustration λsum_ijfrac12sum_αβσ c^dagger_iασ c_iβσ u^x_i, where itinerant electrons are coupled to lattice vibrations, the coupling pattern is","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling(1//2, @pattern 𝕕(1ˢᵗ, α, σ, 2) 𝕕(1ˢᵗ, β, σ, 1) 𝕦(1ˢᵗ, x))\n1//2 ∑[𝕕(1ˢᵗ, α, σ, 2) 𝕕(1ˢᵗ, β, σ, 1) 𝕦(1ˢᵗ, x)]","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"In principle, the couplings of hybrid quantum lattice systems that couple different categories of internal degrees of freedom can be initialized in these ways. For more discussions on hybrid systems, please refer to the page of Hybrid systems.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"One more remark. The constraints can only act on the internal attribute but not on the site attribute of Index. Remind that the site attribute of Index in the coupling pattern is the ordinal of a point in a bond but not the site index of a point in a lattice. Constraint on it makes no sense.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Coupling-patterns-with-matrices-acting-on-sub-internal-spaces","page":"Couplings among different degrees of freedom","title":"Coupling patterns with matrices acting on sub internal spaces","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"At times, the coupling pattern of a term is not compact enough to be represented by a single Coupling. Then as has been pointed out, they can be represented by an iterator of Couplings. A particular common case in condensed matter physics is that it can be represented by a matrix acting on specific sub internal spaces, e.g., a spin-dependent hopping tsum_ijc^dagger_i σᶻ c_j + hc where σᶻ acts on the local spin space. A new type, the MatrixCoupling, as a vector of Coupling, which can be constructed by the following functions:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"# Fock systems\nMatrixCoupling(\n sites::Union{NTuple{2, Ordinal}, Colon},\n ::Type{<:FockIndex},\n orbital::Union{AbstractMatrix, Colon},\n spin::Union{AbstractMatrix, Colon},\n nambu::Union{AbstractMatrix, Colon}\n)\nMatrixCoupling(\n ::Union{typeof(𝕗), typeof(𝕓), typeof(𝕕)},\n sites::Union{NTuple{2, Ordinal}, Colon},\n orbital::Union{AbstractMatrix, Colon},\n spin::Union{AbstractMatrix, Colon},\n nambu::Union{AbstractMatrix, Colon}\n)\n𝕗⁺𝕗(\n sites::Union{NTuple{2, Ordinal}, Colon},\n orbital::Union{AbstractMatrix, Colon},\n spin::Union{AbstractMatrix, Colon},\n nambu::Union{AbstractMatrix, Colon}\n)\n𝕓⁺𝕓(\n sites::Union{NTuple{2, Ordinal}, Colon},\n orbital::Union{AbstractMatrix, Colon},\n spin::Union{AbstractMatrix, Colon},\n nambu::Union{AbstractMatrix, Colon}\n)\n𝕕⁺𝕕(\n sites::Union{NTuple{2, Ordinal}, Colon},\n orbital::Union{AbstractMatrix, Colon},\n spin::Union{AbstractMatrix, Colon},\n nambu::Union{AbstractMatrix, Colon}\n)\n\n# Spin systems\nMatrixCoupling(\n sites::Union{NTuple{2, Ordinal}, Colon},\n ::Type{<:SpinIndex},\n matrix::AbstractMatrix\n)\nMatrixCoupling(\n ::Type{<:𝕊},\n sites::Union{NTuple{2, Ordinal}, Colon},\n matrix::AbstractMatrix\n)\n𝕊ᵀ𝕊(\n sites::Union{NTuple{2, Ordinal}, Colon},\n matrix::AbstractMatrix\n)\n\n# Phonon systems\nMatrixCoupling(\n sites::Union{NTuple{2, Ordinal}, Colon},\n ::Type{<:PhononIndex{:u}},\n matrix::AbstractMatrix\n)\nMatrixCoupling(\n ::typeof(𝕦),\n sites::Union{NTuple{2, Ordinal}, Colon},\n matrix::AbstractMatrix\n)\n𝕦ᵀ𝕦(\n sites::Union{NTuple{2, Ordinal}, Colon},\n matrix::AbstractMatrix\n)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"is designed to represent the coupling patterns in such cases. Here, in construction functions for spin systems the matrix acts on the local (S^x S^y S^z)^T vector space, and in the construction functions for phonon systems the matrix acts on the local (u^x u^y u^z)^T vector space depending on the dimension of the lattice vibrations.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The following codes construct the coupling pattern of the above spin-dependent hopping example:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> mc = MatrixCoupling(𝕕, :, :, σ\"z\", :);\n\njulia> length(mc)\n2\n\njulia> mc[1]\n∑[𝕕(:, :, 1//2, :) 𝕕(:, :, 1//2, :)]\n\njulia> mc[2]\n- ∑[𝕕(:, :, -1//2, :) 𝕕(:, :, -1//2, :)]\n\njulia> mc == 𝕕⁺𝕕(:, :, σ\"z\", :)\ntrue","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Here, @σ_str is a string literal that returns the generalized Pauli matrices:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"σ\"0\" => SparseMatrixCSC([1 0; 0 1])\nσ\"x\" => SparseMatrixCSC([0 1; 1 0])\nσ\"y\" => SparseMatrixCSC([0 -1im; 1im 0])\nσ\"z\" => SparseMatrixCSC([1 0; 0 -1])\nσ\"+\" => SparseMatrixCSC([0 1; 0 0])\nσ\"-\" => SparseMatrixCSC([0 0; 1 0])\nσ\"11\" => SparseMatrixCSC([1 0; 0 0])\nσ\"22\" => SparseMatrixCSC([0 0; 0 1])","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The coupling pattern of the Heisenberg term Jsum_ijS^x_iS^x_j+S^y_iS^y_j+S^z_iS^z_j can be constructed as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> mc = MatrixCoupling(𝕊, :, Heisenberg\"\");\n\njulia> length(mc)\n3\n\njulia> mc[1]\n𝕊(:, 'x') 𝕊(:, 'x')\n\njulia> mc[2]\n𝕊(:, 'y') 𝕊(:, 'y')\n\njulia> mc[3]\n𝕊(:, 'z') 𝕊(:, 'z')\n\njulia> mc == 𝕊ᵀ𝕊(:, Heisenberg\"\")\ntrue","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"where @Heisenberg_str is a string literal that helps to specify common spin terms.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Here lists all the predefined string literals that are helpful to local spin systems:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"# Heisenberg term\nHeisenberg\"\" => SparseMatrixCSC([1 0 0; 0 1 0; 0 0 1])\n\n# Ising terms\nIsing\"x\" => SparseMatrixCSC([1 0 0; 0 0 0; 0 0 0])\nIsing\"y\" => SparseMatrixCSC([0 0 0; 0 1 0; 0 0 0])\nIsing\"z\" => SparseMatrixCSC([0 0 0; 0 0 0; 0 0 1])\n\n# Γ terms\nΓ\"x\" => SparseMatrixCSC([0 0 0; 0 0 1; 0 1 0])\nΓ\"y\" => SparseMatrixCSC([0 0 1; 0 0 0; 1 0 0])\nΓ\"z\" => SparseMatrixCSC([0 1 0; 1 0 0; 0 0 0])\n\n# Γ′ terms\nΓ′\"x\" => SparseMatrixCSC([0 1 1; 1 0 0; 1 0 0])\nΓ′\"y\" => SparseMatrixCSC([0 1 0; 1 0 1; 0 1 0])\nΓ′\"z\" => SparseMatrixCSC([0 0 1; 0 0 1; 1 1 0])\n\n# Dzyaloshinskii–Moriya terms\nDM\"x\" => SparseMatrixCSC([0 0 0; 0 0 1; 0 -1 0])\nDM\"y\" => SparseMatrixCSC([0 0 -1; 0 0 0; 1 0 0])\nDM\"z\" => SparseMatrixCSC([0 1 0; -1 0 0; 0 0 0])","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"MatrixCouplings can be producted or summed.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"For one example, for the nearest-neighbor spin exchange interactions of itinerant fermions Jsum_ijc^_ivecσ_ic_i c^_jvecσ_jc_j where vecσ_i=(σ^x_i σ^y_i σ^z_i)^T acts on the local spin space at site i, the coupling pattern can be constructed as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> mc₁ = 𝕕⁺𝕕(:, :, σ\"+\", :);\n\njulia> mc₂ = 𝕕⁺𝕕(:, :, σ\"-\", :);\n\njulia> mc₃ = 𝕕⁺𝕕(:, :, σ\"z\", :);\n\njulia> coupling = 1//2*mc₁*mc₂ + 1//2*mc₂*mc₁ + mc₃*mc₃;\n\njulia> collect(coupling)\n6-element Vector{Coupling}:\n 1//2 ∑[𝕕(:, :, 1//2, :) 𝕕(:, :, -1//2, :)] ⊗ ∑[𝕕(:, :, -1//2, :) 𝕕(:, :, 1//2, :)]\n 1//2 ∑[𝕕(:, :, -1//2, :) 𝕕(:, :, 1//2, :)] ⊗ ∑[𝕕(:, :, 1//2, :) 𝕕(:, :, -1//2, :)]\n ∑[𝕕(:, :, 1//2, :) 𝕕(:, :, 1//2, :)] ⊗ ∑[𝕕(:, :, 1//2, :) 𝕕(:, :, 1//2, :)]\n - ∑[𝕕(:, :, -1//2, :) 𝕕(:, :, -1//2, :)] ⊗ ∑[𝕕(:, :, 1//2, :) 𝕕(:, :, 1//2, :)]\n - ∑[𝕕(:, :, 1//2, :) 𝕕(:, :, 1//2, :)] ⊗ ∑[𝕕(:, :, -1//2, :) 𝕕(:, :, -1//2, :)]\n ∑[𝕕(:, :, -1//2, :) 𝕕(:, :, -1//2, :)] ⊗ ∑[𝕕(:, :, -1//2, :) 𝕕(:, :, -1//2, :)]","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"For another example, for the onsite spin-orbital coupling of the (d_yz d_xz d_xy)^T t_2g orbitals lambdasum_i c^dagger_i vecL_icdotvecσ_i c_i where vecL_i=(L^x_i L^y_i L^z_i)^T acts on the local orbital space and vecσ_i=(σ^x_i σ^y_i σ^z_i)^T acts on the local spin space, the coupling pattern can be constructed as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> mc₁ = 𝕕⁺𝕕(:, L\"x\", σ\"x\", :);\n\njulia> mc₂ = 𝕕⁺𝕕(:, L\"y\", σ\"y\", :);\n\njulia> mc₃ = 𝕕⁺𝕕(:, L\"z\", σ\"z\", :);\n\njulia> coupling = mc₁ + mc₂ + mc₃;\n\njulia> collect(coupling)\n12-element Vector{Coupling}:\n -1im 𝕕(:, 3, -1//2, :) 𝕕(:, 2, 1//2, :)\n 1im 𝕕(:, 2, -1//2, :) 𝕕(:, 3, 1//2, :)\n -1im 𝕕(:, 3, 1//2, :) 𝕕(:, 2, -1//2, :)\n 1im 𝕕(:, 2, 1//2, :) 𝕕(:, 3, -1//2, :)\n - 𝕕(:, 3, -1//2, :) 𝕕(:, 1, 1//2, :)\n 𝕕(:, 1, -1//2, :) 𝕕(:, 3, 1//2, :)\n 𝕕(:, 3, 1//2, :) 𝕕(:, 1, -1//2, :)\n - 𝕕(:, 1, 1//2, :) 𝕕(:, 3, -1//2, :)\n -1im 𝕕(:, 2, 1//2, :) 𝕕(:, 1, 1//2, :)\n 1im 𝕕(:, 1, 1//2, :) 𝕕(:, 2, 1//2, :)\n 1im 𝕕(:, 2, -1//2, :) 𝕕(:, 1, -1//2, :)\n -1im 𝕕(:, 1, -1//2, :) 𝕕(:, 2, -1//2, :)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Bond-dependent-coupling-patterns","page":"Couplings among different degrees of freedom","title":"Bond-dependent coupling patterns","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Sometimes, the coupling pattern of a term could be dependent on the bonds. For example, for the Kitaev term on the honeycomb lattice Ksum_ij_γ S_i^γS_j^γ where the nearest-neighbor spin exchange interaction depends on the direction of the nearest-neighbor bonds, as illustrated by the following picture, (Image: Kitaev honeycomb model) the coupling pattern can be represented by the following function:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"function kitaev(bond::Bond)\n ϕ = azimuth(rcoordinate(bond)) # get the azimuth angle of a bond in radians\n any(≈(ϕ), (π/6, 7π/6)) && return Coupling(𝕊, :, ('x', 'x'))\n any(≈(ϕ), (5π/6, 11π/6)) && return Coupling(𝕊, :, ('y', 'y'))\n any(≈(ϕ), (π/2, 3π/2)) && return Coupling(𝕊, :, ('z', 'z'))\n error(\"kitaev error: wrong input bond.\")\nend","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Note in all cases, the function to specify a bond dependent coupling pattern can only accept an instance of Bond as its sole argument, but it can return either a Coupling or an iterator of Couplings.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Bond-dependent-amplitude","page":"Couplings among different degrees of freedom","title":"Bond-dependent amplitude","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"As is similar to bond-dependent coupling patterns, the bond-dependent amplitude of a term can be achieved by a function that only accepts an instance of Bond as its sole argument and returns a number. For example, for the staggered local chemical potential Δsum_i(-1)^ic_i^c_i, the bond-dependent amplitude can be specified as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"function staggered(bond::Bond)\n @assert length(bond)==1 \"staggered error: wrong input bond.\"\n return (-1)^bond[1].site\nend","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Terms-with-complex-coefficients","page":"Couplings among different degrees of freedom","title":"Terms with complex coefficients","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"A special case must be paid attention to, i.e., a term with a complex coefficient. In the construction function of Term, a complex number with a nonzero imaginary part can not be used to specify the overall coefficient of a term. This is because the Hamiltonian of a quantum lattice system must be Hermitian and a complex coefficient must be accompanied with its complex conjugate. Thus, the positive direction of the phase must be appointed, resulting in a bond-dependent amplitude. Then, it is always feasible to extract a real overall factor as the final coefficient and leave the remaining part to the bond-dependent amplitude function. For example, for the p+ip pairing potential Δsum_ije^iϕ_ijc^_ic^_j + hc, the coefficient is a pure imaginary number along the y direction, and the bond-dependent amplitude of this term can be specified as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"function pip_potential(bond::Bond)\n ϕ = azimuth(rcoordinate(bond))\n return exp(1im*ϕ)\nend","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Principles-of-the-partition-of-coefficients","page":"Couplings among different degrees of freedom","title":"Principles of the partition of coefficients","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"As has been shown but not explicitly stated, in general, the coefficient of a term is partitioned into three parts in Term, the first part is the overall coefficient which must be a real number and is specified by the value argument in the construction function, the second part is the coefficient occurring in the coupling pattern, and the last part is handled by the bond-dependent amplitude function. Then there exist an ambiguity about how these three parts should be partitioned. Here are the recommended principles:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The overall real coefficient should contain as much as possible of the coefficient of the term that can be put in front of the summation over bonds.\nThe coefficient of a coupling pattern should be determined by traditions (e.g., i in the σʸ Pauli matrix), otherwise should be 1.\nThe bond-dependent amplitude should not contain the tuning parameters of a quantum lattice model.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"If the coefficient of a complicated term cannot fulfill the above principles at the same time, then you should consider splitting it into several terms. A simple check of the number of terms is that in principle it should be equal to the number of tunable parameters of the quantum lattice model under study.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Specialized-terms","page":"Couplings among different degrees of freedom","title":"Specialized terms","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"For each certain kind of terms, some of the input parameters of the basic construction function are in fact fixed or have default values, e.g., the usual hopping term is always non-Hermitian while the Hubbard term is always Hermitian. Therefore, for each common kind of terms in condensed matter physics, it is more convenient to define the specialized construction function. In the following subsections we will list the predefined specialized terms.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Terms-for-complex-fermionic/bosonic-systems","page":"Couplings among different degrees of freedom","title":"Terms for complex fermionic/bosonic systems","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"# termkind = :Onsite\n# bondkind = 0\nOnsite(\n id::Symbol, value, coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :));\n ishermitian::Bool=true,\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :Hopping\n# ishermitian = false\nHopping(\n id::Symbol,\n value,\n bondkind,\n coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :));\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :Pairing\n# ishermitian = false\nPairing(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :Hubbard\n# bondkind = 0\n# coupling = Coupling(𝕕, :, :, (1//2, 1//2, -1//2, -1//2), (2, 1, 2, 1))\n# ishermitian = true\nHubbard(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :InterOrbitalInterSpin\n# bondkind = 0\n# coupling = Coupling(@pattern(\n# 𝕕(:, α, σ, 2), 𝕕(:, α, σ, 1), 𝕕(:, β, σ′, 2), 𝕕(:, β, σ′, 1);\n# constraint=α<β && σ≠σ′\n# ))\n# ishermitian = true\nInterOrbitalInterSpin(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :InterOrbitalIntraSpin\n# bondkind = 0\n# coupling = Coupling(@pattern(\n# 𝕕(:, α, σ, 2), 𝕕(:, α, σ, 1), 𝕕(:, β, σ, 2), 𝕕(:, β, σ, 1);\n# constraint=α<β\n# ))\n# ishermitian = true\nInterOrbitalIntraSpin(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :SpinFlip\n# bondkind = 0\n# coupling = Coupling(@pattern(\n# 𝕕(:, α, 1//2, 2), 𝕕(:, β, -1//2, 2), 𝕕(:, α, -1//2, 1), 𝕕(:, β, 1//2, 1);\n# constraint=α<β\n# ))\n# ishermitian = false\nSpinFlip(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :PairHopping\n# bondkind = 0\n# coupling = Coupling(@pattern(\n# 𝕕(:, α, 1//2, 2), 𝕕(:, α, -1//2, 2), 𝕕(:, β, -1//2, 1), 𝕕(:, β, 1//2, 1);\n# constraint=α<β\n# ))\n# ishermitian = false\nPairHopping(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :Coulomb\nCoulomb(\n id::Symbol,\n value,\n bondkind,\n coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :))^2;\n ishermitian::Bool=true,\n amplitude::Union{Function, Nothing}=nothing\n)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Default rules for such terms when the site attribute of Index and the orbital, spin and nambu attributes of FockIndex initialized by the : operator are listed as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":" site orbital spin nambu\nOnsite (1ˢᵗ, 1ˢᵗ) diagonal diagonal (2, 1)\nHopping (1ˢᵗ, 2ⁿᵈ) diagonal diagonal (2, 1)\nPairing (1ˢᵗ, 1ˢᵗ)/(1ˢᵗ, 2ⁿᵈ) diagonal diagonal (1, 1)\nHubbard (1ˢᵗ, 1ˢᵗ, 1ˢᵗ, 1ˢᵗ) diagonal \nInterOrbitalInterSpin (1ˢᵗ, 1ˢᵗ, 1ˢᵗ, 1ˢᵗ) \nInterOrbitalIntraSpin (1ˢᵗ, 1ˢᵗ, 1ˢᵗ, 1ˢᵗ) \nSpinFlip (1ˢᵗ, 1ˢᵗ, 1ˢᵗ, 1ˢᵗ) \nPairHopping (1ˢᵗ, 1ˢᵗ, 1ˢᵗ, 1ˢᵗ) \nCoulomb (1ˢᵗ, 1ˢᵗ, 2ⁿᵈ, 2ⁿᵈ) diagonal diagonal (2, 1, 2, 1)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"note: Note\nFor the Pairing term, the site attributes will be (1ˢᵗ, 1ˢᵗ) when bondkind=0, otherwise (1ˢᵗ, 2ⁿᵈ).\nBlank cells in the above table mean that the corresponding attributes have been explicitly specified by the specialized construction functions. See the comments of the above code block in this subsection.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Terms-for-SU(2)-spin-systems","page":"Couplings among different degrees of freedom","title":"Terms for SU(2) spin systems","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Standard concrete spin terms are summarized as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"# termkind = :Zeeman\n# bondkind = 0\n# ishermitian = true\nZeeman(\n id::Symbol, value, direction::Char, g::Number=1;\n amplitude::Union{Function, Nothing}=nothing\n)\nZeeman(\n id::Symbol,\n value,\n direction::Union{AbstractVector{<:Number}, Tuple{Number, Number}},\n g::Union{Number, AbstractMatrix{<:Number}}=1;\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :SingleIonAnisotropy\n# bondkind = 0\n# ishermitian = true\nSingleIonAnisotropy(\n id::Symbol, value, direction::Char;\n amplitude::Union{Function, Nothing}=nothing\n)\nSingleIonAnisotropy(\n id::Symbol, value, matrix::AbstractMatrix{<:Number};\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :Ising\n# ishermitian = true\nIsing(\n id::Symbol, value, bondkind, direction::Char;\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :Heisenberg\n# ishermitian = true\nHeisenberg(\n id::Symbol, value, bondkind;\n form::Symbol=Symbol(\"+-z\"), amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :Kitaev\n# ishermitian = true\nKitaev(\n id::Symbol, value, bondkind;\n x::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n y::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n z::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :Γ\n# ishermitian = true\nΓ(\n id::Symbol, value, bondkind;\n x::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n y::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n z::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :Γ′\n# ishermitian = true\nΓ′(\n id::Symbol, value, bondkind;\n x::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n y::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n z::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :DM\n# ishermitian = true\nDM(\n id::Symbol,\n value,\n bondkind,\n vectors::Pair{<:AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}}, <:Union{Char, AbstractVector{<:Number}}}...;\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing\n)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Beyond the above standard concrete terms, the generic spin term can be used:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"# termkind = :SpinTerm\n# ishermitian = true\nSpinTerm(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Here, only the site attribute of Index can be initialized by the : operator. Depending on its rank (i.e. the number of Indexes in the coupling pattern) and the length of the bonds to be summed over, it will be (1ˢᵗ, 1ˢᵗ, ...) when the bond length is 1 and (1ˢᵗ, 2ⁿᵈ, 1ˢᵗ, 2ⁿᵈ...) when the bond length is 2. For other generic bonds with more points, no default rule exists.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Terms-for-phononic-systems","page":"Couplings among different degrees of freedom","title":"Terms for phononic systems","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"# termkind = :Kinetic\n# bondkind = 0\n# coupling = Coupling(𝕡(:, :), 𝕡(:, :))\n# ishermitian = true\nKinetic(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :Hooke\n# ishermitian = true\nHooke(id::Symbol, value, bondkind; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :Elastic\n# ishermitian = true\n# default rules: (1ˢᵗ, 2ⁿᵈ) for `site` and diagonal for `direction`\nElastic(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"For Elastic, the site attribute of Index and the direction attribute of PhononIndex{:u} can be initialized by the : operator. The default rules are also summarized in the comments of the above code block.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Expand-terms-to-obtain-operators","page":"Couplings among different degrees of freedom","title":"Expand terms to obtain operators","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"To obtain the operators of a Term, the expand function exported by this package can be used as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"expand(term::Term, bond::Bond, hilbert::Hilbert) -> Operators\nexpand(term::Term, bonds::AbstractVector{<:Bond}, hilbert::Hilbert) -> Operators","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Let's see a simple example of the usual hopping term:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> t = Hopping(:t, 2.0, 1);\n\njulia> bond = Bond(1, Point(1, [0.0], [0.0]), Point(2, [0.5], [0.0]));\n\njulia> hilbert = Hilbert(1=>Fock{:f}(1, 2), 2=>Fock{:f}(1, 2));\n\njulia> expand(t, bond, hilbert)\nOperators with 4 Operator\n Operator(2.0, 𝕗(1, 1, -1//2, 2, [0.0], [0.0]), 𝕗(2, 1, -1//2, 1, [0.5], [0.0]))\n Operator(2.0, 𝕗(2, 1, -1//2, 2, [0.5], [0.0]), 𝕗(1, 1, -1//2, 1, [0.0], [0.0]))\n Operator(2.0, 𝕗(1, 1, 1//2, 2, [0.0], [0.0]), 𝕗(2, 1, 1//2, 1, [0.5], [0.0]))\n Operator(2.0, 𝕗(2, 1, 1//2, 2, [0.5], [0.0]), 𝕗(1, 1, 1//2, 1, [0.0], [0.0]))","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"When a bond and a term do not match each other, the expand function will return an empty Operators:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> t = Hopping(:t, 1.0, 1);\n\njulia> bond = Bond(2, Point(1, [0.0], [0.0]), Point(1, [1.0], [1.0]));\n\njulia> hilbert = Hilbert(1=>Fock{:f}(1, 2), 2=>Fock{:f}(1, 2));\n\njulia> expand(t, bond, hilbert)\nOperators with 0 Operator","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"In the expand function, an AbstractVector of Bonds can also be provided to get all the operators expanded on such bonds:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> t = Hopping(:t, 1.0, 1);\n\njulia> bonds = [\n Bond(1, Point(2, [0.5], [0.0]), Point(1, [0.0], [0.0]))\n Bond(1, Point(2, [-0.5], [-1.0]), Point(1, [0.0], [0.0]))\n ];\n\njulia> hilbert = Hilbert(1=>Fock{:f}(1, 2), 2=>Fock{:f}(1, 2));\n\njulia> expand(t, bonds, hilbert)\nOperators with 8 Operator\n Operator(1.0, 𝕗(2, 1, -1//2, 2, [0.5], [0.0]), 𝕗(1, 1, -1//2, 1, [0.0], [0.0]))\n Operator(1.0, 𝕗(1, 1, -1//2, 2, [0.0], [0.0]), 𝕗(2, 1, -1//2, 1, [0.5], [0.0]))\n Operator(1.0, 𝕗(2, 1, 1//2, 2, [0.5], [0.0]), 𝕗(1, 1, 1//2, 1, [0.0], [0.0]))\n Operator(1.0, 𝕗(1, 1, 1//2, 2, [0.0], [0.0]), 𝕗(2, 1, 1//2, 1, [0.5], [0.0]))\n Operator(1.0, 𝕗(2, 1, -1//2, 2, [-0.5], [-1.0]), 𝕗(1, 1, -1//2, 1, [0.0], [0.0]))\n Operator(1.0, 𝕗(1, 1, -1//2, 2, [0.0], [0.0]), 𝕗(2, 1, -1//2, 1, [-0.5], [-1.0]))\n Operator(1.0, 𝕗(2, 1, 1//2, 2, [-0.5], [-1.0]), 𝕗(1, 1, 1//2, 1, [0.0], [0.0]))\n Operator(1.0, 𝕗(1, 1, 1//2, 2, [0.0], [0.0]), 𝕗(2, 1, 1//2, 1, [-0.5], [-1.0]))","category":"page"},{"location":"advanced topics/Introduction/","page":"Introduction","title":"Introduction","text":"CurrentModule = QuantumLattices","category":"page"},{"location":"advanced topics/Introduction/#AdvancedTopicsIntroduction","page":"Introduction","title":"Introduction","text":"","category":"section"},{"location":"advanced topics/Introduction/","page":"Introduction","title":"Introduction","text":"The unitcell description framework is the basics of this package, which completes the goal of describing a quantum lattice system and obtaining its Hamiltonian in the operator form. Here, we introduce some advanced utilities provided in this package that will be useful for the compiling, debugging and applying of quantum many-body algorithms.","category":"page"},{"location":"advanced topics/Introduction/","page":"Introduction","title":"Introduction","text":"Pages = [\n \"LaTeXFormattedOutputs.md\",\n \"IndexOrders.md\",\n \"BoundaryConditions.md\",\n \"HybridSystems.md\",\n \"Transformations.md\",\n \"ManageProjects.md\",\n ]\nDepth = 2","category":"page"},{"location":"advanced topics/LaTeXFormattedOutputs/","page":"LaTeX formatted outputs","title":"LaTeX formatted outputs","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"advanced topics/LaTeXFormattedOutputs/#LaTeX-formatted-outputs","page":"LaTeX formatted outputs","title":"LaTeX formatted outputs","text":"","category":"section"},{"location":"man/Spatials/","page":"Spatials","title":"Spatials","text":"CurrentModule = QuantumLattices.Spatials","category":"page"},{"location":"man/Spatials/#Spatials","page":"Spatials","title":"Spatials","text":"","category":"section"},{"location":"man/Spatials/","page":"Spatials","title":"Spatials","text":"Modules = [Spatials]\nOrder = [:module, :constant, :type, :macro, :function]","category":"page"},{"location":"man/Spatials/#QuantumLattices.Spatials.heatmap","page":"Spatials","title":"QuantumLattices.Spatials.heatmap","text":"@recipe plot(reciprocalspace::BrillouinZone, data::AbstractMatrix{<:Number})\n@recipe plot(reciprocalspace::ReciprocalZone, data::AbstractMatrix{<:Number})\n\nDefine the recipe for the heatmap visualization of data on a Brillouin/reciprocal zone.\n\n\n\n\n\n","category":"constant"},{"location":"man/Spatials/#QuantumLattices.Spatials.line","page":"Spatials","title":"QuantumLattices.Spatials.line","text":"@recipe plot(path::ReciprocalPath, data::AbstractVector{<:Number})\n@recipe plot(path::ReciprocalPath, data::AbstractMatrix{<:Number})\n\nDefine the recipe for the line visualization of data along a reciprocal path.\n\n\n\n\n\n","category":"constant"},{"location":"man/Spatials/#QuantumLattices.QuantumNumbers.𝕂²-Union{Tuple{N₂}, Tuple{N₁}, Tuple{AbstractVector{<:Number}, AbstractVector{<:AbstractVector{<:Number}}}} where {N₁, N₂}","page":"Spatials","title":"QuantumLattices.QuantumNumbers.𝕂²","text":"𝕂²{N₁, N₂}(momentum::AbstractVector{<:Number}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}; atol=atol, rtol=rtol) where {N₁, N₂}\n\nConstruct a 2d quantum momentum by the coordinates.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.QuantumNumbers.𝕂³-Union{Tuple{N₃}, Tuple{N₂}, Tuple{N₁}, Tuple{AbstractVector{<:Number}, AbstractVector{<:AbstractVector{<:Number}}}} where {N₁, N₂, N₃}","page":"Spatials","title":"QuantumLattices.QuantumNumbers.𝕂³","text":"𝕂³{N₁, N₂, N₃}(momentum::AbstractVector{<:Number}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}; atol=atol, rtol=rtol) where {N₁, N₂, N₃}\n\nConstruct a 3d quantum momentum by the coordinates.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.QuantumNumbers.𝕂¹-Union{Tuple{N}, Tuple{AbstractVector{<:Number}, AbstractVector{<:AbstractVector{<:Number}}}} where N","page":"Spatials","title":"QuantumLattices.QuantumNumbers.𝕂¹","text":"𝕂¹{N}(momentum::AbstractVector{<:Number}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}; atol=atol, rtol=rtol) where N\n\nConstruct a 1d quantum momentum by the coordinates.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.AbstractLattice","page":"Spatials","title":"QuantumLattices.Spatials.AbstractLattice","text":"AbstractLattice{N, D<:Number, M}\n\nAbstract type of a unitcell-described lattice.\n\nIt should have the following contents:\n\nname::Symbol: the name of the lattice\ncoordinates::Matrix{D}: the coordinates of the lattice\nvectors::SVector{M, SVector{N, D}}: the translation vectors of the lattice\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.Bond","page":"Spatials","title":"QuantumLattices.Spatials.Bond","text":"Bond{K, P<:Point}\n\nA generic bond, which could contains several points.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.Bond-Tuple{Point}","page":"Spatials","title":"QuantumLattices.Spatials.Bond","text":"Bond(point::Point)\nBond(kind, point₁::Point, point₂::Point, points::Point...)\n\nConstruct a bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.BrillouinZone","page":"Spatials","title":"QuantumLattices.Spatials.BrillouinZone","text":"BrillouinZone{K, P<:𝕂, S<:SVector, N} <: ReciprocalSpace{K, S}\n\nBrillouin zone of a lattice.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.BrillouinZone-Tuple{AbstractVector{<:AbstractVector{<:Number}}, Any}","page":"Spatials","title":"QuantumLattices.Spatials.BrillouinZone","text":"BrillouinZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, nk)\nBrillouinZone{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, nk) where K\nBrillouinZone(::Type{P}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}) where {P<:𝕂}\nBrillouinZone{K}(::Type{P}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}) where {K, P<:𝕂}\n\nConstruct a Brillouin zone.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.Lattice","page":"Spatials","title":"QuantumLattices.Spatials.Lattice","text":"Lattice{N, D<:Number, M} <: AbstractLattice{N, D, M}\n\nSimplest lattice.\n\nA simplest lattice can be constructed from its coordinates and translation vectors.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.Lattice-Union{Tuple{N}, Tuple{AbstractLattice, NTuple{N, Int64}}, Tuple{AbstractLattice, NTuple{N, Int64}, NTuple{N, Union{Char, String, Symbol}}}} where N","page":"Spatials","title":"QuantumLattices.Spatials.Lattice","text":"Lattice(lattice::AbstractLattice, ranges::NTuple{N, Int}, boundaries::NTuple{N, Union{Char, String, Symbol}}=ntuple(i->'O', Val(N)); mode::Symbol=:nonnegative) where N\nLattice(lattice::AbstractLattice, ranges::NTuple{N, UnitRange{Int}}, boundaries::NTuple{N, Union{Char, String, Symbol}}=ntuple(i->'O', Val(N))) where N\n\nConstruct a lattice from the translations of another.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.Lattice-Union{Tuple{Vararg{NTuple{N, Number}}}, Tuple{N}} where N","page":"Spatials","title":"QuantumLattices.Spatials.Lattice","text":"Lattice(coordinates::NTuple{N, Number}...; name::Symbol=:lattice, vectors::Union{AbstractVector{<:AbstractVector{<:Number}}, Nothing}=nothing) where N\nLattice(coordinates::AbstractVector{<:Number}...; name::Symbol=:lattice, vectors::Union{AbstractVector{<:AbstractVector{<:Number}}, Nothing}=nothing)\n\nConstruct a lattice.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.Neighbors","page":"Spatials","title":"QuantumLattices.Spatials.Neighbors","text":"Neighbors{K, V<:Number} <: CompositeDict{K, V}\n\nNeighbor vs. bond length maps.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.Neighbors-Tuple{AbstractLattice, Integer}","page":"Spatials","title":"QuantumLattices.Spatials.Neighbors","text":"Neighbors(lattice::AbstractLattice, nneighbor::Integer; coordination::Integer=12)\n\nGet the neighbor vs. bond length map of a lattice up to the nneighborth order.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.Point","page":"Spatials","title":"QuantumLattices.Spatials.Point","text":"Point{N, D<:Number}\n\nA point in a unitcell-described lattice.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.Point-Union{Tuple{N}, Tuple{Integer, NTuple{N, var\"#s123\"} where var\"#s123\"<:Number}, Tuple{Integer, NTuple{N, var\"#s122\"} where var\"#s122\"<:Number, NTuple{N, var\"#s121\"} where var\"#s121\"<:Number}} where N","page":"Spatials","title":"QuantumLattices.Spatials.Point","text":"Point(site::Integer, rcoordinate::SVector{N, D}, icoordinate::SVector{N, D}) where {N, D<:Number}\nPoint(site::Integer, rcoordinate::NTuple{N, <:Number}, icoordinate::NTuple{N, <:Number}=ntuple(i->0, Val(N))) where N\nPoint(site::Integer, rcoordinate::AbstractVector{<:Number}, icoordinate::AbstractVector{<:Number}=zero(SVector{length(rcoordinate), Int}))\n\nConstruct a labeled point.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalCurve","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalCurve","text":"ReciprocalCurve{K, S<:SVector} <: ReciprocalSpace{K, S}\n\nA curve in the reciprocal space.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalCurve-Tuple{ReciprocalPath}","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalCurve","text":"ReciprocalCurve(path::ReciprocalPath)\n\nConstruct a reciprocal curve from a reciprocal path.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalCurve-Union{Tuple{AbstractVector{<:NTuple{N, Number}}}, Tuple{N}} where N","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalCurve","text":"ReciprocalCurve(curve::AbstractVector{<:NTuple{N, Number}}) where N\nReciprocalCurve(curve::AbstractVector{<:AbstractVector{<:Number}})\nReciprocalCurve{K}(curve::AbstractVector{<:NTuple{N, Number}}) where {K, N}\nReciprocalCurve{K}(curve::AbstractVector{<:AbstractVector{<:Number}}) where K\n\nConstruct a curve in the reciprocal space.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalPath","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalPath","text":"ReciprocalPath{K, S<:SVector, N, R} <: ReciprocalSpace{K, S}\n\nA path in the reciprocal space.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalPath-Tuple{AbstractVector{<:AbstractVector{<:Number}}, NamedTuple{(:points, :labels), <:Tuple{var\"#s15\", var\"#s14\"} where {var\"#s15\"<:Tuple, var\"#s14\"<:Tuple}}}","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalPath","text":"ReciprocalPath(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, contents::NamedTuple{(:points, :labels), <:Tuple{<:Tuple, <:Tuple}}; length=100, ends=nothing)\nReciprocalPath{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, contents::NamedTuple{(:points, :labels), <:Tuple{<:Tuple, <:Tuple}}; length=100, ends=nothing) where K\n\nReciprocalPath(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, points::NTuple{N, Number}...; labels=points, length=100, ends=nothing) where N\nReciprocalPath(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, points::Tuple{Vararg{NTuple{N, Number}}}; labels=points, length=100, ends=nothing) where N\nReciprocalPath{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, points::NTuple{N, Number}...; labels=points, length=100, ends=nothing) where {K, N}\nReciprocalPath{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, points::Tuple{Vararg{NTuple{N, Number}}}; labels=points, length=100, ends=nothing) where {K, N}\n\nReciprocalPath(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, segments::Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}...; labels=segments, length=100, ends=nothing) where N\nReciprocalPath(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, segments::Tuple{Vararg{Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}}}; labels=segments, length=100, ends=nothing) where N\nReciprocalPath{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, segments::Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}...; labels=segments, length=100, ends=nothing) where {K, N}\nReciprocalPath{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, segments::Tuple{Vararg{Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}}}; labels=segments, length=100, ends=nothing) where {K, N}\n\nConstruct a path in the reciprocal space.\n\nnote: Note\nFor connected segments,\nwhen length is an integer, it specifies the length of each segment except for the last whose length will be length+1;\nwhen ends is nothing, the start point will be included while the end point will be not for each segment except for the last both points of which will be included.\nFor disconnected segments, they can be partitioned into several connected parts, and the rules for connected segments apply for each of such connected parts.With the above rules, all the points along the assigned path will be counted once and only once with the largest homogeneity.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalSpace","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalSpace","text":"ReciprocalSpace{K, P<:SVector} <: SimpleNamedVectorSpace{K, P}\n\nAbstract type of reciprocal spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalZone","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalZone","text":"ReciprocalZone{K, S<:SVector, V<:Number} <: ReciprocalSpace{K, S}\n\nA zone in the reciprocal space.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalZone-Tuple{AbstractVector{<:AbstractVector{<:Number}}}","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalZone","text":"ReciprocalZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}; length=100, ends=(true, false))\nReciprocalZone{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}; length=100, ends=(true, false)) where K\n\nReciprocalZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::Pair{<:Number, <:Number}...; length=100, ends=(true, false))\nReciprocalZone{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::Pair{<:Number, <:Number}...; length=100, ends=(true, false)) where K\n\nReciprocalZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::AbstractVector{<:Pair{<:Number, <:Number}}; length=100, ends=(true, false))\nReciprocalZone{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::AbstractVector{<:Pair{<:Number, <:Number}}; length=100, ends=(true, false)) where K\n\nReciprocalZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::Tuple{Vararg{Pair{<:Number, <:Number}}}; length=100, ends=(true, false))\nReciprocalZone{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::Tuple{Vararg{Pair{<:Number, <:Number}}}; length=100, ends=(true, false)) where K\n\nConstruct a rectangular zone in the reciprocal space.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalZone-Union{Tuple{BrillouinZone{K, P}}, Tuple{P}, Tuple{K}} where {K, P<:(AbelianQuantumNumberProd)}","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalZone","text":"ReciprocalZone(brillouinzone::BrillouinZone)\n\nConstruct a reciprocal zone from a Brillouin zone.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.@hexagon_str-Tuple{String}","page":"Spatials","title":"QuantumLattices.Spatials.@hexagon_str","text":"hexagon\"P₁-P₂-P₃-...\"\nhexagon\"P₁-P₂-P₃-..., 120°\"\nhexagon\"P₁-P₂-P₃-..., 60°\"\n\nConstruct a tuple of start-stop point pairs for the hexagonal reciprocal space.\n\n\n\n\n\n","category":"macro"},{"location":"man/Spatials/#QuantumLattices.Spatials.@line_str-Tuple{String}","page":"Spatials","title":"QuantumLattices.Spatials.@line_str","text":"line\"P₁-P₂-P₃-...\"\n\nConstruct a tuple of start-stop point pairs for the one dimensional reciprocal space.\n\n\n\n\n\n","category":"macro"},{"location":"man/Spatials/#QuantumLattices.Spatials.@rectangle_str-Tuple{String}","page":"Spatials","title":"QuantumLattices.Spatials.@rectangle_str","text":"rectangle\"P₁-P₂-P₃-...\"\n\nConstruct a tuple of start-stop point pairs for the rectangular reciprocal space.\n\n\n\n\n\n","category":"macro"},{"location":"man/Spatials/#Base.eltype-Tuple{Bond}","page":"Spatials","title":"Base.eltype","text":"eltype(bond::Bond)\neltype(::Type{<:Bond{K, P} where K}) where {P<:Point}\n\nGet the point type contained in a generic bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#Base.getindex-Tuple{AbstractLattice, Integer}","page":"Spatials","title":"Base.getindex","text":"getindex(lattice::AbstractLattice, i::Integer) -> SVector\n\nGet the ith coordinate.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#Base.getindex-Tuple{Bond, Integer}","page":"Spatials","title":"Base.getindex","text":"getindex(bond::Bond, i::Integer) -> Point\n\nGet the ith point contained in a generic bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#Base.iterate","page":"Spatials","title":"Base.iterate","text":"iterate(bond::Bond, state=1)\n\nIterate over the points contained in a generic bond.\n\n\n\n\n\n","category":"function"},{"location":"man/Spatials/#Base.length-Tuple{AbstractLattice}","page":"Spatials","title":"Base.length","text":"length(lattice::AbstractLattice) -> Int\n\nGet the number of points contained in a lattice.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#Base.length-Tuple{Bond}","page":"Spatials","title":"Base.length","text":"length(bond::Bond) -> Int\n\nGet the number of points contained in a generic bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#Base.reverse-Tuple{Bond}","page":"Spatials","title":"Base.reverse","text":"reverse(bond::Bond) -> Bond\n\nGet the reversed bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#Base.step-Tuple{ReciprocalPath, Integer}","page":"Spatials","title":"Base.step","text":"step(path::ReciprocalPath, i::Integer) -> scalartype(path)\n\nGet the step between the ith and the (i+1)th points in the path.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.QuantumOperators.scalartype-Union{Tuple{Type{<:AbstractLattice{N, D} where N}}, Tuple{D}} where D<:Number","page":"Spatials","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(::Type{<:AbstractLattice{N, D} where N}) where {D<:Number}\n\nGet the data type of the coordinates of a lattice.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.QuantumOperators.scalartype-Union{Tuple{Type{<:Bond{K, P} where K}}, Tuple{P}} where P<:Point","page":"Spatials","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(::Type{<:Bond{K, P} where K}) where {P<:Point}\n\nGet the data type of the coordinates of the points contained in a generic bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.QuantumOperators.scalartype-Union{Tuple{Type{<:Point{N, D} where N}}, Tuple{D}} where D<:Number","page":"Spatials","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(::Type{<:Point{N, D} where N}) where {D<:Number}\n\nGet the data type of the coordinates of a point.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.azimuth-Tuple{AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.azimuth","text":"azimuth(v::AbstractVector{<:Number}) -> Number\n\nGet the azimuth angle in radians of a vector.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.azimuthd-Tuple{AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.azimuthd","text":"azimuthd(v::AbstractVector{<:Number}) -> Number\n\nGet the azimuth angle in degrees of a vector.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.bonds!-Tuple{Vector, AbstractLattice, Integer}","page":"Spatials","title":"QuantumLattices.Spatials.bonds!","text":"bonds!(bonds::Vector, lattice::AbstractLattice, nneighbor::Integer; coordination::Integer=12)\nbonds!(bonds::Vector, lattice::AbstractLattice, neighbors::Neighbors) -> typeof(bonds)\n\nGet the required bonds of a lattice and append them to the input bonds.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.bonds-Tuple{AbstractLattice, Integer}","page":"Spatials","title":"QuantumLattices.Spatials.bonds","text":"bonds(lattice::AbstractLattice, nneighbor::Integer; coordination::Integer=12) -> Vector{Bond{Int, Point{dimension(lattice), scalartype(lattice)}}}\nbonds(lattice::AbstractLattice, neighbors::Neighbors) -> Vector{Bond{keytype(neighbors), Point{dimension(lattice), scalartype(lattice)}}}\n\nGet the required bonds of a lattice.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.direction-Tuple{Char, Vararg{Any}}","page":"Spatials","title":"QuantumLattices.Spatials.direction","text":"direction(v::Char, args...) -> SVector{3, <:Number}\ndirection(v::Number, unit::Symbol) -> SVector{2, <:Number}\ndirection(v::Tuple{Number, Number}, unit::Symbol) -> SVector{3, <:Number}\ndirection(v::AbstractVector{<:Number}, args...) -> AbstractVector{<:Number}\n\nGet the unit vector that specifies the direction of a vector.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.distance-Tuple{AbstractVector{<:Number}, AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.distance","text":"distance(p₁::AbstractVector{<:Number}, p₂::AbstractVector{<:Number}) -> Number\n\nGet the distance between two points.\n\nnote: Note\nCompared to norm(p₁-p₂), this function avoids the memory allocation for p₁-p₂, thus is more efficient.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.distance-Tuple{ReciprocalPath}","page":"Spatials","title":"QuantumLattices.Spatials.distance","text":"distance(path::ReciprocalPath) -> scalartype(path)\ndistance(path::ReciprocalPath, i::Integer) -> scalartype(path)\ndistance(path::ReciprocalPath, i::Integer, j::Integer) -> scalartype(path)\n\nGet the distance\n\nof the total path,\nfrom the start point to the ith point in the path,\nfrom the ith point to the jth point in the path (when i is greater than j, the value is negative).\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.icoordinate-Tuple{Bond}","page":"Spatials","title":"QuantumLattices.Spatials.icoordinate","text":"icoordinate(bond::Bond) -> SVector\n\nGet the icoordinate of the bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.interlinks-Tuple{AbstractMatrix{<:Number}, AbstractMatrix{<:Number}, Neighbors}","page":"Spatials","title":"QuantumLattices.Spatials.interlinks","text":"interlinks(cluster₁::AbstractMatrix{<:Number}, cluster₂::AbstractMatrix{<:Number}, neighbors::Neighbors) -> Vector{Tuple{Int, Int, Int}}\n\nUse kdtree to get the intercluster nearest neighbors.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.isintracell-Tuple{Bond}","page":"Spatials","title":"QuantumLattices.Spatials.isintracell","text":"isintracell(bond::Bond) -> Bool\n\nJudge whether a bond is intra the unit cell of a lattice.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.isintracell-Tuple{Point}","page":"Spatials","title":"QuantumLattices.Spatials.isintracell","text":"isintracell(point::Point) -> Bool\n\nJudge whether a point is intra the unitcell.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.isintratriangle-Tuple{AbstractVector{<:Number}, AbstractVector{<:Number}, AbstractVector{<:Number}, AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.isintratriangle","text":"isintratriangle(\n p::AbstractVector{<:Number}, p₁::AbstractVector{<:Number}, p₂::AbstractVector{<:Number}, p₃::AbstractVector{<:Number};\n vertexes::NTuple{3, Bool}=(true, true, true), edges::NTuple{3, Bool}=(true, true, true), atol::Real=atol, rtol::Real=rtol\n) -> Bool\n\nJudge whether a point belongs to the interior of a triangle whose vertexes are p₁, 'p₂' and p₃ with the give tolerance. vertexes and edges define whether the interior should contain the vertexes or edges, respectively.\n\nnote: Note\nThe vertexes are in the order (p₁, p₂, p₃) and the edges are in the order (p₁p₂, p₂p₃, p₃p₁).\nThe edges do not contain the vertexes.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.isonline-Tuple{AbstractVector{<:Number}, AbstractVector{<:Number}, AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.isonline","text":"isonline(\n p::AbstractVector{<:Number}, p₁::AbstractVector{<:Number}, p₂::AbstractVector{<:Number};\n ends::Tuple{Bool, Bool}=(true, true), atol::Real=atol, rtol::Real=rtol\n) -> Bool\n\nJudge whether a point is on a line segment whose end points are p₁ and p₂ with the given tolerance. ends defines whether the line segment should contain its ends.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.isparallel-Tuple{AbstractVector{<:Number}, AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.isparallel","text":"isparallel(v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}; atol::Real=atol, rtol::Real=rtol) -> Int\n\nJudge whether two vectors are parallel to each other with the given tolerance, 0 for not parallel, 1 for parallel and -1 for antiparallel.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.issubordinate-Tuple{AbstractVector{<:Number}, AbstractVector{<:AbstractVector{<:Number}}}","page":"Spatials","title":"QuantumLattices.Spatials.issubordinate","text":"issubordinate(coordinate::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}; atol::Real=atol, rtol::Real=rtol) -> Bool\n\nJudge whether a coordinate belongs to a lattice defined by vectors with the given tolerance.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.matrix-Tuple{AbstractVector{<:AbstractVector}}","page":"Spatials","title":"QuantumLattices.Spatials.matrix","text":"matrix(vs::AbstractVector{<:AbstractVector}) -> Matrix\n\nConvert a vector of vector to a matrix.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.minimumlengths","page":"Spatials","title":"QuantumLattices.Spatials.minimumlengths","text":"minimumlengths(cluster::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, nneighbor::Integer=1; coordination::Integer=12) -> Vector{Float}\nminimumlengths(cluster::AbstractMatrix{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, nneighbor::Integer=1; coordination::Integer=12) -> Vector{Float}\n\nUse kdtree to search the lowest several minimum bond lengths within a lattice translated by a cluster.\n\nWhen the translation vectors are not empty, the lattice will be considered periodic in the corresponding directions. Otherwise the lattice will be open in all directions. To search for the bonds across the periodic boundaries, the cluster will be pre-translated to become a supercluster, which has open boundaries but is large enough to contain all the nearest neighbors within the required order. The coordination parameter sets the average number of each order of nearest neighbors. If it is to small, larger bond lengths may not be searched, and the result will contain Inf. This is a sign that you may need a larger coordination. Another situation that Inf appears in the result occurs when the minimum lengths are searched in open lattices. Indeed, the cluster may be too small so that the required order just goes beyond it. In this case the warning message can be safely ignored.\n\n\n\n\n\n","category":"function"},{"location":"man/Spatials/#QuantumLattices.Spatials.polar-Tuple{AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.polar","text":"polar(v::AbstractVector{<:Number}) -> Number\n\nGet the polar angle in radians of a vector.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.polard-Tuple{AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.polard","text":"polard(v::AbstractVector{<:Number}) -> Number\n\nGet the polar angle in degrees of a vector.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.rcoordinate-Tuple{Bond}","page":"Spatials","title":"QuantumLattices.Spatials.rcoordinate","text":"rcoordinate(bond::Bond) -> SVector\n\nGet the rcoordinate of the bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.reciprocals-Tuple{AbstractLattice}","page":"Spatials","title":"QuantumLattices.Spatials.reciprocals","text":"reciprocals(lattice::AbstractLattice) -> Vector{<:SVector}\n\nGet the reciprocal translation vectors of the dual lattice.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.reciprocals-Tuple{AbstractVector{<:AbstractVector{<:Number}}}","page":"Spatials","title":"QuantumLattices.Spatials.reciprocals","text":"reciprocals(vectors::AbstractVector{AbstractVector{<:Number}}) -> AbstractVector{<:AbstractVector{<:Number}}\n\nGet the reciprocals dual to the input vectors.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.rotate-Tuple{AbstractVector{<:Number}, Number}","page":"Spatials","title":"QuantumLattices.Spatials.rotate","text":"rotate(vector::AbstractVector{<:Number}, angle::Number; axis::Tuple{Union{AbstractVector{<:Number}, Nothing}, Tuple{<:Number, <:Number}}=(nothing, (0, 0))) -> AbstractVector{<:Number}\nrotate(cluster::AbstractMatrix{<:Number}, angle::Number; axis::Tuple{Union{AbstractVector{<:Number}, Nothing}, Tuple{<:Number, <:Number}}=(nothing, (0, 0))) -> AbstractMatrix{<:Number}\n\nGet a rotated vector/cluster of the original one by a certain angle around an axis.\n\nThe axis is determined by a point it gets through (nothing can be used to denote the origin), and its polar as well as azimuth angles in radians. The default axis is the z axis.\n\nnote: Note\nThe result is given by the Rodrigues' rotation formula.\nOnly 2 and 3 dimensional vectors can be rotated.\nWhen the input vectors are 2 dimensional, both the polar and azimuth of the axis must be 0.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.save-Tuple{AbstractString, ReciprocalPath, Union{AbstractMatrix{<:Number}, AbstractVector{<:Number}}}","page":"Spatials","title":"QuantumLattices.Spatials.save","text":"save(filename::AbstractString, path::ReciprocalPath, data::Union{AbstractVector{<:Number}, AbstractMatrix{<:Number}})\nsave(filename::AbstractString, path::ReciprocalPath, y::AbstractVector{<:Number}, data::Union{AbstractMatrix{<:Number}, AbstractArray{<:Number, 3}})\nsave(filename::AbstractString, reciprocalspace::Union{BrillouinZone, ReciprocalZone}, data::Union{AbstractMatrix{<:Number}, AbstractArray{<:Number, 3}})\n\nSave data to delimited files.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.selectpath-Tuple{BrillouinZone, NamedTuple{(:points, :labels), <:Tuple{var\"#s91\", var\"#s90\"} where {var\"#s91\"<:Tuple, var\"#s90\"<:Tuple}}}","page":"Spatials","title":"QuantumLattices.Spatials.selectpath","text":"selectpath(brillouinzone::BrillouinZone, contents::NamedTuple{(:points, :labels), <:Tuple{<:Tuple, <:Tuple}}; ends=nothing, atol::Real=atol, rtol::Real=rtol) -> Tuple(ReciprocalPath, Vector{Int})\nselectpath(brillouinzone::BrillouinZone, points::NTuple{N, Number}...; labels=points, ends=nothing, atol::Real=atol, rtol::Real=rtol) where N -> Tuple(ReciprocalPath, Vector{Int})\nselectpath(brillouinzone::BrillouinZone, points::Tuple{Vararg{NTuple{N, Number}}}; labels=points, ends=nothing, atol::Real=atol, rtol::Real=rtol) where N -> Tuple(ReciprocalPath, Vector{Int})\nselectpath(brillouinzone::BrillouinZone, segments::Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}...; labels=segments, ends=nothing, atol::Real=atol, rtol::Real=rtol) where N -> Tuple(ReciprocalPath, Vector{Int})\nselectpath(brillouinzone::BrillouinZone, segments::Tuple{Vararg{Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}}}; labels=segments, ends=nothing, atol::Real=atol, rtol::Real=rtol) where N -> Tuple(ReciprocalPath, Vector{Int})\n\nSelect a path from a BrillouinZone. Return a ReciprocalPath and the positions of the equivalent points in the BrillouinZone.\n\nnote: Note\nFor connected segments, the start point will be included while the stop point will be not for each segment except for the last both points of which will be included if ends is nothing.\nFor disconnected segments, they can be partitioned into several connected parts, and the rule for connected segments applies for each of such connected parts.With the above rules, all the points along the assigned path will be counted once and only once.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.setup-Tuple{Expr}","page":"Spatials","title":"QuantumLattices.Spatials.setup","text":"@recipe plot(path::ReciprocalPath, y::AbstractVector{<:Number}, data::AbstractArray{<:Number, 3}; subtitles=nothing, subtitlefontsize=8, nrow=nothing, ncol=nothing, clims=nothing)\n@recipe plot(reciprocalspace::BrillouinZone, data::AbstractArray{<:Number, 3}; subtitles=nothing, subtitlefontsize=8, nrow=nothing, ncol=nothing, clims=nothing)\n@recipe plot(reciprocalspace::ReciprocalZone, data::AbstractArray{<:Number, 3}; subtitles=nothing, subtitlefontsize=8, nrow=nothing, ncol=nothing, clims=nothing)\n\nDefine the recipe for the heatmap visualization of a series of data on \n\nthe x-y plain with the x axis being a reciprocal path,\na Brillouin zone,\na reciprocal zone.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.shrink-Union{Tuple{N}, Tuple{K}, Tuple{ReciprocalZone{K}, Vararg{OrdinalRange{<:Integer}, N}}} where {K, N}","page":"Spatials","title":"QuantumLattices.Spatials.shrink","text":"shrink(reciprocalzone::ReciprocalZone{K}, ranges::Vararg{OrdinalRange{<:Integer}, N}) where {K, N} -> ReciprocalZone\n\nShrink a reciprocal zone.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.ticks-Tuple{ReciprocalPath}","page":"Spatials","title":"QuantumLattices.Spatials.ticks","text":"ticks(path::ReciprocalPath) -> Tuple{Vector{scalartype(path)}, Vector{String}}\n\nGet the position-label pairs of the ticks of a path.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.tile-Tuple{AbstractVector{<:Number}, AbstractVector{<:AbstractVector{<:Number}}, Any}","page":"Spatials","title":"QuantumLattices.Spatials.tile","text":"tile(cluster::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, translations) -> AbstractMatrix{<:Number}\ntile(cluster::AbstractMatrix{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, translations) -> AbstractMatrix{<:Number}\n\nTile a supercluster by translations of the input cluster.\n\nBasically, the final supercluster is composed of several parts, each of which is a translation of the original cluster, with the translation vectors specified by vectors and each set of the translation indices contained in translations. When translation vectors are empty, a copy of the original cluster will be returned.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.translate-Tuple{AbstractVector{<:Number}, AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.translate","text":"translate(cluster::AbstractVector{<:Number}, vector::AbstractVector{<:Number}) -> AbstractVector{<:Number}\ntranslate(cluster::AbstractMatrix{<:Number}, vector::AbstractVector{<:Number}) -> AbstractMatrix{<:Number}\n\nGet the translated cluster of the original one by a vector.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.volume-Tuple{AbstractVector{<:AbstractVector{<:Number}}}","page":"Spatials","title":"QuantumLattices.Spatials.volume","text":"volume(vectors::AbstractVector{<:AbstractVector{<:Number}}) -> Number\nvolume(v::AbstractVector{<:Number}) -> Number\nvolume(v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}) -> Number\nvolume(v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}, v₃::AbstractVector{<:Number}) -> Number\n\nGet the volume spanned by the input vectors.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.volume-Tuple{BrillouinZone}","page":"Spatials","title":"QuantumLattices.Spatials.volume","text":"volume(brillouinzone::BrillouinZone) -> Number\n\nGet the volume of a Brillouin zone.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.volume-Tuple{ReciprocalZone}","page":"Spatials","title":"QuantumLattices.Spatials.volume","text":"volume(reciprocalzone::ReciprocalZone) -> Number\n\nGet the volume of a reciprocal zone.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.decompose-Tuple{AbstractMatrix{<:Number}, AbstractMatrix{<:Number}}","page":"Spatials","title":"QuantumLattices.decompose","text":"decompose(m::AbstractMatrix{<:Number}, m₀::AbstractMatrix{<:Number}) -> Number\ndecompose(m::AbstractMatrix{<:Number}, ms::Tuple{Vararg{AbstractMatrix{<:Number}}}) -> Tuple{Vararg{Number}}\ndecompose(m::AbstractMatrix{<:Number}, ms::AbstractVector{<:AbstractMatrix{<:Number}}) -> Vector{<:Number}\n\nDecompose a matrix.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.decompose-Tuple{AbstractVector{<:Number}, AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.decompose","text":"decompose(v₀::AbstractVector{<:Number}, v₁::AbstractVector{<:Number}) -> Number\ndecompose(v₀::AbstractVector{<:Number}, v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}) -> Tuple{Number, Number}\ndecompose(v₀::AbstractVector{<:Number}, v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}, v₃::AbstractVector{<:Number}) -> Tuple{Number, Number, Number}\ndecompose(v₀::AbstractVector{<:Number}, vs::AbstractVector{<:AbstractVector{<:Number}}) -> Vector{<:Number}\n\nDecompose a vector with respect to input basis vectors.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.dimension-Tuple{AbstractLattice}","page":"Spatials","title":"QuantumLattices.dimension","text":"dimension(lattice::AbstractLattice) -> Int\ndimension(::Type{<:AbstractLattice{N}}) where N -> Int\n\nGet the space dimension of the lattice.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.dimension-Tuple{Bond}","page":"Spatials","title":"QuantumLattices.dimension","text":"dimension(bond::Bond) -> Int\ndimension(::Type{<:Bond{K, P} where K}) where {P<:Point} -> Int\n\nGet the space dimension of a concrete bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.dimension-Tuple{Point}","page":"Spatials","title":"QuantumLattices.dimension","text":"dimension(point::Point) -> Int\ndimension(::Type{<:Point{N}}) where N -> Int\n\nGet the spatial dimension of a point.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.expand-Tuple{AbelianQuantumNumberProd, AbstractVector{<:AbstractVector{<:Number}}}","page":"Spatials","title":"QuantumLattices.expand","text":"expand(momentum::𝕂, reciprocals::AbstractVector{<:AbstractVector{<:Number}}) -> eltype(reciprocals)\n\nExpand the momentum from integral values to real values with the given reciprocals.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#RecipesBase.apply_recipe","page":"Spatials","title":"RecipesBase.apply_recipe","text":"@recipe plot(lattice::AbstractLattice, neighbors::Union{Int, Neighbors}, filter::Function=bond->true; siteon=false)\n\nDefine the recipe for the visualization of a lattice.\n\n\n\n\n\n","category":"function"},{"location":"man/Spatials/#RecipesBase.apply_recipe-Tuple{AbstractDict{Symbol, Any}, ReciprocalCurve}","page":"Spatials","title":"RecipesBase.apply_recipe","text":"@recipe plot(path::ReciprocalCurve)\n\nDefine the recipe for the visualization of a reciprocal curve.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#RecipesBase.apply_recipe-Tuple{AbstractDict{Symbol, Any}, ReciprocalPath, AbstractVector{<:Number}, AbstractMatrix{<:Number}}","page":"Spatials","title":"RecipesBase.apply_recipe","text":"@recipe plot(path::ReciprocalPath, y::AbstractVector{<:Number}, data::AbstractMatrix{<:Number})\n\nDefine the recipe for the heatmap visualization of data on the x-y plain with the x axis being a reciprocal path.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#RecipesBase.apply_recipe-Tuple{AbstractDict{Symbol, Any}, ReciprocalPath}","page":"Spatials","title":"RecipesBase.apply_recipe","text":"@recipe plot(path::ReciprocalPath)\n\nDefine the recipe for the visualization of a reciprocal path.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#RecipesBase.apply_recipe-Tuple{AbstractDict{Symbol, Any}, ReciprocalSpace}","page":"Spatials","title":"RecipesBase.apply_recipe","text":"@recipe plot(reciprocalspace::ReciprocalSpace)\n\nDefine the recipe for the visualization of a reciprocal space.\n\n\n\n\n\n","category":"method"},{"location":"advanced topics/IndexOrders/","page":"Index orders","title":"Index orders","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"advanced topics/IndexOrders/#Index-orders","page":"Index orders","title":"Index orders","text":"","category":"section"},{"location":"man/DegreesOfFreedom/","page":"Degrees of freedom","title":"Degrees of freedom","text":"CurrentModule = QuantumLattices.DegreesOfFreedom","category":"page"},{"location":"man/DegreesOfFreedom/#Degrees-of-freedom","page":"Degrees of freedom","title":"Degrees of freedom","text":"","category":"section"},{"location":"man/DegreesOfFreedom/","page":"Degrees of freedom","title":"Degrees of freedom","text":"Modules = [DegreesOfFreedom]\nOrder = [:module, :constant, :type, :macro, :function]","category":"page"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.ˢᵗ","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.ˢᵗ","text":"const ˢᵗ = ⁿᵈ = ʳᵈ = ᵗʰ = Ordinal(1)\n\nConstant ordinals.\n\n\n\n\n\n","category":"constant"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.AllEqual","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.AllEqual","text":"AllEqual{Fields} <: Function\n\nAll-equal constraint for the direct product of homogenous simple internal indexes that for every specified field the values of the internal indexes should be all equal.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.AllEqual-Tuple{Vararg{Symbol}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.AllEqual","text":"AllEqual(fields::Tuple{Vararg{Symbol}})\nAllEqual(fields::Symbol...)\n\nConstruct an all-equal constraint.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.AllEqual-Union{Tuple{InternalIndexProd{NTuple{N, I}}}, Tuple{I}, Tuple{N}, Tuple{fields}} where {fields, N, I<:SimpleInternalIndex}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.AllEqual","text":"(constraint::AllEqual{fields})(index::InternalIndexProd{NTuple{N, I}}) where {fields, N, I<:SimpleInternalIndex} -> Bool\n\nJudge whether the direct product of a set of homogenous simple internal indexes is subject to an all-equal constraint.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.AllEqual-Union{Tuple{Type{I}}, Tuple{I}} where I<:SimpleInternalIndex","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.AllEqual","text":"AllEqual(::Type{I}) where {I<:SimpleInternalIndex}\n\nConstruct an all-equal constraint based on the type of a simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Boundary","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Boundary","text":"Boundary{Names}(values::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}) where Names\n\nBoundary twist of operators.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Boundary-Tuple{Operator}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Boundary","text":"(bound::Boundary)(operator::Operator; origin::Union{AbstractVector, Nothing}=nothing) -> Operator\n\nGet the boundary twisted operator.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Component","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Component","text":"Component{T₁, T₂} <: VectorSpace{Tuple{T₁, T₁, T₂}}\n\nA component of a matrix coupling, i.e., a matrix acting on a separated internal space.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.CompositeIndex","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.CompositeIndex","text":"CompositeIndex{I<:Index} <: OperatorIndex\n\nAbstract type of a composite index.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.CompositeInternal","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.CompositeInternal","text":"CompositeInternal{T<:Tuple{Vararg{SimpleInternal}}, I<:InternalIndex} <: Internal{I}\n\nAbstract type of the composition (i.e., direct sum or direct product) of several simple internal spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.ConstrainedInternal","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.ConstrainedInternal","text":"ConstrainedInternal{P<:InternalProd, C<:InternalPattern}\n\nConstrained internal space.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.ConstrainedInternal-Tuple{SimpleInternal, InternalPattern}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.ConstrainedInternal","text":"ConstrainedInternal(internal::SimpleInternal, pattern::InternalPattern)\nConstrainedInternal(internal::InternalProd, pattern::InternalPattern)\n\nConstruct a constrained internal space.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.CoordinatedIndex","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.CoordinatedIndex","text":"CoordinatedIndex{I<:Index, V<:SVector} <: CompositeIndex{I}\n\nCoordinated index, i.e., index with coordinates in the unitcell.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.CoordinatedIndex-Tuple{Index, Any, Any}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.CoordinatedIndex","text":"CoordinatedIndex(index::Index, rcoordinate, icoordinate)\nCoordinatedIndex(index::Index; rcoordinate, icoordinate)\n\nConstruct a coordinated index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Coupling","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Coupling","text":"Coupling{V, P<:Pattern} <: OperatorPack{V, P}\n\nCoupling among internal degrees of freedom at different or same lattice points.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Coupling-Tuple{Pattern}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Coupling","text":"Coupling(value, pattern::Pattern)\nCoupling(pattern::Pattern)\n\nConstruct a coupling.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Coupling-Tuple{Vararg{Index}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Coupling","text":"Coupling(indexes::Index...)\nCoupling(value, indexes::Index...)\nCoupling(value, indexes::Tuple{Vararg{Index}})\n\nConstruct a coupling with the input indexes as the pattern.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Coupling-Union{Tuple{I}, Tuple{N}, Tuple{Union{Colon, NTuple{N, Ordinal}}, Type{I}, Vararg{Union{Colon, NTuple{N, T} where T}}}} where {N, I<:SimpleInternalIndex}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Coupling","text":"Coupling(sites::Union{NTuple{N, Ordinal}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleInternalIndex}\nCoupling(value, sites::Union{NTuple{N, Ordinal}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleInternalIndex}\nCoupling{N}(sites::Union{NTuple{N, Ordinal}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleInternalIndex}\nCoupling{N}(value, sites::Union{NTuple{N, Ordinal}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleInternalIndex}\n\nConstruct a Coupling with the input sites and the fields of a kind of simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Coupling-Union{Tuple{N}, Tuple{Union{Function, Type{<:Function}}, Union{Colon, NTuple{N, Ordinal}}, Vararg{Union{Colon, NTuple{N, T} where T}}}} where N","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Coupling","text":"Coupling(f::Union{Function, Type{<:Function}}, sites::Union{NTuple{N, Ordinal}, Colon}, fields::Union{NTuple{N}, Colon}...) where N\nCoupling(value::Number, f::Union{Function, Type{<:Function}}, sites::Union{NTuple{N, Ordinal}, Colon}, fields::Union{NTuple{N}, Colon}...) where N\nCoupling{N}(f::Union{Function, Type{<:Function}}, sites::Union{NTuple{N, Ordinal}, Colon}, fields::Union{NTuple{N}, Colon}...) where N\nCoupling{N}(value::Number, f::Union{Function, Type{<:Function}}, sites::Union{NTuple{N, Ordinal}, Colon}, fields::Union{NTuple{N}, Colon}...) where N\n\nConstruct a Coupling by a function that can construct an Index with the input sites and the fields of a kind of simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Hilbert","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Hilbert","text":"Hilbert{I<:Internal} <: CompositeDict{Int, I}\n\nHilbert space at a lattice.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Hilbert-Tuple{Internal, Integer}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Hilbert","text":"Hilbert(internal::Internal, num::Integer)\n\nConstruct a Hilbert space with all same internal spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Hilbert-Tuple{Vararg{Internal}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Hilbert","text":"Hilbert(internals::Internal...)\nHilbert(internals::Tuple{Vararg{Internal}})\nHilbert(internals::AbstractVector{<:Internal})\n\nConstruct a Hilbert space with the given internal spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Hilbert-Tuple{Vararg{Pair}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Hilbert","text":"Hilbert(ps::Pair...)\nHilbert(kv)\n\nConstruct a Hilbert space the same way as an OrderedDict.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Index","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Index","text":"Index(site::Union{Int, Ordinal, Colon}, internal::SimpleInternalIndex)\n\nIndex of a degree of freedom, which consist of the spatial part (i.e., the site index) and the internal part (i.e., the internal index).\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Internal","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Internal","text":"Internal{I<:InternalIndex} <: VectorSpace{I}\n\nInternal space at a single point.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalIndex","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalIndex","text":"InternalIndex <: OperatorIndex\n\nInternal index of an internal degree of freedom.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalIndexProd","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalIndexProd","text":"InternalIndexProd{T<:Tuple{Vararg{SimpleInternalIndex}}} <: InternalIndex\n\nDirect product of several simple internal indexes.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalIndexProd-Tuple{Vararg{SimpleInternalIndex}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalIndexProd","text":"InternalIndexProd(contents::SimpleInternalIndex...)\n\nConstruct the direct product of several simple internal indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalPattern","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalPattern","text":"InternalPattern(index::InternalIndexProd, constraint::Function, representation::String=string(constraint))\nInternalPattern{P}(index::InternalIndexProd, constraints::NTuple{N, Function}, representations::NTuple{N, String}=map(string, constraints)) where {P, N}\n\nConstruct an internal pattern for the direct product of a set of simple internal indexes with 1) only one constraint function, and 2) several constraint functions.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalPattern-2","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalPattern","text":"InternalPattern{I, P, N, C<:NTuple{N, Function}} <: QuantumOperator\n\nInternal pattern for the direct product of a set of simple internal indexes with extra constraints.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalPattern-Tuple{SimpleInternalIndex}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalPattern","text":"InternalPattern(index::SimpleInternalIndex)\nInternalPattern(index::InternalIndexProd{<:Tuple{Vararg{I}}}) where {I<:SimpleInternalIndex}\n\nConstruct an internal pattern whose constraint is an AllEqual function for the direct product of a homogeneous set of simple internal indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalProd","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalProd","text":"InternalProd{T<:Tuple{Vararg{SimpleInternal}}, I<:InternalIndex} <: CompositeInternal{T, I}\n\nDirect product of several single internal spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalSum","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalSum","text":"InternalSum{T<:Tuple{Vararg{SimpleInternal}}, I<:InternalIndex} <: CompositeInternal{T, I}\n\nDirect sum of several single internal spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.MatrixCoupling","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.MatrixCoupling","text":"MatrixCoupling{I}(sites::Union{NTuple{2, Ordinal}, NTuple{2, Colon}}, contents::Tuple{Vararg{Component}}) where {I<:SimpleInternalIndex}\nMatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{I}, contents::Component...) where {I<:SimpleInternalIndex}\n\nMatrix coupling, i.e., a set of couplings whose coefficients are specified by matrices acting on separated internal spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.MatrixCouplingProd","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.MatrixCouplingProd","text":"MatrixCouplingProd{V<:Number, C<:Tuple{Vararg{MatrixCoupling}}} <: VectorSpace{Coupling}\n\nProduct of matrix couplings together with an overall coefficient.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.MatrixCouplingSum","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.MatrixCouplingSum","text":"MatrixCouplingSum{C<:MatrixCouplingProd, N} <: VectorSpace{Coupling}\n\nSum of the products of matrix couplings.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Metric","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Metric","text":"Metric <: Function\n\nRules for measuring an operator index so that different operator indexes can be compared.\n\nAs a function, every instance should accept only one positional argument, i.e. the operator index to be measured.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.OperatorIndexToTuple","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.OperatorIndexToTuple","text":"OperatorIndexToTuple{Fields} <: Metric\n\nA rule that converts an operator index into a tuple based on the specified type parameter Fields.\n\nHere, Fields must be a tuple of Union{Symbol, Function}, which determines the elements of the converted tuple on an element-by-element basis.\n\nFor the ith element of Fields:\n\nIf it is a Symbol, it represents the name of a single index of an OperatorIndex, and its value will become the corresponding element in the converted tuple.\nIf it is a Function, it should be a trait function of an OperatorIndex, and its return value will become the corresponding element in the converted tuple.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.OperatorIndexToTuple-Tuple{Index}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.OperatorIndexToTuple","text":"(operatorunittotuple::OperatorIndexToTuple)(index::Index) -> Tuple\n\nConvert an index to a tuple.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.OperatorIndexToTuple-Union{Tuple{Type{I}}, Tuple{I}} where I<:Index","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.OperatorIndexToTuple","text":"OperatorIndexToTuple(::Type{I}) where {I<:Index}\n\nConstruct the metric rule from the information of the Index type.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Ordinal","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Ordinal","text":"Ordinal\n\nOrdinal of an Int.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Pattern","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Pattern","text":"Pattern{C<:InternalPattern, S<:Tuple{Vararg{Union{Ordinal, Colon}}}} <: QuantumOperator\n\nCoupling pattern.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Pattern-Tuple{Vararg{Index}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Pattern","text":"Pattern(indexes::Index...)\nPattern(indexes::Tuple{Vararg{Index}})\n\nConstruct a coupling pattern from a set of indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.SimpleInternal","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.SimpleInternal","text":"SimpleInternal{I<:SimpleInternalIndex} <: Internal{I}\n\nSimple internal space at a single point.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.SimpleInternalIndex","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.SimpleInternalIndex","text":"SimpleInternalIndex <: InternalIndex\n\nSimple internal index, i.e., a complete set of indexes to denote an internal degree of freedom.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Table","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Table","text":"Table(indexes::AbstractVector{<:OperatorIndex}, by::Metric=OperatorIndexToTuple(eltype(indexes)))\n\nConvert a set of operator units to the corresponding table of operator index vs. sequence pairs.\n\nThe input operator units are measured by the input by function with the duplicates removed. The resulting unique values are sorted, which determines the sequence of the input indexes. Note that two operator units have the same sequence if their converted values are equal to each other.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Table-2","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Table","text":"Table{I, B<:Metric} <: CompositeDict{I, Int}\n\nTable of operator index v.s. sequence pairs.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Table-3","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Table","text":"Table(hilbert::Hilbert, by::Metric=OperatorIndexToTuple(typeof(hilbert))) -> Table\n\nGet the index-sequence table of a Hilbert space.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Term","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Term","text":"Term{K, I, V, B, C<:TermCoupling, A<:TermAmplitude}\n\nTerm of a quantum lattice system.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Term-Union{Tuple{K}, Tuple{Symbol, Any, Any, Any, Bool}} where K","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Term","text":"Term{K}(id::Symbol, value, bondkind, coupling, ishermitian::Bool; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true) where K\n\nConstruct a term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.TermAmplitude","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.TermAmplitude","text":"TermAmplitude{F} <: TermFunction{F}\n\nFunction for the amplitude of a term.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.TermCoupling","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.TermCoupling","text":"TermCoupling{C<:Coupling, F} <: TermFunction{F}\n\nFunction for the coupling of a term.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.TermFunction","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.TermFunction","text":"TermFunction{F} <: Function\n\nAbstract type for concrete term functions.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.@pattern-Tuple","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.@pattern","text":"@pattern index₁ index₂ ...\n@pattern(index₁, index₂, ...; constraint=...)\n\nConstruct a coupling pattern according to the pattern of the input indexes and an optional constraint.\n\n\n\n\n\n","category":"macro"},{"location":"man/DegreesOfFreedom/#Base.:*-Tuple{MatrixCoupling, MatrixCoupling}","page":"Degrees of freedom","title":"Base.:*","text":"*(mc₁::MatrixCoupling, mc₂::MatrixCoupling) -> MatrixCouplingProd\n*(mc::MatrixCoupling, mcp::MatrixCouplingProd) -> MatrixCouplingProd\n*(mcp::MatrixCouplingProd, mc::MatrixCoupling) -> MatrixCouplingProd\n*(mcp₁::MatrixCouplingProd, mcp₂::MatrixCouplingProd) -> MatrixCouplingProd\n*(mc::MatrixCoupling, factor::Number) -> MatrixCouplingProd\n*(factor::Number, mc::MatrixCoupling) -> MatrixCouplingProd\n*(factor::Number, mcp::MatrixCouplingProd) -> MatrixCouplingProd\n*(mcp::MatrixCouplingProd, factor::Number) -> MatrixCouplingProd\n*(mcs::MatrixCouplingSum, element::Union{Number, MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum\n*(element::Union{Number, MatrixCoupling, MatrixCouplingProd}, mcs::MatrixCouplingSum) -> MatrixCouplingSum\n*(mcs₁::MatrixCouplingSum, mcs₂::MatrixCouplingSum) -> MatrixCouplingSum\n\nProduct between MatrixCouplings and MatrixCouplingProds.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.:+-Tuple{Union{MatrixCoupling, MatrixCouplingProd}, Union{MatrixCoupling, MatrixCouplingProd}}","page":"Degrees of freedom","title":"Base.:+","text":"+(mc₁::Union{MatrixCoupling, MatrixCouplingProd}, mc₂::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum\n+(mc::Union{MatrixCoupling, MatrixCouplingProd}, mcs::MatrixCouplingSum) -> MatrixCouplingSum\n+(mcs::MatrixCouplingSum, mc::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum\n+(mcs₁::MatrixCouplingSum, mcs₂::MatrixCouplingSum) -> MatrixCouplingSum\n\nAddition between MatrixCouplings and MatrixCouplingProds.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.:/-Tuple{MatrixCouplingProd, Number}","page":"Degrees of freedom","title":"Base.:/","text":"/(mcp::MatrixCouplingProd, factor::Number) -> MatrixCouplingProd\n/(mcs::MatrixCouplingSum, factor::Number) -> MatrixCouplingSum\n/(mc::MatrixCoupling, factor::Number) -> MatrixCouplingProd\n//(mcp::MatrixCouplingProd, factor::Number) -> MatrixCouplingProd\n//(mcs::MatrixCouplingSum, factor::Number) -> MatrixCouplingSum\n//(mc::MatrixCoupling, factor::Number) -> MatrixCouplingProd\n-(mc::MatrixCoupling) -> MatrixCouplingProd\n-(mcp::MatrixCouplingProd) -> MatrixCouplingProd\n-(mcs::MatrixCouplingSum) -> MatrixCouplingSum\n-(mc₁::Union{MatrixCoupling, MatrixCouplingProd}, mc₂::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum\n-(mc::Union{MatrixCoupling, MatrixCouplingProd}, mcs::MatrixCouplingSum) -> MatrixCouplingSum\n-(mcs::MatrixCouplingSum, mc::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum\n-(mcs₁::MatrixCouplingSum, mcs₂::MatrixCouplingSum) -> MatrixCouplingSum\n\nDefine right-division, minus and subtraction operator for a MatrixCoupling/MatrixCouplingProd/MatrixCouplingSum.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.:^-Tuple{Union{MatrixCoupling, MatrixCouplingProd, MatrixCouplingSum}, Integer}","page":"Degrees of freedom","title":"Base.:^","text":"^(mc::Union{MatrixCoupling, MatrixCouplingProd, MatrixCouplingSum}, n::Integer) -> Union{MatrixCoupling, MatrixCouplingProd, MatrixCouplingSum}\n\nGet the nth power of a MatrixCoupling/MatrixCouplingProd/MatrixCouplingSum.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.adjoint-Tuple{CoordinatedIndex}","page":"Degrees of freedom","title":"Base.adjoint","text":"adjoint(index::CoordinatedIndex) -> typeof(index)\n\nGet the adjoint of a coordinated index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.adjoint-Tuple{Index}","page":"Degrees of freedom","title":"Base.adjoint","text":"adjoint(index::Index) -> typeof(index)\n\nGet the adjoint of an index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.filter-Tuple{SimpleInternalIndex, CompositeInternal}","page":"Degrees of freedom","title":"Base.filter","text":"filter(ii::SimpleInternalIndex, ci::CompositeInternal) -> Union{Nothing, SimpleInternal, CompositeInternal}\nfilter(::Type{I}, ci::CompositeInternal) where {I<:SimpleInternalIndex} -> Union{Nothing, SimpleInternal, CompositeInternal}\n\nFilter the composite internal space and select those that match the input simple internal index or the type of a simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.filter-Tuple{SimpleInternalIndex, SimpleInternal}","page":"Degrees of freedom","title":"Base.filter","text":"filter(ii::SimpleInternalIndex, i::SimpleInternal) -> Union{Nothing, typeof(internal)}\nfilter(::Type{I}, i::SimpleInternal) where {I<:SimpleInternalIndex} -> Union{Nothing, typeof(internal)}\n\nFilter a simple internal space with respect to the input simple internal index or the type of a simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.filter-Union{Tuple{CI}, Tuple{SimpleInternalIndex, Type{CI}}} where CI<:CompositeInternal","page":"Degrees of freedom","title":"Base.filter","text":"filter(ii::SimpleInternalIndex, ::Type{CI}) where {CI<:CompositeInternal}\nfilter(::Type{I}, ::Type{CI}) where {I<:SimpleInternalIndex, CI<:CompositeInternal}\n\nFilter the type of a composite internal space and select those that match the input simple internal index or the type of a simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.filter-Union{Tuple{SI}, Tuple{SimpleInternalIndex, Type{SI}}} where SI<:SimpleInternal","page":"Degrees of freedom","title":"Base.filter","text":"filter(ii::SimpleInternalIndex, ::Type{SI}) where {SI<:SimpleInternal}\nfilter(::Type{I}, ::Type{SI}) where {I<:SimpleInternalIndex, SI<:SimpleInternal}\n\nFilter the type of a simple internal space with respect to the input simple internal index or the type of a simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.findall-Tuple{Function, Hilbert, Table}","page":"Degrees of freedom","title":"Base.findall","text":"findall(select::Function, hilbert::Hilbert, table::Table) -> Vector{Int}\n\nFind all the sequences of indexes contained in a Hilbert space according to a table and a select function.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.getindex-Tuple{Table, OperatorIndex}","page":"Degrees of freedom","title":"Base.getindex","text":"getindex(table::Table, index::OperatorIndex) -> Int\n\nInquiry the sequence of an operator index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.haskey-Tuple{Table, OperatorIndex}","page":"Degrees of freedom","title":"Base.haskey","text":"haskey(table::Table, index::OperatorIndex) -> Bool\nhaskey(table::Table, indexes::ID{OperatorIndex}) -> Tuple{Vararg{Bool}}\n\nJudge whether a single operator index or a set of operator indexes have been assigned with sequences in table.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.keys-Tuple{Boundary}","page":"Degrees of freedom","title":"Base.keys","text":"keys(bound::Boundary) -> Tuple{Vararg{Symbol}}\nkeys(::Type{<:Boundary{Names}}) where Names -> Names\n\nGet the names of the boundary parameters.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.keys-Union{Tuple{OperatorIndexToTuple{Fields}}, Tuple{Fields}} where Fields","page":"Degrees of freedom","title":"Base.keys","text":"keys(::OperatorIndexToTuple{Fields}) where Fields -> Fields\nkeys(::Type{<:OperatorIndexToTuple{Fields}}) where Fields -> Fields\n\nGet the values of the type parameter Fields.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.match-Tuple{InternalPattern, InternalIndexProd}","page":"Degrees of freedom","title":"Base.match","text":"match(pattern::InternalPattern, index::InternalIndexProd) -> Bool\n\nJudge whether the direct product of a set of simple internal indexes satisfies an internal pattern.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.match-Tuple{SimpleInternalIndex, SimpleInternal}","page":"Degrees of freedom","title":"Base.match","text":"match(ii::SimpleInternalIndex, i::SimpleInternal) -> Bool\nmatch(::Type{I}, i::SimpleInternal) where {I<:SimpleInternalIndex} -> Bool\nmatch(ii::SimpleInternalIndex, ::Type{SI}) where {SI<:SimpleInternal} -> Bool\nmatch(::Type{I}, ::Type{SI}) where {I<:SimpleInternalIndex, SI<:SimpleInternal} -> Bool\n\nJudge whether a simple internal space or the type of a simple internal space matches a simple internal index or the type of a simple internal index.\n\nHere, \"match\" means that the eltype of the simple internal space is consistent with the type of the simple internal index, which usually means that they share the same type name.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.merge!-Tuple{Boundary, Boundary}","page":"Degrees of freedom","title":"Base.merge!","text":"merge!(bound::Boundary, another::Boundary) -> typeof(bound)\n\nMerge the values and vectors of the twisted boundary condition from another one.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.one-Tuple{Term}","page":"Degrees of freedom","title":"Base.one","text":"one(term::Term) -> Term\n\nGet a unit term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.replace-Tuple{Boundary}","page":"Degrees of freedom","title":"Base.replace","text":"replace(bound::Boundary; values=bound.values, vectors=bound.vectors) -> Boundary\n\nReplace the values or vectors of a twisted boundary condition and get the new one.\n\nnote: Note\nThe plain boundary condition keeps plain even when replaced with new values or new vectors.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.replace-Tuple{Term, Any}","page":"Degrees of freedom","title":"Base.replace","text":"replace(term::Term, value) -> Term\n\nReplace the value of a term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.string-Tuple{Term, Bond, Hilbert}","page":"Degrees of freedom","title":"Base.string","text":"string(term::Term, bond::Bond, hilbert::Hilbert) -> String\n\nGet the string representation of a term on a bond with a given Hilbert space.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.union-Tuple{Vararg{Table}}","page":"Degrees of freedom","title":"Base.union","text":"union(tables::Table...) -> Table\n\nUnite several operator index vs. sequence tables.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.valtype-Tuple{Term}","page":"Degrees of freedom","title":"Base.valtype","text":"valtype(term::Term)\nvaltype(::Type{<:Term)\n\nGet the value type of a term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.valtype-Tuple{Tuple{Term, Vararg{Term}}}","page":"Degrees of freedom","title":"Base.valtype","text":"valtype(terms::Tuple{Term, Vararg{Term}})\nvaltype(::Type{<:T}) where {T<:Tuple{Term, Vararg{Term}}}\n\nGet the common value type of a set of terms.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.valtype-Union{Tuple{I}, Tuple{M}, Tuple{Type{M}, Type{I}}} where {M<:OperatorIndexToTuple, I<:Index}","page":"Degrees of freedom","title":"Base.valtype","text":"valtype(::Type{<:OperatorIndexToTuple}, ::Type{<:Index})\n\nGet the valtype of applying an OperatorIndexToTuple rule to an Index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.zero-Tuple{Term}","page":"Degrees of freedom","title":"Base.zero","text":"zero(term::Term) -> Term\n\nGet a zero term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LaTeXStrings.latexstring-Tuple{Coupling}","page":"Degrees of freedom","title":"LaTeXStrings.latexstring","text":"latexstring(coupling::Coupling) -> String\n\nConvert a coupling to the latex format.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LaTeXStrings.latexstring-Tuple{InternalPattern}","page":"Degrees of freedom","title":"LaTeXStrings.latexstring","text":"latexstring(pattern::InternalPattern) -> String\n\nConvert an internal pattern to the latex format.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LaTeXStrings.latexstring-Tuple{Pattern}","page":"Degrees of freedom","title":"LaTeXStrings.latexstring","text":"latexstring(pattern::Pattern) -> String\n\nConvert a coupling pattern to the latex format.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LinearAlgebra.rank-Tuple{CompositeInternal}","page":"Degrees of freedom","title":"LinearAlgebra.rank","text":"rank(ci::CompositeInternal) -> Int\nrank(::Type{<:CompositeInternal{T}}) where {T<:Tuple{Vararg{SimpleInternal}}} -> Int\n\nGet the number of simple internal spaces in a composite internal space.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LinearAlgebra.rank-Tuple{Coupling}","page":"Degrees of freedom","title":"LinearAlgebra.rank","text":"rank(coupling::Coupling) -> Int\nrank(::Type{M}) where {M<:Coupling} -> Int\n\nGet the rank of a coupling.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LinearAlgebra.rank-Tuple{InternalIndexProd}","page":"Degrees of freedom","title":"LinearAlgebra.rank","text":"rank(cii::InternalIndexProd) -> Int\nrank(::Type{<:InternalIndexProd{T}}) where {T<:Tuple{Vararg{SimpleInternalIndex}}} -> Int\n\nGet the number of simple internal indexes in a direct product.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LinearAlgebra.rank-Tuple{InternalPattern, Integer}","page":"Degrees of freedom","title":"LinearAlgebra.rank","text":"rank(pattern::InternalPattern, i::Integer) -> Int\nrank(::Type{P}, i::Integer) where {P<:InternalPattern} -> Int\n\nGet the rank of the direct product of the simple internal indexes that the ith constraint in an internal pattern can apply.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LinearAlgebra.rank-Tuple{InternalPattern}","page":"Degrees of freedom","title":"LinearAlgebra.rank","text":"rank(pattern::InternalPattern) -> Int\nrank(::Type{P}) where {P<:InternalPattern} -> Int\n\nGet the rank of the direct product of the simple internal indexes that an internal pattern can apply.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LinearAlgebra.rank-Tuple{Pattern}","page":"Degrees of freedom","title":"LinearAlgebra.rank","text":"rank(pattern::Pattern) -> Int\nrank(::Type{<:Pattern{<:InternalPattern, S}}) where {S<:Tuple{Vararg{Union{Ordinal, Colon}}}} -> Int\n\nGet the rank of a coupling pattern.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LinearAlgebra.rank-Tuple{Term}","page":"Degrees of freedom","title":"LinearAlgebra.rank","text":"rank(term::Term) -> Int\nrank(::Type{<:Term) -> Int\n\nGet the rank of a term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.:⊕-Tuple{Vararg{SimpleInternal}}","page":"Degrees of freedom","title":"QuantumLattices.:⊕","text":"⊕(is::SimpleInternal...) -> InternalSum\n⊕(i::SimpleInternal, ci::InternalSum) -> InternalSum\n⊕(ci::InternalSum, i::SimpleInternal) -> InternalSum\n⊕(ci₁::InternalSum, ci₂::InternalSum) -> InternalSum\n\nDirect sum between simple internal spaces and composite internal spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.:⊗-Tuple{Coupling, Coupling}","page":"Degrees of freedom","title":"QuantumLattices.:⊗","text":"*(cp₁::Coupling, cp₂::Coupling) -> Coupling\n⊗(cp₁::Coupling, cp₂::Coupling) -> Coupling\n\nGet the multiplication between two coupling.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.:⊗-Tuple{InternalPattern, InternalPattern}","page":"Degrees of freedom","title":"QuantumLattices.:⊗","text":"⊗(pattern₁::InternalPattern, pattern₂::InternalPattern) -> InternalPattern\n\nGet the combination of two internal patterns.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.:⊗-Tuple{Pattern, Pattern}","page":"Degrees of freedom","title":"QuantumLattices.:⊗","text":"⊗(pattern₁::Pattern, pattern₂::Pattern) -> Pattern\n\nGet the combination of two coupling patterns.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.:⊗-Tuple{Vararg{SimpleInternalIndex}}","page":"Degrees of freedom","title":"QuantumLattices.:⊗","text":"⊗(iis::SimpleInternalIndex...) -> InternalIndexProd\n⊗(ii::SimpleInternalIndex, cii::InternalIndexProd) -> InternalIndexProd\n⊗(cii::InternalIndexProd, ii::SimpleInternalIndex) -> InternalIndexProd\n⊗(cii₁::InternalIndexProd, cii₂::InternalIndexProd) -> InternalIndexProd\n\nDirect product between internal indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.:⊗-Tuple{Vararg{SimpleInternal}}","page":"Degrees of freedom","title":"QuantumLattices.:⊗","text":"⊗(is::SimpleInternal...) -> InternalProd\n⊗(i::SimpleInternal, ci::InternalProd) -> InternalProd\n⊗(ci::InternalProd, i::SimpleInternal) -> InternalProd\n⊗(ci₁::InternalProd, ci₂::InternalProd) -> InternalProd\n\nDirect product between simple internal spaces and composite internal spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.allequalfields-Union{Tuple{Type{I}}, Tuple{I}} where I<:SimpleInternalIndex","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.allequalfields","text":"allequalfields(::Type{I}) where {I<:SimpleInternalIndex} -> Tuple{Vararg{Symbol}}\n\nGet the field names that can be subject to all-equal constraint based on the type of a simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.coordinatedindextype-Tuple{Type{<:SimpleInternal}, Type{<:Point}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.coordinatedindextype","text":"coordinatedindextype(I::Type{<:SimpleInternal}, P::Type{<:Point})\n\nGet the compatible type of the coordinated index based on the type of an internal space and the type of a point.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.indextype-Tuple{CompositeIndex}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.indextype","text":"indextype(::CompositeIndex)\nindextype(::Type{<:CompositeIndex})\n\nGet the index type of a composite index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.indextype-Tuple{Type{<:SimpleInternal}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.indextype","text":"indextype(I::Type{<:SimpleInternal})\n\nGet the compatible type of the index based on the type of an internal space.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.internalindextype-Tuple{Index}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.internalindextype","text":"internalindextype(index::Index)\ninternalindextype(::Type{I}) where {I<:Index}\n\nGet the type of the internal part of an index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.isdefinite-Tuple{Index}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.isdefinite","text":"isdefinite(index::Index) -> Bool\nisdefinite(::Type{<:Index{I}}) where {I<:SimpleInternalIndex} -> Bool\n\nDetermine whether an index denotes a definite degree of freedom.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.isdefinite-Tuple{InternalIndex}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.isdefinite","text":"isdefinite(ii::InternalIndex) -> Bool\nisdefinite(::Type{<:InternalIndex}) -> Bool\n\nJudge whether an internal index denotes a definite internal degree of freedom.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.isdefinite-Tuple{Tuple{Vararg{Index}}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.isdefinite","text":"isdefinite(indexes::Tuple{Vararg{Index}}) -> Bool\nisdefinite(::Type{T}) where {T<:Tuple{Vararg{Index}}} -> Bool\n\nDetermine whether a tuple of indexes denotes a definite degree of freedom.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.partition-Tuple{InternalPattern}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.partition","text":"partition(pattern::InternalPattern) -> Tuple{Vararg{Int}}\npartition(::Type{<:InternalPattern{I, P} where I}) where P -> P\n\nGet the partition of the direct product of a set of simple internal indexes on which the extra constraints operate independently.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.patternrule","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.patternrule","text":"patternrule(value, ::Val{Name}, args...; kwargs...) where Name\n\nBy overriding this function, a named rule for the value of some attributes in a pattern can be defined so that the value can be transformed into the desired one.\n\nIn most cases, such overridden functions define the default rules for the attributes in a pattern when they take on the default value :. \n\n\n\n\n\n","category":"function"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.patternrule-Tuple{Any, Val, Vararg{Any}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.patternrule","text":"patternrule(value, ::Val, args...; kwargs...)-> typeof(value)\n\nDefault pattern rule unless otherwise specified.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.patternrule-Union{Tuple{Name}, Tuple{T}, Tuple{N}, Tuple{InternalIndexProd{T}, Val{Name}}} where {N, T<:NTuple{N, SimpleInternalIndex}, Name}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.patternrule","text":"patternrule(index::InternalIndexProd{T}, ::Val{Name}) where {N, T<:NTuple{N, SimpleInternalIndex}, Name} -> InternalIndexProd\n\nDefine the default rule for the internal index in an internal pattern.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.patternrule-Union{Tuple{N}, Tuple{NTuple{N, Colon}, Val, Integer}} where N","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.patternrule","text":"patternrule(sites::NTuple{N, Colon}, ::Val, bondlength::Integer) where N -> NTuple{N, Ordinal}\n\nDefine the default rule for the sites of a set of indexes in a coupling pattern.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.plain","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.plain","text":"plain\n\nPlain boundary condition without any twist.\n\n\n\n\n\n","category":"function"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.statistics-Tuple{CompositeIndex}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.statistics","text":"statistics(index::CompositeIndex) -> Symbol\nstatistics(::Type{I}) where {I<:CompositeIndex} -> Symbol\n\nGet the statistics of a composite index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.statistics-Tuple{Index}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.statistics","text":"statistics(index::Index) -> Symbol\nstatistics(::Type{I}) where {I<:Index} -> Symbol\n\nGet the statistics of an index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.statistics-Tuple{SimpleInternalIndex}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.statistics","text":"statistics(ii::SimpleInternalIndex) -> Symbol\n\nGet the statistics of a simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.statistics-Tuple{SimpleInternal}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.statistics","text":"statistics(i::SimpleInternal) -> Symbol\nstatistics(::Type{<:SimpleInternal{I}}) where {I<:SimpleInternalIndex} -> Symbol\n\nGet the statistics of a simple internal space.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.QuantumOperators.operatortype-Union{Tuple{T}, Tuple{H}, Tuple{B}, Tuple{Type{B}, Type{H}, Type{T}}} where {B<:Bond, H<:Hilbert, T<:Term}","page":"Degrees of freedom","title":"QuantumLattices.QuantumOperators.operatortype","text":"operatortype(::Type{B}, ::Type{H}, ::Type{T}) where {B<:Bond, H<:Hilbert, T<:Term}\n\nGet the compatible Operator type from the type of a term, a Hilbert space and a bond.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.QuantumOperators.script-Tuple{CoordinatedIndex, Val{:integercoordinate}}","page":"Degrees of freedom","title":"QuantumLattices.QuantumOperators.script","text":"script(index::CoordinatedIndex, ::Val{:integercoordinate}; vectors, kwargs...)\n\nGet the integer coordinate script of a coordinated index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.QuantumOperators.script-Tuple{CoordinatedIndex, Val{:rcoordinate}}","page":"Degrees of freedom","title":"QuantumLattices.QuantumOperators.script","text":"script(index::CoordinatedIndex, ::Val{:rcoordinate}; kwargs...) -> String\nscript(index::CoordinatedIndex, ::Val{:icoordinate}; kwargs...) -> String\n\nGet the rcoordinate/icoordinate script of a coordinated index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.QuantumOperators.script-Tuple{Index, Val{:site}}","page":"Degrees of freedom","title":"QuantumLattices.QuantumOperators.script","text":"script(index::Index, ::Val{:site}; kwargs...) -> String\nscript(index::Index, attr::Val; kwargs...) -> String\n\nGet the required script of an index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.QuantumOperators.script-Union{Tuple{attr}, Tuple{CompositeIndex, Val{attr}}} where attr","page":"Degrees of freedom","title":"QuantumLattices.QuantumOperators.script","text":"script(index::CompositeIndex, ::Val{attr}; kwargs...) where attr\n\nGet the attr script of a composite index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.Spatials.icoordinate-Tuple{Operator{<:Number, <:NTuple{N, CoordinatedIndex} where N}}","page":"Degrees of freedom","title":"QuantumLattices.Spatials.icoordinate","text":"icoordinate(opt::Operator{<:Number, <:ID{CoordinatedIndex}}) -> SVector\n\nGet the whole icoordinate of an operator.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.Spatials.nneighbor-Tuple{Term}","page":"Degrees of freedom","title":"QuantumLattices.Spatials.nneighbor","text":"nneighbor(term::Term) -> Int\nnneighbor(terms::Tuple{Term, Vararg{Term}}) -> Int\n\nGet the\n\norder of neighbor in a single term;\nhighest order of neighbors in a set of terms.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.Spatials.rcoordinate-Tuple{Operator{<:Number, <:NTuple{N, CoordinatedIndex} where N}}","page":"Degrees of freedom","title":"QuantumLattices.Spatials.rcoordinate","text":"rcoordinate(opt::Operator{<:Number, <:ID{CoordinatedIndex}}) -> SVector\n\nGet the whole rcoordinate of an operator.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.Toolkit.shape-Tuple{SimpleInternal, SimpleInternalIndex}","page":"Degrees of freedom","title":"QuantumLattices.Toolkit.shape","text":"shape(internal::SimpleInternal, index::SimpleInternalIndex) -> OrdinalRange{Int, Int}\n\nGet the shape of a simple internal space when a labeled simple internal index are considered.\n\nA constrained internal space need this function to generate all the internal indexes that match the internal pattern, which gets a default implementation, i.e.,\n\nshape(internal::SimpleInternal, index::SimpleInternalIndex) = shape(internal)\n\nIt can be overloaded to restrict the shape of a simple internal space based on the input simple internal index to significantly improve efficiency, but this is not necessary.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.expand!-Tuple{Operators, Term, Bond, Hilbert}","page":"Degrees of freedom","title":"QuantumLattices.expand!","text":"expand!(operators::Operators, term::Term, bond::Bond, hilbert::Hilbert; half::Bool=false) -> Operators\nexpand!(operators::Operators, term::Term, bonds, hilbert::Hilbert; half::Bool=false) -> Operators\n\nExpand the operators of a term on a bond/set-of-bonds with a given Hilbert space.\n\nThe half parameter determines the behavior of generating operators, which falls into the following two categories\n\ntrue: \"Hermitian half\" of the generated operators\nfalse: \"Hermitian whole\" of the generated operators\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.expand-Tuple{Term, Bond, Hilbert}","page":"Degrees of freedom","title":"QuantumLattices.expand","text":"expand(term::Term, bond::Bond, hilbert::Hilbert; half::Bool=false) -> Operators\nexpand(term::Term, bonds, hilbert::Hilbert; half::Bool=false) -> Operators\n\nExpand the operators of a term on a bond/set-of-bonds with a given Hilbert space.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.expand-Union{Tuple{Rule}, Tuple{Coupling, Val{Rule}, Bond, Hilbert}} where Rule","page":"Degrees of freedom","title":"QuantumLattices.expand","text":"expand(coupling::Coupling, ::Val{Rule}, bond::Bond, hilbert::Hilbert) where Rule\n\nExpand a coupling with the given bond and Hilbert space under a given named pattern rule.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.id-Tuple{Term}","page":"Degrees of freedom","title":"QuantumLattices.id","text":"id(term::Term) -> Symbol\nid(::Type{<:Term) -> Symbol\n\nGet the id of a term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.kind-Tuple{Term}","page":"Degrees of freedom","title":"QuantumLattices.kind","text":"kind(term::Term) -> Symbol\nkind(::Type{<:Term) -> Symbol\n\nGet the kind of a term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.permute-Tuple{CoordinatedIndex, CoordinatedIndex}","page":"Degrees of freedom","title":"QuantumLattices.permute","text":"permute(index₁::CoordinatedIndex, index₂::CoordinatedIndex) -> Tuple{Vararg{Operator}}\n\nGet the permutation of two coordinated indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.permute-Tuple{Index, Index}","page":"Degrees of freedom","title":"QuantumLattices.permute","text":"permute(index₁::Index, index₂::Index) -> Tuple{Vararg{Operator}}\n\nGet the permutation of two indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.reset!-Tuple{Table, AbstractVector{<:OperatorIndex}}","page":"Degrees of freedom","title":"QuantumLattices.reset!","text":"reset!(table::Table, indexes::AbstractVector{<:OperatorIndex}) -> Table\n\nReset a table by a new set of indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.reset!-Tuple{Table, Hilbert}","page":"Degrees of freedom","title":"QuantumLattices.reset!","text":"reset!(table::Table, hilbert::Hilbert) -> Table\n\nReset a table by a Hilbert space.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.update!-Tuple{Boundary}","page":"Degrees of freedom","title":"QuantumLattices.update!","text":"update!(bound::Boundary; parameters...) -> Boundary\n\nUpdate the values of the boundary twisted phase.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.update!-Tuple{Term, Vararg{Any}}","page":"Degrees of freedom","title":"QuantumLattices.update!","text":"update!(term::Term, args...; kwargs...) -> Term\n\nUpdate the value of a term if it is ismodulatable.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.value-Tuple{Term}","page":"Degrees of freedom","title":"QuantumLattices.value","text":"value(term::Term) -> valtype(term)\n\nGet the value of a term.\n\n\n\n\n\n","category":"method"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"CurrentModule = QuantumLattices","category":"page"},{"location":"unitcell description framework/Introduction/#UnitcellDescriptionIntroduction","page":"Introduction","title":"Introduction","text":"","category":"section"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"A quantum lattice system can be completely described based on its unitcell. Basically, this description should contain three types of information:","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"the spatial information, such as the coordinates of the points contained in the unitcell;\nthe internal degrees of freedom, such as the local algebra acting on the local Hilbert space at each point;\nthe couplings among different degrees of freedom, such as the terms present in the Hamiltonian.","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"In theory, as long as the above information is told, one could easily write down the operator representation of the Hamiltonian of the system. For example, in the phrase \"the single orbital electronic Hubbard model with only nearest neighbor hopping on a one dimensional lattice with only two sites\", \"one dimensional lattice with only two sites\" is the spatial information, \"single orbital electronic\" defines the local Hilbert space and thus the local algebra, and \"Hubbard model with only nearest neighbor hopping\" describes the terms present in the Hamiltonian. From this phrase, we also know that the Hamiltonian of the system is","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"H=tc^_1c_2+tc^_2c_1+tc^_1c_2+tc^_2c_1+Uc^_1c_1c^_1c_1+Uc^_2c_2c^_2c_2","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"where t is the hopping amplitude, U is the Hubbard interaction strength and the electronic creation/annihilation operator c^dagger_isigmac_isigma carries a site index i (i=1 2) and a spin index sigma (sigma=uparrow downarrow). Actually, the unitcell description framework follows exactly after the above train of thought. For example, the aforementioned system can be constructed by the following codes:","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"using QuantumLattices\nusing SymPy: Sym, symbols\n\n# define the unitcell\nlattice = Lattice([zero(Sym)], [one(Sym)])\n\n# define the internal degrees of freedom, i.e., the single-orbital spin-1/2 fermionic algebra\nhilbert = Hilbert(site=>Fock{:f}(1, 2) for site=1:length(lattice))\n\n# define the terms\nt = Hopping(:t, symbols(\"t\", real=true), 1)\nU = Hubbard(:U, symbols(\"U\", real=true))\n\n# get the Hamiltonian\noperators = expand(OperatorGenerator(bonds(lattice, 1), hilbert, (t, U)))","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"The last line displays all the generated operators in the Hamiltonian in the LaTeX format. Here, in the subscript of the electronic annihilation/creation operator, an extra orbital index is also displayed.","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"In the following pages listed below, we will explain in detail how these codes work. Firstly, in the page of Spatial information of a unitcell, we will introduce the construction of the unitcell as well as the ways to obtain the bonds at different orders of nearest neighbors. Secondly, in the page of Internal degrees of freedom, we will explain the hierarchy of the internal degrees of freedom and discuss how they are organized for different categories of quantum systems. Thirdly, in the page of Couplings among different degrees of freedom, we will discuss the ways to specify the terms present in the Hamiltonian. Finally, in the page of Generator of operators, we will show how to combine all to get the operator representation of the Hamiltonian of a quantum lattice system. For more sophisticated information, the manual of this package can also be referred.","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"Pages = [\n \"SpatialInfoOfAUnitcell.md\",\n \"InternalDegreesOfFreedom.md\",\n \"CouplingsAmongDifferentDegreesOfFreedom.md\",\n \"GeneratorOfOperators.md\",\n ]\nDepth = 2","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"CurrentModule = QuantumLattices\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/#Spatial-information-of-a-unitcell","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"","category":"section"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"The first step toward the complete description of a quantum lattice system is the understanding of the spatial information of a unitcell.","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/#Construction-of-a-lattice","page":"Spatial information of a unitcell","title":"Construction of a lattice","text":"","category":"section"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"In general, a lattice has translation symmetry. This symmetry introduces an equivalence relation for the points in a lattice when they can be translated into each other by multiple times of the translation vectors. This observation sets the mathematical foundation of the unitcell construction. As a result, it is enough for a lattice to restrict all points within the origin unitcell together with the translation vectors.","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"Lattice is the simplest structure to encode all the spatial information within the origin unitcell. Apparently, it must contain all the coordinates of the points in the origin unitcell and the translation vectors of the lattice. It also appears to be useful to associate a lattice with a name. Therefore, in this package, Lattice has three attributes:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"name::Symbol: the name of the lattice\ncoordinates::Matrix{<:Number}: the coordinates of the points within the origin unitcell\nvectors::Vector{<:StaticArraysCore.SVector}: the translation vectors of the lattice","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"Lattice can be constructed by offering the coordinates, with optional keyword arguments to specify its name and translation vectors:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> Lattice([0.0])\nLattice(lattice)\n with 1 point:\n [0.0]\n\njulia> Lattice((0.0, 0.0), (0.5, 0.5); vectors=[[1.0, 0.0], [0.0, 1.0]], name=:Square)\nLattice(Square)\n with 2 points:\n [0.0, 0.0]\n [0.5, 0.5]\n with 2 translation vectors:\n [1.0, 0.0]\n [0.0, 1.0]\n\njulia> Lattice(\n (0.0, 0.0, 0.0);\n name=:Cube,\n vectors=[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]\n )\nLattice(Cube)\n with 1 point:\n [0.0, 0.0, 0.0]\n with 3 translation vectors:\n [1.0, 0.0, 0.0]\n [0.0, 1.0, 0.0]\n [0.0, 0.0, 1.0]","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"The coordinates could be specified by vectors or tuples.","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"Iteration over a lattice will get the coordinates of the points in it:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> lattice = Lattice((0.0, 0.0), (0.5, 0.5); vectors=[[1.0, 0.0], [0.0, 1.0]]);\n\njulia> length(lattice)\n2\n\njulia> [lattice[1], lattice[2]]\n2-element Vector{StaticArraysCore.SVector{2, Float64}}:\n [0.0, 0.0]\n [0.5, 0.5]\n\njulia> collect(lattice)\n2-element Vector{StaticArraysCore.SVector{2, Float64}}:\n [0.0, 0.0]\n [0.5, 0.5]","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"The reciprocal translation vectors of the dual lattice can be obtained by reciprocals:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> lattice = Lattice((0.0, 0.0); vectors=[[1.0, 0.0], [0.0, 1.0]]);\n\njulia> reciprocals(lattice)\n2-element StaticArraysCore.SVector{2, StaticArraysCore.SVector{2, Float64}} with indices SOneTo(2):\n [6.283185307179586, -0.0]\n [-0.0, 6.283185307179586]","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/#Request-for-the-bonds-of-a-lattice","page":"Spatial information of a unitcell","title":"Request for the bonds of a lattice","text":"","category":"section"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"Before the introduction of how to obtain the bonds of a lattice, let's discuss more about the unitcell construction to clarify the logic behind the definitions of the Point type and the Bond type in this package.","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/#Point","page":"Spatial information of a unitcell","title":"Point","text":"","category":"section"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"With the translation symmetry, all points of a lattice are equivalent to those within the origin unitcell. However, it becomes complicated when the bonds are requested. The bonds inter different unitcells cannot be compressed into a single unitcell. Therefore, even in the unitcell construction framework, it turns out to be unavoidable to specify a point outside the origin unitcell, which requires extra information beyond a single coordinate if we want to remember which point it is equivalent to within the origin unitcell at the same time. In fact, it is customary in literature to express the coordinate mathbfR of a point in a lattice as mathbfR=mathbfR_i+mathbfr, where mathbfR_i is the integral coordinate of the unitcell the point belongs to and mathbfr is the relative displacement of the point in the unitcell. Apparently, any two of these three coordinates are complete to get the full information. In this package, we choose mathbfR and mathbfR_i as the complete set for a individual lattice point. Besides, we also associate a site index with a point for the fast lookup for its equivalence within the origin unitcell although it is redundant in theory. Thus, the Point defined in this package has three attributes as follows:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"site::Int: the site index of a point that specifies the equivalent point within the origin unitcell\nrcoordinate::StaticArraysCore.SVector: the real coordinate of the point (mathbfR)\nicoordinate::StaticArraysCore.SVector: the integral coordinate of the unitcell the point belongs to (mathbfR_i)","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"At the construction of a Point, rcoordinate and icoordinate can accept tuples or usual vectors as inputs, such as","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> Point(1, [0.0], [0.0])\nPoint(1, [0.0], [0.0])\n\njulia> Point(1, (1.5, 0.0), (1.0, 0.0))\nPoint(1, [1.5, 0.0], [1.0, 0.0])","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"icoordinate can be omitted, then it will be initialized by a zero StaticArraysCore.SVector:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> Point(1, [0.0, 0.5])\nPoint(1, [0.0, 0.5], [0.0, 0.0])","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/#Bond","page":"Spatial information of a unitcell","title":"Bond","text":"","category":"section"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"A bond in the narrow sense consist of two points. However, in quantum lattice systems, it is common to refer to generic bonds with only one or more than two points. In addition, it is also convenient to associate a bond with a kind information, such as the order of the nearest neighbors of the bond. Thus, the Bond is defined as follows:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"kind: the kind information of a generic bond\npoints::Vector{<:Point}: the points a generic bond contains","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> Bond(Point(1, [0.0, 0.0], [0.0, 0.0])) # 1-point bond\nBond(0, Point(1, [0.0, 0.0], [0.0, 0.0]))\n\njulia> Bond(2, Point(1, [0.0, 0.0], [0.0, 0.0]), Point(1, [1.0, 1.0], [1.0, 1.0])) # 2-point bond\nBond(2, Point(1, [0.0, 0.0], [0.0, 0.0]), Point(1, [1.0, 1.0], [1.0, 1.0]))\n\njulia> Bond(:plaquette, Point(1, [0.0, 0.0]), Point(2, [1.0, 0.0]), Point(3, [1.0, 1.0]), Point(4, [0.0, 1.0])) # generic bond with 4 points\nBond(:plaquette, Point(1, [0.0, 0.0], [0.0, 0.0]), Point(2, [1.0, 0.0], [0.0, 0.0]), Point(3, [1.0, 1.0], [0.0, 0.0]), Point(4, [0.0, 1.0], [0.0, 0.0]))","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"It is noted that the kind attribute of a bond with only one point is set to be 0.","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"Iteration over a bond will get the points it contains:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> bond = Bond(2, Point(1, [0.0, 0.0], [0.0, 0.0]), Point(2, [1.0, 0.0], [0.0, 0.0]));\n\njulia> length(bond)\n2\n\njulia> [bond[1], bond[2]]\n2-element Vector{Point{2, Float64}}:\n Point(1, [0.0, 0.0], [0.0, 0.0])\n Point(2, [1.0, 0.0], [0.0, 0.0])\n\njulia> collect(bond)\n2-element Vector{Point{2, Float64}}:\n Point(1, [0.0, 0.0], [0.0, 0.0])\n Point(2, [1.0, 0.0], [0.0, 0.0])","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"The coordinate of a bond as a whole is also defined for those that only contain one or two points. The coordinate of a 1-point bond is defined to be the corresponding coordinate of this point, and the coordinate of a 2-point bond is defined to be the corresponding coordinate of the second point minus that of the first:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> bond1p = Bond(Point(1, [2.0], [1.0]));\n\njulia> rcoordinate(bond1p)\n1-element StaticArraysCore.SVector{1, Float64} with indices SOneTo(1):\n 2.0\n\njulia> icoordinate(bond1p)\n1-element StaticArraysCore.SVector{1, Float64} with indices SOneTo(1):\n 1.0\n\njulia> bond2p = Bond(1, Point(1, [1.0, 1.0], [1.0, 1.0]), Point(2, [0.5, 0.5], [0.0, 0.0]));\n\njulia> rcoordinate(bond2p)\n2-element StaticArraysCore.SVector{2, Float64} with indices SOneTo(2):\n -0.5\n -0.5\n\njulia> icoordinate(bond2p)\n2-element StaticArraysCore.SVector{2, Float64} with indices SOneTo(2):\n -1.0\n -1.0","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/#Generation-of-1-point-and-2-point-bonds-of-a-lattice","page":"Spatial information of a unitcell","title":"Generation of 1-point and 2-point bonds of a lattice","text":"","category":"section"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"In this package, we provide the function bonds to get the 1-point and 2-point bonds of a lattice:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"bonds(lattice::Lattice, nneighbor::Int) -> Vector{<:Bond}\nbonds(lattice::Lattice, neighbors::Neighbors) -> Vector{<:Bond}","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"which is based on the KDTree type provided by the NearestNeighbors.jl package. In the first method, all the bonds up to the nneighborth nearest neighbors are returned, including the 1-point bonds:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> lattice = Lattice([0.0, 0.0]; vectors=[[1.0, 0.0], [0.0, 1.0]]);\n\njulia> bonds(lattice, 2)\n5-element Vector{Bond{Int64, Point{2, Float64}}}:\n Bond(0, Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(2, Point(1, [-1.0, -1.0], [-1.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(1, Point(1, [0.0, -1.0], [0.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(2, Point(1, [1.0, -1.0], [1.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(1, Point(1, [-1.0, 0.0], [-1.0, 0.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"However, this method is not so efficient, as KDTree only searches the bonds with the lengths less than a value, and it does not know the bond lengths for each order of nearest neighbors. Such information must be computed as first. Therefore, in the second method, bonds can accept a new type, the Neighbors, as its second positional parameter to improve the efficiency, which could tell the program the information of the bond lengths in priori:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> lattice = Lattice([0.0, 0.0]; vectors=[[1.0, 0.0], [0.0, 1.0]]);\n\njulia> bonds(lattice, Neighbors(0=>0.0, 1=>1.0, 2=>√2))\n5-element Vector{Bond{Int64, Point{2, Float64}}}:\n Bond(0, Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(2, Point(1, [-1.0, -1.0], [-1.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(1, Point(1, [0.0, -1.0], [0.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(2, Point(1, [1.0, -1.0], [1.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(1, Point(1, [-1.0, 0.0], [-1.0, 0.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"Meanwhile, an instance of Neighbors could also serve as a filter of the generated bonds, which select those bonds with the given bond lengths:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> lattice = Lattice([0.0, 0.0]; vectors=[[1.0, 0.0], [0.0, 1.0]]);\n\njulia> bonds(lattice, Neighbors(2=>√2))\n2-element Vector{Bond{Int64, Point{2, Float64}}}:\n Bond(2, Point(1, [-1.0, -1.0], [-1.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(2, Point(1, [1.0, -1.0], [1.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"To obtain generic bonds containing more points, user are encouraged to implement their own bonds methods. Pull requests are welcomed.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Internal-degrees-of-freedom","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Now let's move to the second step, the internal degrees of freedom.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Hierarchy-of-the-internal-degrees-of-freedom","page":"Internal degrees of freedom","title":"Hierarchy of the internal degrees of freedom","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"In general, a lattice Hamiltonian can be expressed by the generators of the algebra that acts on the Hilbert space of the system. For example for the complex fermionic (bosonic) system, the Hilbert space is the Fock space, and the lattice Hamiltonian can be expressed by the generators of the fermionic (bosonic) algebra, i.e., the the creation and annihilation operators c^dagger_alpha c_alpha left(b^dagger_alpha b_alpharight). For another example for the local spin-1/2 system, the Hilbert space is the otimes_alphalvertuparrowrangle lvertdownarrowrangle_alpha space, and the lattice Hamiltonian can be expressed by the generators of the SU(2) spin algebra, i.e., the spin operators S^x_alpha S^y_alpha S^z_alpha or S^+_alpha S^-_alpha S^z_alpha. In both examples, the subscript alpha denotes a complete set of indexes of the internal degrees of freedom of the quantum system. Therefore, the determination of the algebra acting on the system's Hilbert space and its corresponding generators lies at the center of the constructions of the operator representations of lattice Hamiltonians.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The global Hilbert space of a lattice system can be decomposed into the direct product of the local internal spaces \"living\" on individual points, leading to a similar decomposition of the global algebra into local ones. To incorporate with the unitcell construction of the lattice, an extra intermediate representation of the translation-equivalent internal degrees of freedom within the origin unitcell is also needed. Thus, from the microscopic to the macroscopic, we arrive at a three level hierarchy, namely the local-unitcell-global hierarchy, of the internal degrees of freedom.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"At the local or the individual-point level, the local algebra is represented by the type Internal, and a local generator of the local algebra is represented by the type InternalIndex. Both types are abstract types with their concrete subtypes to represent concrete local algebras and concrete local generators of different quantum lattice systems with different internal structures, respectively.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"At the unitcell level, the algebra of the system is represented by the type Hilbert, which defines the concrete local algebras point by point within the origin unitcell. Accordingly, the type Index, which combines a site index and an instance of InternalIndex, could specify a translation-equivalent generator within the origin unitcell.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"At the global or the whole-lattice level, we do not actually need a representation of the algebra of the system, but really do for the generators because we have to specify them outside the origin unitcell when the bond goes across the unitcell boundaries. The type CoordinatedIndex, which combines an instance of Index and the coordinates mathbfR and mathbfR_i of the underlying point, represents a generator at such a level.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The above discussions can be summarized by the following table, which also displays how the spatial part of a quantum lattice system is represented:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":" local (individual-point) level unitcell level global (whole-lattice) level\nspatial Point Lattice \nalgebra Internal and its concrete subtypes Hilbert \ngenerator InternalIndex and its concrete subtypes Index CoordinatedIndex","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Quantum-lattice-systems-with-different-internal-structures","page":"Internal degrees of freedom","title":"Quantum lattice systems with different internal structures","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"In this section, we will explain in detail for the common categories of quantum lattice systems implemented in this package about how their algebras and generators are organized according to the above three level hierarchy.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Canonical-complex-fermionic,-canonical-complex-bosonic-and-hard-core-bosonic-systems","page":"Internal degrees of freedom","title":"Canonical complex fermionic, canonical complex bosonic and hard-core bosonic systems","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Local-level:-Fock-and-FockIndex","page":"Internal degrees of freedom","title":"Local level: Fock and FockIndex","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Roughly speaking, these systems share similar internal structures of local Hilbert spaces termed as the Fock space where the generators of local algebras are the annihilation and creation operators. Besides the nambu index to distinguish whether it is an annihilation one or a creation one, such a generator usually adopts an orbital index and a spin index. Thus, the type FockIndex<:InternalIndex, which specifies a certain local generator of a local Fock algebra, has the following attributes:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"orbital::Int: the orbital index\nspin::Rational{Int}: the spin index, which must be a half integer\nnambu::Int: the nambu index, which must be 1(annihilation) or 2(creation).","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Correspondingly, the type Fock<:Internal, which specifies the local algebra acting on the local Fock space, has the following attributes:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"norbital::Int: the number of allowed orbital indices\nnspin::Int: the number of allowed spin indices","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"To distinguish whether the system is a fermionic one or a bosonic one, FockIndex and Fock take a symbol :f(for fermionic) or :b(for bosonic) to be their first type parameters.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Now let's see some examples.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"An FockIndex instance can be initialized by giving all its three attributes:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> FockIndex{:f}(2, 1//2, 1)\n𝕗(2, 1//2, 1)\n\njulia> FockIndex{:b}(2, 0, 1)\n𝕓(2, 0, 1)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Here, 𝕗 (\\bbf) and 𝕓 (\\bbb) are two functions that are convenient to construct and display instances of FockIndex{:f} and FockIndex{:b}, respectively.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕗(2, 1//2, 1) isa FockIndex{:f}\ntrue\n\njulia> 𝕓(2, 0, 1) isa FockIndex{:b}\ntrue","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The adjoint of an FockIndex instance is also defined:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕗(3, 3//2, 1)'\n𝕗(3, 3//2, 2)\n\njulia> 𝕓(3, 3//2, 2)'\n𝕓(3, 3//2, 1)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Apparently, this operation is nothing but the \"Hermitian conjugate\".","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"A Fock instance can be initialized by giving all its attributes:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Fock{:f}(1, 2)\n4-element Fock{:f}:\n 𝕗(1, -1//2, 1)\n 𝕗(1, 1//2, 1)\n 𝕗(1, -1//2, 2)\n 𝕗(1, 1//2, 2)\n\njulia> Fock{:b}(1, 1)\n2-element Fock{:b}:\n 𝕓(1, 0, 1)\n 𝕓(1, 0, 2)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"As can be seen, a Fock instance behaves like a vector (because the parent type Internal is a subtype of AbstractVector), and its iteration just generates all the allowed FockIndex instances on its associated spatial point:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> fck = Fock{:f}(2, 1);\n\njulia> fck |> typeof |> eltype\nFockIndex{:f, Int64, Rational{Int64}, Int64}\n\njulia> fck |> length\n4\n\njulia> [fck[1], fck[2], fck[3], fck[4]]\n4-element Vector{FockIndex{:f, Int64, Rational{Int64}, Int64}}:\n 𝕗(1, 0, 1)\n 𝕗(2, 0, 1)\n 𝕗(1, 0, 2)\n 𝕗(2, 0, 2)\n\njulia> fck |> collect\n4-element Vector{FockIndex{:f, Int64, Rational{Int64}, Int64}}:\n 𝕗(1, 0, 1)\n 𝕗(2, 0, 1)\n 𝕗(1, 0, 2)\n 𝕗(2, 0, 2)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"This is isomorphic to the mathematical fact that a local algebra is a vector space of the local generators.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Unitcell-level:-Hilbert-and-Index","page":"Internal degrees of freedom","title":"Unitcell level: Hilbert and Index","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"To specify the Fock algebra at the unitcell level, Hilbert associate each point within the origin unitcell with an instance of Fock:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Hilbert(1=>Fock{:f}(1, 2), 2=>Fock{:f}(1, 2))\nHilbert{Fock{:f}} with 2 entries:\n 1 => Fock{:f}(norbital=1, nspin=2)\n 2 => Fock{:f}(norbital=1, nspin=2)\n\njulia> Hilbert(site=>Fock{:f}(2, 2) for site=1:2)\nHilbert{Fock{:f}} with 2 entries:\n 1 => Fock{:f}(norbital=2, nspin=2)\n 2 => Fock{:f}(norbital=2, nspin=2)\n\njulia> Hilbert(Fock{:f}(2, 2), 2)\nHilbert{Fock{:f}} with 2 entries:\n 1 => Fock{:f}(norbital=2, nspin=2)\n 2 => Fock{:f}(norbital=2, nspin=2)\n\njulia> Hilbert([Fock{:f}(2, 2), Fock{:f}(2, 2)])\nHilbert{Fock{:f}} with 2 entries:\n 1 => Fock{:f}(norbital=2, nspin=2)\n 2 => Fock{:f}(norbital=2, nspin=2)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"In general, at different sites, the local Fock algebra could be different:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Hilbert(site=>Fock{:f}(iseven(site) ? 2 : 1, 1) for site=1:2)\nHilbert{Fock{:f}} with 2 entries:\n 1 => Fock{:f}(norbital=1, nspin=1)\n 2 => Fock{:f}(norbital=2, nspin=1)\n\njulia> Hilbert(1=>Fock{:f}(1, 2), 2=>Fock{:b}(1, 2))\nHilbert{Fock} with 2 entries:\n 1 => Fock{:f}(norbital=1, nspin=2)\n 2 => Fock{:b}(norbital=1, nspin=2)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Hilbert itself is a subtype of AbstractDict, the iteration over the keys gives the sites, and the iteration over the values gives the local algebras:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> hilbert = Hilbert(site=>Fock{:f}(iseven(site) ? 2 : 1, 1) for site=1:2);\n\njulia> collect(keys(hilbert))\n2-element Vector{Int64}:\n 1\n 2\n\njulia> collect(values(hilbert))\n2-element Vector{Fock{:f}}:\n Fock{:f}(norbital=1, nspin=1)\n Fock{:f}(norbital=2, nspin=1)\n\njulia> collect(hilbert)\n2-element Vector{Pair{Int64, Fock{:f}}}:\n 1 => Fock{:f}(norbital=1, nspin=1)\n 2 => Fock{:f}(norbital=2, nspin=1)\n\njulia> [hilbert[1], hilbert[2]]\n2-element Vector{Fock{:f}}:\n Fock{:f}(norbital=1, nspin=1)\n Fock{:f}(norbital=2, nspin=1)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"To specify a translation-equivalent generator of the Fock algebra within the unitcell, Index just combines a site::Int attribute and an internal::FockIndex attribute:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> index = Index(1, FockIndex{:f}(1, -1//2, 2))\n𝕗(1, 1, -1//2, 2)\n\njulia> index.site\n1\n\njulia> index.internal\n𝕗(1, -1//2, 2)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Here, the functions 𝕗 and 𝕓 can also construct and display instances of Index{<:FockIndex{:f}} and Index{<:FockIndex{:b}}, respectively.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕗(1, 1, -1//2, 2) isa Index{<:FockIndex{:f}}\ntrue\n\njulia> 𝕓(1, 1, -1//2, 2) isa Index{<:FockIndex{:b}}\ntrue","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The Hermitian conjugate of an Index is also defined:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕗(1, 1, -1//2, 2)'\n𝕗(1, 1, -1//2, 1)\n\njulia> 𝕓(1, 1, -1//2, 1)'\n𝕓(1, 1, -1//2, 2)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Global-level:-CoordinatedIndex","page":"Internal degrees of freedom","title":"Global level: CoordinatedIndex","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Since the local algebra of a quantum lattice system can be defined point by point, the global algebra can be completely compressed into the origin unitcell. However, the generator outside the origin unitcell cannot be avoided because we have to use them to compose the Hamiltonian on the bonds that goes across the unitcell boundaries. This situation is similar to the case of Lattice and Point. Therefore, we take a similar solution for the generators to that is adopted for the Point, i.e., we include the mathbfR coordinate (by the rcoordinate attribute) and the mathbfR_i coordinate (by the icoordinate attribute) of the underlying point together with the index::Index attribute in the CoordinatedIndex type to represent a generator that could be inside or outside the origin unitcell:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> index = CoordinatedIndex(Index(1, FockIndex{:f}(1, 0, 2)), [0.5, 0.0], [0.0, 0.0])\n𝕗(1, 1, 0, 2, [0.5, 0.0], [0.0, 0.0])\n\njulia> index.index\n𝕗(1, 1, 0, 2)\n\njulia> index.rcoordinate\n2-element StaticArraysCore.SVector{2, Float64} with indices SOneTo(2):\n 0.5\n 0.0\n\njulia> index.icoordinate\n2-element StaticArraysCore.SVector{2, Float64} with indices SOneTo(2):\n 0.0\n 0.0\n\njulia> index' # the Hermitian conjugate of a CoordinatedIndex is also defined\n𝕗(1, 1, 0, 1, [0.5, 0.0], [0.0, 0.0])","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Here, as can be expected, the functions 𝕗 and 𝕓 can construct and display instances of CoordinatedIndex{<:Index{<:FockIndex{:f}}} and CoordinatedIndex{<:Index{<:FockIndex{:b}}}, respectively, as well.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕗(1, 1, 0, 2, [0.5, 0.0], [0.0, 0.0]) isa CoordinatedIndex{<:Index{<:FockIndex{:f}}}\ntrue\n\njulia> 𝕓(1, 1, 0, 2, [0.5, 0.0], [0.0, 0.0]) isa CoordinatedIndex{<:Index{<:FockIndex{:b}}}\ntrue","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#SU(2)-spin-systems","page":"Internal degrees of freedom","title":"SU(2) spin systems","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Local-level:-Spin-and-SpinIndex","page":"Internal degrees of freedom","title":"Local level: Spin and SpinIndex","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Spin<:Internal and SpinIndex<:InternalIndex are designed to deal with SU(2) spin systems at the local level.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Although spin systems are essentially bosonic, the commonly-used local Hilbert space is distinct from that of an usual bosonic system: it is the space spanned by the eigenstates of a local S^z operator rather than a Fock space. At the same time, a spin Hamiltonian is usually expressed by local spin operators, such as S^x, S^y, S^z, S^+ and S^-, instead of creation and annihilation operators. Therefore, it is convenient to define another set of concrete subtypes for spin systems.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"To specify which one of the five S^x S^y S^z S^+ S^- a local spin operator is, the type SpinIndex has the following attribute:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"tag::Char: the tag, which must be 'x', 'y', 'z', '+' or '-'.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Correspondingly, the type Spin, which defines the local SU(2) spin algebra, does not need any attribute.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"For SpinIndex and Spin, it is also necessary to know what the total spin is, which is taken as their first type parameters and should be a half-integer or an integer.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Now let's see examples.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"An SpinIndex instance can be initialized as follows","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> SpinIndex{3//2}('x')\n𝕊{3//2}('x')\n\njulia> SpinIndex{1//2}('z')\n𝕊{1//2}('z')\n\njulia> SpinIndex{1}('+')\n𝕊{1}('+')","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Here, the type 𝕊 (\\bbS) plays a similar role in spin systems as 𝕗 and 𝕓 in Fock system.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕊{3//2}('x') isa SpinIndex{3//2}\ntrue","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The \"Hermitian conjugate\" of an SpinIndex instance can be obtained by the adjoint operation:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕊{3//2}('x')'\n𝕊{3//2}('x')\n\njulia> 𝕊{3//2}('y')'\n𝕊{3//2}('y')\n\njulia> 𝕊{3//2}('z')'\n𝕊{3//2}('z')\n\njulia> 𝕊{3//2}('+')'\n𝕊{3//2}('-')\n\njulia> 𝕊{3//2}('-')'\n𝕊{3//2}('+')","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The local spin space is determined by the total spin. The standard matrix representation of an SpinIndex instance on this local spin space can be obtained by the matrix function exported by this package:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕊{1//2}('x') |> matrix\n2×2 Matrix{ComplexF64}:\n 0.0+0.0im 0.5+0.0im\n 0.5+0.0im 0.0+0.0im\n\njulia> 𝕊{1//2}('y') |> matrix\n2×2 Matrix{ComplexF64}:\n 0.0-0.0im -0.0+0.5im\n 0.0-0.5im 0.0-0.0im\n\njulia> 𝕊{1//2}('z') |> matrix\n2×2 Matrix{ComplexF64}:\n -0.5+0.0im -0.0+0.0im\n 0.0+0.0im 0.5+0.0im\n\njulia> 𝕊{1//2}('+') |> matrix\n2×2 Matrix{ComplexF64}:\n 0.0+0.0im 0.0+0.0im\n 1.0+0.0im 0.0+0.0im\n\njulia> 𝕊{1//2}('-') |> matrix\n2×2 Matrix{ComplexF64}:\n 0.0+0.0im 1.0+0.0im\n 0.0+0.0im 0.0+0.0im","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"A Spin instance can be initialized as follows:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Spin{1}()\n5-element Spin{1}:\n 𝕊{1}('x')\n 𝕊{1}('y')\n 𝕊{1}('z')\n 𝕊{1}('+')\n 𝕊{1}('-')\n\njulia> Spin{1//2}()\n5-element Spin{1//2}:\n 𝕊{1//2}('x')\n 𝕊{1//2}('y')\n 𝕊{1//2}('z')\n 𝕊{1//2}('+')\n 𝕊{1//2}('-')","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Similar to Fock, a Spin instance behaves like a vector whose iteration generates all the allowed SpinIndex instances on its associated spatial point:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> sp = Spin{1}();\n\njulia> sp |> typeof |> eltype\nSpinIndex{1, Char}\n\njulia> sp |> length\n5\n\njulia> [sp[1], sp[2], sp[3], sp[4], sp[5]]\n5-element Vector{SpinIndex{1, Char}}:\n 𝕊{1}('x')\n 𝕊{1}('y')\n 𝕊{1}('z')\n 𝕊{1}('+')\n 𝕊{1}('-')\n\njulia> sp |> collect\n5-element Vector{SpinIndex{1, Char}}:\n 𝕊{1}('x')\n 𝕊{1}('y')\n 𝕊{1}('z')\n 𝕊{1}('+')\n 𝕊{1}('-')","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"It is noted that a Spin instance generates SpinIndex instances not only limited to those corresponding to S^x, S^y, S^z, but also those to S^+ and S^- although the former three already forms a complete set of the generators of the local SU(2) spin algebra. This overcomplete feature is for the convenience to the construction of spin Hamiltonians.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Unitcell-and-global-levels:-Hilbert,-Index-and-CoordinatedIndex","page":"Internal degrees of freedom","title":"Unitcell and global levels: Hilbert, Index and CoordinatedIndex","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"At the unitcell and global levels to construct the SU(2) spin algebra and spin generators, it is completely the same to that of the Fock algebra and Fock generators as long as we replace Fock and FockIndex with Spin and SpinIndex, respectively:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Hilbert(1=>Spin{1//2}(), 2=>Spin{1}())\nHilbert{Spin} with 2 entries:\n 1 => Spin{1//2}()\n 2 => Spin{1}()\n\njulia> Index(1, SpinIndex{1//2}('+'))\n𝕊{1//2}(1, '+')\n\njulia> 𝕊{1//2}(1, '+') isa Index{<:SpinIndex{1//2}}\ntrue\n\njulia> CoordinatedIndex(Index(1, SpinIndex{1//2}('-')), [0.5, 0.5], [1.0, 1.0])\n𝕊{1//2}(1, '-', [0.5, 0.5], [1.0, 1.0])\n\njulia> 𝕊{1//2}(1, '-', [0.5, 0.5], [1.0, 1.0]) isa CoordinatedIndex{<:Index{<:SpinIndex{1//2}}}\ntrue","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Phononic-systems","page":"Internal degrees of freedom","title":"Phononic systems","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Local-level:-Phonon-and-PhononIndex","page":"Internal degrees of freedom","title":"Local level: Phonon and PhononIndex","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Phononic systems are also bosonic systems. However, the canonical creation and annihilation operators of phonons depends on the eigenvalues and eigenvectors of the dynamical matrix, making them difficult to be defined locally at each point. Instead, we resort to the displacement (mathbfu) and momentum (mathbfp) operators of lattice vibrations as the generators, which can be easily defined locally. The type PhononIndex<:InternalIndex could specify such a local generator, which has the following attributes:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"direction::Char: the direction, which must be one of 'x', 'y' and 'z', to indicate which spatial directional component of the generator it is","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Correspondingly, the type Phonon<:Internal, which defines the local mathbfu mathbfp algebra of the lattice vibrations, has the following attributes:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"ndirection::Int: the spatial dimension of the lattice vibrations, which must be 1, 2, or 3.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"For PhononIndex and Phonon, it is also necessary to distinguish whether it is for the displacement (mathbfu) or for the momentum (mathbfp). Their first type parameters are designed to solve this problem, with :u and :b denoting mathbfu and mathbfp, respectively.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Now let's see examples:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> PhononIndex{:u}('x')\n𝕦('x')\n\njulia> PhononIndex{:p}('x')\n𝕡('x')\n\njulia> # one-dimensional lattice vibration only has the x component\n\njulia> Phonon{:u}(1)\n1-element Phonon{:u}:\n 𝕦('x')\n\njulia> Phonon{:p}(1)\n1-element Phonon{:p}:\n 𝕡('x')\n\njulia> # two-dimensional lattice vibration only has the x and y components\n\njulia> Phonon{:u}(2) \n2-element Phonon{:u}:\n 𝕦('x')\n 𝕦('y')\n\njulia> Phonon{:p}(2)\n2-element Phonon{:p}:\n 𝕡('x')\n 𝕡('y')\n\njulia> # three-dimensional lattice vibration has the x, y and z components\n\njulia> Phonon{:u}(3)\n3-element Phonon{:u}:\n 𝕦('x')\n 𝕦('y')\n 𝕦('z')\n\njulia> Phonon{:p}(3)\n3-element Phonon{:p}:\n 𝕡('x')\n 𝕡('y')\n 𝕡('z')","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"As is usual, we define functions 𝕦 (\\bbu) and 𝕡 (\\bbp) to construct and display instances of PhononIndex{:u} and PhononIndex{:p} for convenience, respectively.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕦('x') isa PhononIndex{:u}\ntrue\n\njulia> 𝕡('x') isa PhononIndex{:p}\ntrue","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Unitcell-and-global-levels:-Hilbert,-Index-and-CoordinatedIndex-2","page":"Internal degrees of freedom","title":"Unitcell and global levels: Hilbert, Index and CoordinatedIndex","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"At the unitcell and global levels, lattice-vibration algebras and generators are the same to previous situations by Phonon and PhononIndex replaced with in the corresponding types:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Hilbert(site=>Phonon(2) for site=1:3)\nHilbert{Phonon{:}} with 3 entries:\n 1 => Phonon(ndirection=2)\n 2 => Phonon(ndirection=2)\n 3 => Phonon(ndirection=2)\n\njulia> Index(1, PhononIndex{:u}('x'))\n𝕦(1, 'x')\n\njulia> 𝕦(1, 'x') isa Index{<:PhononIndex{:u}}\ntrue\n\njulia> Index(1, PhononIndex{:p}('x'))\n𝕡(1, 'x')\n\njulia> 𝕡(1, 'x') isa Index{<:PhononIndex{:p}}\ntrue\n\njulia> CoordinatedIndex(Index(1, PhononIndex{:u}('x')), [0.5, 0.5], [1.0, 1.0])\n𝕦(1, 'x', [0.5, 0.5], [1.0, 1.0])\n\njulia> 𝕦(1, 'x', [0.5, 0.5], [1.0, 1.0]) isa CoordinatedIndex{<:Index{<:PhononIndex{:u}}}\ntrue\n\njulia> CoordinatedIndex(Index(1, PhononIndex{:p}('x')), [0.5, 0.5], [1.0, 1.0])\n𝕡(1, 'x', [0.5, 0.5], [1.0, 1.0])\n\njulia> 𝕡(1, 'x', [0.5, 0.5], [1.0, 1.0]) isa CoordinatedIndex{<:Index{<:PhononIndex{:p}}}\ntrue","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"It is noted that Phonon{:} is a special kind of Phonon, which are used to specify the Hilbert space of lattice vibrations. In this way, both the displacement (mathbfu) and the momentum (mathbfp) degrees of freedom can be incorporated.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Operator-and-Operators","page":"Internal degrees of freedom","title":"Operator and Operators","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Now we arrive at the core types of this package, the Operator and Operators. They are defined to deal with the mathematical operations, i.e., the +/-/* operations between two elements of the algebra acting on the Hilbert space, and the scalar multiplication between an element of the algebra and a number. Specifically, an Operator represents a product of several generators of the algebra specified at any of the three levels along with a coefficient, and an Operators represents the sum of several instances of Operator.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Operator can be initialized by two ways:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Operator(2, 𝕗(1, -1//2, 2), 𝕗(1, -1//2, 1), 𝕊{1//2}('z'))\nOperator(2, 𝕗(1, -1//2, 2), 𝕗(1, -1//2, 1), 𝕊{1//2}('z'))\n\njulia> 2 * 𝕗(1, 1, -1//2, 2) * 𝕊{1//2}(2, 'z')\nOperator(2, 𝕗(1, 1, -1//2, 2), 𝕊{1//2}(2, 'z'))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"It is noted that the number of the generators can be any natural number.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Although generators at different levels can be producted to make an Operator, it is not recommended to do so because the logic will be muddled:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Operator(2, 𝕗(1, 0, 2), 𝕗(2, 1, 0, 1, [0.0], [0.0])) # never do this !!!\nOperator(2, 𝕗(1, 0, 2), 𝕗(2, 1, 0, 1, [0.0], [0.0]))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Operator can be iterated and indexed by integers, which will give the corresponding generators in the product:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> op = Operator(2, 𝕗(1, 1//2, 2), 𝕗(1, 1//2, 1));\n\njulia> length(op)\n2\n\njulia> [op[1], op[2]]\n2-element Vector{FockIndex{:f, Int64, Rational{Int64}, Int64}}:\n 𝕗(1, 1//2, 2)\n 𝕗(1, 1//2, 1)\n\njulia> collect(op)\n2-element Vector{FockIndex{:f, Int64, Rational{Int64}, Int64}}:\n 𝕗(1, 1//2, 2)\n 𝕗(1, 1//2, 1)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"To get the coefficient of an Operator or all its individual generators as a whole, use the value and id function exported by this package, respectively:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> op = Operator(2, 𝕗(1, 0, 2), 𝕗(1, 0, 1));\n\njulia> value(op)\n2\n\njulia> id(op)\n(𝕗(1, 0, 2), 𝕗(1, 0, 1))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The product between two Operators, or the scalar multiplication between a number and an Operator is also an Operator:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Operator(2, 𝕗(1, 1//2, 2)) * Operator(3, 𝕗(1, 1//2, 1))\nOperator(6, 𝕗(1, 1//2, 2), 𝕗(1, 1//2, 1))\n\njulia> 3 * Operator(2, 𝕗(1, 1//2, 2))\nOperator(6, 𝕗(1, 1//2, 2))\n\njulia> Operator(2, 𝕗(1, 1//2, 2)) * 3\nOperator(6, 𝕗(1, 1//2, 2))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The Hermitian conjugate of an Operator can be obtained by the adjoint operator:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> op = Operator(6, 𝕗(2, 1//2, 2), 𝕗(1, 1//2, 1));\n\njulia> op'\nOperator(6, 𝕗(1, 1//2, 2), 𝕗(2, 1//2, 1))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"There also exists a special Operator, which only has the coefficient:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Operator(2)\nOperator(2)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Operators can be initialized by two ways:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Operators(Operator(2, 𝕗(1, 1//2, 1)), Operator(3, 𝕗(1, 1//2, 2)))\nOperators with 2 Operator\n Operator(2, 𝕗(1, 1//2, 1))\n Operator(3, 𝕗(1, 1//2, 2))\n\njulia> Operator(2, 𝕗(1, 1//2, 1)) - Operator(3, 𝕓(1, 1//2, 2))\nOperators with 2 Operator\n Operator(2, 𝕗(1, 1//2, 1))\n Operator(-3, 𝕓(1, 1//2, 2))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Similar items are automatically merged during the construction of Operators:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Operators(Operator(2, 𝕗(1, 1//2, 1)), Operator(3, 𝕗(1, 1//2, 1)))\nOperators with 1 Operator\n Operator(5, 𝕗(1, 1//2, 1))\n\njulia> Operator(2, 𝕗(1, 1//2, 1)) + Operator(3, 𝕗(1, 1//2, 1))\nOperators with 1 Operator\n Operator(5, 𝕗(1, 1//2, 1))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The multiplication between two Operatorses, or between an Operators and an Operator, or between a number and an Operators are defined:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> ops = Operator(2, 𝕗(1, 1//2, 1)) + Operator(3, 𝕗(1, 1//2, 2));\n\njulia> op = Operator(2, 𝕗(2, 1//2, 1));\n\njulia> ops * op\nOperators with 2 Operator\n Operator(4, 𝕗(1, 1//2, 1), 𝕗(2, 1//2, 1))\n Operator(6, 𝕗(1, 1//2, 2), 𝕗(2, 1//2, 1))\n\njulia> op * ops\nOperators with 2 Operator\n Operator(4, 𝕗(2, 1//2, 1), 𝕗(1, 1//2, 1))\n Operator(6, 𝕗(2, 1//2, 1), 𝕗(1, 1//2, 2))\n\njulia> another = Operator(2, 𝕗(1, 1//2, 1)) + Operator(3, 𝕗(1, 1//2, 2));\n\njulia> ops * another \nOperators with 2 Operator\n Operator(6, 𝕗(1, 1//2, 1), 𝕗(1, 1//2, 2))\n Operator(6, 𝕗(1, 1//2, 2), 𝕗(1, 1//2, 1))\n\njulia> 2 * ops\nOperators with 2 Operator\n Operator(4, 𝕗(1, 1//2, 1))\n Operator(6, 𝕗(1, 1//2, 2))\n\njulia> ops * 2\nOperators with 2 Operator\n Operator(4, 𝕗(1, 1//2, 1))\n Operator(6, 𝕗(1, 1//2, 2))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"It is noted that in the result, the distributive law automatically applies. Besides, the fermion operator relation c^2=cdagger^2=0 is also used.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"As is usual, the Hermitian conjugate of an Operators can be obtained by the adjoint operator:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> op₁ = Operator(6, 𝕗(1, 1//2, 2), 𝕗(2, 1//2, 1));\n\njulia> op₂ = Operator(4, 𝕗(1, 1//2, 1), 𝕗(2, 1//2, 1));\n\njulia> ops = op₁ + op₂;\n\njulia> ops'\nOperators with 2 Operator\n Operator(6, 𝕗(2, 1//2, 2), 𝕗(1, 1//2, 1))\n Operator(4, 𝕗(2, 1//2, 2), 𝕗(1, 1//2, 2))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Operators can be iterated and indexed:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> ops = Operator(2, 𝕗(1, 1//2, 1)) + Operator(3, 𝕗(1, 1//2, 2));\n\njulia> collect(ops)\n2-element Vector{Operator{Int64, Tuple{FockIndex{:f, Int64, Rational{Int64}, Int64}}}}:\n Operator(2, 𝕗(1, 1//2, 1))\n Operator(3, 𝕗(1, 1//2, 2))\n\njulia> ops[1]\nOperator(2, 𝕗(1, 1//2, 1))\n\njulia> ops[2]\nOperator(3, 𝕗(1, 1//2, 2))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The index order of an Operators is the insertion order of the operators it contains.","category":"page"},{"location":"advanced topics/BoundaryConditions/","page":"Boundary conditions","title":"Boundary conditions","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"advanced topics/BoundaryConditions/#Boundary-conditions","page":"Boundary conditions","title":"Boundary conditions","text":"","category":"section"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"CurrentModule = QuantumLattices.QuantumOperators","category":"page"},{"location":"man/QuantumOperators/#Quantum-operators","page":"Quantum operators","title":"Quantum operators","text":"","category":"section"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"Quantum operators form an algebra over a field, which are vector spaces with a bilinear operation (often called the \"multiplication\") between vectors defined.","category":"page"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"With the help of the structure constants of the algebra, the result of the bilinear operation between any arbitrary two vectors can be expressed by a sum of individual ones. Therefore, in principle, an algebra can be represented by the complete basis set of its corresponding vector space and a rank-3 tensor encapsulating its structure constants. It is noted that the \"bilinear operation\" is not restricted to the usual multiplication. For example, it is the commutator, which is a composition of the usual multiplication and subtraction (for any A and B, the commutator [A, B] is defined as [A, B]≝AB-BA) that serves as the bilinear operator for Lie algebras.","category":"page"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"In general, there are three basic operations on quantum operators, i.e. the scalar multiplication between a scalar and a quantum operator, the usual addition and the usual multiplication between quantum operators. Other complicated operations can be composed from these basic ones. These basic operations are implemented in this module.","category":"page"},{"location":"man/QuantumOperators/#OperatorUnit","page":"Quantum operators","title":"OperatorUnit","text":"","category":"section"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"OperatorUnit is the building block of quantum operators, which specifies the basis of the vector space of the corresponding algebra.","category":"page"},{"location":"man/QuantumOperators/#OperatorProd-and-OperatorSum","page":"Quantum operators","title":"OperatorProd and OperatorSum","text":"","category":"section"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"OperatorProd defines the product operator as an entity of basis quantum operators while OperatorSum defines the summation as an entity of OperatorProds. Both of them are subtypes of QuantumOperator, which is the abstract type for all quantum operators.","category":"page"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"An OperatorProd must have two predefined contents:","category":"page"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"value::Number: the coefficient of the quantum operator\nid::ID: the id of the quantum operator","category":"page"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"Arithmetic operations (+, -, *, /) between a scalar, an OperatorProd or an OperatorSum is defined. See Manual for details.","category":"page"},{"location":"man/QuantumOperators/#Manual","page":"Quantum operators","title":"Manual","text":"","category":"section"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"Modules = [QuantumOperators]\nOrder = [:module, :constant, :type, :macro, :function]","category":"page"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.ID","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.ID","text":"ID{U<:OperatorIndex, N}\n\nID of a composite quantum operator, which is an ordered set of operator units.\n\nType alias for NTuple{N, U} where {U<:OperatorIndex}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.ID-Tuple{Vararg{OperatorIndex}}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.ID","text":"ID(id::OperatorIndex...)\nID(u::OperatorIndex, id::ID{OperatorIndex})\nID(id::ID{OperatorIndex}, u::OperatorIndex)\nID(id₁::ID{OperatorIndex}, id₂::ID{OperatorIndex})\n\nGet the id from operator units/ids.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.ID-Union{Tuple{M}, Tuple{N}, Tuple{U}, Tuple{Type{U}, Vararg{NTuple{N, Any}, M}}} where {U<:OperatorIndex, N, M}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.ID","text":"ID(::Type{U}, attrs::Vararg{NTuple{N}, M}) where {U<:OperatorIndex, N, M}\n\nGet the composite id from the components of singular ids.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.LaTeX","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.LaTeX","text":"LaTeX{SP, SB}(body, spdelimiter::String=\", \", sbdelimiter::String=\", \"; options...) where {SP, SB}\n\nLaTeX string representation of quantum operators.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.LinearFunction","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.LinearFunction","text":"LinearFunction{F<:Function} <: LinearTransformation\n\nWrapper a function to be a linear transformation.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.LinearTransformation","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.LinearTransformation","text":"LinearTransformation <: Transformation\n\nAbstract linear transformation on quantum operators.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.LinearTransformation-Tuple{OperatorSet}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.LinearTransformation","text":"(transformation::LinearTransformation)(ms::OperatorSet; kwargs...) -> OperatorSet\n\nGet the linear transformed quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.Matrixization","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.Matrixization","text":"Matrixization <: LinearTransformation\n\nMatrixization transformation.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.Operator","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.Operator","text":"Operator{V, I<:ID{OperatorIndex}} <: OperatorProd{V, I}\n\nOperator.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.OperatorIndex","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.OperatorIndex","text":"OperatorIndex <: QuantumOperator\n\nAn operator index is the irreducible symbolic unit to completely represent a quantum operator.\n\nIt plays the role of the symbols as in usual computer algebras while it can host internal structures, which is convenient to represent quantum operators with complicated spatial and/or internal degrees of freedom.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.OperatorPack","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.OperatorPack","text":"OperatorPack{V, I} <: QuantumOperator\n\nEntity that represent the pack of a number and an id of a quantum operator.\n\nBasically, a concrete subtype should contain two predefined contents:\n\nvalue::V: the coefficient of the pack\nid::I: the id of the pack\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.OperatorProd","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.OperatorProd","text":"OperatorProd{V, I<:Tuple} <: OperatorPack{V, I}\n\nA special kind of OperatorPack, where the relation between the coefficient and each component of the opeator id can be viewed as product.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.OperatorSet","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.OperatorSet","text":"OperatorSet{M<:OperatorPack} <: QuantumOperator\n\nSet of OperatorPacks.\n\nThe relation between two OperatorPacks in an OperatorSet can be viewed as addition.\nBut in general, only iteration over OperatorPacks and length are supported.\nTo use arithmetic operations, please refer to its subtype, OperatorSum.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.OperatorSum","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.OperatorSum","text":"OperatorSum{M<:OperatorPack, I} <: OperatorSet{M}\n\nSum of OperatorPacks.\n\nSimilar items are automatically merged with the aid of the id system.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.OperatorSum-Tuple{Vararg{QuantumOperator}}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.OperatorSum","text":"OperatorSum(ms)\nOperatorSum(ms::QuantumOperator...)\nOperatorSum{M}(ms) where {M<:OperatorPack}\nOperatorSum{M}(ms::QuantumOperator...) where {M<:OperatorPack}\n\nGet the sum of OperatorPacks.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.Operators","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.Operators","text":"Operators{O<:Operator, I<:ID{OperatorIndex}}\n\nA set of operators.\n\nType alias for OperatorSum{O<:Operator, I<:ID{OperatorIndex}}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.Operators-Tuple{Vararg{Operator}}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.Operators","text":"Operators(opts::Operator...)\nOperators{M}(opts::Operator...)\n\nGet a set of operators.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.Permutation","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.Permutation","text":"Permutation{T} <: LinearTransformation\n\nPermutation transformation.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.Permutation-Tuple{OperatorProd}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.Permutation","text":"(permutation::Permutation)(m::OperatorProd; rev::Bool=false, kwargs...) -> OperatorSum\n\nPermute the operator units of an OperatorProd to the descending order according to the table contained in permutation.\n\nnote: Note\nTo use this function, the user must implement a method of permute, which computes the result of the permutation of two operator units:permute(u₁::OperatorIndex, u₂::OperatorIndex) -> Union{OperatorProd, OperatorSum}Here, u₁ and u₂ are two arbitrary operator units contained in id(m).\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.QuantumOperator","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.QuantumOperator","text":"QuantumOperator\n\nAbstract type of any quantum operator.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.RankFilter","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.RankFilter","text":"RankFilter{R} <: LinearTransformation\n\nRank filter, which filters out the OperatorProd with a given rank R.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.TabledUnitSubstitution","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.TabledUnitSubstitution","text":"TabledUnitSubstitution{U<:OperatorIndex, S<:OperatorSum, T<:AbstractDict{U, S}} <: UnitSubstitution{U, S}\n\nA concrete unit substitution transformation, which stores every substitution of the old OperatorIndexs in its table as a dictionary.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.Transformation","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.Transformation","text":"Transformation <: Function\n\nAbstract transformation on quantum operators.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.UnitSubstitution","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.UnitSubstitution","text":"UnitSubstitution{U<:OperatorIndex, S<:OperatorSum} <: LinearTransformation\n\nUnit substitution transformation, which substitutes each OperatorIndex in the old quantum operators to a new expression represented by an OperatorSum.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.UnitSubstitution-Tuple{OperatorProd}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.UnitSubstitution","text":"(unitsubstitution::UnitSubstitution)(m::OperatorProd; kwargs...) -> OperatorSum\n\nSubstitute every OperatorIndex in an OperatorProd with a new OperatorSum.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.:*-Tuple{Number, OperatorIndex}","page":"Quantum operators","title":"Base.:*","text":"*(factor::Number, m::OperatorIndex) -> Operator\n*(m::OperatorIndex, factor::Number) -> Operator\n*(m₁::OperatorIndex, m₂::OperatorIndex) -> Operator\n*(factor::Number, m::OperatorPack) -> OperatorPack\n*(m::OperatorPack, factor::Number) -> OperatorPack\n*(m₁::OperatorPack, m₂::OperatorIndex) -> OperatorPack\n*(m₁::OperatorIndex, m₁::OperatorPack) -> OperatorPack\n*(m₁::OperatorPack, m₂::OperatorPack) -> OperatorPack\n*(factor::Number, ms::OperatorSum) -> OperatorSum\n*(ms::OperatorSum, factor::Number) -> OperatorSum\n*(m::OperatorIndex, ms::OperatorSum) -> OperatorSum\n*(ms::OperatorSum, m::OperatorIndex) -> OperatorSum\n*(m::OperatorPack, ms::OperatorSum) -> OperatorSum\n*(ms::OperatorSum, m::OperatorPack) -> OperatorSum\n*(ms₁::OperatorSum, ms₂::OperatorSum) -> OperatorSum\n\nOverloaded * between quantum operators or a quantum operator and a number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.:+-Tuple{QuantumOperator}","page":"Quantum operators","title":"Base.:+","text":"+(m::QuantumOperator) -> typeof(m)\n+(m₁::QuantumOperator, m₂::QuantumOperator) -> OperatorSum\n+(factor::Number, m::QuantumOperator) -> OperatorSum\n+(m::QuantumOperator, factor::Number) -> OperatorSum\n\nOverloaded + between quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.:--Tuple{QuantumOperator}","page":"Quantum operators","title":"Base.:-","text":"-(m::QuantumOperator) -> QuantumOperator\n-(m₁::QuantumOperator, m₂::QuantumOperator) -> OperatorSum\n-(factor::Number, m::QuantumOperator) -> OperatorSum\n-(m::QuantumOperator, factor::Number) -> OperatorSum\n\nOverloaded - between quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.:/-Tuple{QuantumOperator, Number}","page":"Quantum operators","title":"Base.:/","text":"/(m::QuantumOperator, factor::Number) -> QuantumOperator\n\nOverloaded / between a quantum operator and a number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.://-Tuple{QuantumOperator, Number}","page":"Quantum operators","title":"Base.://","text":"//(m::QuantumOperator, factor::Number) -> QuantumOperator\n\nOverloaded // between a quantum operator and a number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.:^-Tuple{QuantumOperator, Integer}","page":"Quantum operators","title":"Base.:^","text":"^(m::QuantumOperator, n::Integer) -> QuantumOperator\n\nOverloaded ^ between a quantum operator and an integer.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.adjoint-Tuple{NTuple{N, OperatorIndex} where N}","page":"Quantum operators","title":"Base.adjoint","text":"adjoint(id::ID{OperatorIndex}) -> ID\n\nGet the adjoint of an id.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.adjoint-Tuple{Operators}","page":"Quantum operators","title":"Base.adjoint","text":"adjoint(opts::Operators) -> Operators\n\nGet the adjoint of a set of operators.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.adjoint-Tuple{Operator}","page":"Quantum operators","title":"Base.adjoint","text":"adjoint(m::Operator) -> Operator\n\nGet the adjoint of an operator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.conj-Tuple{OperatorIndex}","page":"Quantum operators","title":"Base.conj","text":"conj(m::OperatorIndex) -> OperatorIndex\nconj(m::OperatorPack) -> OperatorPack\nconj(m::OperatorSum) -> OperatorSum\n\nGet the conjugation.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.convert-Union{Tuple{M}, Tuple{Type{M}, Number}} where M<:OperatorProd","page":"Quantum operators","title":"Base.convert","text":"convert(::Type{M}, m::Number) where {M<:OperatorProd}\n\nConvert a number to a quantum operator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.convert-Union{Tuple{M}, Tuple{Type{M}, OperatorIndex}} where M<:Operator","page":"Quantum operators","title":"Base.convert","text":"convert(::Type{M}, u::OperatorIndex) where {M<:Operator}\n\nConvert an operator index to an operator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.convert-Union{Tuple{M}, Tuple{Type{M}, OperatorPack}} where M<:OperatorPack","page":"Quantum operators","title":"Base.convert","text":"convert(::Type{M}, m::OperatorPack) where {M<:OperatorPack}\n\nConvert a quantum operator from one type to another.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.eltype-Tuple{OperatorProd}","page":"Quantum operators","title":"Base.eltype","text":"eltype(m::OperatorProd)\neltype(::Type{M}) where {M<:OperatorProd}\n\nGet the eltype of an OperatorProd.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.eltype-Tuple{OperatorSet}","page":"Quantum operators","title":"Base.eltype","text":"eltype(ms::OperatorSet)\neltype(::Type{<:OperatorSet{M}}) where {M<:OperatorPack}\n\nGet the eltype of an OperatorSet.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.empty-Tuple{OperatorSum}","page":"Quantum operators","title":"Base.empty","text":"empty(ms::OperatorSum) -> typeof(ms)\nempty!(ms::OperatorSum) -> typeof(ms)\n\nGet an empty copy or empty an OperatorSum.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.getindex-Tuple{OperatorProd, Integer}","page":"Quantum operators","title":"Base.getindex","text":"getindex(m::OperatorProd, i::Integer) -> eltype(idtype(m))\ngetindex(m::OperatorProd, slice) -> OperatorProd\n\nOverloaded [].\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.getindex-Tuple{OperatorSum, Integer}","page":"Quantum operators","title":"Base.getindex","text":"getindex(ms::OperatorSum, index::Integer) -> eltype(ms)\ngetindex(ms::OperatorSum, indexes::AbstractVector{<:Integer}) -> typeof(ms)\ngetindex(ms::OperatorSum, ::Colon) -> typeof(ms)\n\nOverloaded [].\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.getproperty-Tuple{NTuple{N, OperatorIndex} where N, Symbol}","page":"Quantum operators","title":"Base.getproperty","text":"getproperty(id::ID{OperatorIndex}, name::Symbol)\n\nGet the property of a composite id.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.haskey-Tuple{OperatorSum, Any}","page":"Quantum operators","title":"Base.haskey","text":"haskey(ms::OperatorSum, id) -> Bool\n\nJudge whether an OperatorSum contains an OperatorPack with the given id. \n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.isapprox-Tuple{OperatorPack, OperatorPack}","page":"Quantum operators","title":"Base.isapprox","text":"isapprox(m₁::OperatorPack, m₂::OperatorPack; atol::Real=atol, rtol::Real=rtol) -> Bool\n\nCompare two OperatorPacks and judge whether they are approximate to each other.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.isapprox-Tuple{OperatorSum, OperatorSum}","page":"Quantum operators","title":"Base.isapprox","text":"isapprox(ms₁::OperatorSum, ms₂::OperatorSum; atol::Real=atol, rtol::Real=rtol) -> Bool\n\nCompare two OperatorSums and judge whether they are approximate to each other.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.iszero-Tuple{OperatorIndex}","page":"Quantum operators","title":"Base.iszero","text":"iszero(u::OperatorIndex) -> Bool\n\nJudge whether an OperatorIndex is zero, which is defined to be always false.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.iszero-Tuple{OperatorPack}","page":"Quantum operators","title":"Base.iszero","text":"iszero(m::OperatorPack) -> Bool\n\nJudge whether an OperatorPack is zero, i.e., its value is zero.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.iszero-Tuple{OperatorSet}","page":"Quantum operators","title":"Base.iszero","text":"iszero(ms::OperatorSet) -> Bool\n\nJudge whether an OperatorSet is zero, i.e, it does not contain any OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.iszero-Tuple{OperatorSum}","page":"Quantum operators","title":"Base.iszero","text":"iszero(ms::OperatorSum) -> Bool\n\nJudge whether an OperatorSum is zero, i.e, it does not contain any OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.iterate-Tuple{OperatorProd}","page":"Quantum operators","title":"Base.iterate","text":"iterate(m::OperatorProd)\niterate(m::OperatorProd, state)\n\nIterate over the components of the id of an OperatorProd.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.iterate-Tuple{OperatorSum}","page":"Quantum operators","title":"Base.iterate","text":"iterate(ms::OperatorSum)\niterate(ms::OperatorSum, state)\n\nIterate over the OperatorPacks contained in an OperatorSum.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.length-Tuple{OperatorProd}","page":"Quantum operators","title":"Base.length","text":"length(m::OperatorProd) -> Int\n\nGet the length of an OperatorProd.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.length-Tuple{OperatorSum}","page":"Quantum operators","title":"Base.length","text":"length(ms::OperatorSum) -> Int\n\nGet the number of OperatorPacks contained in an OperatorSum.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.map!-Tuple{Function, OperatorSum}","page":"Quantum operators","title":"Base.map!","text":"map!(f::Function, ms::OperatorSum; kwargs...) -> typeof(ms)\n\nIn place map of an OperatorSum by the function f elementally.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.one-Union{Tuple{Type{M}}, Tuple{M}} where M<:OperatorProd","page":"Quantum operators","title":"Base.one","text":"one(::Type{M}) where {M<:OperatorProd}\none(m::OperatorProd)\n\nGet the identity quantum operator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.propertynames-Tuple{NTuple{N, OperatorIndex} where N}","page":"Quantum operators","title":"Base.propertynames","text":"propertynames(::Type{I}) where I<:ID{OperatorIndex} -> Tuple{Vararg{Symbol}}\n\nGet the property names of a composite id.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.replace-Tuple{OperatorPack, Any}","page":"Quantum operators","title":"Base.replace","text":"replace(m::OperatorPack, v) -> OperatorPack\n\nReplace the value of an OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.replace-Tuple{QuantumOperator}","page":"Quantum operators","title":"Base.replace","text":"replace(m::QuantumOperator; kwargs...) -> typeof(m)\n\nReturn a copy of a concrete QuantumOperator with some of the field values replaced by the keyword arguments.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.show-Tuple{IO, MIME{Symbol(\"text/latex\")}, QuantumOperator}","page":"Quantum operators","title":"Base.show","text":"show(io::IO, ::MIME\"text/latex\", m::QuantumOperator)\n\nShow a quantum operator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.split-Tuple{OperatorProd}","page":"Quantum operators","title":"Base.split","text":"split(m::OperatorProd) -> Tuple{valtype(m), Vararg{Any}}\n\nSplit an OperatorProd into the coefficient and a sequence of the components of its id.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.valtype-Tuple{OperatorPack}","page":"Quantum operators","title":"Base.valtype","text":"valtype(m::OperatorPack)\nvaltype(::Type{T}) where {T<:OperatorPack}\n\nGet the type of the value of an OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.zero-Tuple{QuantumOperator}","page":"Quantum operators","title":"Base.zero","text":"zero(m::QuantumOperator)\n\nGet a zero QuantumOperator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.zero-Union{Tuple{Type{M}}, Tuple{M}} where M<:OperatorIndex","page":"Quantum operators","title":"Base.zero","text":"zero(::Type{M}) where {M<:OperatorIndex} -> OperatorSum\nzero(::Type{M}) where {M<:OperatorPack} -> OperatorSum\nzero(::Type{M}) where {M<:OperatorSum} -> OperatorSum\n\nGet the zero sum.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LaTeXStrings.latexstring-Tuple{OperatorIndex}","page":"Quantum operators","title":"LaTeXStrings.latexstring","text":"latexstring(u::OperatorIndex) -> String\n\nLaTeX string representation of an operator index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LaTeXStrings.latexstring-Tuple{OperatorProd}","page":"Quantum operators","title":"LaTeXStrings.latexstring","text":"latexstring(opt::OperatorProd) -> String\n\nGet the string representation of an operator in the LaTeX format.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LaTeXStrings.latexstring-Tuple{OperatorSet}","page":"Quantum operators","title":"LaTeXStrings.latexstring","text":"latexstring(opts::OperatorSet) -> String\n\nGet the string representation of a set of operators in the LaTeX format.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LinearAlgebra.dot-Tuple{QuantumOperator, QuantumOperator}","page":"Quantum operators","title":"LinearAlgebra.dot","text":"dot(m₁::QuantumOperator, m₂::QuantumOperator)\ndot(m::QuantumOperator, c::Number)\ndot(c::Number, m::QuantumOperator)\n\nDot product between two QuantumOperators or between a QuantumOperator and a number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LinearAlgebra.ishermitian-Tuple{NTuple{N, OperatorIndex} where N}","page":"Quantum operators","title":"LinearAlgebra.ishermitian","text":"ishermitian(id::ID{OperatorIndex}) -> Bool\n\nJudge whether an id is Hermitian.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LinearAlgebra.ishermitian-Tuple{Operators}","page":"Quantum operators","title":"LinearAlgebra.ishermitian","text":"ishermitian(opts::Operators) -> Bool\n\nJudge whether a set of operators as a whole is Hermitian.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LinearAlgebra.ishermitian-Tuple{Operator}","page":"Quantum operators","title":"LinearAlgebra.ishermitian","text":"ishermitian(m::Operator) -> Bool\n\nJudge whether an operator is Hermitian.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LinearAlgebra.mul!-Tuple{OperatorSum, Number}","page":"Quantum operators","title":"LinearAlgebra.mul!","text":"mul!(ms::OperatorSum, factor::Number) -> OperatorSum\n\nGet the in-place multiplication of an OperatorSum with a number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LinearAlgebra.rank-Tuple{NTuple{N, OperatorIndex} where N}","page":"Quantum operators","title":"LinearAlgebra.rank","text":"rank(id::ID{OperatorIndex}) -> Int\nrank(::Type{<:ID{OperatorIndex, N}}) where N -> Int\n\nGet the rank of an id.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LinearAlgebra.rank-Tuple{OperatorProd}","page":"Quantum operators","title":"LinearAlgebra.rank","text":"rank(m::OperatorProd) -> Int\nrank(::Type{M}) where {M<:OperatorProd} -> Int\n\nGet the rank of an OperatorProd.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.equivalenttoscalar-Tuple{QuantumOperator}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.equivalenttoscalar","text":"equivalenttoscalar(m::QuantumOperator) -> Bool\nequivalenttoscalar(::Type{M}) where {M<:QuantumOperator} -> Bool\n\nJudge whether a QuantumOperator is equivalent to a scalar.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.equivalenttoscalar-Tuple{Type{<:OperatorPack}}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.equivalenttoscalar","text":"equivalenttoscalar(::Type{<:OperatorPack})\nequivalenttoscalar(::Type{<:OperatorPack{V, Tuple{}} where V})\n\nJudge whether an OperatorPack is equivalent to a scalar.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.idtype-Tuple{OperatorPack}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.idtype","text":"idtype(m::OperatorPack)\nidtype(::Type{T}) where {T<:OperatorPack}\n\nGet the type of the id of an OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.latexformat-Tuple{Type{<:OperatorIndex}}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.latexformat","text":"latexformat(T::Type{<:OperatorIndex}) -> LaTeX\nlatexformat(T::Type{<:OperatorIndex}, l::LaTeX) -> LaTeX\n\nGet/Set the LaTeX format for a subtype of OperatorIndex.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.latexname-Tuple{Type{<:OperatorIndex}}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.latexname","text":"latexname(T::Type{<:OperatorIndex}) -> Symbol\n\nGet the name of a type of OperatorIndex in the latex format lookups.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.matrix","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.matrix","text":"matrix\n\nGeneric matrix representation.\n\n\n\n\n\n","category":"function"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.operatortype-Tuple{QuantumOperator}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.operatortype","text":"operatortype(m::QuantumOperator)\n\nGet the operator type of a QuantumOperator, which is defined to be the type it corresponds to so that addition between two such objects can be performed directly. Usually, it is a subtype of OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.operatortype-Union{Tuple{Type{M}}, Tuple{M}} where M<:OperatorIndex","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.operatortype","text":"operatortype(::Type{M}) where {M<:OperatorIndex}\noperatortype(::Type{M}) where {M<:OperatorPack}\noperatortype(::Type{M}) where {M<:OperatorSet}\n\nGet the corresponding OperatorPack type of a quantum operator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.scalartype-Tuple{Any}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(t)\nscalartype(::Type{T}) where {T<:Number}\nscalartype(::Type{<:AbstractArray{T}}) where T\nscalartype(::Type{<:Tuple{Vararg{T}}}) where T\n\nGet the scalar type of an object.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.scalartype-Union{Tuple{Type{M}}, Tuple{M}} where M<:QuantumOperator","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(::Type{M}) where {M<:QuantumOperator}\n\nGet the scalar type of a QuantumOperator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.scalartype-Union{Tuple{Type{T}}, Tuple{T}} where T<:OperatorPack","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(::Type{T}) where {T<:OperatorPack}\n\nScalar type of the coefficient of an OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.script-Tuple{OperatorIndex, LaTeX, Val{:BD}}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.script","text":"script(u::OperatorIndex, l::LaTeX, ::Val{:BD}) -> Any\nscript(u::OperatorIndex, l::LaTeX, ::Val{:SP}) -> Tuple\nscript(u::OperatorIndex, l::LaTeX, ::Val{:SB}) -> Tuple\n\nGet the body/superscript/subscript of the LaTeX string representation of an operator index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.script-Tuple{OperatorIndex, Val}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.script","text":"script(u::OperatorIndex, ::Val{}; kwargs...) -> String\n\nDefault script for an operator index, which always return an empty string.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.sequence-Tuple{OperatorProd, Any}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.sequence","text":"sequence(m::OperatorProd, table) -> NTuple{rank(m), Int}\n\nGet the sequence of the id of a quantum operator according to a table.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.add!-Tuple{Any, LinearTransformation, OperatorPack}","page":"Quantum operators","title":"QuantumLattices.add!","text":"add!(destination, transformation::LinearTransformation, op::OperatorPack; kwargs...) -> typeof(destination)\nadd!(destination, transformation::LinearTransformation, op::OperatorSet; kwargs...) -> typeof(destination)\n\nAdd the result of the linear transformation on a quantum operator to the destination.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.add!-Tuple{OperatorSum}","page":"Quantum operators","title":"QuantumLattices.add!","text":"add!(ms::OperatorSum) -> typeof(ms)\nadd!(ms::OperatorSum, m::Union{Number, OperatorIndex, OperatorPack}) -> typeof(ms)\nadd!(ms::OperatorSum, mms::OperatorSum) -> typeof(ms)\n\nGet the in-place addition of quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.div!-Tuple{OperatorSum, Number}","page":"Quantum operators","title":"QuantumLattices.div!","text":"div!(ms::OperatorSum, factor::Number) -> OperatorSum\n\nGet the in-place division of an OperatorSum with a number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.expand-Tuple{QuantumOperator}","page":"Quantum operators","title":"QuantumLattices.expand","text":"expand(m::QuantumOperator) -> typeof(m)\n\nExpand a QuantumOperator, which is defined to be itself.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.id-Tuple{OperatorPack}","page":"Quantum operators","title":"QuantumLattices.id","text":"id(m::OperatorPack) -> idtype(m)\n\nGet the id of an OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.sub!-Tuple{OperatorSum}","page":"Quantum operators","title":"QuantumLattices.sub!","text":"sub!(ms::OperatorSum) -> typeof(ms)\nsub!(ms::OperatorSum, m::Union{Number, OperatorIndex, OperatorPack}) -> typeof(ms)\nsub!(ms::OperatorSum, mms::OperatorSum) -> typeof(ms)\n\nGet the in-place subtraction of quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.update!-Tuple{QuantumOperator}","page":"Quantum operators","title":"QuantumLattices.update!","text":"update!(m::QuantumOperator; parameters...) -> typeof(m)\n\nUpdate the parameters of a QuantumOperator in place and return the updated one.\n\nBy default, the parameter update of a QuantumOperator does nothing.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.value-Tuple{OperatorPack}","page":"Quantum operators","title":"QuantumLattices.value","text":"value(m::OperatorPack) -> valtype(m)\n\nGet the value of an OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"using QuantumLattices\nusing SymPy: Sym, symbols","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/#Generator-of-operators","page":"Generator of operators","title":"Generator of operators","text":"","category":"section"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"In previous pages we have introduced the essential elements in detail of a quantum lattice system in the unitcell description framework. In this page, we will discuss how such elements can be incorporated to get the operator representation of the lattice Hamiltonian.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/#Operator-formed-lattice-Hamiltonians","page":"Generator of operators","title":"Operator-formed lattice Hamiltonians","text":"","category":"section"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"The essential elements to obtain an operator-formed lattice Hamiltonian are 1) terms, 2) bonds and 3) Hilbert space.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Accordingly, OperatorGenerator is the type to incorporate all these elements:","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"OperatorGenerator(bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term})","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Then, the operator representation of the lattice Hamiltonian can be obtained by the expand function:","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"expand(gen::OperatorGenerator)","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"which is based on the expansion of terms introduced in the last section of the previous page Couplings among different degrees of freedom.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Now, let's go back to the example proposed in the page of Introduction:","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"lattice = Lattice([zero(Sym)], [one(Sym)]);\nhilbert = Hilbert(site=>Fock{:f}(1, 2) for site=1:length(lattice));\nt = Hopping(:t, symbols(\"t\", real=true), 1);\nU = Hubbard(:U, symbols(\"U\", real=true));\noperators = expand(OperatorGenerator(bonds(lattice, 1), hilbert, (t, U)))","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Note to run the above codes, SymPy.Sym and SymPy.symbols should be imported first.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"The LaTeX formatted outputs will be discussed in the page of LaTeX formatted outputs.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Here, we have two comments:","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"In the construction of OperatorGenerator, a vector of Bonds other than a Lattice is required. Indeed, it is more flexible to control the generated operators by passing a vector of Bonds. By restricting the range of the input bonds, a certain subset of the lattice Hamiltonian can be easily obtained, which is sometimes useful in some quantum many-body algorithms.\nThe Hilbert space is essential because in general not all information of the local generators of a concrete quantum lattice system is contained in the terms. Remind: 1) the statistics of particles or the total spin of local spins is usually omitted in the coupling pattern of a term, and 2) the total number of local orbital/spin degrees of freedom, or the dimension of lattice vibrations, cannot be determined solely by the information provided by the coupling pattern of a term. Therefore, in order to obtain the lattice Hamiltonian, such incomplete information must be supplemented by the Hilbert space.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/#Parameters-tuning-of-lattice-Hamiltonians","page":"Generator of operators","title":"Parameters tuning of lattice Hamiltonians","text":"","category":"section"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"It is customary to tune the parameters of a lattice Hamiltonian. This can be achieved by the update! function exported by this package:","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"update!(gen::OperatorGenerator; termid₁=termvalue₁, termid₁=termvalue₂, ...)","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Here, termidᵢ (i = 1, 2, ...) is the id of a term in the lattice Hamiltonian, and termvalueᵢ is the new overall coefficient of this term.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"The parameters of the terms in an OperatorGenerator can be requested by the type Parameters (a type alias of NamedTuple):","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Parameters(gen::OperatorGenerator) -> Parameters","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Let's see an example.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"julia> lattice = Lattice([0.0], [1.0]);\n\njulia> hilbert = Hilbert(site=>Fock{:f}(1, 2) for site=1:length(lattice));\n\njulia> t = Hopping(:t, 1.0, 1);\n\njulia> gen = OperatorGenerator(bonds(lattice, 1), hilbert, t);\n\njulia> Parameters(gen)\n(t = 1.0,)\n\njulia> expand(gen)\nOperators with 4 Operator\n Operator(1.0, 𝕗(2, 1, -1//2, 2, [1.0], [0.0]), 𝕗(1, 1, -1//2, 1, [0.0], [0.0]))\n Operator(1.0, 𝕗(1, 1, -1//2, 2, [0.0], [0.0]), 𝕗(2, 1, -1//2, 1, [1.0], [0.0]))\n Operator(1.0, 𝕗(2, 1, 1//2, 2, [1.0], [0.0]), 𝕗(1, 1, 1//2, 1, [0.0], [0.0]))\n Operator(1.0, 𝕗(1, 1, 1//2, 2, [0.0], [0.0]), 𝕗(2, 1, 1//2, 1, [1.0], [0.0]))\n\njulia> update!(gen; t=2.0);\n\njulia> Parameters(gen)\n(t = 2.0,)\n\njulia> expand(gen)\nOperators with 4 Operator\n Operator(2.0, 𝕗(2, 1, -1//2, 2, [1.0], [0.0]), 𝕗(1, 1, -1//2, 1, [0.0], [0.0]))\n Operator(2.0, 𝕗(1, 1, -1//2, 2, [0.0], [0.0]), 𝕗(2, 1, -1//2, 1, [1.0], [0.0]))\n Operator(2.0, 𝕗(2, 1, 1//2, 2, [1.0], [0.0]), 𝕗(1, 1, 1//2, 1, [0.0], [0.0]))\n Operator(2.0, 𝕗(1, 1, 1//2, 2, [0.0], [0.0]), 𝕗(2, 1, 1//2, 1, [1.0], [0.0]))","category":"page"},{"location":"#QuantumLattices.jl","page":"Home","title":"QuantumLattices.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"(Image: CI) (Image: codecov) (Image: ) (Image: ) (Image: 996.icu) (Image: LICENSE) (Image: LICENSE) (Image: Code Style: Blue) (Image: ColPrac: Contributor's Guide on Collaborative Practices for Community Packages)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Julia package for the construction of quantum lattice systems.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Welcome to QuantumLattices. Here we provide a general framework to construct the operator-formed Hamiltonian of any quantum lattice system, with the inputs as simple as its description by the natural language. This operator-formed Hamiltonian supports complete symbolic computations when combined with SymPy, and can serve as a convenient frontend of quantum many-body algorithms, such as TBA (tight-bind approximation), LSWT (linear spin wave theory), SCMF (self-consistent mean field theory), ED (exact diagonalization), CPT/VCA (cluster perturbation theory / variational cluster approach), DMRG (density matrix renormalization group), RPA (random phase approximation), etc. Generic interfaces are defined to provide a unified access to these algorithms with automatic project management.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In Julia v1.8+, please type ] in the REPL to use the package mode, then type this command:","category":"page"},{"location":"","page":"Home","title":"Home","text":"pkg> add QuantumLattices","category":"page"},{"location":"#Package-Features","page":"Home","title":"Package Features","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The mathematical foundations of our package is that the operators in a lattice Hamiltonian:","category":"page"},{"location":"","page":"Home","title":"Home","text":"act on local Hilbert spaces, and\nform an algebra over the complex field.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Based on this, the package has the following features:","category":"page"},{"location":"","page":"Home","title":"Home","text":"Unitcell Description Framework: the Hamiltonian can be constructed based on the unitcell of a lattice with the information of the local algebra acting on the local Hilbert space living on each point and the terms that couples different degrees of freedom on the same or different points. Such information can be input into the program as simple as describing the quantum system in a usual research paper.\nComplete Symbolic Computation: with only this package, symbolic computation between operators is realized while the coefficient of any operator remains numeric; by integrating it with SymPy, complete symbolic computation can be achieved and no modifications need be made on the methods in this package.\nGeneric Frontend of Many-Body Algorithms: with the operator-formed Hamiltonian as the foothold, quantum many-body algorithms can be initialized in quite similar ways with only minor modifications needed. Moreover, automatic project management is realized, including that of result recording, data caching, parameter updating, information logging, dependency managing, etc.","category":"page"},{"location":"#Supported-Systems","page":"Home","title":"Supported Systems","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Four common categories of quantum lattice systems in condensed matter physics are supported:","category":"page"},{"location":"","page":"Home","title":"Home","text":"canonical complex fermionic systems\ncanonical complex and hard-core bosonic systems\nSU(2) spin systems\nPhononic systems","category":"page"},{"location":"","page":"Home","title":"Home","text":"Furthermore, other systems can be supported easily by extending the generic protocols provided in this package.","category":"page"},{"location":"#Supported-Algorithms","page":"Home","title":"Supported Algorithms","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Concrete algorithms could be considered as the \"backend\" of quantum lattice systems. They are developed in separate packages (still in progress):","category":"page"},{"location":"","page":"Home","title":"Home","text":"TBA: tight-binding approximation for complex-fermionic/complex-bosonic/phononic systems;\nLSWT: linear spin wave theory for magnetically ordered local-spin systems;\nSCMF: self-consistent mean field theory for complex fermionic systems;\nED: exact diagonalization for complex-fermionic/hard-core-bosonic/local-spin systems;\nCPT/VCA: cluster perturbation theory and variational cluster approach for complex fermionic and local spin systems;\nDMRG: density matrix renormalization group for complex-fermionic/hard-core-bosonic/local-spin systems based on TensorKit and MPSKit;\nRPA: random phase approximation for complex fermionic systems.","category":"page"},{"location":"#Getting-Started","page":"Home","title":"Getting Started","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Tutorials: unitcell description\nTutorials: advanced topics","category":"page"},{"location":"#Note","page":"Home","title":"Note","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Due to the fast development of this package, releases with different minor version numbers are not guaranteed to be compatible with previous ones before the release of v1.0.0. Comments are welcomed in the GitHub issues.","category":"page"},{"location":"#Contact","page":"Home","title":"Contact","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"waltergu1989@gmail.com","category":"page"},{"location":"#Python-counterpart","page":"Home","title":"Python counterpart","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"HamiltonianPy: in fact, the authors of this Julia package worked on the python package at first and only turned to Julia later.","category":"page"}] +[{"location":"advanced topics/ManageProjects/","page":"Manage projects","title":"Manage projects","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"advanced topics/ManageProjects/#Manage-projects","page":"Manage projects","title":"Manage projects","text":"","category":"section"},{"location":"man/QuantumSystems/","page":"Quantum Systems","title":"Quantum Systems","text":"CurrentModule = QuantumLattices.QuantumSystems","category":"page"},{"location":"man/QuantumSystems/#Quantum-Systems","page":"Quantum Systems","title":"Quantum Systems","text":"","category":"section"},{"location":"man/QuantumSystems/","page":"Quantum Systems","title":"Quantum Systems","text":"Modules = [QuantumSystems]\nOrder = [:module, :constant, :type, :macro, :function]","category":"page"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.FockTerm","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.FockTerm","text":"FockTerm\n\nType alias for Union{Onsite, Hopping, Pairing, Hubbard, InterOrbitalInterSpin, InterOrbitalIntraSpin, SpinFlip, PairHopping, Coulomb}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.PhononTerm","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.PhononTerm","text":"PhononTerm\n\nType alias for Union{Kinetic, Hooke, Elastic}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.annihilation","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.annihilation","text":"annihilation\n\nIndicate that the nambu index is annihilation.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.block","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.block","text":"*(f₁::Operator{<:Number, <:ID{FockIndex{:f}}}, f₂::Operator{<:Number, <:ID{FockIndex{:f}}}) -> Operator\n*(f₁::Operator{<:Number, <:ID{Index{<:FockIndex{:f}, Int}}}, f₂::Operator{<:Number, <:ID{Index{<:FockIndex{:f}, Int}}}) -> Operator\n*(f₁::Operator{<:Number, <:ID{CompositeIndex{<:Index{<:FockIndex{:f}, Int}}}}, f₂::Operator{<:Number, <:ID{CompositeIndex{<:Index{<:FockIndex{:f}, Int}}}}) -> Operator\n\nGet the multiplication of two fermionic Fock operators.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.creation","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.creation","text":"creation\n\nIndicate that the nambu index is creation.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.latexofbosons","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.latexofbosons","text":"latexofbosons\n\nDefault LaTeX format of a bosonic index.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.latexoffermions","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.latexoffermions","text":"latexoffermions\n\nDefault LaTeX format of a fermionic index.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.latexofparticles","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.latexofparticles","text":"latexofparticles\n\nDefault LaTeX format of a wildcard Fock index.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.latexofphonons","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.latexofphonons","text":"latexofphonons\n\nDefault LaTeX format of a phonon index.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.latexofspins","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.latexofspins","text":"latexofspins\n\nDefault LaTeX format of a spin index.\n\n\n\n\n\n","category":"constant"},{"location":"man/QuantumSystems/#QuantumLattices.DegreesOfFreedom.MatrixCoupling-Tuple{Union{typeof(𝕓), typeof(𝕕), typeof(𝕗)}, Union{Colon, Tuple{Ordinal, Ordinal}}, Union{Colon, AbstractMatrix}, Union{Colon, AbstractMatrix}, Union{Colon, AbstractMatrix}}","page":"Quantum Systems","title":"QuantumLattices.DegreesOfFreedom.MatrixCoupling","text":"MatrixCoupling(F::Union{typeof(𝕗), typeof(𝕓), typeof(𝕕)}, sites::Union{NTuple{2, Ordinal}, Colon}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon})\nMatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{F}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon}) where {F<:FockIndex}\n\nConstruct a matrix coupling for Fock systems.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.DegreesOfFreedom.MatrixCoupling-Tuple{typeof(𝕦), Union{Colon, Tuple{Ordinal, Ordinal}}, AbstractMatrix}","page":"Quantum Systems","title":"QuantumLattices.DegreesOfFreedom.MatrixCoupling","text":"MatrixCoupling(::typeof(𝕦), sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::Union{AbstractVector, Nothing}=nothing, cols::Union{AbstractVector, Nothing}=nothing)\nMatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{PhononIndex{:u}}, matrix::AbstractMatrix; rows::Union{AbstractVector, Nothing}=nothing, cols::Union{AbstractVector, Nothing}=nothing)\n\nConstruct a set of Couplings corresponding to the dynamical matrix of phonons.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.DegreesOfFreedom.MatrixCoupling-Union{Tuple{S}, Tuple{Type{S}, Union{Colon, Tuple{Ordinal, Ordinal}}, AbstractMatrix}} where S<:𝕊","page":"Quantum Systems","title":"QuantumLattices.DegreesOfFreedom.MatrixCoupling","text":"MatrixCoupling(::Type{<:𝕊}, sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::AbstractVector=SVector('x', 'y', 'z'), cols::AbstractVector=SVector('x', 'y', 'z'))\nMatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{<:SpinIndex}, matrix::AbstractMatrix; rows::AbstractVector=SVector('x', 'y', 'z'), cols::AbstractVector=SVector('x', 'y', 'z'))\n\nConstruct a matrix coupling for spin systems.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumNumbers.Graded-Tuple{Fock{:f}}","page":"Quantum Systems","title":"QuantumLattices.QuantumNumbers.Graded","text":"Graded(fock::Fock{:f})\nGraded{ℤ₁}(fock::Fock{:f})\nGraded{ℕ}(fock::Fock{:f})\nGraded{𝕊ᶻ}(fock::Fock{:f})\nGraded{ℕ ⊠ 𝕊ᶻ}(fock::Fock{:f})\nGraded{𝕊ᶻ ⊠ ℕ}(fock::Fock{:f})\n\nDecompose a local fermionic Fock space into an Abelian graded space that preserves 1, 2) no symmetry, 3) particle number symmetry, 4) spin-z component symmetry, and 5, 6) both particle-number and spin-z component symmetry.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumNumbers.Graded-Tuple{Spin}","page":"Quantum Systems","title":"QuantumLattices.QuantumNumbers.Graded","text":"Graded(spin::Spin)\nGraded{ℤ₁}(spin::Spin)\nGraded{𝕊ᶻ}(spin::Spin)\n\nDecompose a local spin space into an Abelian graded space that preserves 1, 2) no symmetry, and 3) spin-z component symmetry.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Coulomb","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Coulomb","text":"Coulomb(id::Symbol, value, bondkind, coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :))^2; ishermitian::Bool=true, amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nCoulomb term.\n\nType alias for Term{:Coulomb, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.DM","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.DM","text":"DM(\n id::Symbol,\n value,\n bondkind,\n vectors::Pair{<:AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}}, <:Union{Char, AbstractVector{<:Number}}}...;\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing,\n ismodulatable::Bool=true\n)\n\nDM term. Since DM term is antisymmetric on every bond, only the positive direction of a bond is needed. The negative direction of a bond can be handled automatically by this function.\n\nHere, vectors specify the unit DM vector on every bond in the form [bond₁, bond₂, ...]=>v, where bondᵢ can be\n\na Number specifying the azimuth angle of a bond in the 2-dimensional case, or\na Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or\nan AbstractVector{<:Number} specifying the direction of a bond;\n\nand v can be\n\na Char of 'x', 'y' or 'z', indicating the unit DM vector on the set of bonds is along the x, y or z direction, or\nan AbstractVector{<:Number}, specifying the direction of the DM vector on the set of bonds.\n\nType alias for Term{:DM, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Elastic","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Elastic","text":"Elastic(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nGeneric elastic energy of phonons.\n\nType alias for Term{:Elastic, id, V, B, C<:TermCoupling, A<:TermAmplitude}\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Fock","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Fock","text":"Fock{T} <: SimpleInternal{FockIndex{T, Int, Rational{Int}, Int}}\n\nFock space of Fock generators at a single point.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.FockIndex","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.FockIndex","text":"FockIndex{T, O<:Union{Int, Symbol, Colon}, S<:Union{Rational{Int}, Symbol, Colon}, N<:Union{Int, Symbol, Colon}} <: SimpleInternalIndex\n\nFock index, i.e., the internal index to specify the generators of a Fock space.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.FockIndex-Tuple{Union{Colon, Int64, Symbol}, Union{Colon, Rational{Int64}, Int64, Symbol}, Union{Colon, Int64, Symbol}}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.FockIndex","text":"FockIndex(orbital::Union{Int, Symbol, Colon}, spin::Union{Rational{Int}, Int, Symbol, Colon}, nambu::Union{Int, Symbol, Colon})\nFockIndex{T}(orbital::Union{Int, Symbol, Colon}, spin::Union{Rational{Int}, Int, Symbol, Colon}, nambu::Union{Int, Symbol, Colon}) where T\nFockIndex{T, O, S, N}(orbital::Union{Int, Symbol, Colon}, spin::Union{Rational{Int}, Symbol, Colon}, nambu::Union{Int, Symbol, Colon}) where {T, O, S, N}\n\nConstruct a Fock index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Heisenberg","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Heisenberg","text":"Heisenberg(id::Symbol, value, bondkind; form::Symbol=Symbol(\"+-z\"), amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nHeisenberg term.\n\nType alias for Term{:Heisenberg, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Hooke","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Hooke","text":"Hooke(id::Symbol, value, bondkind; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nPotential energy of phonons by the Hooke's law.\n\nType alias for Term{:Hooke, id, V, B, C<:TermCoupling, A<:TermAmplitude}\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Hopping","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Hopping","text":"Hopping(id::Symbol, value, bondkind, coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :)); amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nHopping term.\n\nType alias for Term{:Hopping, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Hubbard","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Hubbard","text":"Hubbard(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nHubbard term.\n\nType alias for Term{:Hubbard, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.InterOrbitalInterSpin","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.InterOrbitalInterSpin","text":"InterOrbitalInterSpin(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nInterorbital-interspin term.\n\nType alias for Term{:InterOrbitalInterSpin, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.InterOrbitalIntraSpin","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.InterOrbitalIntraSpin","text":"InterOrbitalIntraSpin(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nInterorbital-intraspin term.\n\nType alias for Term{:InterOrbitalIntraSpin, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Ising","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Ising","text":"Ising(id::Symbol, value, bondkind, direction::Char; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nIsing term.\n\nType alias for Term{:Ising, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Kinetic","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Kinetic","text":"Kinetic(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nKinetic energy of phonons.\n\nType alias for Term{:Kinetic, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Kitaev","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Kitaev","text":"Kitaev(\n id::Symbol, value, bondkind;\n x::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n y::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n z::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing,\n ismodulatable::Bool=true\n)\n\nKitaev term. Since Kitaev term is symmetric on every bond, only one direction of a bond is needed. The inverse direction of a bond can be handled automatically by this function.\n\nHere, x, y and z assign the x-bonds, y-bonds, and z-bonds, respectively, with each kind of bond can be\n\na Number specifying the azimuth angle of a bond in the 2-dimensional case, or\na Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or\nan AbstractVector{<:Number} specifying the direction of a bond.\n\nType alias for Term{:Kitaev, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Onsite","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Onsite","text":"Onsite(id::Symbol, value, coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :)); ishermitian::Bool=true, amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nOnsite term.\n\nType alias for Term{:Onsite, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.PairHopping","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.PairHopping","text":"PairHopping(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nPair-hopping term.\n\nType alias for Term{:PairHopping, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Pairing","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Pairing","text":"Pairing(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nPairing term.\n\nType alias for Term{:Pairing, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Phonon","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Phonon","text":"Phonon{K} <: SimpleInternal{PhononIndex{K, Char}}\n\nPhonon space of lattice vibration generators at a single point.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Phonon-Tuple{Integer}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Phonon","text":"Phonon(ndirection::Integer)\nPhonon{K}(ndirection::Integer) where K\n\nConstruct a phonon space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.PhononIndex","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.PhononIndex","text":"PhononIndex{K, D<:Union{Char, Symbol, Colon}} <: SimpleInternalIndex\n\nPhonon index, i.e., the internal index to specify the generators of the vibration of a lattice point.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.PhononIndex-Union{Tuple{Union{Colon, Char, Symbol}}, Tuple{D}, Tuple{K}} where {K, D}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.PhononIndex","text":"PhononIndex{K}(direction::Union{Char, Symbol, Colon}) where K\nPhononIndex{K, D}(direction::Union{Char, Symbol, Colon}) where {K, D}\n\nConstruct a phonon index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.SingleIonAnisotropy","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.SingleIonAnisotropy","text":"SingleIonAnisotropy(id::Symbol, value, direction::Char; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\nSingleIonAnisotropy(id::Symbol, value, matrix::AbstractMatrix{<:Number}; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nSingle ion anisotropy term.\n\nType alias for Term{:SingleIonAnisotropy, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Spin","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Spin","text":"Spin{S} <: SimpleInternal{SpinIndex{S, Char}}\n\nSpin space of spin generators at a single point.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.SpinFlip","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.SpinFlip","text":"SpinFlip(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nSpin-flip term.\n\nType alias for Term{:SpinFlip, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.SpinIndex","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.SpinIndex","text":"SpinIndex{S, T<:Union{Char, Symbol, Colon}} <: SimpleInternalIndex\n\nSpin index, i.e., the internal index to specify the generators of a spin space.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.SpinIndex-Tuple{Union{Colon, Char, Symbol}}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.SpinIndex","text":"SpinIndex(tag::Union{Char, Symbol, Colon})\nSpinIndex{S}(tag::Union{Char, Symbol, Colon}) where S\nSpinIndex{S, T}(tag::Union{Char, Symbol, Colon}) where {S, T}\n\nConstruct a spin index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.SpinTerm","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.SpinTerm","text":"SpinTerm(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true)\n\nGeneric spin term.\n\nType alias for Term{:SpinTerm, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Zeeman","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Zeeman","text":"Zeeman(\n id::Symbol, value, direction::Char, g::Number=1;\n amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true\n)\nZeeman(\n id::Symbol, value, direction::Union{AbstractVector{<:Number}, Tuple{Number, Number}}, g::Union{Number, AbstractMatrix{<:Number}}=1;\n unit::Symbol=:degree, amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true\n)\n\nZeeman term.\n\nType alias for Term{:Zeeman, id, V, Int, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Γ","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Γ","text":"Γ(\n id::Symbol, value, bondkind;\n x::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n y::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n z::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing,\n ismodulatable::Bool=true\n)\n\nΓ Term. Since Γ term is symmetric on every bond, only one direction of a bond is needed. The inverse direction of a bond can be handled automatically by this function.\n\nHere, x, y and z assign the x-bonds, y-bonds, and z-bonds, respectively, with each kind of bond can be\n\na Number specifying the azimuth angle of a bond in the 2-dimensional case, or\na Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or\nan AbstractVector{<:Number} specifying the direction of a bond.\n\nType alias for Term{:Γ, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.Γ′","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.Γ′","text":"Γ′(\n id::Symbol, value, bondkind;\n x::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n y::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n z::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing,\n ismodulatable::Bool=true\n)\n\nΓ′ Term. Since Γ′ term is symmetric on every bond, only one direction of a bond is needed. The inverse direction of a bond can be handled automatically by this function.\n\nHere, x, y and z assign the x-bonds, y-bonds, and z-bonds, respectively, with each bond can be\n\na Number specifying the azimuth angle of a bond in the 2-dimensional case, or\na Tuple{Number, Number} specifying the polar and azimuth angle pairs of a bond in the 3-dimensional case, or\nan AbstractVector{<:Number} specifying the direction of a bond.\n\nType alias for Term{:Γ′, id, V, B, C<:TermCoupling, A<:TermAmplitude}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕊","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕊","text":"𝕊(tag) -> SpinIndex\n𝕊(site, tag) -> Index{<:SpinIndex}\n𝕊(site, tag, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:SpinIndex}}\n\n𝕊{S}(tag) where S -> SpinIndex{S}\n𝕊{S}(site, tag) where S -> Index{<:SpinIndex{S}}\n𝕊{S}(site, tag, rcoordinate, icoordinate) where S -> CoordinatedIndex{<:Index{<:SpinIndex{S}}}\n\nConvenient construction of SpinIndex, Index{<:SpinIndex}, CoordinatedIndex{<:Index{<:SpinIndex}}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.@DM_str-Tuple{String}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.@DM_str","text":"DM\"x\" => SparseMatrixCSC([0 0 0; 0 0 1; 0 -1 0])\nDM\"y\" => SparseMatrixCSC([0 0 -1; 0 0 0; 1 0 0])\nDM\"z\" => SparseMatrixCSC([0 1 0; -1 0 0; 0 0 0])\n\nDM coupling matrix.\n\n\n\n\n\n","category":"macro"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.@Heisenberg_str-Tuple{String}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.@Heisenberg_str","text":"Heisenberg\"\" => SparseMatrixCSC([1 0 0; 0 1 0; 0 0 1])\n\nHeisenberg coupling matrix.\n\n\n\n\n\n","category":"macro"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.@Ising_str-Tuple{String}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.@Ising_str","text":"Ising\"x\" => SparseMatrixCSC([1 0 0; 0 0 0; 0 0 0])\nIsing\"y\" => SparseMatrixCSC([0 0 0; 0 1 0; 0 0 0])\nIsing\"z\" => SparseMatrixCSC([0 0 0; 0 0 0; 0 0 1])\n\nIsing coupling matrix.\n\n\n\n\n\n","category":"macro"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.@L_str-Tuple{String}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.@L_str","text":"L\"x\" => SparseMatrixCSC([0 0 0; 0 0 1im; 0 -1im 0])\nL\"y\" => SparseMatrixCSC([0 0 -1im; 0 0 0; 1im 0 0])\nL\"z\" => SparseMatrixCSC([0 1im 0; -1im 0 0; 0 0 0])\n\nThree-dimensional rotation generators.\n\n\n\n\n\n","category":"macro"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.@Γ_str-Tuple{String}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.@Γ_str","text":"Γ\"x\" => SparseMatrixCSC([0 0 0; 0 0 1; 0 1 0])\nΓ\"y\" => SparseMatrixCSC([0 0 1; 0 0 0; 1 0 0])\nΓ\"z\" => SparseMatrixCSC([0 1 0; 1 0 0; 0 0 0])\n\nΓ coupling matrix.\n\n\n\n\n\n","category":"macro"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.@Γ′_str-Tuple{String}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.@Γ′_str","text":"Γ′\"x\" => SparseMatrixCSC([0 1 1; 1 0 0; 1 0 0])\nΓ′\"y\" => SparseMatrixCSC([0 1 0; 1 0 1; 0 1 0])\nΓ′\"z\" => SparseMatrixCSC([0 0 1; 0 0 1; 1 1 0])\n\nΓ′ coupling matrix.\n\n\n\n\n\n","category":"macro"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.@σ_str-Tuple{String}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.@σ_str","text":"σ\"0\" => SparseMatrixCSC([1 0; 0 1])\nσ\"x\" => SparseMatrixCSC([0 1; 1 0])\nσ\"y\" => SparseMatrixCSC([0 -1im; 1im 0])\nσ\"z\" => SparseMatrixCSC([1 0; 0 -1])\nσ\"+\" => SparseMatrixCSC([0 1; 0 0])\nσ\"-\" => SparseMatrixCSC([0 0; 1 0])\nσ\"11\" => SparseMatrixCSC([1 0; 0 0])\nσ\"22\" => SparseMatrixCSC([0 0; 0 1])\n\nPauli matrix σ⁰, σˣ, σʸ, σᶻ, σ⁺, σ⁻, σ¹¹, σ²².\n\n\n\n\n\n","category":"macro"},{"location":"man/QuantumSystems/#Base.angle-Tuple{CoordinatedIndex{<:Index{<:FockIndex}}, AbstractVector{<:AbstractVector{<:Number}}, AbstractVector{<:Number}}","page":"Quantum Systems","title":"Base.angle","text":"angle(id::CoordinatedIndex{<:Index{<:FockIndex}}, vectors::AbstractVector{<:AbstractVector{<:Number}}, values::AbstractVector{<:Number}) -> Complex{<:Number}\n\nGet the twist phase.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.DegreesOfFreedom.patternrule-Union{Tuple{N}, Tuple{NTuple{N, Colon}, Val, Type{<:FockIndex}, Val{:nambu}}} where N","page":"Quantum Systems","title":"QuantumLattices.DegreesOfFreedom.patternrule","text":"patternrule(nambus::NTuple{N, Colon}, ::Val{}, ::Type{<:FockIndex}, ::Val{:nambu}) where N -> NTuple{N, Int}\n\nDefault pattern rule for the :nambu attribute of Fock indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumOperators.matrix-Union{Tuple{SpinIndex{S, Char}}, Tuple{S}, Tuple{SpinIndex{S, Char}, Type{<:Number}}} where S","page":"Quantum Systems","title":"QuantumLattices.QuantumOperators.matrix","text":"matrix(index::SpinIndex{S, Char}, dtype::Type{<:Number}=Complex{Float}) where S -> Matrix{dtype}\nmatrix(index::Index{<:SpinIndex}, dtype::Type{<:Number}=Complex{Float}) -> Matrix{dtype}\nmatrix(index::CompositeIndex{<:Index{<:SpinIndex}}, dtype::Type{<:Number}=Complex{Float}) -> Matrix{dtype}\n\nGet the matrix representation of an index acting on the local 𝕊ᶻ space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumOperators.script-Tuple{FockIndex, Val{:orbital}}","page":"Quantum Systems","title":"QuantumLattices.QuantumOperators.script","text":"script(index::FockIndex, ::Val{:orbital}; kwargs...) -> String\nscript(index::FockIndex, ::Val{:spin}; kwargs...) -> String\nscript(index::FockIndex, ::Val{:spinsym}; kwargs...) -> String\nscript(index::FockIndex, ::Val{:nambu}; kwargs...) -> String\n\nGet the requested script of a Fock index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumOperators.script-Union{Tuple{K}, Tuple{PhononIndex{K, Colon}, Val{:direction}}} where K","page":"Quantum Systems","title":"QuantumLattices.QuantumOperators.script","text":"script(index::PhononIndex, ::Val{:direction}; kwargs...) -> String\n\nGet the requested script of a phonon index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumOperators.script-Union{Tuple{S}, Tuple{SpinIndex{S, Colon}, Val{:tag}}} where S","page":"Quantum Systems","title":"QuantumLattices.QuantumOperators.script","text":"script(index::SpinIndex, ::Val{:tag}; kwargs...) -> String\n\nGet the requested script of a spin index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.isannihilation-Tuple{FockIndex}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.isannihilation","text":"isannihilation(index::FockIndex) -> Bool\nisannihilation(index::Index) -> Bool\nisannihilation(index::CompositeIndex) -> Bool\n\nJudge whether the nambu index is annihilation.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.iscreation-Tuple{FockIndex}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.iscreation","text":"iscreation(index::FockIndex) -> Bool\niscreation(index::Index) -> Bool\niscreation(index::CompositeIndex) -> Bool\n\nJudge whether the nambu index is creation.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.isnormalordered-Tuple{Operator{<:Number, <:NTuple{N, CompositeIndex{<:Index{<:FockIndex}}} where N}}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.isnormalordered","text":"isnormalordered(opt::Operator{<:Number, <:ID{CompositeIndex{<:Index{<:FockIndex}}}}) -> Bool\n\nJudge whether an operator is normal ordered.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.totalspin-Tuple{SpinIndex}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.totalspin","text":"totalspin(::SpinIndex) -> Rational{Int}/Int/Colon\ntotalspin(::Type{<:SpinIndex}) -> Rational{Int}/Int/Colon/Float64\n\ntotalspin(::Index{<:SpinIndex}) -> Rational{Int}/Int/Colon\ntotalspin(::Type{<:Index{<:SpinIndex}}) -> Rational{Int}/Int/Colon/Float64\n\ntotalspin(::CompositeIndex{<:Index{<:SpinIndex}}) -> Rational{Int}/Int/Colon\ntotalspin(::Type{<:CompositeIndex{<:Index{<:SpinIndex}}}) -> Rational{Int}/Int/Colon/Float64\n\nGet the total spin.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.totalspin-Tuple{Spin}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.totalspin","text":"totalspin(::Spin) -> Rational{Int}/Int/Colon\ntotalspin(::Type{<:Spin}) -> Rational{Int}/Int/Colon\n\nGet the total spin.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕊ᵀ𝕊-Tuple{Union{Colon, Tuple{Ordinal, Ordinal}}, AbstractMatrix}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕊ᵀ𝕊","text":"𝕊ᵀ𝕊(sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::AbstractVector=SVector('x', 'y', 'z'), cols::AbstractVector=SVector('x', 'y', 'z')) -> MatrixCoupling\n\nConstruct a matrix coupling for spin system.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕓","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕓","text":"𝕓(orbital, spin, nambu) -> FockIndex{:b}\n𝕓(site, orbital, spin, nambu) -> Index{<:FockIndex{:b}}\n𝕓(site, orbital, spin, nambu, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:FockIndex{:b}}}\n\nConvenient construction of FockIndex{:b}, Index{<:FockIndex{:b}}, CoordinatedIndex{<:Index{<:FockIndex{:b}}}.\n\n\n\n\n\n","category":"function"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕕","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕕","text":"𝕕(orbital, spin, nambu) -> FockIndex{:}\n𝕕(site, orbital, spin, nambu) -> Index{<:FockIndex{:}}\n𝕕(site, orbital, spin, nambu, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:FockIndex{:}}}\n\nConvenient construction of FockIndex{:}, Index{<:FockIndex{:}}, CoordinatedIndex{<:Index{<:FockIndex{:}}}.\n\n\n\n\n\n","category":"function"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕗","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕗","text":"𝕗(orbital, spin, nambu) -> FockIndex{:f}\n𝕗(site, orbital, spin, nambu) -> Index{<:FockIndex{:f}}\n𝕗(site, orbital, spin, nambu, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:FockIndex{:f}}}\n\nConvenient construction of FockIndex{:f}, Index{<:FockIndex{:f}}, CoordinatedIndex{<:Index{<:FockIndex{f}}}.\n\n\n\n\n\n","category":"function"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕗⁺𝕗-Tuple{Union{Colon, Tuple{Ordinal, Ordinal}}, Union{Colon, AbstractMatrix}, Union{Colon, AbstractMatrix}, Union{Colon, AbstractMatrix}}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕗⁺𝕗","text":"𝕗⁺𝕗(sites::Union{NTuple{2, Ordinal}, Colon}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon}) -> MatrixCoupling\n𝕓⁺𝕓(sites::Union{NTuple{2, Ordinal}, Colon}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon}) -> MatrixCoupling\n𝕕⁺𝕕(sites::Union{NTuple{2, Ordinal}, Colon}, orbital::Union{AbstractMatrix, Colon}, spin::Union{AbstractMatrix, Colon}, nambu::Union{AbstractMatrix, Colon}) -> MatrixCoupling\n\nConstruct a matrix coupling for Fock systems.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕡-Tuple{Any}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕡","text":"𝕡(direction) -> PhononIndex{:p}\n𝕡(site, direction) -> Index{<:PhononIndex{:p}}\n𝕡(site, direction, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:PhononIndex{:p}}}\n\nConvenient construction of SpinIndex{:p}, Index{<:SpinIndex{:p}}, CoordinatedIndex{<:Index{<:SpinIndex{:p}}}.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕦-Tuple{Any}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕦","text":"𝕦(direction) -> PhononIndex{:u}\n𝕦(site, direction) -> Index{<:PhononIndex{:u}}\n𝕦(site, direction, rcoordinate, icoordinate) -> CoordinatedIndex{<:Index{<:PhononIndex{:u}}}\n\nConvenient construction of SpinIndex{:u}, Index{<:SpinIndex{:u}}, CoordinatedIndex{<:Index{<:SpinIndex{:u}}}.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.QuantumSystems.𝕦ᵀ𝕦-Tuple{Union{Colon, Tuple{Ordinal, Ordinal}}, AbstractMatrix}","page":"Quantum Systems","title":"QuantumLattices.QuantumSystems.𝕦ᵀ𝕦","text":"𝕦ᵀ𝕦(sites::Union{NTuple{2, Ordinal}, Colon}, matrix::AbstractMatrix; rows::Union{AbstractVector, Nothing}=nothing, cols::Union{AbstractVector, Nothing}=nothing) -> MatrixCoupling\n\nConstruct a set of Couplings corresponding to the dynamical matrix of phonons.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.expand-Tuple{Coupling{<:Number, <:Pattern{<:InternalPattern{var\"#s119\", P, N} where {var\"#s119\"<:Tuple{PhononIndex{:u}, PhononIndex{:u}}, P, N}}}, Val{:Hooke}, Bond, Hilbert}","page":"Quantum Systems","title":"QuantumLattices.expand","text":"expand(pnc::Coupling{<:Number, <:Pattern{<:InternalPattern{<:NTuple{2, PhononIndex{:u}}}}}, ::Val{:Hooke}, bond::Bond, hilbert::Hilbert) -> VectorSpace\n\nExpand the default phonon potential coupling on a given bond.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.kind-Tuple{PhononIndex}","page":"Quantum Systems","title":"QuantumLattices.kind","text":"kind(index::PhononIndex) -> Symbol\nkind(::Type{<:PhononIndex{K}}) where K -> Symbol\n\nkind(index::Index{<:PhononIndex}) -> Symbol\nkind(::Type{<:Index{<:PhononIndex{K}}}) where K -> Symbol\n\nkind(index::CoordinatedIndex{<:Index{<:PhononIndex}}) -> Symbol\nkind(::Type{<:CoordinatedIndex{<:Index{<:PhononIndex{K}}}}) where K -> Symbol\n\nGet the kind of a phonon index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.kind-Tuple{Phonon}","page":"Quantum Systems","title":"QuantumLattices.kind","text":"kind(pn::Phonon)\nkind(::Type{<:Phonon{K}}) where K\n\nGet the kind of a phonon space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.permute-Tuple{FockIndex{:f}, FockIndex{:f}}","page":"Quantum Systems","title":"QuantumLattices.permute","text":"permute(id₁::FockIndex, id₂::FockIndex) -> Tuple{Vararg{Operator}}\n\nPermute two Fock indexes and get the result.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.permute-Tuple{PhononIndex, PhononIndex}","page":"Quantum Systems","title":"QuantumLattices.permute","text":"permute(id₁::PhononIndex, id₂::PhononIndex) -> Tuple{Vararg{Operator}}\n\nPermute two phonon indexes and get the result.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumSystems/#QuantumLattices.permute-Tuple{SpinIndex, SpinIndex}","page":"Quantum Systems","title":"QuantumLattices.permute","text":"permute(id₁::SpinIndex, id₂::SpinIndex) -> Tuple{Vararg{Operator}}\n\nPermute two spin indexes and get the result.\n\n\n\n\n\n","category":"method"},{"location":"advanced topics/Transformations/","page":"Transformations","title":"Transformations","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"advanced topics/Transformations/#Transformations","page":"Transformations","title":"Transformations","text":"","category":"section"},{"location":"man/Frameworks/","page":"Frameworks","title":"Frameworks","text":"CurrentModule = QuantumLattices.Frameworks","category":"page"},{"location":"man/Frameworks/#Frameworks","page":"Frameworks","title":"Frameworks","text":"","category":"section"},{"location":"man/Frameworks/","page":"Frameworks","title":"Frameworks","text":"Modules = [Frameworks]\nOrder = [:module, :constant, :type, :macro, :function]","category":"page"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.OneOrMore","page":"Frameworks","title":"QuantumLattices.Frameworks.OneOrMore","text":"const OneOrMore{A} = Union{A, Tuple{A, Vararg{A}}}\n\nOne or more something.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.OneOrMore-Tuple{Any}","page":"Frameworks","title":"QuantumLattices.Frameworks.OneOrMore","text":"OneOrMore(x) -> Tuple{typeof(x)}\nOneOrMore(x::Tuple) -> typeof(x)\n\nIf x is a tuple, return itself; if not, return (x,).\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.eager","page":"Frameworks","title":"QuantumLattices.Frameworks.eager","text":"const eager = Eager()\n\nSingleton instance of Eager.\n\n\n\n\n\n","category":"constant"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.lazy","page":"Frameworks","title":"QuantumLattices.Frameworks.lazy","text":"const lazy = Lazy()\n\nSingleton instance of Lazy.\n\n\n\n\n\n","category":"constant"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Action","page":"Frameworks","title":"QuantumLattices.Frameworks.Action","text":"Action\n\nAbstract type for all actions.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Algorithm","page":"Frameworks","title":"QuantumLattices.Frameworks.Algorithm","text":"Algorithm{F<:Frontend, P<:Parameters, M<:Function} <: Function\n\nAn algorithm associated with an frontend.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Algorithm-Tuple{Assignment}","page":"Frameworks","title":"QuantumLattices.Frameworks.Algorithm","text":"(alg::Algorithm)(assign::Assignment) -> Tuple{Algorithm, Assignment}\n(assign::Assignment)(alg::Algorithm) -> Tuple{Algorithm, Assignment}\n\nRun an assignment based on an algorithm.\n\nThe difference between these two methods is that the first uses the parameters of assign as the current parameters while the second uses those of alg.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Algorithm-Tuple{Symbol, Action}","page":"Frameworks","title":"QuantumLattices.Frameworks.Algorithm","text":"(alg::Algorithm)(id::Symbol, action::Action; info::Bool=true, kwargs...) -> Tuple{Algorithm, Assignment}\n\nAdd an assignment on a algorithm by providing the contents of the assignment, and run this assignment.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Algorithm-Tuple{Symbol, Frontend}","page":"Frameworks","title":"QuantumLattices.Frameworks.Algorithm","text":"Algorithm(name::Symbol, frontend::Frontend; din::String=\".\", dout::String=\".\", parameters::Parameters=Parameters(frontend), map::Function=identity)\n\nConstruct an algorithm.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Algorithm-Tuple{Symbol}","page":"Frameworks","title":"QuantumLattices.Frameworks.Algorithm","text":"(alg::Algorithm)(id::Symbol; info::Bool=true, parameters::Parameters=Parameters{()}()) -> Tuple{Algorithm, Assignment}\n\nRun an assignment specified by its id.\n\nOptionally, the time of the run process can be informed by setting the info argument to be true.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Assignment","page":"Frameworks","title":"QuantumLattices.Frameworks.Assignment","text":"Assignment{A<:Action, P<:Parameters, M<:Function, N, D} <: Function\n\nAn assignment associated with an action.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.CategorizedGenerator","page":"Frameworks","title":"QuantumLattices.Frameworks.CategorizedGenerator","text":"CategorizedGenerator{V, C, A<:NamedTuple, B<:NamedTuple, P<:Parameters, D<:Boundary, S<:ExpansionStyle} <: Generator{V}\n\nCategorized generator that groups the (representations of) quantum operators in a quantum lattice system into three categories, i.e., the constant, the alterable, and the boundary.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Eager","page":"Frameworks","title":"QuantumLattices.Frameworks.Eager","text":"Eager <: ExpansionStyle\n\nEager expansion style with eager computation so that similar terms are combined in the final result.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.ExpansionStyle","page":"Frameworks","title":"QuantumLattices.Frameworks.ExpansionStyle","text":"ExpansionStyle\n\nExpansion style of a generator of (representations of) quantum operators. It has two singleton subtypes, Eager and Lazy.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Formula","page":"Frameworks","title":"QuantumLattices.Frameworks.Formula","text":"Formula{V, F<:Function, P<:Parameters}\n\nRepresentation of a quantum lattice system with an explicit analytical formula.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Formula-Tuple","page":"Frameworks","title":"QuantumLattices.Frameworks.Formula","text":"(formula::Formula)(args...; kwargs...) -> valtype(formula)\n\nGet the result of a Formula.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Frontend","page":"Frameworks","title":"QuantumLattices.Frameworks.Frontend","text":"Frontend\n\nFrontend of algorithms applied to a quantum lattice system.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Generator","page":"Frameworks","title":"QuantumLattices.Frameworks.Generator","text":"Generator{V}\n\nGenerator of (representations of) quantum operators in a quantum lattice system.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Generator-Tuple{Any, NamedTuple, NamedTuple, NamedTuple{Names, T} where {Names, T<:Tuple{Vararg{Number}}}, Boundary, ExpansionStyle}","page":"Frameworks","title":"QuantumLattices.Frameworks.Generator","text":"Generator(constops, alterops::NamedTuple, boundops::NamedTuple, parameters::Parameters, boundary::Boundary, style::ExpansionStyle) -> CategorizedGenerator\n\nConstruct a CategorizedGenerator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Generator-Tuple{CategorizedGenerator{<:Operators}, Vector{<:Bond}, Hilbert, Union{Tuple{Term, Vararg{Term}}, Term}, Bool}","page":"Frameworks","title":"QuantumLattices.Frameworks.Generator","text":"Generator(operators::CategorizedGenerator{<:Operators}, bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, half::Bool) -> OperatorGenerator\nGenerator(bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, boundary::Boundary=plain, style::ExpansionStyle=eager; half::Bool=false) -> OperatorGenerator\n\nConstruct an OperatorGenerator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Lazy","page":"Frameworks","title":"QuantumLattices.Frameworks.Lazy","text":"Lazy <: ExpansionStyle\n\nLazy expansion style with lazy computation so that similar terms are not combined in the final result.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.OperatorGenerator","page":"Frameworks","title":"QuantumLattices.Frameworks.OperatorGenerator","text":"OperatorGenerator(bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, boundary::Boundary=plain, style::ExpansionStyle=eager; half::Bool=false)\n\nConstruct a generator of quantum operators based on the input bonds, Hilbert space, terms and (twisted) boundary condition.\n\nWhen the boundary condition is plain, the boundary operators will be set to be empty for simplicity and efficiency.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.OperatorGenerator-2","page":"Frameworks","title":"QuantumLattices.Frameworks.OperatorGenerator","text":"OperatorGenerator{V<:Operators, CG<:CategorizedGenerator{V}, B<:Bond, H<:Hilbert, TS<:Tuple{Vararg{Term}}} <: Generator{V}\n\nA generator of operators based on the terms, bonds and Hilbert space of a quantum lattice system.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Parameters","page":"Frameworks","title":"QuantumLattices.Frameworks.Parameters","text":"Parameters{Names}(values::Number...) where Names\n\nA NamedTuple that contains the key-value pairs.\n\n\n\n\n\n","category":"type"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Parameters-Tuple{Boundary}","page":"Frameworks","title":"QuantumLattices.Frameworks.Parameters","text":"Parameters(bound::Boundary)\n\nGet the parameters of the twisted boundary condition.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Parameters-Tuple{CategorizedGenerator}","page":"Frameworks","title":"QuantumLattices.Frameworks.Parameters","text":"Parameters(cat::CategorizedGenerator)\n\nGet the complete set of parameters of a categorized generator of (representations of) quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Parameters-Tuple{Formula}","page":"Frameworks","title":"QuantumLattices.Frameworks.Parameters","text":"Parameters(formula::Formula) -> Parameters\n\nGet the parameters of a Formula.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Parameters-Tuple{OperatorGenerator}","page":"Frameworks","title":"QuantumLattices.Frameworks.Parameters","text":"Parameters(gen::OperatorGenerator) -> Parameters\n\nGet the parameters of an OperatorGenerator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.Parameters-Tuple{OperatorSet}","page":"Frameworks","title":"QuantumLattices.Frameworks.Parameters","text":"Parameters(ops::OperatorSet) -> NamedTuple{(), Tuple{}}\n\nGet the parameters of an OperatorSet, which is defined to be an empty NamedTuple.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.QuantumOperators.LinearTransformation-Tuple{CategorizedGenerator}","page":"Frameworks","title":"QuantumLattices.QuantumOperators.LinearTransformation","text":"(transformation::LinearTransformation)(cat::CategorizedGenerator; kwargs...) -> CategorizedGenerator\n\nApply a linear transformation to a categorized generator of (representations of) quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.QuantumOperators.Transformation-Tuple{OperatorGenerator}","page":"Frameworks","title":"QuantumLattices.QuantumOperators.Transformation","text":"(transformation::Transformation)(gen::OperatorGenerator; kwargs...) -> CategorizedGenerator\n\nGet the transformation applied to a generator of quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.:*-Tuple{CategorizedGenerator, Any}","page":"Frameworks","title":"Base.:*","text":"*(cat::CategorizedGenerator, factor) -> CategorizedGenerator\n*(factor, cat::CategorizedGenerator) -> CategorizedGenerator\n\nMultiply a categorized generator of (representations of) quantum operators with a factor.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.:+-Tuple{CategorizedGenerator, CategorizedGenerator}","page":"Frameworks","title":"Base.:+","text":"+(cat₁::CategorizedGenerator, cat₂::CategorizedGenerator) -> CategorizedGenerator\n\nAddition of two categorized generators of (representations of) quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.eltype-Tuple{Generator}","page":"Frameworks","title":"Base.eltype","text":"eltype(gen::Generator)\neltype(::Type{T}) where {T<:Generator}\n\nGet the eltype of a Generator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.empty-Tuple{CategorizedGenerator}","page":"Frameworks","title":"Base.empty","text":"empty(cat::CategorizedGenerator) -> CategorizedGenerator\nempty!(cat::CategorizedGenerator) -> CategorizedGenerator\n\nGet an empty copy of a categorized generator or empty a categorized generator of (representations of) quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.empty-Tuple{OperatorGenerator}","page":"Frameworks","title":"Base.empty","text":"empty(gen::OperatorGenerator) -> OperatorGenerator\nempty!(gen::OperatorGenerator) -> OperatorGenerator\n\nGet an empty copy of or empty an operator generator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.isempty-Tuple{CategorizedGenerator}","page":"Frameworks","title":"Base.isempty","text":"isempty(cat::CategorizedGenerator) -> Bool\n\nJudge whether a categorized generator is empty.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.isempty-Tuple{OperatorGenerator}","page":"Frameworks","title":"Base.isempty","text":"isempty(gen::OperatorGenerator) -> Bool\n\nJudge whether an OperatorGenerator is empty.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.iterate-Tuple{Generator}","page":"Frameworks","title":"Base.iterate","text":"iterate(gen::Generator)\niterate(::Generator, state)\n\nIterate over a Generator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.match-Tuple{NamedTuple{Names, T} where {Names, T<:Tuple{Vararg{Number}}}, NamedTuple{Names, T} where {Names, T<:Tuple{Vararg{Number}}}}","page":"Frameworks","title":"Base.match","text":"match(params₁::Parameters, params₂::Parameters; atol=atol, rtol=rtol) -> Bool\n\nJudge whether the second set of parameters matches the first.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.nameof-Tuple{Algorithm, Assignment}","page":"Frameworks","title":"Base.nameof","text":"nameof(alg::Algorithm, assign::Assignment) -> String\n\nGet the name of the combination of an algorithm and an assignment.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.show-Tuple{IO, Algorithm}","page":"Frameworks","title":"Base.show","text":"show(io::IO, alg::Algorithm)\n\nShow an algorithm.\n\nOptionally, some parameters of the algorithm can be filtered by specifying the :select context in io. Besides, the maximum number of decimals of the parameters can also be specified by the :ndecimal context in io.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.summary-Tuple{Algorithm}","page":"Frameworks","title":"Base.summary","text":"summary(alg::Algorithm)\n\nProvide a summary of an algorithm.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.valtype-Tuple{Assignment}","page":"Frameworks","title":"Base.valtype","text":"valtype(assign::Assignment)\nvaltype(::Type{<:Assignment})\n\nType of the data (result) of an assignment.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.valtype-Tuple{Formula}","page":"Frameworks","title":"Base.valtype","text":"valtype(formula::Formula)\nvaltype(::Type{<:Formula{V}})\n\nGet the valtype of a Formula.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#Base.valtype-Tuple{Generator}","page":"Frameworks","title":"Base.valtype","text":"valtype(gen::Generator)\nvaltype(::Type{<:Generator{V}}) where V\n\nGet the valtype of a Generator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Frameworks.prepare!","page":"Frameworks","title":"QuantumLattices.Frameworks.prepare!","text":"prepare!(alg::Algorithm, assign::Assignment, f::Function=assign->true) -> Tuple{Algorithm, Assignment}\n\nRun the dependencies of an assignment.\n\nOptionally, some dependencies can be filtered by specifying the f function.\n\n\n\n\n\n","category":"function"},{"location":"man/Frameworks/#QuantumLattices.QuantumOperators.scalartype-Union{Tuple{Type{F}}, Tuple{F}} where F<:Formula","page":"Frameworks","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(::Type{F}) where {F<:Formula}\n\nGet the scalar type of a Formula.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.QuantumOperators.scalartype-Union{Tuple{Type{T}}, Tuple{T}} where T<:Generator","page":"Frameworks","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(::Type{T}) where {T<:Generator}\n\nGet the scalar type of a Generator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.Spatials.save-Tuple{Algorithm, Assignment}","page":"Frameworks","title":"QuantumLattices.Spatials.save","text":"save(alg::Algorithm, assign::Assignment; delimited=false) -> Tuple{Algorithm, Assignment}\n\nSave the data of an assignment registered on an algorithm.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.add!-Tuple{Algorithm, Symbol, Action}","page":"Frameworks","title":"QuantumLattices.add!","text":"add!(alg::Algorithm, id::Symbol, action::Action; parameters::Parameters=Parameters{()}(), map::Function=identity, dependencies::Tuple=(), kwargs...) -> Tuple{Algorithm, Assignment}\n\nAdd an assignment on an algorithm by providing the contents of the assignment without the execution of it.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.expand!-Tuple{Any, Generator}","page":"Frameworks","title":"QuantumLattices.expand!","text":"expand!(result, gen::Generator) -> typeof(result)\n\nExpand the generator to add the (representations of) quantum operators in a quantum lattice system to result.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.expand-Tuple{CategorizedGenerator, Lazy}","page":"Frameworks","title":"QuantumLattices.expand","text":"expand(cat::CategorizedGenerator, ::Lazy)\n\nExpand a categorized generator to get the (representations of) quantum operators in a quantum lattice system.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.expand-Tuple{Generator}","page":"Frameworks","title":"QuantumLattices.expand","text":"expand(gen::Generator)\nexpand(gen::Generator, ::Eager)\nexpand(gen::Generator, ::Lazy)\n\nExpand the generator to get the (representations of) quantum operators in a quantum lattice system.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.expand-Tuple{OperatorGenerator, Symbol}","page":"Frameworks","title":"QuantumLattices.expand","text":"expand(gen::OperatorGenerator, name::Symbol) -> Operators\nexpand(gen::OperatorGenerator, i::Int) -> Operators\nexpand(gen::OperatorGenerator, name::Symbol, i::Int) -> Operators\n\nExpand an operator generator to get:\n\nthe operators of a specific term;\nthe operators on a specific bond;\nthe operators of a specific term on a specific bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.reset!-Tuple{CategorizedGenerator, LinearTransformation, CategorizedGenerator{<:Operators}}","page":"Frameworks","title":"QuantumLattices.reset!","text":"reset!(cat::CategorizedGenerator, transformation::LinearTransformation, source::CategorizedGenerator{<:Operators}; kwargs...)\n\nReset a categorized generator by its source categorized generator of (representations of) quantum operators and the corresponding linear transformation.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.reset!-Tuple{OperatorGenerator, AbstractVector{<:Bond}, Hilbert}","page":"Frameworks","title":"QuantumLattices.reset!","text":"reset!(gen::OperatorGenerator, bonds::AbstractVector{<:Bond}, hilbert::Hilbert; vectors::AbstractVector{<:AbstractVector}=gen.operators.boundary.vectors) -> OperatorGenerator\n\nReset an operator generator by a new lattice and the corresponding new hilbert space.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.update!-Tuple{Algorithm}","page":"Frameworks","title":"QuantumLattices.update!","text":"update!(alg::Algorithm; parameters...) -> Algorithm\n\nUpdate the parameters of an algorithm and its associated frontend.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.update!-Tuple{Assignment}","page":"Frameworks","title":"QuantumLattices.update!","text":"update!(assign::Assignment; parameters...) -> Assignment\n\nUpdate the parameters of an assignment and the status of its associated action.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.update!-Tuple{CategorizedGenerator, LinearTransformation, CategorizedGenerator{<:Operators}}","page":"Frameworks","title":"QuantumLattices.update!","text":"update!(cat::CategorizedGenerator, transformation::LinearTransformation, source::CategorizedGenerator{<:Operators}; kwargs...) -> CategorizedGenerator\n\nUpdate the parameters (including the boundary parameters) of a categorized generator based on its source categorized generator of (representations of) quantum operators and the corresponding linear transformation.\n\n!!! Note The coefficients of boundops are also updated due to the change of the boundary parameters.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.update!-Tuple{CategorizedGenerator{<:OperatorSum}}","page":"Frameworks","title":"QuantumLattices.update!","text":"update!(cat::CategorizedGenerator{<:OperatorSum}; parameters...) -> CategorizedGenerator\n\nUpdate the parameters (including the boundary parameters) of a categorized generator of (representations of) quantum operators.\n\n!!! Note The coefficients of boundops are also updated due to the change of the boundary parameters.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.update!-Tuple{Formula}","page":"Frameworks","title":"QuantumLattices.update!","text":"update!(formula::Formula; parameters...) -> Formula\n\nUpdate the parameters of a Formula in place and return itself after update.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.update!-Tuple{OperatorGenerator}","page":"Frameworks","title":"QuantumLattices.update!","text":"update!(gen::OperatorGenerator; parameters...) -> typeof(gen)\n\nUpdate the coefficients of the terms in a generator.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#QuantumLattices.update-Tuple{NamedTuple}","page":"Frameworks","title":"QuantumLattices.update","text":"update(params::NamedTuple; parameters...) -> Parameters\n\nUpdate a set of Parameters and return the updated one.\n\n\n\n\n\n","category":"method"},{"location":"man/Frameworks/#RecipesBase.apply_recipe-Tuple{AbstractDict{Symbol, Any}, Tuple{Algorithm, Assignment}}","page":"Frameworks","title":"RecipesBase.apply_recipe","text":"@recipe plot(pack::Tuple{Algorithm, Assignment})\n\nDefine the recipe for the visualization of an assignment of an algorithm.\n\n\n\n\n\n","category":"method"},{"location":"advanced topics/HybridSystems/","page":"Hybrid systems","title":"Hybrid systems","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"advanced topics/HybridSystems/#Hybrid-systems","page":"Hybrid systems","title":"Hybrid systems","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"CurrentModule = QuantumLattices.Toolkit\nDocTestFilters = [r\"var\\\".*\\\"\", r\"generic function with [0-9]* method\", r\".*s \\(.*\\% GC\\)\", r\"evals/sample:.*\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../../src/\")\n using QuantumLattices.Toolkit\n import QuantumLattices.Toolkit: isparameterbound, parameternames, contentnames, getcontent\nend","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"push!(LOAD_PATH, \"../../../src/\")\nusing QuantumLattices.Toolkit","category":"page"},{"location":"man/Toolkit/#Toolkit","page":"Toolkit","title":"Toolkit","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"This module contains the toolkit of the package.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The constants, types, macros, functions defined in this module will not be exported by the package. Instead, they serve as the prerequisites. The range of the contents are quite wide, but basically, they fall into two categories:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Utilities, such as global constants and miscellaneous tiny useful functions;\nBasic data structures as supplements to the Julia.Base and other common packages.","category":"page"},{"location":"man/Toolkit/#Utilities","page":"Toolkit","title":"Utilities","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"atol\nrtol\nFloat\nconcatenate\ntostr\nsubscript\nsuperscript\ndelta\nid\nvalue\nDirectSummedIndices\nSegment","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.atol","page":"Toolkit","title":"QuantumLattices.Toolkit.atol","text":"Absolute tolerance for float numbers.\n\n\n\n\n\n","category":"constant"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.rtol","page":"Toolkit","title":"QuantumLattices.Toolkit.rtol","text":"Relative tolerance for float numbers.\n\n\n\n\n\n","category":"constant"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.Float","page":"Toolkit","title":"QuantumLattices.Toolkit.Float","text":"Default float type.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.concatenate","page":"Toolkit","title":"QuantumLattices.Toolkit.concatenate","text":"concatenate(ts::Tuple...) -> Tuple\n\nConcatenate tuples.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.tostr","page":"Toolkit","title":"QuantumLattices.Toolkit.tostr","text":"tostr(number, ::Integer=5) -> String\ntostr(number::Integer, n::Integer=5) -> String\ntostr(number::Rational, n::Integer=5) -> String\ntostr(number::AbstractFloat, n::Integer=5) -> String\ntostr(number::Complex, n::Integer=5) -> String\n\nConvert a number to a string with at most n decimal places.\n\n\n\n\n\ntostr(value::Symbol) -> String\ntostr(value::Colon) -> String\ntostr(value::Char) -> String\n\nConvert a single value to string.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.subscript","page":"Toolkit","title":"QuantumLattices.Toolkit.subscript","text":"subscript(i::Integer) -> String\n\nConvert an integer to the subscript.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.superscript","page":"Toolkit","title":"QuantumLattices.Toolkit.superscript","text":"superscript(i::Integer) -> String\n\nConvert an integer to the superscript.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.delta","page":"Toolkit","title":"QuantumLattices.Toolkit.delta","text":"delta(i, j) -> Int\n\nKronecker delta function.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.id","page":"Toolkit","title":"QuantumLattices.id","text":"id(od::OrderedDict, i) -> keytype(od)\n\nGet the ith key of an OrderedDict.\n\n\n\n\n\nid(m::OperatorPack) -> idtype(m)\n\nGet the id of an OperatorPack.\n\n\n\n\n\nid(term::Term) -> Symbol\nid(::Type{<:Term) -> Symbol\n\nGet the id of a term.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.value","page":"Toolkit","title":"QuantumLattices.value","text":"value(od::OrderedDict, i) -> valtype(od)\n\nGet the ith value of an OrderedDict.\n\n\n\n\n\nvalue(m::OperatorPack) -> valtype(m)\n\nGet the value of an OperatorPack.\n\n\n\n\n\nvalue(qn::SimpleAbelianQuantumNumber) -> Number\n\nGet the value of a simple Abelian quantum number.\n\n\n\n\n\nvalue(qn::AbelianQuantumNumberProd, i::Integer) -> Number\n\nGet the value of the ith simple Abelian quantum number in a Deligne tensor product.\n\n\n\n\n\nvalue(term::Term) -> valtype(term)\n\nGet the value of a term.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.DirectSummedIndices","page":"Toolkit","title":"QuantumLattices.Toolkit.DirectSummedIndices","text":"DirectSummedIndices{T<:Tuple{Vararg{OrdinalRange{Int, Int}}}} <: AbstractVector{CartesianIndex{3}}\n\nDirect sum of indexes.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.Segment","page":"Toolkit","title":"QuantumLattices.Toolkit.Segment","text":"Segment{S} <: AbstractVector{S}\n\nA segment.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#Combinatorics","page":"Toolkit","title":"Combinatorics","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The combinations and permutations of an indexable object are implemented, with duplicate elements allowed or not. Compared to another Julia package Combinatorics, the iterators return tuples instead of vectors, which could greatly decrease the memory allocation times and improves the code efficiency.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Combinatorics{M, C} is the abstract type of all combinatorial algorithms. It has two type parameters:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"M: the number of elements to be taken\nC: the type of the collection of candidate elements","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"To avoid memory allocation, the iteration of a concrete combinatorial algorithm returns a tuple, whose length is M and eltype is eltype(C).","category":"page"},{"location":"man/Toolkit/#Combinations-and-DuplicateCombinations","page":"Toolkit","title":"Combinations and DuplicateCombinations","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Combinations{M, C} and DuplicateCombinations{M, C} generate all the combinations of M elements from an indexable collection whose type is C, with the differences being that the former forbids duplicate elements in the combinations while the latter allows.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"All combinations of 2 integers taken from 1 to 3 without duplicate:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Combinations{2}(1:3) |> collect","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"All combinations of 2 integers taken from 1 to 3 with duplicate allowed:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"DuplicateCombinations{2}(1:3) |> collect","category":"page"},{"location":"man/Toolkit/#Permutations-and-DuplicatePermutations","page":"Toolkit","title":"Permutations and DuplicatePermutations","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Permutations{M, C} and DuplicatePermutations{M, C} generate all the permutations of M elements from an indexable collection whose type is C, with the differences being that the former forbids duplicate elements in the permutations while the latter allows.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"All permutations of 2 integers taken from 1 to 3 without duplicate:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Permutations{2}(1:3) |> collect","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"All permutations of 2 integers taken from 1 to 3 with duplicate allowed:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"DuplicatePermutations{2}(1:3) |> collect","category":"page"},{"location":"man/Toolkit/#Manual","page":"Toolkit","title":"Manual","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Combinatorics\nCombinations\nDuplicateCombinations\nPermutations\nDuplicatePermutations","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.Combinatorics","page":"Toolkit","title":"QuantumLattices.Toolkit.Combinatorics","text":"Combinatorics{M, C}\n\nAbstract combinatorial algorithms.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.Combinations","page":"Toolkit","title":"QuantumLattices.Toolkit.Combinations","text":"Combinations{M}(contents::C) where {M, C}\n\nCombinations of M elements from contents. Duplicates are not allowed.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.DuplicateCombinations","page":"Toolkit","title":"QuantumLattices.Toolkit.DuplicateCombinations","text":"DuplicateCombinations{M}(contents::C) where {M, C}\n\nCombinations of M elements from contents. Duplicates are allowed.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.Permutations","page":"Toolkit","title":"QuantumLattices.Toolkit.Permutations","text":"Permutations{M}(contents::C) where {M, C}\n\nPermutations of M elements from contents. Duplicates are not allowed.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.DuplicatePermutations","page":"Toolkit","title":"QuantumLattices.Toolkit.DuplicatePermutations","text":"DuplicatePermutations{M}(contents::C) where {M, C}\n\nPermutations of M elements from contents. Duplicates are allowed.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#Traits","page":"Toolkit","title":"Traits","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Trait functions and trait types that are useful to the package are defined.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Generally speaking, traits in Julia could fall into two categories according to their usages, the first may be term as \"type helpers\" and the second are usually called \"Holy traits\" named after Tim Holy. Type helpers aim at the inquiry, alteration and computation of the compile-time information of types, while Holy traits can be applied as an alternative to multi-inheritance by use of the Julia multidispatch feature.","category":"page"},{"location":"man/Toolkit/#Type-helpers","page":"Toolkit","title":"Type helpers","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Type helpers are important for the generic programming in Julia, especially in the design of generic interfaces and abstract types.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Let's see a simple situation, i.e. the elemental addition of two vectors of numbers. The numbers can assume different types and the type of the result depends on both of them, for example, the result between two vectors of integers is a vector of integers while that between a vector of integers and a vector of floats is a vector of floats. Of course, one can explicitly define every elemental addition function between any two different types of vectors of numbers, like this:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"# wrong design pattern\n\nfunction elementaladdition(v₁::Vector{Int64}, v₂::Vector{Int64})\n result = Int[]\n ...\nend\nfunction elementaladdition(v₁::Vector{Int64}, v₂::Vector{Float64})\n result = Float64[]\n ...\nend\n...\n...","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Writing down all such methods is already a heavy repetition. What's worse, you will quickly find that a lot more functions, such as the elemental subtraction, elemental multiplication and elemental division, are waiting for you to implement. This is a total disaster.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The correct strategy is to define the promotion rule of any two types of numbers and use it to define the type of the result:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"# correct design pattern\n\npromotion(::Type{Int64}, ::Type{Int64}) = Int64\npromotion(::Type{Int64}, ::Type{Float64}) = Float64\n...\n...\n\nfunction elementaladdition(v₁::Vector{T₁}, v₂::Vector{T₂}) where {T₁<:Number, T₂<:Number}\n result = promotion(T₁, T₂)[]\n ...\nend\nfunction elementalsubtraction(v₁::Vector{T₁}, v₂::Vector{T₂}) where {T₁<:Number, T₂<:Number}\n result = promotion(T₁, T₂)[]\n ...\nend\n...\n...","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The promotion rule applies equally to all the arithmetic operations on numbers. Therefore, tedious code repetition could be avoided with it. In fact, similar promotion rules have already been defined in Julia base, and the default implementations of arithmetic operations in Julia are indeed based on them (see Base.promote_rule and Base.promote_type). When new user-defined numeric types are introduced, the only things you need to do is to add new promotion rules and implement a few basic arithmetic functions for these new types. Then quite a lot of generic codes could apply to them without any modification.","category":"page"},{"location":"man/Toolkit/#Type-helpers-with-type-parameters","page":"Toolkit","title":"Type helpers with type parameters","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The input and output types of a promotion rule are known at compile time, thus, the promotion rule is a trait function aiming at the computation of compile-time information of types. Trait functions dealing with the inquiries of compile-time information of types are also widely used in Julia, such as the eltype function of Vector:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> eltype(Vector{String})\nString","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"For a user-defined parametric type, it is also useful to provide an inquiry function to access to the type parameters:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> struct Hi{T<:Number}\n content::T\n end\n contenttype(::Type{Hi{T}}) where T<:Number = T\n contenttype(Hi{Int64})\nInt64","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"However, the above defined function contenttype could not apply to a UnionAll type, such as Hi{<:Real}:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> contenttype(Hi{<:Real})\nERROR: MethodError: no method matching contenttype(::Type{Hi{<:Real}})\n[...]","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"In fact in Julia base, all such inquiry functions, e.g., the eltype function, work poor for the UnionAll types:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> eltype(Vector{<:Real})\nAny","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"In concept, eltype(Vector{<:Real} should return Real instead of Any as every element in Vector{<:Real} is indeed a real number. Similarly, we expect that contenttype(Hi{<:Real}) should also give us Real. Unfortunately, functions defined in the similar form like this could never achieve such goals. Julia base doesn't provide generic functions to access or change the information of the parameters of a type. In this module, we try to fill this gap with a set of generic trait functions.","category":"page"},{"location":"man/Toolkit/#Access-or-change-the-type-parameters-by-their-position-orders","page":"Toolkit","title":"Access or change the type parameters by their position orders","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The most direct information of the parameters of a type is their position orders. We provide parametertype to access to them by such information:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parametertype(Hi{<:Real}, 1)\nReal\n\njulia> parametertype(Vector{<:Real}, 1)\nReal\n\njulia> parametertype(Vector{<:Real}, 2)\n1","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"You can use parametercount to inquire the total number of the parameters of a type:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parametercount(Hi)\n1\n\njulia> parametercount(Vector)\n2","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"It is noted that Vector has 2 type parameters because it is just a type alias for Array{T, 1} where T.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"To change the parameters of a type, reparameter can be used:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> reparameter(Hi{Int64}, 1, Real)\nHi{<:Real}\n\njulia> reparameter(Vector{Int64}, 1, Real)\nVector{<:Real} (alias for Array{<:Real, 1})\n\njulia> reparameter(Vector{<:Real}, 2, 3)\nArray{<:Real, 3}\n\njulia> reparameter(Hi{Int64}, 1, Real, false)\nHi{Real}\n\njulia> reparameter(Hi{Int64}, 1, Real, true)\nHi{<:Real}","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"We want to remark that by providing the fourth positional argument with the true value, a UnionAll type could be generated. When the fourth positional argument is omitted, it is actually determined by another trait function, i.e., isparameterbound. This function judges whether an input type should be considered as the upper bound of the new parameter of a type. By default, it is defined to be","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"isparameterbound(::Type{}, ::Val{}, ::Type{D}) where D = !isconcretetype(D)\nisparameterbound(::Type{}, ::Val{}, ::Any) = false","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"This function can be overloaded to change the behavior for a certain type:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> isparameterbound(::Type{<:Vector}, ::Val{1}, ::Type{D}) where D = false;\n\njulia> reparameter(Vector, 1, Real)\nVector{Real} (alias for Array{Real, 1})","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The second positional argument of isparameterbound must be of type Val because in principle you should be able to assign different behaviors for different parameters of a type separately. If it is of type Integer, a single overloading would change the behaviors for all.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Besides, you can inquire all the parameters of a type by parametertypes:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parametertypes(Hi{<:Real})\nTuple{Real}\n\njulia> parametertypes(Vector{Int64})\nTuple{Int64, 1}","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The obtained type parameters are stored as those of a Tuple.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"At the same time, you can change all the parameters of a type by fulltype:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> fulltype(Hi{Int64}, Tuple{Real})\nHi{<:Real}\n\njulia> fulltype(Hi{Int64}, Tuple{Real}, (false,))\nHi{Real}\n\njulia> fulltype(Vector{Int64}, Tuple{Real, 2})\nMatrix{Real} (alias for Array{Real, 2})\n\njulia> fulltype(Vector{Int64}, Tuple{Real, 2}, (true, false))\nMatrix{<:Real} (alias for Array{<:Real, 2})","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Like reparameter, the last positional argument of fulltype could determine whether the corresponding types specified by the type parameters of the input Tuple should be considered as the upper bounds of the new parameters of a type. When this argument is omitted, it is determined by another trait function isparameterbounds, which successively calls the isparameterbound function to determine the behaviors for all the parameters of a type as the literal indicates.","category":"page"},{"location":"man/Toolkit/#Associate-type-parameters-with-names","page":"Toolkit","title":"Associate type parameters with names","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Sometimes, it is more convenient to associate names with the parameters of a type, and then access or change them by their names. This can be done by overloading the parameternames trait function for a certain type:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parameternames(::Type{<:Hi}) = (:content,)\nparameternames (generic function with 3 methods)","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Now, you can inquire the name of a type parameter by parametername with the given position order or vice versa by parameterorder:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parametername(Hi, 1)\n:content\n\njulia> parameterorder(Hi, :content)\n1","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"You can also inquire whether a type has a parameter with the given name by hasparameter:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> hasparameter(Hi, :content)\ntrue\n\njulia> hasparameter(Hi, :others)\nfalse","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"And parametertype and reparameter can be applied by the name of a type parameter instead of its position order:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parametertype(Hi{<:Real}, :content)\nReal\n\njulia> reparameter(Hi{Int}, :content, Real)\nHi{<:Real}\n\njulia> reparameter(Hi{Int}, :content, Real, false)\nHi{Real}","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"To change the reparameter behavior when its last positional argument is omitted, you should overload the isparameterbound function accordingly, e.g.:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> isparameterbound(::Type{<:Hi}, ::Val{:content}, ::Type{D}) where D = false;\n\njulia> reparameter(Hi{Int}, :content, Real)\nHi{Real}","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"note: Note\nAccessing or altering a parameter of a type by its name is independent from that by its position order. Thus, even the following methodisparameterbound(::Type{<:Hi}, ::Val{1}, D)has been overloaded, it doesn't affect the result of the function call likereparameter(Hi{Int}, :content, Real)Rather, it only affect the result of the function call likereparameter(Hi{Int}, 1, Real)To change the default behavior of the former function call, you must overload the following method manually as wellisparameterbound(::Type{<:Hi}, ::Val{:content}, D)","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"A new trait function parameterpair is provided to inquire the name-type pair of a parameter of a type:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parameterpair(Hi{<:Real}, 1)\nPair{:content, Real}\n\njulia> parameterpair(Hi{<:Real}, :content)\nPair{:content, Real}","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"And a new trait function parameterpairs can be used to inquire all the name-type pairs of the parameters of a type:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> parameterpairs(Hi{<:Real})\n@NamedTuple{content::Real}","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The parameters of a type can be altered all at once by giving the name-type pairs to fulltype:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> fulltype(Hi{Int}, NamedTuple{(:content,), Tuple{Real}}, (false,))\nHi{Real}\n\njulia> fulltype(Hi{Int}, NamedTuple{(:content,), Tuple{Real}}, (true,))\nHi{<:Real}\n\njulia> fulltype(Hi{Int}, NamedTuple{(:content,), Tuple{Real}})\nHi{Real}","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Here, the last positional argument can be omitted whose default value would be determined by the isparameterbounds function which successively calls the isparameterbound function on each of the named parameter. Note that similar to the situation of the reparameter function in this subsubsection, the isparameterbound function called here is also the version that takes the parameter name as the input rather than that of the position order.","category":"page"},{"location":"man/Toolkit/#Type-helpers-with-predefined-contents","page":"Toolkit","title":"Type helpers with predefined contents","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Julia abstract types don't have any field or attribute. They are only tags on the type tree. However, we may expect sometimes an abstract type to possess some kind of predefined content so that the design of some methods could be highly simplified. For example, we may need an abstract type that describes a composite vector. Apparently, it should have a field that is the vector contained in it. Of course, we can appoint a fixed field name with it and force every concrete subtype must contain such a field. In such a design pattern, the name of this field in every concrete subtype must be kept unchanged, which may be annoying when it conflicts with that of another field. What's worse, a predefined content of an abstract type is not always limited to a certain field. Maybe we need more than one fields to construct such a content. The just mentioned design pattern cannot deal with such situations.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Here, we provide a set of trait functions to help the design of abstract types with predefined contents. We take the case of composite vector for illustration, and the generalization to other situations is straightforward. First, the trait function contentnames should be overloaded to define the names of the predefined contents:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> abstract type CompositeVector{T} end\n contentnames(::Type{<:CompositeVector}) = (:content,);","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Then you can inquire the total number of predefined contents by contentcount, inquire the name of a predefined content with its position order by contentname, and judge whether a type has a predefined content with a given name by hascontent:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> contentcount(CompositeVector)\n1\n\njulia> contentname(CompositeVector, 1)\n:content\n\njulia> hascontent(CompositeVector, :content)\ntrue\n\njulia> hascontent(CompositeVector, :value)\nfalse","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The key is the interface getcontent, which defines how to get the value of the predefined content. For the simple case when the predefined content just corresponds to a field, and also the field name of the predefined content coincides with the content name, the overloading of getcontent can be omitted, e.g.:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> struct AnotherCompositeVector{T} <: CompositeVector{T}\n content::Vector{T}\n end;\n\njulia> v = AnotherCompositeVector([1, 2, 3])\n getcontent(v, :content)\n3-element Vector{Int64}:\n 1\n 2\n 3","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"For the cases when a predefined contents does not share the same name with a certain field, or even it is not limited to only one certain field, you must implement your own getcontent manually. Let's see two typical examples:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"julia> struct DifferentFieldName{T} <: CompositeVector{T}\n data::Vector{T}\n end\n getcontent(v::DifferentFieldName, ::Val{:content}) = v.data;\n\njulia> struct BeyondSingleField{T} <: CompositeVector{T}\n firsthalf::Vector{T}\n secondhalf::Vector{T}\n end\n getcontent(v::BeyondSingleField, ::Val{:content}) = [v.firsthalf; v.secondhalf];\n\njulia> v = DifferentFieldName([1, 2, 3])\n getcontent(v, :content)\n3-element Vector{Int64}:\n 1\n 2\n 3\n\njulia> v = BeyondSingleField([1, 2, 3], [4, 5, 6])\n getcontent(v, :content)\n6-element Vector{Int64}:\n 1\n 2\n 3\n 4\n 5\n 6","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Note that for the method overloading of getcontent, the second argument is of type Val{:content}. This is convenient because in principle an abstract type could have more than only one predefined content, thus, the behaviors of the getcontent function could be defined separately for different predefined contents in this way. In fact, the function call getcontent(m, contentname) is just an alias for getcontent(m, contentname|>Val).","category":"page"},{"location":"man/Toolkit/#Holy-traits","page":"Toolkit","title":"Holy traits","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"As an emergent feature of Julia, basically speaking, a Holy trait is a Julia type that could direct the generic function of a user-defined type to a certain implementation based on the Julia multi-dispatch mechanism. For different user-defined types, they could be assigned with different Holy traits, leading to different implementations of the same generic interface. Since the information of Holy traits are known at compile time, such design pattern doesn't affect the runtime efficiency as long as type stability is ensured.","category":"page"},{"location":"man/Toolkit/#Alternative-of-multi-inheritance","page":"Toolkit","title":"Alternative of multi-inheritance","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Maybe the most common application of Holy traits is to serve as the alternative of multi-inheritance. Let's see a simple scenario. You have defined an abstract type. It is natural to demand that for every concrete subtype of it, a pair of instances could be compared and judge whether they are equivalent to each other by the value. Unfortunately, for a new user-defined type, the default == function in Julia actually judges whether they are the same object, but not equal to each other by the value. Therefore, you need to define your own == function for this abstract type. However, you may need define a lot of abstract types when you are developing a Julia package. It is annoying if such simple functions must be written for each of them. In other languages like Python, this could be solved with the help of multi-inheritance. But Julia does not support multi-inheritance. The common way is to use Holy traits. For example, the above issue could be solved like this:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"struct Equivalence end\nconst equivalence = Equivalence()\nfunction Base.:(==)(::Equivalence, o₁, o₂)\n n₁, n₂ = fieldcount(typeof(o₁)), fieldcount(typeof(o₂))\n n₁≠n₂ && return false\n for i = 1:n₁\n getfield(o₁, i)≠getfield(o₂, i) && return false\n end\n return true\nend\n\nabstract type TypeWithEquivalence end\nBase.:(==)(o₁::TypeWithEquivalence, o₂::TypeWithEquivalence) = ==(equivalence, o₁, o₂);\n\nstruct ConcreteTypeWithEquivalence{F₁, F₂} <: TypeWithEquivalence\n f₁::F₁\n f₂::F₂\nend;\n\na₁ = ConcreteTypeWithEquivalence((\"a\", \"b\", \"c\"), [1, 2, 3])\na₂ = ConcreteTypeWithEquivalence((\"a\", \"b\", \"c\"), [1.0, 2.0, 3.0])\na₁ == a₂","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Here, the type Equivalence is the Holy trait that helps the abstract type TypeWithEquivalence to implement the == function, which applies equally to any other types.","category":"page"},{"location":"man/Toolkit/#Type-stability-and-the-generated-function-trick","page":"Toolkit","title":"Type stability and the generated function trick","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"However, the story does not end up here. If you are concerned about the code efficiency, you may find that the above implementation is not type stable:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"using BenchmarkTools\n@benchmark $a₁ == $a₂","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"The memory allocation occurs when the == function tries to compare the values of getfield(o₁, i) and getfield(o₂, i) because in principle the types of these values depend on the runtime value of the variable i. To ensure type stability, the generated function trick can be utilized:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"struct EfficientEquivalence end\nconst efficientequivalence = EfficientEquivalence()\n@generated function Base.:(==)(::EfficientEquivalence, o₁, o₂)\n n₁, n₂ = fieldcount(o₁), fieldcount(o₂)\n n₁≠n₂ && return false\n expr = :(getfield(o₁, 1) == getfield(o₂, 1))\n for i = 2:n₁\n expr = Expr(:&&, expr, :(getfield(o₁, $i) == getfield(o₂, $i)))\n end\n return expr\nend\n\nabstract type TypeWithEfficientEquivalence end\nfunction Base.:(==)(o₁::TypeWithEfficientEquivalence, o₂::TypeWithEfficientEquivalence)\n return ==(efficientequivalence, o₁, o₂)\nend\n\nstruct ConcreteTypeWithEfficientEquivalence{F₁, F₂} <: TypeWithEfficientEquivalence\n f₁::F₁\n f₂::F₂\nend\n\na₁ = ConcreteTypeWithEfficientEquivalence((\"a\", \"b\", \"c\"), [1, 2, 3])\na₂ = ConcreteTypeWithEfficientEquivalence((\"a\", \"b\", \"c\"), [1.0, 2.0, 3.0])\na₁ == a₂","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"@benchmark $a₁ == $a₂","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"At runtime of the generated == function, it compares the values of getfield(o₁, 1) and getfield(o₂, 1), getfield(o₁, 2) and getfield(o₂, 2), etc., whose types are known at compile time. Therefore, type stability could be ensured.","category":"page"},{"location":"man/Toolkit/#EfficientOperations","page":"Toolkit","title":"EfficientOperations","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"EfficientOperations is a Holy trait defined in this module that packs several common operations, such as ==/isequal, DataType/UnionAll\n\nGet the \"raw part\" of a type. That is, the type without all its type parameters.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#Core.DataType","page":"Toolkit","title":"Core.DataType","text":"DataType <: Type{T}\n\nDataType represents explicitly declared types that have names, explicitly declared supertypes, and, optionally, parameters. Every concrete value in the system is an instance of some DataType.\n\nExamples\n\njulia> typeof(Real)\nDataType\n\njulia> typeof(Int)\nDataType\n\njulia> struct Point\n x::Int\n y\n end\n\njulia> typeof(Point)\nDataType\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#Base.supertype","page":"Toolkit","title":"Base.supertype","text":"supertype(T::DataType)\n\nReturn the supertype of DataType T.\n\nExamples\n\njulia> supertype(Int32)\nSigned\n\n\n\n\n\nsupertype(T, termination::Symbol) -> DataType\n\nGet the supertype of T till termination.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"For traits with type parameters:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"hasparameter\nisparameterbound\nisparameterbounds\nparametercount\nparametername\nparameternames\nparameterorder\nparameterpair\nparameterpairs\nparametertype\nparametertypes\npromoteparameters\nreparameter","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.hasparameter","page":"Toolkit","title":"QuantumLattices.Toolkit.hasparameter","text":"hasparameter(::Type{T}, name::Symbol) where T -> Bool\n\nFor type T, judge whether it has a type parameter specified by name.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.isparameterbound","page":"Toolkit","title":"QuantumLattices.Toolkit.isparameterbound","text":"isparameterbound(::Type{T}, i::Integer, D) where T -> Bool\nisparameterbound(::Type{T}, name::Symbol, D) where T -> Bool\n\nFor a type T, judge whether a type D should be considered as the upper bound of one of its type parameters.\n\nnote: Note\nThe default implementations of this function isisparameterbound(::Type{}, ::Val{}, ::Type{D}) where D = !isconcretetype(D)\nisparameterbound(::Type{}, ::Val{}, ::Any) = false\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.isparameterbounds","page":"Toolkit","title":"QuantumLattices.Toolkit.isparameterbounds","text":"isparameterbounds(::Type{T}, ::Type{PS}) where {T, PS<:Tuple} -> Tuple{Vararg{Bool}}\nisparameterbounds(::Type{T}, ::Type{PS}) where {T, PS<:NamedTuple} -> Tuple{Vararg{Bool}}\n\nFor a type T, judge whether the types specified by PS should be considered as the upper bounds of its corresponding type parameters.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parametercount","page":"Toolkit","title":"QuantumLattices.Toolkit.parametercount","text":"parametercount(::Type{T}) where T -> Int\n\nFor a type T, get the number of its type parameters.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parametername","page":"Toolkit","title":"QuantumLattices.Toolkit.parametername","text":"parametername(::Type{T}, i::Integer) where T -> Symbol\n\nFor a type T, get the name of its ith type parameter.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parameternames","page":"Toolkit","title":"QuantumLattices.Toolkit.parameternames","text":"parameternames(::Type{T}) where T -> Tuple{Vararg{Symbol}}\n\nFor a type T, get the names of all its type parameters.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parameterorder","page":"Toolkit","title":"QuantumLattices.Toolkit.parameterorder","text":"parameterorder(::Type{T}, name::Symbol) where T -> Int\n\nFor a type T, get the order of one of its type parameters.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parameterpair","page":"Toolkit","title":"QuantumLattices.Toolkit.parameterpair","text":"parameterpair(::Type{T}, name::Symbol) where T\nparameterpair(::Type{T}, i::Integer) where T\n\nFor type T, get the name-type pair of one of its type parameters.\n\nThe result is stored in the type parameters of a Pair.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parameterpairs","page":"Toolkit","title":"QuantumLattices.Toolkit.parameterpairs","text":"parameterpairs(::Type{T}) where T\n\nFor a type T, get the name-type pairs of all its type parameters.\n\nThe return types are stored in the type parameters of a NamedTuple.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parametertype","page":"Toolkit","title":"QuantumLattices.Toolkit.parametertype","text":"parametertype(::Type{T}, name::Symbol) where T\nparametertype(::Type{T}, i::Integer) where T\n\nFor a type T, get the type of one of its type parameters.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.parametertypes","page":"Toolkit","title":"QuantumLattices.Toolkit.parametertypes","text":"parametertypes(::Type{T}) where T\n\nFor a type T, get the types of all its type parameters.\n\nThe returned types are stored in the type parameters of a Tuple.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.promoteparameters","page":"Toolkit","title":"QuantumLattices.Toolkit.promoteparameters","text":"promoteparameters(::Type{T₁}, ::Type{T₂}) where {T₁<:NamedTuple, T₂<:NamedTuple}\n\nPromote the types specified by two named tuples with the same names accordingly.\n\nThe result is stored in the type parameters of a NamedTuple.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.reparameter","page":"Toolkit","title":"QuantumLattices.Toolkit.reparameter","text":"reparameter(::Type{T}, i::Integer, P, ub::Bool=isparameterbound(T, i, P)) where T\nreparameter(::Type{T}, name::Symbol, P, ub::Bool=isparameterbound(T, name, P)) where T\n\nFor a type T, replace the type of its ith type parameter with P. Here, ub determines whether P should be considered as the upper bound. \n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"For traits with type contents:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"contentcount\ncontentname\ncontentnames\ncontentorder\ncontenttype\ncontenttypes\ngetcontent\nhascontent\ndissolve","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.contentcount","page":"Toolkit","title":"QuantumLattices.Toolkit.contentcount","text":"contentcount(::Type{T}) where T -> Int\n\nFor a type T, get the number of its predefined contents.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.contentname","page":"Toolkit","title":"QuantumLattices.Toolkit.contentname","text":"contentname(::Type{T}, i::Integer) where T -> Symbol\n\nFor a type T, get the name of its ith predefined content.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.contentnames","page":"Toolkit","title":"QuantumLattices.Toolkit.contentnames","text":"contentnames(::Type{T}) where T -> Tuple{Vararg{Symbol}}\n\nFor a type T, define the names of its predefined contents.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.contentorder","page":"Toolkit","title":"QuantumLattices.Toolkit.contentorder","text":"contentorder(::Type{T}, name::Symbol) where T -> Int\n\nFor a type T, get the position order of a predefined content by the name.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.contenttype","page":"Toolkit","title":"QuantumLattices.Toolkit.contenttype","text":"contenttype(::Type{T}, name::Symbol) where T\ncontenttype(::Type{T}, ::Val{name}) where {T, name}\n\nFor a type T, get the type of a predefined content by the name.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.contenttypes","page":"Toolkit","title":"QuantumLattices.Toolkit.contenttypes","text":"contenttypes(::Type{T}) where T\n\nFor a type T, get the types of its predefined contents.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.getcontent","page":"Toolkit","title":"QuantumLattices.Toolkit.getcontent","text":"getcontent(m, i::Integer)\ngetcontent(m, name::Symbol)\ngetcontent(m, ::Val{name}) where name\n\nGet the value of the predefined content of m. \n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.hascontent","page":"Toolkit","title":"QuantumLattices.Toolkit.hascontent","text":"hascontent(::Type{T}, name::Symbol) where T -> Bool\n\nFor a type T, judge whether it has a predefined content specified by name.\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.dissolve","page":"Toolkit","title":"QuantumLattices.Toolkit.dissolve","text":"dissolve(m, f::Function=identity, args...; kwargs...) -> Tuple\n\nConvert m to a tuple by the function f applied elementally to its contents with the extra positional arguments (args) and keyword arguments (kwargs). \n\nTo each content of m, the underlying interface of the dissolve function when f is applied is as follows:\n\ndissolve(m, Val(name), f, args...; kwargs...)\n\nHere, name is the name of the corresponding content of m.\n\nBasically, the rule of how f operates on each field of m can be overridden by redefining the above dissolve function.\n\nnote: Note\nThe default dissolve function ignores the operation of function f and just return the content value of m.\n\n\n\n\n\ndissolve(m, ::Val{name}, f::Function, args...; kwargs...) where name\n\nDissolve the content specified by name of m by the function f applied with the extra positional arguments (args) and keyword arguments (kwargs).\n\n\n\n\n\n","category":"function"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"For traits with type operations:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"efficientoperations","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.efficientoperations","page":"Toolkit","title":"QuantumLattices.Toolkit.efficientoperations","text":"efficientoperations\n\nIndicate that the efficient operations, i.e. \"==\"/\"isequal\", \"<\"/\"isless\" or \"replace\", will be used.\n\n\n\n\n\n","category":"constant"},{"location":"man/Toolkit/#Composite-structures","page":"Toolkit","title":"Composite structures","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"In principle, Julia is not an object-oriented programming language. For example, only abstract types can be inherited so that subtype cannot inherit fields from their parents. Therefore, Julia prefers composition over inheritance. However, to make a new concrete type behaves much alike another one, tedious repetitions of redefining the generic interfaces are usually not avoidable, especially for the basic types in Julia base. In this module, we implement to such composited types, CompositeVector and CompositeDict, for the sake of future usages.","category":"page"},{"location":"man/Toolkit/#CompositeVector","page":"Toolkit","title":"CompositeVector","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"A composite vector can be considered as a vector that is implemented by including a concrete subtype of AbstractVector as its data attribute, and it itself is a subtype of AbstractVector.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"To take full advantages of the Julia base, the following interfaces are redefined:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"inquiry of info: size, length\ncomparison between objects: ==, isequal\nobtainment of old elements: getindex\noperation of old elements: setindex!\naddition of new elements: push!, pushfirst!, insert!, append!, prepend!\nremoval of old elements: splice!, deleteat!, pop!, popfirst!, empty!\nconstruction of new objects: empty, reverse, similar\niteration: iterate, keys, values, pairs","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Note that arithmetic operations and logical operations excluding == and isequal are not supported.","category":"page"},{"location":"man/Toolkit/#CompositeDict","page":"Toolkit","title":"CompositeDict","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"A composite dict can be considered as a dict that is implemented by including a concrete subtype of AbstractDict as its data attribute and it itself is a subtype of AbstractDict.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"To take full advantages of the Julia base, the following interfaces are redefined:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"inquiry of info: isempty, length, haskey, in\ncomparison between objects: ==, isequal\nobtainment of old elements: get, getkey, getindex\noperation and addition of elements: push!, get!, setindex!\nremoval of old elements: pop!, delete!, empty!\nconstruction of new objects: merge, empty\niteration: iterate, keys, values, pairs","category":"page"},{"location":"man/Toolkit/#Manual-3","page":"Toolkit","title":"Manual","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"CompositeDict\nCompositeVector","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.CompositeDict","page":"Toolkit","title":"QuantumLattices.Toolkit.CompositeDict","text":"CompositeDict{K, V}\n\nA composite dict can be considered as a dict that is implemented by including a concrete subtype of AbstractDict as its data attribute.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.CompositeVector","page":"Toolkit","title":"QuantumLattices.Toolkit.CompositeVector","text":"CompositeVector{T}\n\nA composite vector can be considered as a vector that is implemented by including a concrete subtype of AbstractVector as its data attribute.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#Vector-spaces","page":"Toolkit","title":"Vector spaces","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"A vector space is a linear space, in which the addition of vectors and multiplication of a vector by a scalar are defined.","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Vector spaces are frequently encountered in physics, e.g. the Hilbert space in quantum mechanics. In this submodule, we only implement those with finite dimensions. We want to remark that in our implementation, a vector space is a subtype of an abstract vector, therefore, the bases always possess a order, which means, two vector spaces are not considered to be equal to each other even if their corresponding actual mathematical spaces are the same but the orders of the bases are different.","category":"page"},{"location":"man/Toolkit/#VectorSpace","page":"Toolkit","title":"VectorSpace","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"VectorSpace{B} is the abstraction of a vector space, which has only one type parameter:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"B<:Any: the type of the bases of the vector space","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Basically, a subtype should implement the following 2 methods:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Base.length(vs::VectorSpace) -> Int\nGet the dimension of a vector space\nBase.getindex(vs::VectorSpace{B}, i::Int) where B -> B\nGet the ith basis of a vector space","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Other features include","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"comparison: == and isequal\niteration: iterate\ninquiry: size and in\nsearch: searchsortedfirst","category":"page"},{"location":"man/Toolkit/#Manual-4","page":"Toolkit","title":"Manual","text":"","category":"section"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Predefined types of vector spaces:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"VectorSpace\nNamedVectorSpace\nSimpleNamedVectorSpace\nParameterSpace\nNamedVectorSpaceProd\nNamedVectorSpaceZip","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpace","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpace","text":"VectorSpace{B} <: AbstractVector{B}\n\nAbstract vector space.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.NamedVectorSpace","page":"Toolkit","title":"QuantumLattices.Toolkit.NamedVectorSpace","text":"NamedVectorSpace{B} <: VectorSpace{B}\n\nAbstract named vector space.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.SimpleNamedVectorSpace","page":"Toolkit","title":"QuantumLattices.Toolkit.SimpleNamedVectorSpace","text":"SimpleNamedVectorSpace{N, B} <: NamedVectorSpace{B}\n\nAbstract simple named vector space.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.ParameterSpace","page":"Toolkit","title":"QuantumLattices.Toolkit.ParameterSpace","text":"ParameterSpace{N, T, B} <: SimpleNamedVectorSpace{N, B}\n\nParameter space.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.NamedVectorSpaceProd","page":"Toolkit","title":"QuantumLattices.Toolkit.NamedVectorSpaceProd","text":"NamedVectorSpaceProd{Order, T<:Tuple{Vararg{SimpleNamedVectorSpace}}, B<:Tuple} <: CompositeNamedVectorSpace{T, B}\n\nDirect producted named vector space.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.NamedVectorSpaceZip","page":"Toolkit","title":"QuantumLattices.Toolkit.NamedVectorSpaceZip","text":"NamedVectorSpaceZip{T<:Tuple{Vararg{SimpleNamedVectorSpace}}, B<:Tuple} <: CompositeNamedVectorSpace{T, B}\n\nZipped named vector space.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"Predefined types of vector space style:","category":"page"},{"location":"man/Toolkit/","page":"Toolkit","title":"Toolkit","text":"VectorSpaceStyle\nVectorSpaceGeneral\nVectorSpaceEnumerative\nVectorSpaceCartesian\nVectorSpaceDirectProducted\nVectorSpaceDirectSummed\nVectorSpaceZipped","category":"page"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpaceStyle","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpaceStyle","text":"VectorSpaceStyle\n\nStyle of a concrete type of vector space.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpaceGeneral","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpaceGeneral","text":"VectorSpaceGeneral <: VectorSpaceStyle\n\nDefault vector space style.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpaceEnumerative","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpaceEnumerative","text":"VectorSpaceEnumerative <: VectorSpaceStyle\n\nEnumerative vector space style, which indicates that the vector space has a predefined content named contents that contains all its bases.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpaceCartesian","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpaceCartesian","text":"VectorSpaceCartesian <: VectorSpaceStyle\n\nCartesian vector space style, which indicates that every basis in it could be represented by a Cartesian index.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpaceDirectProducted","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpaceDirectProducted","text":"VectorSpaceDirectProducted{Order} <: VectorSpaceStyle\n\nVector space style which indicates that a vector space is the direct product of its sub-components.\n\nThe type parameter Order must be either :forward or :backward:\n\n:forward: the direct product iterates over the first sub-component first like a Julia array;\n:backward: the direct product iterates over the last sub-component first like a C/C++ array.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpaceDirectSummed","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpaceDirectSummed","text":"VectorSpaceDirectSummed <: VectorSpaceStyle\n\nVector space style which indicates that a vector space is the direct sum of its sub-components.\n\n\n\n\n\n","category":"type"},{"location":"man/Toolkit/#QuantumLattices.Toolkit.VectorSpaceZipped","page":"Toolkit","title":"QuantumLattices.Toolkit.VectorSpaceZipped","text":"VectorSpaceZipped <: VectorSpaceStyle\n\nVector space style which indicates that a vector space is the zip of its sub-components.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/","page":"Quantum numbers","title":"Quantum numbers","text":"CurrentModule = QuantumLattices.QuantumNumbers","category":"page"},{"location":"man/QuantumNumbers/#Quantum-numbers","page":"Quantum numbers","title":"Quantum numbers","text":"","category":"section"},{"location":"man/QuantumNumbers/","page":"Quantum numbers","title":"Quantum numbers","text":"Quantum numbers can be considered as the conserved labels for the bases of a Hilbert space when a quantum system hosts some symmetries. Here we only implement Abelian quantum numbers because non-Abelian ones are far more complicated yet much less used.","category":"page"},{"location":"man/QuantumNumbers/#AbelianQuantumNumber","page":"Quantum numbers","title":"AbelianQuantumNumber","text":"","category":"section"},{"location":"man/QuantumNumbers/#RepresentationSpace","page":"Quantum numbers","title":"RepresentationSpace","text":"","category":"section"},{"location":"man/QuantumNumbers/#qnmanual","page":"Quantum numbers","title":"Manual","text":"","category":"section"},{"location":"man/QuantumNumbers/","page":"Quantum numbers","title":"Quantum numbers","text":"Modules = [QuantumNumbers]\nOrder = [:module, :constant, :type, :macro, :function]","category":"page"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.Abelian","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.Abelian","text":"const Abelian = AbelianQuantumNumber\n\nType alias for AbelianQuantumNumber.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianGradedSpace","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianGradedSpace","text":"AbelianGradedSpace(quantumnumbers::AbstractVector{<:AbelianQuantumNumber}, dimensions::AbstractVector{<:Integer}, dual::Bool=false; ordercheck::Bool=false, duplicatecheck::Bool=false, degeneracycheck::Bool=false)\n\nConstruct an Abelian graded space.\n\nHere:\n\nquantumnumbers specifies the Abelian quantum numbers labeling the irreducible representations of the corresponding Abelian group which must be sorted in the ascending order. Such an ordering should be manually guaranteed by the user. When and only when the keyword argument ordercheck is true, the constructor will check whether this condition is satisfied and raise an error if it doesn't. Besides, quantumnumbers must not contain duplicate Abelian quantum numbers, manually guaranteed by the user as well. This condition can be checked when and only when both ordercheck==true and duplicatecheck==true. An error will be raised if this check fails.\ndimensions specifies the degenerate dimensions of the corresponding Abelian quantum numbers. Apparently, each degenerate dimension must be positive, which should also be manually guaranteed by the user. When and only when the keyword argument degeneracycheck is true, the constructor will check whether this condition is satisfied and raise an error if it doesn't.\ndual specifies whether the graded space is the dual representation of the corresponding Abelian group, which roughly speaking, can be viewed as the direction of the arrow of the Abelian quantum numbers labeling the irreducible representations. We assume dual==true corresponds to the in-arrow and dual==false corresponds to the out-arrow.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianGradedSpace-2","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianGradedSpace","text":"AbelianGradedSpace{QN<:AbelianQuantumNumber} <: RepresentationSpace{QN}\n\nA quantum representation space of an Abelian group that has been decomposed into the direct sum of its irreducible representations.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianGradedSpace-Tuple{Any}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianGradedSpace","text":"AbelianGradedSpace(pairs; dual::Bool=false)\nAbelianGradedSpace(pairs::Pair...; dual::Bool=false)\nAbelianGradedSpace{QN}(pairs; dual::Bool=false) where {QN<:AbelianQuantumNumber}\nAbelianGradedSpace{QN}(pairs::Pair...; dual::Bool=false) where {QN<:AbelianQuantumNumber}\n\nConstruct an Abelian graded space.\n\nIn this function, the Abelian quantum numbers will be sorted automatically, therefore, their orders need not be worried. Duplicate and dimension checks of the quantum numbers are also carried out and errors will be raised if either such checks fails.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianGradedSpaceProd","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianGradedSpaceProd","text":"AbelianGradedSpaceProd{N, QN<:AbelianQuantumNumber} <: CompositeAbelianGradedSpace{N, QN}\n\nDirect product of Abelian graded spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianGradedSpaceSum","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianGradedSpaceSum","text":"AbelianGradedSpaceSum{N, QN<:AbelianQuantumNumber} <: CompositeAbelianGradedSpace{N, QN}\n\nDirect sum of Abelian graded spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianQuantumNumber","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianQuantumNumber","text":"AbelianQuantumNumber\n\nAbstract type of Abelian quantum numbers.\n\nAn Abelian quantum number is the label of a irreducible representation of an Abelian group acted on a quantum representation space. \n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd","text":"AbelianQuantumNumberProd{T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} <: AbelianQuantumNumber\n\nDeligne tensor product of simple Abelian quantum numbers.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd-Tuple{Vararg{SimpleAbelianQuantumNumber}}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd","text":"AbelianQuantumNumberProd(contents::SimpleAbelianQuantumNumber...)\nAbelianQuantumNumberProd(contents::Tuple{Vararg{SimpleAbelianQuantumNumber}})\n\nConstruct a Deligne tensor product of simple Abelian quantum numbers.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd-Union{NTuple{N, Number}, Tuple{T}, Tuple{N}} where {N, T<:NTuple{N, SimpleAbelianQuantumNumber}}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd","text":"AbelianQuantumNumberProd{T}(vs::Vararg{Number, N}) where {N, T<:NTuple{N, SimpleAbelianQuantumNumber}}\nAbelianQuantumNumberProd{T}(vs::NTuple{N, Number}) where {N, T<:NTuple{N, SimpleAbelianQuantumNumber}}\n\nConstruct a Deligne tensor product of simple Abelian quantum numbers by their values.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.CompositeAbelianGradedSpace","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.CompositeAbelianGradedSpace","text":"CompositeAbelianGradedSpace{N, QN<:AbelianQuantumNumber} <: RepresentationSpace{QN}\n\nAbstract type of composite Abelian graded spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.Graded","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.Graded","text":"const Graded = AbelianGradedSpace\n\nType alias for AbelianGradedSpace.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.Momenta","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.Momenta","text":"Momenta{P<:𝕂} <: RepresentationSpace{P}\n\nComplete allowed set of momenta.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.RepresentationSpace","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.RepresentationSpace","text":"RepresentationSpace{QN<:AbelianQuantumNumber} <: VectorSpace{QN}\n\nAbstract type of quantum representation spaces of Abelian groups.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.SimpleAbelianQuantumNumber","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.SimpleAbelianQuantumNumber","text":"SimpleAbelianQuantumNumber <: AbelianQuantumNumber\n\nAbstract type of simple Abelian quantum numbers. That is, it contains only one label.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.ℕ","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.ℕ","text":"ℕ <: <: 𝕌₁\n\nConcrete Abelian quantum number of the particle number.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.ℤ","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.ℤ","text":"ℤ{N} <: SimpleAbelianQuantumNumber\n\nℤₙ quantum numbers.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.ℤ₁","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.ℤ₁","text":"const ℤ₁ = ℤ{1}\nconst ℤ₂ = ℤ{2}\nconst ℤ₃ = ℤ{3}\nconst ℤ₄ = ℤ{4}\n\nAlias for ℤ₁/ℤ₂/ℤ₃/ℤ₄ quantum numbers.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.𝕂","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.𝕂","text":"const 𝕂 = AbelianQuantumNumberProd{<:Tuple{Vararg{ℤ}}}\nconst 𝕂¹{N} = AbelianQuantumNumberProd{Tuple{ℤ{N}}}\nconst 𝕂²{N₁, N₂} = AbelianQuantumNumberProd{Tuple{ℤ{N₁}, ℤ{N₂}}}\nconst 𝕂³{N₁, N₂, N₃} = AbelianQuantumNumberProd{Tuple{ℤ{N₁}, ℤ{N₂}, ℤ{N₃}}}\n\nType alias for the Abelian quantum numbers of 1d, 2d and 3d momentum.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.𝕂¹-Union{Tuple{Integer}, Tuple{N}} where N","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.𝕂¹","text":"𝕂¹{N}(k::Integer) where N\n𝕂²{N}(k₁::Integer, k₂::Integer) where N\n𝕂²{N₁, N₂}(k₁::Integer, k₂::Integer) where {N₁, N₂}\n𝕂³{N}(k₁::Integer, k₂::Integer, k₃::Integer) where N\n𝕂³{N₁, N₂, N₃}(k₁::Integer, k₂::Integer, k₃::Integer) where {N₁, N₂, N₃}\n\nConstruct 1d, 2d and 3d momentum.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.𝕊ᶻ","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.𝕊ᶻ","text":"𝕊ᶻ <: 𝕌₁\n\nConcrete Abelian quantum number of the z-component of a spin.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.𝕌₁","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.𝕌₁","text":"𝕌₁ <: SimpleAbelianQuantumNumber\n\nAbstract type of 𝕌₁ quantum numbers.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumNumbers/#Base.:+-Tuple{AbelianQuantumNumber}","page":"Quantum numbers","title":"Base.:+","text":"+(qn::AbelianQuantumNumber) -> typeof(qn)\n\nOverloaded + operator for AbelianQuantumNumber.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.:+-Union{Tuple{QN}, Tuple{QN, QN, Vararg{QN}}} where QN<:QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd","page":"Quantum numbers","title":"Base.:+","text":"+(qn₁::QN, qn₂::QN, qns::QN...) where {QN<:AbelianQuantumNumberProd} -> QN\n\nOverloaded + operator for AbelianQuantumNumberProd.\n\nnote: Note\nTo ensure type stability, two AbelianQuantumNumberProd can be added together if and only if they are of the same type.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.:+-Union{Tuple{QN}, Tuple{QN, QN, Vararg{QN}}} where QN<:SimpleAbelianQuantumNumber","page":"Quantum numbers","title":"Base.:+","text":"+(qn₁::QN, qn₂::QN, qns::QN...) where {QN<:SimpleAbelianQuantumNumber} -> QN\n\nOverloaded + operator for SimpleAbelianQuantumNumber.\n\nnote: Note\nTo ensure type stability, two SimpleAbelianQuantumNumber can be added together if and only if they are of the same type.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.:--Tuple{QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd}","page":"Quantum numbers","title":"Base.:-","text":"-(qn::AbelianQuantumNumberProd) -> typeof(qn)\n-(qn₁::QN, qn₂::QN) where {QN<:AbelianQuantumNumberProd} -> QN\n\nOverloaded - operator for AbelianQuantumNumberProd.\n\nnote: Note\nTo ensure type stability, a AbelianQuantumNumberProd can be subtracted by another AbelianQuantumNumberProd if and only if they are of the same type.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.:--Tuple{SimpleAbelianQuantumNumber}","page":"Quantum numbers","title":"Base.:-","text":"-(qn::SimpleAbelianQuantumNumber) -> typeof(qn)\n-(qn₁::QN, qn₂::QN) where {QN<:SimpleAbelianQuantumNumber} -> QN\n\nOverloaded - operator for SimpleAbelianQuantumNumber.\n\nnote: Note\nTo ensure type stability, a SimpleAbelianQuantumNumber can be subtracted by another SimpleAbelianQuantumNumber if and only if they are of the same type.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.adjoint-Tuple{AbelianGradedSpace}","page":"Quantum numbers","title":"Base.adjoint","text":"adjoint(gs::AbelianGradedSpace) -> typeof(gs)\n\nGet the dual of an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.cumsum-Tuple{RepresentationSpace, Union{Integer, CartesianIndex}}","page":"Quantum numbers","title":"Base.cumsum","text":"cumsum(rs::RepresentationSpace, i::Union{Integer, CartesianIndex}) -> Int\n\nGet the accumulative degenerate dimension up to the ith Abelian quantum number contained in a representation space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.cumsum-Union{Tuple{QN}, Tuple{AbelianGradedSpace{QN}, QN}} where QN<:AbelianQuantumNumber","page":"Quantum numbers","title":"Base.cumsum","text":"cumsum(gs::AbelianGradedSpace{QN}, qn::QN) where {QN<:AbelianQuantumNumber} -> Int\n\nGet the accumulative dimension of an Abelian graded space up to a certain Abelian quantum number contained in an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.getindex-Tuple{AbelianGradedSpace, AbstractVector{<:Integer}}","page":"Quantum numbers","title":"Base.getindex","text":"getindex(gs::AbelianGradedSpace, indexes::AbstractVector{<:Integer}) -> typeof(gs)\ngetindex(gs::AbelianGradedSpace{QN}, quantumnumbers::AbstractVector{QN}) where {QN<:AbelianQuantumNumber} -> AbelianGradedSpace{QN}\n\nGet a subset of an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.getindex-Tuple{QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd, Integer}","page":"Quantum numbers","title":"Base.getindex","text":"getindex(qn::AbelianQuantumNumberProd, i::Integer) -> SimpleAbelianQuantumNumber\n\nGet the ith simple Abelian quantum number in a Deligne tensor product.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.getindex-Union{Tuple{T}, Tuple{Type{AbelianQuantumNumber}, Type{T}}} where T<:AbelianQuantumNumber","page":"Quantum numbers","title":"Base.getindex","text":"getindex(::Type{Abelian}, ::Type{T}) where {T<:AbelianQuantumNumber} -> Type{T}\n\nOverloaded [] for Abelian, i.e., the support of syntax Abelian[T] where T<:AbelianQuantumNumber, which is helpful for the construction of tensor producted Abelian quantum numbers.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.in-Union{Tuple{QN}, Tuple{QN, AbelianGradedSpace{QN}}} where QN<:AbelianQuantumNumber","page":"Quantum numbers","title":"Base.in","text":"in(qn::QN, gs::AbelianGradedSpace{QN}) where {QN<:AbelianQuantumNumber} -> Bool\n\nCheck whether an Abelian quantum number is contained in an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.inv","page":"Quantum numbers","title":"Base.inv","text":"inv(qn::AbelianQuantumNumber, bool::Bool=true) -> typeof(qn)\n\nGet the inverse of an Abelian quantum number qn if bool is true. Otherwise, return qn itself.\n\n\n\n\n\n","category":"function"},{"location":"man/QuantumNumbers/#Base.length-Tuple{AbelianGradedSpace}","page":"Quantum numbers","title":"Base.length","text":"length(gs::AbelianGradedSpace) -> Int\n\nGet the number of inequivalent irreducible representations (i.e., the Abelian quantum numbers) of an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.length-Tuple{QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd}","page":"Quantum numbers","title":"Base.length","text":"length(qn::AbelianQuantumNumberProd) -> Int\n\nGet the length of a Deligne tensor product.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.merge-Tuple{AbelianGradedSpaceProd}","page":"Quantum numbers","title":"Base.merge","text":"merge(rs::AbelianGradedSpaceProd) -> Tuple{AbelianGradedSpace{eltype(rs)}, Dict{eltype(rs), Vector{NTuple{rank(rs), eltype(rs)}}}}\n\nGet the decomposition of the direct product of several Abelian graded spaces and its corresponding fusion processes.\n\nFor a set of Abelian graded spaces (gs₁, gs₂, ...), their direct product space can contain several equivalent irreducible representations because for different sets of Abelian quantum numbers (qn₁, qn₂, ...) where qnᵢ∈gsᵢ, the fusion, i.e., ⊗(qn₁, qn₂, ...) may give the same result qn. This function returns the decomposition of the direct product of (gs₁, gs₂, ...) as well as all the fusion processes of each quantum number contained in the decomposition.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.pairs-Tuple{RepresentationSpace, typeof(dimension)}","page":"Quantum numbers","title":"Base.pairs","text":"pairs(rs::RepresentationSpace, ::typeof(dimension)) -> RepresentationSpacePairs\npairs(rs::RepresentationSpace, ::typeof(range)) -> RepresentationSpacePairs\n\nReturn an iterator that iterates over the pairs of the Abelian quantum numbers and their corresponding (slices of the) degenerate dimensions contained in a representation space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.range-Tuple{AbelianGradedSpace, CartesianIndex}","page":"Quantum numbers","title":"Base.range","text":"range(gs::AbelianGradedSpace, qn::CartesianIndex) -> UnitRange{Int}\nrange(gs::AbelianGradedSpace{QN}, qn::QN) where {QN<:AbelianQuantumNumber} -> UnitRange{Int}\n\nGet the slice of the degenerate dimension of an Abelian quantum number contained in an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.range-Tuple{AbelianGradedSpaceProd, CartesianIndex}","page":"Quantum numbers","title":"Base.range","text":"range(rs::AbelianGradedSpaceProd, i::CartesianIndex) -> AbstractVector{Int}\n\nGet the slice of the degenerate dimension of the ith Abelian quantum number in the direct product of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.range-Tuple{AbelianGradedSpaceSum, CartesianIndex}","page":"Quantum numbers","title":"Base.range","text":"range(rs::AbelianGradedSpaceSum, i::CartesianIndex) -> UnitRange{Int}\n\nGet the slice of the degenerate dimension of the ith Abelian quantum number in the direct sum of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.range-Tuple{RepresentationSpace, Integer}","page":"Quantum numbers","title":"Base.range","text":"range(rs::RepresentationSpace, i::Integer)\n\nGet the slice of the degenerate dimension of the ith Abelian quantum number contained in a representation space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.range-Union{Tuple{QN}, Tuple{N}, Tuple{AbelianGradedSpaceProd{N, QN}, NTuple{N, QN}}} where {N, QN<:AbelianQuantumNumber}","page":"Quantum numbers","title":"Base.range","text":"range(rs::AbelianGradedSpaceProd{N, QN}, qns::NTuple{N, QN}) where {N, QN<:AbelianQuantumNumber} -> AbstractVector{Int}\n\nGet the slice of the degenerate dimension of the Abelian quantum number fused by qns in the direct product of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.split-Union{Tuple{QN}, Tuple{N}, Tuple{QN, AbelianGradedSpaceProd{N, QN}}} where {N, QN<:AbelianQuantumNumber}","page":"Quantum numbers","title":"Base.split","text":"split(target::QN, rs::AbelianGradedSpaceProd{N, QN}; nmax::Real=20) where {N, QN<:AbelianQuantumNumber} -> Set{NTuple{N, QN}}\n\nFind a set of splittings of the target Abelian quantum number with respect to the direct product of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.values-Tuple{QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd}","page":"Quantum numbers","title":"Base.values","text":"values(qn::AbelianQuantumNumberProd) -> NTuple{rank(qn), Number}\n\nGet the values of the simple Abelian quantum numbers in a Deligne tensor product.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.values-Tuple{SimpleAbelianQuantumNumber}","page":"Quantum numbers","title":"Base.values","text":"values(qn::SimpleAbelianQuantumNumber) -> Tuple{Number}\n\nGet the value of a simple Abelian quantum number and return it as the sole element of a tuple.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#Base.zero-Tuple{AbelianQuantumNumber}","page":"Quantum numbers","title":"Base.zero","text":"zero(qn::AbelianQuantumNumber) -> typeof(qn)\nzero(::Type{QN}) where {QN<:AbelianQuantumNumber} -> QN\n\nGet the zero Abelian quantum number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#LinearAlgebra.rank-Tuple{QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd}","page":"Quantum numbers","title":"LinearAlgebra.rank","text":"rank(qn::AbelianQuantumNumberProd) -> Int\nrank(::Type{<:AbelianQuantumNumberProd}) -> Int\n\nGet the rank of a Deligne tensor product of simple Abelian quantum numbers.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#LinearAlgebra.rank-Tuple{QuantumLattices.QuantumNumbers.CompositeAbelianGradedSpace}","page":"Quantum numbers","title":"LinearAlgebra.rank","text":"rank(rs::CompositeAbelianGradedSpace) -> Int\nrank(::Type{<:CompositeAbelianGradedSpace{N}}) where N -> Int\n\nGet the number of Abelian graded spaces in the direct sum.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.:⊕-Tuple{Vararg{AbelianGradedSpace}}","page":"Quantum numbers","title":"QuantumLattices.:⊕","text":"⊕(gses::AbelianGradedSpace...) -> AbelianGradedSpaceSum\n⊕(gs::AbelianGradedSpace, rs::AbelianGradedSpaceSum) -> AbelianGradedSpaceSum\n⊕(rs::AbelianGradedSpaceSum, gs::AbelianGradedSpace) -> AbelianGradedSpaceSum\n⊕(rs₁::AbelianGradedSpaceSum, rs₂::AbelianGradedSpaceSum) -> AbelianGradedSpaceSum\n\nGet the direct sum of some Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.:⊗-Tuple{Vararg{AbelianGradedSpace}}","page":"Quantum numbers","title":"QuantumLattices.:⊗","text":"⊗(gses::AbelianGradedSpace...) -> AbelianGradedSpaceProd\n⊗(gs::AbelianGradedSpace, rs::AbelianGradedSpaceProd) -> AbelianGradedSpaceProd\n⊗(rs::AbelianGradedSpaceProd, gs::AbelianGradedSpace) -> AbelianGradedSpaceProd\n⊗(rs₁::AbelianGradedSpaceProd, rs₂::AbelianGradedSpaceProd) -> AbelianGradedSpaceProd\n\nGet the direct product of some Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.:⊗-Tuple{Vararg{AbelianQuantumNumber}}","page":"Quantum numbers","title":"QuantumLattices.:⊗","text":"⊗(qns::AbelianQuantumNumber...) -> eltype(qns)\n\nGet the direct product of some AbelianQuantumNumbers.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.:⊠-Tuple{Vararg{SimpleAbelianQuantumNumber}}","page":"Quantum numbers","title":"QuantumLattices.:⊠","text":"⊠(qns::SimpleAbelianQuantumNumber...) -> AbelianQuantumNumberProd\n⊠(qn₁::SimpleAbelianQuantumNumber, qn₂::AbelianQuantumNumberProd) -> AbelianQuantumNumberProd\n⊠(qn₁::AbelianQuantumNumberProd, qn₂::SimpleAbelianQuantumNumber) -> AbelianQuantumNumberProd\n⊠(qn₁::AbelianQuantumNumberProd, qn₂::AbelianQuantumNumberProd) -> AbelianQuantumNumberProd\n\nDeligne tensor product of Abelian quantum numbers.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.:⊠-Tuple{Vararg{Type{<:SimpleAbelianQuantumNumber}}}","page":"Quantum numbers","title":"QuantumLattices.:⊠","text":"⊠(QNS::Type{<:SimpleAbelianQuantumNumber}...) -> Type{AbelianQuantumNumberProd{Tuple{QNS...}}}\n⊠(::Type{QN}, ::Type{AbelianQuantumNumberProd{T}}) where {QN<:SimpleAbelianQuantumNumber, T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} -> Type{AbelianQuantumNumberProd{Tuple{QN, fieldtypes(T)...}}}\n⊠(::Type{AbelianQuantumNumberProd{T}}, ::Type{QN}) where {T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}, QN<:SimpleAbelianQuantumNumber} -> Type{AbelianQuantumNumberProd{Tuple{fieldtypes(T)...}, QN}}\n⊠(::Type{AbelianQuantumNumberProd{T₁}}, ::Type{AbelianQuantumNumberProd{T₂}}) where {T₁<:Tuple{Vararg{SimpleAbelianQuantumNumber}}, T₂<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} -> Type{AbelianQuantumNumberProd{Tuple{fieldtypes(T₁)..., fieldtypes(T₂)...}}}\n\nDeligne tensor product of Abelian quantum numbers.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.findindex-Tuple{Integer, AbelianGradedSpace, Integer}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.findindex","text":"findindex(position::Integer, gs::AbelianGradedSpace, guess::Integer) -> Int\n\nFind the index of an Abelian quantum number in an Abelian graded space beginning at guess whose position in the complete dimension range is position.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.period-Tuple{QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd, Integer}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.period","text":"period(qn::AbelianQuantumNumberProd, i::Integer) -> Number\nperiod(::Type{AbelianQuantumNumberProd{T}}, i::Integer) where {T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} -> Number\n\nGet the period of the ith simple Abelian number contained in a Deligne tensor product.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.period-Tuple{SimpleAbelianQuantumNumber}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.period","text":"period(qn::SimpleAbelianQuantumNumber) -> Number\nperiod(::Type{QN}) where {QN<:SimpleAbelianQuantumNumber} -> Number\n\nGet the period of a simple Abelian quantum number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.periods-Tuple{AbelianQuantumNumber}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.periods","text":"periods(qn::AbelianQuantumNumber) -> Tuple{Vararg{Number}}\nperiods(::Type{QN}) where {QN<:AbelianQuantumNumber} -> Tuple{Vararg{Number}}\n\nGet the periods of Abelian quantum numbers.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.regularize!-Tuple{Vector{<:AbelianQuantumNumber}, Vector{Int64}}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.regularize!","text":"regularize!(quantumnumbers::Vector{<:AbelianQuantumNumber}, dimensions::Vector{Int}; check::Bool=false) -> Tuple{typeof(quantumnumbers), typeof(dimensions), Vector{Int}}\n\nIn place regularization of the input Abelian quantum numbers and their corresponding degenerate dimensions.\n\nAfter the regularization, the Abelian quantum numbers will be sorted in the ascending order and duplicates will be merged together. The degenerate dimensions will be processed accordingly. When check is true, this function also check whether all input degenerate dimensions are positive. The regularized Abelian quantum numbers and degenerate dimensions, as well as the permutation vector that sorts the input Abelian quantum numbers, will be returned. \n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.QuantumNumbers.regularize-Tuple{AbstractVector{<:AbelianQuantumNumber}, AbstractVector{<:Integer}}","page":"Quantum numbers","title":"QuantumLattices.QuantumNumbers.regularize","text":"regularize(quantumnumbers::AbstractVector{<:AbelianQuantumNumber}, dimension::AbstractVector{<:Integer}; check::Bool=false) -> Tuple{Vector{eltype(quantumnumbers)}, Vector{Int}, Vector{Int}}\n\nRegularize of the input Abelian quantum numbers and their corresponding degenerate dimensions.\n\nSee regularize!.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.decompose-Tuple{QuantumLattices.QuantumNumbers.CompositeAbelianGradedSpace}","page":"Quantum numbers","title":"QuantumLattices.decompose","text":"decompose(rs::CompositeAbelianGradedSpace; expand::Bool=true) -> Tuple{AbelianGradedSpace{eltype(rs)}, Vector{Int}}\n\nDecompose a composite of several Abelian graded spaces to the canonical one.\n\nWhen expand is false, the corresponding permutation vector that sorts the Abelian quantum numbers will be returned as well. When expand is true, the expanded dimension indexes of the permutation vector that sorts the Abelian quantum numbers will be returned as well.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Tuple{AbelianGradedSpace, CartesianIndex}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(gs::AbelianGradedSpace, qn::CartesianIndex) -> Int\ndimension(gs::AbelianGradedSpace{QN}, qn::QN) where {QN<:AbelianQuantumNumber} -> Int\n\nGet the degenerate dimension of an Abelian quantum number contained in an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Tuple{AbelianGradedSpaceProd, CartesianIndex}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(rs::AbelianGradedSpaceProd, i::CartesianIndex) -> Int\n\nGet the degenerate dimension of the ith Abelian quantum number in the direct product of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Tuple{AbelianGradedSpaceProd}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(rs::AbelianGradedSpaceProd) -> Int\n\nGet the total dimension of the direct product of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Tuple{AbelianGradedSpaceSum, CartesianIndex}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(rs::AbelianGradedSpaceSum, i::CartesianIndex) -> Int\n\nGet the degenerate dimension of the ith Abelian quantum number in the direct sum of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Tuple{AbelianGradedSpaceSum}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(rs::AbelianGradedSpaceSum) -> Int\n\nGet the total dimension of the direct sum of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Tuple{AbelianGradedSpace}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(gs::AbelianGradedSpace) -> Int\n\nGet the total dimension of an Abelian graded space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Tuple{RepresentationSpace, Integer}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(rs::RepresentationSpace, i::Integer) -> Int\n\nGet the degenerate dimension of the ith Abelian quantum number contained in a representation space.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.dimension-Union{Tuple{QN}, Tuple{N}, Tuple{AbelianGradedSpaceProd{N, QN}, NTuple{N, QN}}} where {N, QN<:AbelianQuantumNumber}","page":"Quantum numbers","title":"QuantumLattices.dimension","text":"dimension(rs::AbelianGradedSpaceProd{N, QN}, qns::NTuple{N, QN}) where {N, QN<:AbelianQuantumNumber} -> Int\n\nGet the degenerate dimension of the Abelian quantum number fused by qns in the direct product of several Abelian graded spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.value-Tuple{QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd, Integer}","page":"Quantum numbers","title":"QuantumLattices.value","text":"value(qn::AbelianQuantumNumberProd, i::Integer) -> Number\n\nGet the value of the ith simple Abelian quantum number in a Deligne tensor product.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumNumbers/#QuantumLattices.value-Tuple{SimpleAbelianQuantumNumber}","page":"Quantum numbers","title":"QuantumLattices.value","text":"value(qn::SimpleAbelianQuantumNumber) -> Number\n\nGet the value of a simple Abelian quantum number.\n\n\n\n\n\n","category":"method"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\n using SymPy: symbols\nend","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Couplings-among-different-degrees-of-freedom","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Now we arrive at the final step toward the complete description of a quantum lattice system, i.e., the terms that represent the couplings among different degrees of freedom.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Ingredients-of-terms-in-Hamiltonians","page":"Couplings among different degrees of freedom","title":"Ingredients of terms in Hamiltonians","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"In this package, the type Term is the representation of a term in lattice Hamiltonians.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"As is well-known, different quantum lattice models have different terms. For example, the Hubbard model consists of an usual hopping term tsum_ijc^_ic_j + hc and a Hubbard term Usum_i c^_i c_i c^_ic_i while the transverse-field Ising model contains an Ising term Jsum_ijS^z_iS^z_j as well as a transverse-field term hsum_iS^x_i. Despite the rich diversity of the terms in quantum lattice models, they host common ingredients:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Overall coefficient: every term has an overall coefficient, e.g., the hopping amplitude t for the usual hopping term, the Hubbard interaction strength U for the Hubbard term, etc.\nKind of bonds to be summed over: as the natural result of lattice symmetry, every term contains a summation over some kind of generic bonds, e.g., the usual hopping term sums over the nearest-neighbor bonds ij, the Hubbard term sums over all individual points (namely the 1-point bonds), etc.\nCoupling pattern: in the body of the summation over bonds, every term contains a coupling pattern that can be represented by a certain combination of operators, e.g., the coupling pattern of the usual hopping term can be represented by c^_ic_j, of the Hubbard term can be represented by c^_i c_i c^_ic_i, etc.\nHermiticity: to guarantee the Hamiltonian to be Hermitian, the Hermitian conjugate (h.c.) of non-Hermitian terms must be added, e.g., the Hermitian conjugate of the usual hopping term must be added in the expression of the lattice Hamiltonian while that of the Hubbard term need not.\nBond-dependent amplitude (optional): the amplitude of a term can be dependent on the generic bonds, e.g., the staggered local chemical potential Δsum_i(-1)^ic^_ic_i depends on the site index of a point, the p+ip pairing potential Δsum_ije^iϕ_ijc^_ic^_j + hc depends on the azimuth angle ϕ_ij of the bond ij, etc.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Such common ingredients determine the underlying organization of Term. In fact, all of them manifest themselves in the basic construction function of Term shown as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Term{termkind}(\n id::Symbol, value, bondkind, coupling, ishermitian::Bool;\n amplitude::Union{Function, Nothing}=nothing\n) where termkind","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"where termkind must be a Symbol, value is the overall coefficient which should be a real number, coupling specifies the coupling pattern of the term which can accept an instance of Coupling, or an iterator of Couplings, or a function that returns a Coupling or an iterator of Couplings, and the keyword argument amplitude specifies the bond dependency of the amplitude if it is not nothing. Here, the new type Coupling is the building block of the coupling pattern, which will be discussed in detail in the following section. It is also noted that an extra id is also assigned with each term which can be used for fast lookup for later convenience.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Coupling-patterns","page":"Couplings among different degrees of freedom","title":"Coupling patterns","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Before the further discussion of Term, we at first turn to the coupling patterns, which lie at the center of the constructions of Terms.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Coupling:-building-block-of-coupling-patterns","page":"Couplings among different degrees of freedom","title":"Coupling: building block of coupling patterns","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Coupling uses a set of Indexes together with a coefficient to represent the coupling pattern, as the following construction function implies:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Coupling([value, ]indexes::Index...)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Here, when value is omitted, it will be set to 1.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Let's see a typical example, which represents the coupling pattern of the usual hopping term tsum_ijc^_ic_j + hc:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling(Index(1ˢᵗ, FockIndex(:, :, 2)), Index(2ⁿᵈ, FockIndex(:, :, 1)))\n∑[𝕕(1ˢᵗ, :, :, 2) 𝕕(2ⁿᵈ, :, :, 1)]","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"There are several differences of the Indexes here compared to those introduced in the previous page of Internal degrees of freedom:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The site attributes are not the site indexes of the points in a lattice, instead, they are the ordinals of the points contained in a bond. In fact, in the expression of c^_ic_j, i is always the first site of a bond while j is always the second, thus, the site attributes here are 1ˢᵗ and 2ⁿᵈ for the first Index and the second Index, respectively. Here, 1ˢᵗ and 2ⁿᵈ are instances of Ordinal, and an arbitrary ordinal can be obtained by an integer followed by the corresponding special constants, e.g., 1ˢᵗ, 2ⁿᵈ, 3ʳᵈ, 4ᵗʰ, 5ᵗʰ, etc.\nThe internal attributes are initialized by special FockIndex instances, which do not have the type parameter :f or :b to specify the statistics, and whose orbital and spin attributes are initialized by the : operator rather than integers. Without the statistics of :f or :b, FockIndex could suit for both fermionic and bosonic quantum lattice systems, as the coupling pattern of an usual hopping term is the same for both kinds of systems. Here, 𝕕 (\\bbd) is the function that is convenient to construct and display instances of FockIndex suitable for both fermionic and bosonic statistics. When the : operator is used in the initialization for either the orbital or the spin attribute, the default rule applies in the coupling pattern, that orbitals or spins are summed diagonally, i.e., c^_ic_jsum_ασc^_iασc_jασ. This rule is in fact a tradition in the literature of condensed matter physics. This implicit summation in the construction of a Coupling is made explicit in its string representation by the ∑ symbol, as can be seen in the above example.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Similarly, the total spin of SpinIndex can be omitted during the construction of the coupling patterns of spin terms, meaning that it suits any allowable value of total spins, e.g., the coupling pattern of the spin-flip term of any total spin Jsum_ijS^+_iS^-_j + hc is as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling(1//2, Index(1ˢᵗ, SpinIndex('+')), Index(2ⁿᵈ, SpinIndex('-')))\n1//2 𝕊(1ˢᵗ, '+') 𝕊(2ⁿᵈ, '-')","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Note that in this coupling pattern, there is no summation symbol ∑ in the string representation because all indexes are definite. Therefore, the summation symbol ∑ in the string representation of a coupling pattern only reflects the summation over local internal degrees of freedom, but not the summation over bonds.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The diagonal summation rule also applies to the direction attribute of PhononIndex if initialized by the : operator, e.g., the the coupling pattern of the phonon kinetic term frac12Msum_i p^2_i can be constructed as:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling(𝕡(1ˢᵗ, :), 𝕡(1ˢᵗ, :))\n∑[𝕡(1ˢᵗ, :) 𝕡(1ˢᵗ, :)]","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Of course, more specific coupling patterns can be initialized with more specific internal indexes, e.g., the coupling pattern of the orbital-1 spin-down hopping term of fermions tsum_ijc^_i 1 c_j 1 + hc is","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling(𝕗(1ˢᵗ, 1, -1//2, 2), 𝕗(2ⁿᵈ, 1, -1//2, 1))\n𝕗(1ˢᵗ, 1, -1//2, 2) 𝕗(2ⁿᵈ, 1, -1//2, 1)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"When all Indexes are of the same type, a Coupling can be initialized in different simpler ways:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"# Coupling pattern for Fock systems\nCoupling(\n [value, ]\n sites::Union{Colon, NTuple{N, Ordinal}},\n ::Type{<:FockIndex},\n orbitals::Union{NTuple{N, Int}, Colon},\n spins::Union{NTuple{N, Union{Rational{Int}, Int}}, Colon},\n nambus::Union{NTuple{N, Int}, Colon}\n) where N\nCoupling(\n [value, ]\n ::Union{typeof(𝕗), typeof(𝕓), typeof(𝕕)},\n sites::Union{Colon, NTuple{N, Ordinal}},\n orbitals::Union{NTuple{N, Int}, Colon},\n spins::Union{NTuple{N, Union{Rational{Int}, Int}}, Colon},\n nambus::Union{NTuple{N, Int}, Colon}\n) where N\n\n# Coupling pattern for spin systems\nCoupling(\n [value, ]\n sites::Union{Colon, NTuple{N, Ordinal}},\n ::Type{<:SpinIndex},\n tags::NTuple{N, Char}\n) where N\nCoupling(\n [value, ]\n ::Type{<:𝕊},\n sites::Union{Colon, NTuple{N, Ordinal}},\n tags::NTuple{N, Char}\n) where N\n\n# Coupling pattern for phonon systems\nCoupling(\n [value, ]\n sites::Union{Colon, NTuple{N, Ordinal}},\n ::Type{<:Union{PhononIndex{:u}, PhononIndex{:p}}},\n directions::Union{Colon, NTuple{N, Char}}\n) where N\nCoupling(\n [value, ]\n ::Union{typeof(𝕦), typeof(𝕡)},\n sites::Union{Colon, NTuple{N, Ordinal}},\n directions::Union{Colon, NTuple{N, Char}}\n) where N","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Here, as is usual, when value is omitted, the coefficient of the Coupling will be set to be 1.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"See examples:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling((1ˢᵗ, 1ˢᵗ, 2ⁿᵈ, 2ⁿᵈ), FockIndex, :, :, (2, 2, 1, 1))\n∑[𝕕(1ˢᵗ, :, :, 2) 𝕕(1ˢᵗ, :, :, 2) 𝕕(2ⁿᵈ, :, :, 1) 𝕕(2ⁿᵈ, :, :, 1)]\n\njulia> Coupling(𝕕, (1ˢᵗ, 1ˢᵗ, 2ⁿᵈ, 2ⁿᵈ), :, :, (2, 2, 1, 1))\n∑[𝕕(1ˢᵗ, :, :, 2) 𝕕(1ˢᵗ, :, :, 2) 𝕕(2ⁿᵈ, :, :, 1) 𝕕(2ⁿᵈ, :, :, 1)]\n\njulia> Coupling((1ˢᵗ, 2ⁿᵈ), SpinIndex, ('z', 'z'))\n𝕊(1ˢᵗ, 'z') 𝕊(2ⁿᵈ, 'z')\n\njulia> Coupling(𝕊, (1ˢᵗ, 2ⁿᵈ), ('z', 'z'))\n𝕊(1ˢᵗ, 'z') 𝕊(2ⁿᵈ, 'z')\n\njulia> Coupling((1ˢᵗ, 1ˢᵗ), PhononIndex{:p}, :)\n∑[𝕡(1ˢᵗ, :) 𝕡(1ˢᵗ, :)]\n\njulia> Coupling(𝕡, (1ˢᵗ, 1ˢᵗ), :)\n∑[𝕡(1ˢᵗ, :) 𝕡(1ˢᵗ, :)]","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"A Coupling can be multiplied with a number:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> coupling = Coupling(1//2, 𝕊(1ˢᵗ, '+'), 𝕊(2ⁿᵈ, '-'));\n\njulia> coupling * 3\n3//2 𝕊(1ˢᵗ, '+') 𝕊(2ⁿᵈ, '-')\n\njulia> 3 * coupling\n3//2 𝕊(1ˢᵗ, '+') 𝕊(2ⁿᵈ, '-')","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Two Couplings can be multiplied together:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> cp₁ = Coupling(𝕕, (1ˢᵗ, 1ˢᵗ), (:, :), (1//2, 1//2), (2, 1));\n\njulia> cp₂ = Coupling(𝕕, (1ˢᵗ, 1ˢᵗ), (:, :), (-1//2, -1//2), (2, 1));\n\njulia> cp₁ * cp₂\n∑[𝕕(1ˢᵗ, :, 1//2, 2) 𝕕(1ˢᵗ, :, 1//2, 1)] ⊗ ∑[𝕕(1ˢᵗ, :, -1//2, 2) 𝕕(1ˢᵗ, :, -1//2, 1)]","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"It is noted that due to the implicit summation of the orbital index in the coupling pattern, the above product is not equal to the coupling pattern of the Hubbard term Usum_i c^_i c_i c^_ic_i:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> cp₁ = Coupling(𝕕, (1ˢᵗ, 1ˢᵗ), :, (1//2, 1//2), (2, 1));\n\njulia> cp₂ = Coupling(𝕕, (1ˢᵗ, 1ˢᵗ), :, (-1//2, -1//2), (2, 1));\n\njulia> cp = Coupling(𝕕, (1ˢᵗ, 1ˢᵗ, 1ˢᵗ, 1ˢᵗ), :, (1//2, 1//2, -1//2, -1//2), (2, 1, 2, 1)) # Hubbard coupling pattern\n∑[𝕕(1ˢᵗ, :, 1//2, 2) 𝕕(1ˢᵗ, :, 1//2, 1) 𝕕(1ˢᵗ, :, -1//2, 2) 𝕕(1ˢᵗ, :, -1//2, 1)]\n\njulia> cp == cp₁ * cp₂\nfalse","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Default-rules-in-coupling-patterns","page":"Couplings among different degrees of freedom","title":"Default rules in coupling patterns","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"As has been shown in the previous subsection, some attributes of the internal attribute of Index can be initialized by the : operator during the construction of a coupling pattern. For the orbital and spin attributes of FockIndex, and for the direction attribute of PhononIndex, the default rule is that such indexes will be summed diagonally in the coupling pattern. In fact, the site attribute of Index and the nambu attribute of FockIndex also support the : initialization, but with different default rules.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Let's return to the example of the coupling pattern of the usual hopping term, i.e., c^dagger_ic_j. Apparently, the site attributes are always (1ˢᵗ, 2ⁿᵈ) and the nambu attributes are always (2, 1) as long as the coupling pattern belongs to an usual hopping term. In fact, for most common terms in condensed matter, such attributes in the coupling pattern usually depends only on their kinds other than the concrete instances. Therefore, we could define them outside the construction functions of Coupling or Term by separate functions, and just leave them to the default rules.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"All predefined default rules can be found in the section of Specialized terms. If you need a term that is beyond such default rules, or you just think that such rules are too complicated to remember, it is recommended to explicitly writing them out in the coupling pattern.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Coupling-patterns-with-constraints","page":"Couplings among different degrees of freedom","title":"Coupling patterns with constraints","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The default rules cannot handle complicated summation conditions on the local internal degrees of freedom in the coupling pattern. For example, for the interorbital-interspin Hubbard term in a multi-orbital Hubbard model, which can be written as Usum_isum_αβtextandσσ c^_iασ c_iασ c^_iβσ c_iβσ, it is impossible to specify its coupling pattern by a single Coupling in the usual way as introduced in previous subsections. Although the coupling pattern of a Term can also be an iterator of Couplings, it would be quite complicated to write down all the expressions by the manual expansion of the summation over α, β, σ and σ. In fact, we have provided a simple way to specify a coupling pattern like this with the help of the macro @pattern:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"@pattern(index₁, index₂, ...[; constraint=...])","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"For example, the coupling pattern of the above interorbital-interspin Hubbard term can be constructed as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling(@pattern(\n 𝕕(:, α, σ, 2), 𝕕(:, α, σ, 1), 𝕕(:, β, σ′, 2), 𝕕(:, β, σ′, 1);\n constraint=α<β && σ≠σ′\n )\n )\n∑[𝕕(:, α, σ, 2) 𝕕(:, α, σ, 1) 𝕕(:, β, σ′, 2) 𝕕(:, β, σ′, 1)](α < β && σ ≠ σ′)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The keyword argument constraint can be omitted if there are no constraints in the summation, e.g., for a special kind of phonon potential Vsum_ijfrac12sum_μνu_i^μ u_j^ν, the coupling pattern can be written as","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling(1//2, @pattern 𝕦(:, μ) 𝕦(:, ν))\n1//2 ∑[𝕦(:, μ) 𝕦(:, ν)]","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The Indexes in the @pattern macro can be of different types, e.g., for a fabricated term just for illustration λsum_ijfrac12sum_αβσ c^dagger_iασ c_iβσ u^x_i, where itinerant electrons are coupled to lattice vibrations, the coupling pattern is","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> Coupling(1//2, @pattern 𝕕(1ˢᵗ, α, σ, 2) 𝕕(1ˢᵗ, β, σ, 1) 𝕦(1ˢᵗ, x))\n1//2 ∑[𝕕(1ˢᵗ, α, σ, 2) 𝕕(1ˢᵗ, β, σ, 1) 𝕦(1ˢᵗ, x)]","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"In principle, the couplings of hybrid quantum lattice systems that couple different categories of internal degrees of freedom can be initialized in these ways. For more discussions on hybrid systems, please refer to the page of Hybrid systems.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"One more remark. The constraints can only act on the internal attribute but not on the site attribute of Index. Remind that the site attribute of Index in the coupling pattern is the ordinal of a point in a bond but not the site index of a point in a lattice. Constraint on it makes no sense.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Coupling-patterns-with-matrices-acting-on-sub-internal-spaces","page":"Couplings among different degrees of freedom","title":"Coupling patterns with matrices acting on sub internal spaces","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"At times, the coupling pattern of a term is not compact enough to be represented by a single Coupling. Then as has been pointed out, they can be represented by an iterator of Couplings. A particular common case in condensed matter physics is that it can be represented by a matrix acting on specific sub internal spaces, e.g., a spin-dependent hopping tsum_ijc^dagger_i σᶻ c_j + hc where σᶻ acts on the local spin space. A new type, the MatrixCoupling, as a vector of Coupling, which can be constructed by the following functions:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"# Fock systems\nMatrixCoupling(\n sites::Union{NTuple{2, Ordinal}, Colon},\n ::Type{<:FockIndex},\n orbital::Union{AbstractMatrix, Colon},\n spin::Union{AbstractMatrix, Colon},\n nambu::Union{AbstractMatrix, Colon}\n)\nMatrixCoupling(\n ::Union{typeof(𝕗), typeof(𝕓), typeof(𝕕)},\n sites::Union{NTuple{2, Ordinal}, Colon},\n orbital::Union{AbstractMatrix, Colon},\n spin::Union{AbstractMatrix, Colon},\n nambu::Union{AbstractMatrix, Colon}\n)\n𝕗⁺𝕗(\n sites::Union{NTuple{2, Ordinal}, Colon},\n orbital::Union{AbstractMatrix, Colon},\n spin::Union{AbstractMatrix, Colon},\n nambu::Union{AbstractMatrix, Colon}\n)\n𝕓⁺𝕓(\n sites::Union{NTuple{2, Ordinal}, Colon},\n orbital::Union{AbstractMatrix, Colon},\n spin::Union{AbstractMatrix, Colon},\n nambu::Union{AbstractMatrix, Colon}\n)\n𝕕⁺𝕕(\n sites::Union{NTuple{2, Ordinal}, Colon},\n orbital::Union{AbstractMatrix, Colon},\n spin::Union{AbstractMatrix, Colon},\n nambu::Union{AbstractMatrix, Colon}\n)\n\n# Spin systems\nMatrixCoupling(\n sites::Union{NTuple{2, Ordinal}, Colon},\n ::Type{<:SpinIndex},\n matrix::AbstractMatrix\n)\nMatrixCoupling(\n ::Type{<:𝕊},\n sites::Union{NTuple{2, Ordinal}, Colon},\n matrix::AbstractMatrix\n)\n𝕊ᵀ𝕊(\n sites::Union{NTuple{2, Ordinal}, Colon},\n matrix::AbstractMatrix\n)\n\n# Phonon systems\nMatrixCoupling(\n sites::Union{NTuple{2, Ordinal}, Colon},\n ::Type{<:PhononIndex{:u}},\n matrix::AbstractMatrix\n)\nMatrixCoupling(\n ::typeof(𝕦),\n sites::Union{NTuple{2, Ordinal}, Colon},\n matrix::AbstractMatrix\n)\n𝕦ᵀ𝕦(\n sites::Union{NTuple{2, Ordinal}, Colon},\n matrix::AbstractMatrix\n)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"is designed to represent the coupling patterns in such cases. Here, in construction functions for spin systems the matrix acts on the local (S^x S^y S^z)^T vector space, and in the construction functions for phonon systems the matrix acts on the local (u^x u^y u^z)^T vector space depending on the dimension of the lattice vibrations.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The following codes construct the coupling pattern of the above spin-dependent hopping example:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> mc = MatrixCoupling(𝕕, :, :, σ\"z\", :);\n\njulia> length(mc)\n2\n\njulia> mc[1]\n∑[𝕕(:, :, 1//2, :) 𝕕(:, :, 1//2, :)]\n\njulia> mc[2]\n- ∑[𝕕(:, :, -1//2, :) 𝕕(:, :, -1//2, :)]\n\njulia> mc == 𝕕⁺𝕕(:, :, σ\"z\", :)\ntrue","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Here, @σ_str is a string literal that returns the generalized Pauli matrices:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"σ\"0\" => SparseMatrixCSC([1 0; 0 1])\nσ\"x\" => SparseMatrixCSC([0 1; 1 0])\nσ\"y\" => SparseMatrixCSC([0 -1im; 1im 0])\nσ\"z\" => SparseMatrixCSC([1 0; 0 -1])\nσ\"+\" => SparseMatrixCSC([0 1; 0 0])\nσ\"-\" => SparseMatrixCSC([0 0; 1 0])\nσ\"11\" => SparseMatrixCSC([1 0; 0 0])\nσ\"22\" => SparseMatrixCSC([0 0; 0 1])","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The coupling pattern of the Heisenberg term Jsum_ijS^x_iS^x_j+S^y_iS^y_j+S^z_iS^z_j can be constructed as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> mc = MatrixCoupling(𝕊, :, Heisenberg\"\");\n\njulia> length(mc)\n3\n\njulia> mc[1]\n𝕊(:, 'x') 𝕊(:, 'x')\n\njulia> mc[2]\n𝕊(:, 'y') 𝕊(:, 'y')\n\njulia> mc[3]\n𝕊(:, 'z') 𝕊(:, 'z')\n\njulia> mc == 𝕊ᵀ𝕊(:, Heisenberg\"\")\ntrue","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"where @Heisenberg_str is a string literal that helps to specify common spin terms.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Here lists all the predefined string literals that are helpful to local spin systems:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"# Heisenberg term\nHeisenberg\"\" => SparseMatrixCSC([1 0 0; 0 1 0; 0 0 1])\n\n# Ising terms\nIsing\"x\" => SparseMatrixCSC([1 0 0; 0 0 0; 0 0 0])\nIsing\"y\" => SparseMatrixCSC([0 0 0; 0 1 0; 0 0 0])\nIsing\"z\" => SparseMatrixCSC([0 0 0; 0 0 0; 0 0 1])\n\n# Γ terms\nΓ\"x\" => SparseMatrixCSC([0 0 0; 0 0 1; 0 1 0])\nΓ\"y\" => SparseMatrixCSC([0 0 1; 0 0 0; 1 0 0])\nΓ\"z\" => SparseMatrixCSC([0 1 0; 1 0 0; 0 0 0])\n\n# Γ′ terms\nΓ′\"x\" => SparseMatrixCSC([0 1 1; 1 0 0; 1 0 0])\nΓ′\"y\" => SparseMatrixCSC([0 1 0; 1 0 1; 0 1 0])\nΓ′\"z\" => SparseMatrixCSC([0 0 1; 0 0 1; 1 1 0])\n\n# Dzyaloshinskii–Moriya terms\nDM\"x\" => SparseMatrixCSC([0 0 0; 0 0 1; 0 -1 0])\nDM\"y\" => SparseMatrixCSC([0 0 -1; 0 0 0; 1 0 0])\nDM\"z\" => SparseMatrixCSC([0 1 0; -1 0 0; 0 0 0])","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"MatrixCouplings can be producted or summed.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"For one example, for the nearest-neighbor spin exchange interactions of itinerant fermions Jsum_ijc^_ivecσ_ic_i c^_jvecσ_jc_j where vecσ_i=(σ^x_i σ^y_i σ^z_i)^T acts on the local spin space at site i, the coupling pattern can be constructed as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> mc₁ = 𝕕⁺𝕕(:, :, σ\"+\", :);\n\njulia> mc₂ = 𝕕⁺𝕕(:, :, σ\"-\", :);\n\njulia> mc₃ = 𝕕⁺𝕕(:, :, σ\"z\", :);\n\njulia> coupling = 1//2*mc₁*mc₂ + 1//2*mc₂*mc₁ + mc₃*mc₃;\n\njulia> collect(coupling)\n6-element Vector{Coupling}:\n 1//2 ∑[𝕕(:, :, 1//2, :) 𝕕(:, :, -1//2, :)] ⊗ ∑[𝕕(:, :, -1//2, :) 𝕕(:, :, 1//2, :)]\n 1//2 ∑[𝕕(:, :, -1//2, :) 𝕕(:, :, 1//2, :)] ⊗ ∑[𝕕(:, :, 1//2, :) 𝕕(:, :, -1//2, :)]\n ∑[𝕕(:, :, 1//2, :) 𝕕(:, :, 1//2, :)] ⊗ ∑[𝕕(:, :, 1//2, :) 𝕕(:, :, 1//2, :)]\n - ∑[𝕕(:, :, -1//2, :) 𝕕(:, :, -1//2, :)] ⊗ ∑[𝕕(:, :, 1//2, :) 𝕕(:, :, 1//2, :)]\n - ∑[𝕕(:, :, 1//2, :) 𝕕(:, :, 1//2, :)] ⊗ ∑[𝕕(:, :, -1//2, :) 𝕕(:, :, -1//2, :)]\n ∑[𝕕(:, :, -1//2, :) 𝕕(:, :, -1//2, :)] ⊗ ∑[𝕕(:, :, -1//2, :) 𝕕(:, :, -1//2, :)]","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"For another example, for the onsite spin-orbital coupling of the (d_yz d_xz d_xy)^T t_2g orbitals lambdasum_i c^dagger_i vecL_icdotvecσ_i c_i where vecL_i=(L^x_i L^y_i L^z_i)^T acts on the local orbital space and vecσ_i=(σ^x_i σ^y_i σ^z_i)^T acts on the local spin space, the coupling pattern can be constructed as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> mc₁ = 𝕕⁺𝕕(:, L\"x\", σ\"x\", :);\n\njulia> mc₂ = 𝕕⁺𝕕(:, L\"y\", σ\"y\", :);\n\njulia> mc₃ = 𝕕⁺𝕕(:, L\"z\", σ\"z\", :);\n\njulia> coupling = mc₁ + mc₂ + mc₃;\n\njulia> collect(coupling)\n12-element Vector{Coupling}:\n -1im 𝕕(:, 3, -1//2, :) 𝕕(:, 2, 1//2, :)\n 1im 𝕕(:, 2, -1//2, :) 𝕕(:, 3, 1//2, :)\n -1im 𝕕(:, 3, 1//2, :) 𝕕(:, 2, -1//2, :)\n 1im 𝕕(:, 2, 1//2, :) 𝕕(:, 3, -1//2, :)\n - 𝕕(:, 3, -1//2, :) 𝕕(:, 1, 1//2, :)\n 𝕕(:, 1, -1//2, :) 𝕕(:, 3, 1//2, :)\n 𝕕(:, 3, 1//2, :) 𝕕(:, 1, -1//2, :)\n - 𝕕(:, 1, 1//2, :) 𝕕(:, 3, -1//2, :)\n -1im 𝕕(:, 2, 1//2, :) 𝕕(:, 1, 1//2, :)\n 1im 𝕕(:, 1, 1//2, :) 𝕕(:, 2, 1//2, :)\n 1im 𝕕(:, 2, -1//2, :) 𝕕(:, 1, -1//2, :)\n -1im 𝕕(:, 1, -1//2, :) 𝕕(:, 2, -1//2, :)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Bond-dependent-coupling-patterns","page":"Couplings among different degrees of freedom","title":"Bond-dependent coupling patterns","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Sometimes, the coupling pattern of a term could be dependent on the bonds. For example, for the Kitaev term on the honeycomb lattice Ksum_ij_γ S_i^γS_j^γ where the nearest-neighbor spin exchange interaction depends on the direction of the nearest-neighbor bonds, as illustrated by the following picture, (Image: Kitaev honeycomb model) the coupling pattern can be represented by the following function:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"function kitaev(bond::Bond)\n ϕ = azimuth(rcoordinate(bond)) # get the azimuth angle of a bond in radians\n any(≈(ϕ), (π/6, 7π/6)) && return Coupling(𝕊, :, ('x', 'x'))\n any(≈(ϕ), (5π/6, 11π/6)) && return Coupling(𝕊, :, ('y', 'y'))\n any(≈(ϕ), (π/2, 3π/2)) && return Coupling(𝕊, :, ('z', 'z'))\n error(\"kitaev error: wrong input bond.\")\nend","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Note in all cases, the function to specify a bond dependent coupling pattern can only accept an instance of Bond as its sole argument, but it can return either a Coupling or an iterator of Couplings.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Bond-dependent-amplitude","page":"Couplings among different degrees of freedom","title":"Bond-dependent amplitude","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"As is similar to bond-dependent coupling patterns, the bond-dependent amplitude of a term can be achieved by a function that only accepts an instance of Bond as its sole argument and returns a number. For example, for the staggered local chemical potential Δsum_i(-1)^ic_i^c_i, the bond-dependent amplitude can be specified as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"function staggered(bond::Bond)\n @assert length(bond)==1 \"staggered error: wrong input bond.\"\n return (-1)^bond[1].site\nend","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Terms-with-complex-coefficients","page":"Couplings among different degrees of freedom","title":"Terms with complex coefficients","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"A special case must be paid attention to, i.e., a term with a complex coefficient. In the construction function of Term, a complex number with a nonzero imaginary part can not be used to specify the overall coefficient of a term. This is because the Hamiltonian of a quantum lattice system must be Hermitian and a complex coefficient must be accompanied with its complex conjugate. Thus, the positive direction of the phase must be appointed, resulting in a bond-dependent amplitude. Then, it is always feasible to extract a real overall factor as the final coefficient and leave the remaining part to the bond-dependent amplitude function. For example, for the p+ip pairing potential Δsum_ije^iϕ_ijc^_ic^_j + hc, the coefficient is a pure imaginary number along the y direction, and the bond-dependent amplitude of this term can be specified as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"function pip_potential(bond::Bond)\n ϕ = azimuth(rcoordinate(bond))\n return exp(1im*ϕ)\nend","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Principles-of-the-partition-of-coefficients","page":"Couplings among different degrees of freedom","title":"Principles of the partition of coefficients","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"As has been shown but not explicitly stated, in general, the coefficient of a term is partitioned into three parts in Term, the first part is the overall coefficient which must be a real number and is specified by the value argument in the construction function, the second part is the coefficient occurring in the coupling pattern, and the last part is handled by the bond-dependent amplitude function. Then there exist an ambiguity about how these three parts should be partitioned. Here are the recommended principles:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"The overall real coefficient should contain as much as possible of the coefficient of the term that can be put in front of the summation over bonds.\nThe coefficient of a coupling pattern should be determined by traditions (e.g., i in the σʸ Pauli matrix), otherwise should be 1.\nThe bond-dependent amplitude should not contain the tuning parameters of a quantum lattice model.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"If the coefficient of a complicated term cannot fulfill the above principles at the same time, then you should consider splitting it into several terms. A simple check of the number of terms is that in principle it should be equal to the number of tunable parameters of the quantum lattice model under study.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Specialized-terms","page":"Couplings among different degrees of freedom","title":"Specialized terms","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"For each certain kind of terms, some of the input parameters of the basic construction function are in fact fixed or have default values, e.g., the usual hopping term is always non-Hermitian while the Hubbard term is always Hermitian. Therefore, for each common kind of terms in condensed matter physics, it is more convenient to define the specialized construction function. In the following subsections we will list the predefined specialized terms.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Terms-for-complex-fermionic/bosonic-systems","page":"Couplings among different degrees of freedom","title":"Terms for complex fermionic/bosonic systems","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"# termkind = :Onsite\n# bondkind = 0\nOnsite(\n id::Symbol, value, coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :));\n ishermitian::Bool=true,\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :Hopping\n# ishermitian = false\nHopping(\n id::Symbol,\n value,\n bondkind,\n coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :));\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :Pairing\n# ishermitian = false\nPairing(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :Hubbard\n# bondkind = 0\n# coupling = Coupling(𝕕, :, :, (1//2, 1//2, -1//2, -1//2), (2, 1, 2, 1))\n# ishermitian = true\nHubbard(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :InterOrbitalInterSpin\n# bondkind = 0\n# coupling = Coupling(@pattern(\n# 𝕕(:, α, σ, 2), 𝕕(:, α, σ, 1), 𝕕(:, β, σ′, 2), 𝕕(:, β, σ′, 1);\n# constraint=α<β && σ≠σ′\n# ))\n# ishermitian = true\nInterOrbitalInterSpin(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :InterOrbitalIntraSpin\n# bondkind = 0\n# coupling = Coupling(@pattern(\n# 𝕕(:, α, σ, 2), 𝕕(:, α, σ, 1), 𝕕(:, β, σ, 2), 𝕕(:, β, σ, 1);\n# constraint=α<β\n# ))\n# ishermitian = true\nInterOrbitalIntraSpin(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :SpinFlip\n# bondkind = 0\n# coupling = Coupling(@pattern(\n# 𝕕(:, α, 1//2, 2), 𝕕(:, β, -1//2, 2), 𝕕(:, α, -1//2, 1), 𝕕(:, β, 1//2, 1);\n# constraint=α<β\n# ))\n# ishermitian = false\nSpinFlip(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :PairHopping\n# bondkind = 0\n# coupling = Coupling(@pattern(\n# 𝕕(:, α, 1//2, 2), 𝕕(:, α, -1//2, 2), 𝕕(:, β, -1//2, 1), 𝕕(:, β, 1//2, 1);\n# constraint=α<β\n# ))\n# ishermitian = false\nPairHopping(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :Coulomb\nCoulomb(\n id::Symbol,\n value,\n bondkind,\n coupling=Coupling(𝕕(:, :, :, :), 𝕕(:, :, :, :))^2;\n ishermitian::Bool=true,\n amplitude::Union{Function, Nothing}=nothing\n)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Default rules for such terms when the site attribute of Index and the orbital, spin and nambu attributes of FockIndex initialized by the : operator are listed as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":" site orbital spin nambu\nOnsite (1ˢᵗ, 1ˢᵗ) diagonal diagonal (2, 1)\nHopping (1ˢᵗ, 2ⁿᵈ) diagonal diagonal (2, 1)\nPairing (1ˢᵗ, 1ˢᵗ)/(1ˢᵗ, 2ⁿᵈ) diagonal diagonal (1, 1)\nHubbard (1ˢᵗ, 1ˢᵗ, 1ˢᵗ, 1ˢᵗ) diagonal \nInterOrbitalInterSpin (1ˢᵗ, 1ˢᵗ, 1ˢᵗ, 1ˢᵗ) \nInterOrbitalIntraSpin (1ˢᵗ, 1ˢᵗ, 1ˢᵗ, 1ˢᵗ) \nSpinFlip (1ˢᵗ, 1ˢᵗ, 1ˢᵗ, 1ˢᵗ) \nPairHopping (1ˢᵗ, 1ˢᵗ, 1ˢᵗ, 1ˢᵗ) \nCoulomb (1ˢᵗ, 1ˢᵗ, 2ⁿᵈ, 2ⁿᵈ) diagonal diagonal (2, 1, 2, 1)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"note: Note\nFor the Pairing term, the site attributes will be (1ˢᵗ, 1ˢᵗ) when bondkind=0, otherwise (1ˢᵗ, 2ⁿᵈ).\nBlank cells in the above table mean that the corresponding attributes have been explicitly specified by the specialized construction functions. See the comments of the above code block in this subsection.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Terms-for-SU(2)-spin-systems","page":"Couplings among different degrees of freedom","title":"Terms for SU(2) spin systems","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Standard concrete spin terms are summarized as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"# termkind = :Zeeman\n# bondkind = 0\n# ishermitian = true\nZeeman(\n id::Symbol, value, direction::Char, g::Number=1;\n amplitude::Union{Function, Nothing}=nothing\n)\nZeeman(\n id::Symbol,\n value,\n direction::Union{AbstractVector{<:Number}, Tuple{Number, Number}},\n g::Union{Number, AbstractMatrix{<:Number}}=1;\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :SingleIonAnisotropy\n# bondkind = 0\n# ishermitian = true\nSingleIonAnisotropy(\n id::Symbol, value, direction::Char;\n amplitude::Union{Function, Nothing}=nothing\n)\nSingleIonAnisotropy(\n id::Symbol, value, matrix::AbstractMatrix{<:Number};\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :Ising\n# ishermitian = true\nIsing(\n id::Symbol, value, bondkind, direction::Char;\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :Heisenberg\n# ishermitian = true\nHeisenberg(\n id::Symbol, value, bondkind;\n form::Symbol=Symbol(\"+-z\"), amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :Kitaev\n# ishermitian = true\nKitaev(\n id::Symbol, value, bondkind;\n x::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n y::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n z::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :Γ\n# ishermitian = true\nΓ(\n id::Symbol, value, bondkind;\n x::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n y::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n z::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :Γ′\n# ishermitian = true\nΓ′(\n id::Symbol, value, bondkind;\n x::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n y::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n z::AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}},\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing\n)\n\n# termkind = :DM\n# ishermitian = true\nDM(\n id::Symbol,\n value,\n bondkind,\n vectors::Pair{<:AbstractVector{<:Union{Number, Tuple{Number, Number}, AbstractVector{<:Number}}}, <:Union{Char, AbstractVector{<:Number}}}...;\n unit::Symbol=:degree,\n amplitude::Union{Function, Nothing}=nothing\n)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Beyond the above standard concrete terms, the generic spin term can be used:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"# termkind = :SpinTerm\n# ishermitian = true\nSpinTerm(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Here, only the site attribute of Index can be initialized by the : operator. Depending on its rank (i.e. the number of Indexes in the coupling pattern) and the length of the bonds to be summed over, it will be (1ˢᵗ, 1ˢᵗ, ...) when the bond length is 1 and (1ˢᵗ, 2ⁿᵈ, 1ˢᵗ, 2ⁿᵈ...) when the bond length is 2. For other generic bonds with more points, no default rule exists.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Terms-for-phononic-systems","page":"Couplings among different degrees of freedom","title":"Terms for phononic systems","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"# termkind = :Kinetic\n# bondkind = 0\n# coupling = Coupling(𝕡(:, :), 𝕡(:, :))\n# ishermitian = true\nKinetic(id::Symbol, value; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :Hooke\n# ishermitian = true\nHooke(id::Symbol, value, bondkind; amplitude::Union{Function, Nothing}=nothing)\n\n# termkind = :Elastic\n# ishermitian = true\n# default rules: (1ˢᵗ, 2ⁿᵈ) for `site` and diagonal for `direction`\nElastic(id::Symbol, value, bondkind, coupling; amplitude::Union{Function, Nothing}=nothing)","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"For Elastic, the site attribute of Index and the direction attribute of PhononIndex{:u} can be initialized by the : operator. The default rules are also summarized in the comments of the above code block.","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/#Expand-terms-to-obtain-operators","page":"Couplings among different degrees of freedom","title":"Expand terms to obtain operators","text":"","category":"section"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"To obtain the operators of a Term, the expand function exported by this package can be used as follows:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"expand(term::Term, bond::Bond, hilbert::Hilbert) -> Operators\nexpand(term::Term, bonds::AbstractVector{<:Bond}, hilbert::Hilbert) -> Operators","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"Let's see a simple example of the usual hopping term:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> t = Hopping(:t, 2.0, 1);\n\njulia> bond = Bond(1, Point(1, [0.0], [0.0]), Point(2, [0.5], [0.0]));\n\njulia> hilbert = Hilbert(1=>Fock{:f}(1, 2), 2=>Fock{:f}(1, 2));\n\njulia> expand(t, bond, hilbert)\nOperators with 4 Operator\n Operator(2.0, 𝕗(1, 1, -1//2, 2, [0.0], [0.0]), 𝕗(2, 1, -1//2, 1, [0.5], [0.0]))\n Operator(2.0, 𝕗(2, 1, -1//2, 2, [0.5], [0.0]), 𝕗(1, 1, -1//2, 1, [0.0], [0.0]))\n Operator(2.0, 𝕗(1, 1, 1//2, 2, [0.0], [0.0]), 𝕗(2, 1, 1//2, 1, [0.5], [0.0]))\n Operator(2.0, 𝕗(2, 1, 1//2, 2, [0.5], [0.0]), 𝕗(1, 1, 1//2, 1, [0.0], [0.0]))","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"When a bond and a term do not match each other, the expand function will return an empty Operators:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> t = Hopping(:t, 1.0, 1);\n\njulia> bond = Bond(2, Point(1, [0.0], [0.0]), Point(1, [1.0], [1.0]));\n\njulia> hilbert = Hilbert(1=>Fock{:f}(1, 2), 2=>Fock{:f}(1, 2));\n\njulia> expand(t, bond, hilbert)\nOperators with 0 Operator","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"In the expand function, an AbstractVector of Bonds can also be provided to get all the operators expanded on such bonds:","category":"page"},{"location":"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/","page":"Couplings among different degrees of freedom","title":"Couplings among different degrees of freedom","text":"julia> t = Hopping(:t, 1.0, 1);\n\njulia> bonds = [\n Bond(1, Point(2, [0.5], [0.0]), Point(1, [0.0], [0.0]))\n Bond(1, Point(2, [-0.5], [-1.0]), Point(1, [0.0], [0.0]))\n ];\n\njulia> hilbert = Hilbert(1=>Fock{:f}(1, 2), 2=>Fock{:f}(1, 2));\n\njulia> expand(t, bonds, hilbert)\nOperators with 8 Operator\n Operator(1.0, 𝕗(2, 1, -1//2, 2, [0.5], [0.0]), 𝕗(1, 1, -1//2, 1, [0.0], [0.0]))\n Operator(1.0, 𝕗(1, 1, -1//2, 2, [0.0], [0.0]), 𝕗(2, 1, -1//2, 1, [0.5], [0.0]))\n Operator(1.0, 𝕗(2, 1, 1//2, 2, [0.5], [0.0]), 𝕗(1, 1, 1//2, 1, [0.0], [0.0]))\n Operator(1.0, 𝕗(1, 1, 1//2, 2, [0.0], [0.0]), 𝕗(2, 1, 1//2, 1, [0.5], [0.0]))\n Operator(1.0, 𝕗(2, 1, -1//2, 2, [-0.5], [-1.0]), 𝕗(1, 1, -1//2, 1, [0.0], [0.0]))\n Operator(1.0, 𝕗(1, 1, -1//2, 2, [0.0], [0.0]), 𝕗(2, 1, -1//2, 1, [-0.5], [-1.0]))\n Operator(1.0, 𝕗(2, 1, 1//2, 2, [-0.5], [-1.0]), 𝕗(1, 1, 1//2, 1, [0.0], [0.0]))\n Operator(1.0, 𝕗(1, 1, 1//2, 2, [0.0], [0.0]), 𝕗(2, 1, 1//2, 1, [-0.5], [-1.0]))","category":"page"},{"location":"advanced topics/Introduction/","page":"Introduction","title":"Introduction","text":"CurrentModule = QuantumLattices","category":"page"},{"location":"advanced topics/Introduction/#AdvancedTopicsIntroduction","page":"Introduction","title":"Introduction","text":"","category":"section"},{"location":"advanced topics/Introduction/","page":"Introduction","title":"Introduction","text":"The unitcell description framework is the basics of this package, which completes the goal of describing a quantum lattice system and obtaining its Hamiltonian in the operator form. Here, we introduce some advanced utilities provided in this package that will be useful for the compiling, debugging and applying of quantum many-body algorithms.","category":"page"},{"location":"advanced topics/Introduction/","page":"Introduction","title":"Introduction","text":"Pages = [\n \"LaTeXFormattedOutputs.md\",\n \"IndexOrders.md\",\n \"BoundaryConditions.md\",\n \"HybridSystems.md\",\n \"Transformations.md\",\n \"ManageProjects.md\",\n ]\nDepth = 2","category":"page"},{"location":"advanced topics/LaTeXFormattedOutputs/","page":"LaTeX formatted outputs","title":"LaTeX formatted outputs","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"advanced topics/LaTeXFormattedOutputs/#LaTeX-formatted-outputs","page":"LaTeX formatted outputs","title":"LaTeX formatted outputs","text":"","category":"section"},{"location":"man/Spatials/","page":"Spatials","title":"Spatials","text":"CurrentModule = QuantumLattices.Spatials","category":"page"},{"location":"man/Spatials/#Spatials","page":"Spatials","title":"Spatials","text":"","category":"section"},{"location":"man/Spatials/","page":"Spatials","title":"Spatials","text":"Modules = [Spatials]\nOrder = [:module, :constant, :type, :macro, :function]","category":"page"},{"location":"man/Spatials/#QuantumLattices.Spatials.heatmap","page":"Spatials","title":"QuantumLattices.Spatials.heatmap","text":"@recipe plot(reciprocalspace::BrillouinZone, data::AbstractMatrix{<:Number})\n@recipe plot(reciprocalspace::ReciprocalZone, data::AbstractMatrix{<:Number})\n\nDefine the recipe for the heatmap visualization of data on a Brillouin/reciprocal zone.\n\n\n\n\n\n","category":"constant"},{"location":"man/Spatials/#QuantumLattices.Spatials.line","page":"Spatials","title":"QuantumLattices.Spatials.line","text":"@recipe plot(path::ReciprocalPath, data::AbstractVector{<:Number})\n@recipe plot(path::ReciprocalPath, data::AbstractMatrix{<:Number})\n\nDefine the recipe for the line visualization of data along a reciprocal path.\n\n\n\n\n\n","category":"constant"},{"location":"man/Spatials/#QuantumLattices.QuantumNumbers.𝕂²-Union{Tuple{N₂}, Tuple{N₁}, Tuple{AbstractVector{<:Number}, AbstractVector{<:AbstractVector{<:Number}}}} where {N₁, N₂}","page":"Spatials","title":"QuantumLattices.QuantumNumbers.𝕂²","text":"𝕂²{N₁, N₂}(momentum::AbstractVector{<:Number}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}; atol=atol, rtol=rtol) where {N₁, N₂}\n\nConstruct a 2d quantum momentum by the coordinates.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.QuantumNumbers.𝕂³-Union{Tuple{N₃}, Tuple{N₂}, Tuple{N₁}, Tuple{AbstractVector{<:Number}, AbstractVector{<:AbstractVector{<:Number}}}} where {N₁, N₂, N₃}","page":"Spatials","title":"QuantumLattices.QuantumNumbers.𝕂³","text":"𝕂³{N₁, N₂, N₃}(momentum::AbstractVector{<:Number}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}; atol=atol, rtol=rtol) where {N₁, N₂, N₃}\n\nConstruct a 3d quantum momentum by the coordinates.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.QuantumNumbers.𝕂¹-Union{Tuple{N}, Tuple{AbstractVector{<:Number}, AbstractVector{<:AbstractVector{<:Number}}}} where N","page":"Spatials","title":"QuantumLattices.QuantumNumbers.𝕂¹","text":"𝕂¹{N}(momentum::AbstractVector{<:Number}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}; atol=atol, rtol=rtol) where N\n\nConstruct a 1d quantum momentum by the coordinates.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.AbstractLattice","page":"Spatials","title":"QuantumLattices.Spatials.AbstractLattice","text":"AbstractLattice{N, D<:Number, M}\n\nAbstract type of a unitcell-described lattice.\n\nIt should have the following contents:\n\nname::Symbol: the name of the lattice\ncoordinates::Matrix{D}: the coordinates of the lattice\nvectors::SVector{M, SVector{N, D}}: the translation vectors of the lattice\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.Bond","page":"Spatials","title":"QuantumLattices.Spatials.Bond","text":"Bond{K, P<:Point}\n\nA generic bond, which could contains several points.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.Bond-Tuple{Point}","page":"Spatials","title":"QuantumLattices.Spatials.Bond","text":"Bond(point::Point)\nBond(kind, point₁::Point, point₂::Point, points::Point...)\n\nConstruct a bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.BrillouinZone","page":"Spatials","title":"QuantumLattices.Spatials.BrillouinZone","text":"BrillouinZone{K, P<:𝕂, S<:SVector, N} <: ReciprocalSpace{K, S}\n\nBrillouin zone of a lattice.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.BrillouinZone-Tuple{AbstractVector{<:AbstractVector{<:Number}}, Any}","page":"Spatials","title":"QuantumLattices.Spatials.BrillouinZone","text":"BrillouinZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, nk)\nBrillouinZone{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, nk) where K\nBrillouinZone(::Type{P}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}) where {P<:𝕂}\nBrillouinZone{K}(::Type{P}, reciprocals::AbstractVector{<:AbstractVector{<:Number}}) where {K, P<:𝕂}\n\nConstruct a Brillouin zone.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.Lattice","page":"Spatials","title":"QuantumLattices.Spatials.Lattice","text":"Lattice{N, D<:Number, M} <: AbstractLattice{N, D, M}\n\nSimplest lattice.\n\nA simplest lattice can be constructed from its coordinates and translation vectors.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.Lattice-Union{Tuple{N}, Tuple{AbstractLattice, NTuple{N, Int64}}, Tuple{AbstractLattice, NTuple{N, Int64}, NTuple{N, Union{Char, String, Symbol}}}} where N","page":"Spatials","title":"QuantumLattices.Spatials.Lattice","text":"Lattice(lattice::AbstractLattice, ranges::NTuple{N, Int}, boundaries::NTuple{N, Union{Char, String, Symbol}}=ntuple(i->'O', Val(N)); mode::Symbol=:nonnegative) where N\nLattice(lattice::AbstractLattice, ranges::NTuple{N, UnitRange{Int}}, boundaries::NTuple{N, Union{Char, String, Symbol}}=ntuple(i->'O', Val(N))) where N\n\nConstruct a lattice from the translations of another.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.Lattice-Union{Tuple{Vararg{NTuple{N, Number}}}, Tuple{N}} where N","page":"Spatials","title":"QuantumLattices.Spatials.Lattice","text":"Lattice(coordinates::NTuple{N, Number}...; name::Symbol=:lattice, vectors::Union{AbstractVector{<:AbstractVector{<:Number}}, Nothing}=nothing) where N\nLattice(coordinates::AbstractVector{<:Number}...; name::Symbol=:lattice, vectors::Union{AbstractVector{<:AbstractVector{<:Number}}, Nothing}=nothing)\n\nConstruct a lattice.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.Neighbors","page":"Spatials","title":"QuantumLattices.Spatials.Neighbors","text":"Neighbors{K, V<:Number} <: CompositeDict{K, V}\n\nNeighbor vs. bond length maps.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.Neighbors-Tuple{AbstractLattice, Integer}","page":"Spatials","title":"QuantumLattices.Spatials.Neighbors","text":"Neighbors(lattice::AbstractLattice, nneighbor::Integer; coordination::Integer=12)\n\nGet the neighbor vs. bond length map of a lattice up to the nneighborth order.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.Point","page":"Spatials","title":"QuantumLattices.Spatials.Point","text":"Point{N, D<:Number}\n\nA point in a unitcell-described lattice.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.Point-Union{Tuple{N}, Tuple{Integer, NTuple{N, var\"#s123\"} where var\"#s123\"<:Number}, Tuple{Integer, NTuple{N, var\"#s122\"} where var\"#s122\"<:Number, NTuple{N, var\"#s121\"} where var\"#s121\"<:Number}} where N","page":"Spatials","title":"QuantumLattices.Spatials.Point","text":"Point(site::Integer, rcoordinate::SVector{N, D}, icoordinate::SVector{N, D}) where {N, D<:Number}\nPoint(site::Integer, rcoordinate::NTuple{N, <:Number}, icoordinate::NTuple{N, <:Number}=ntuple(i->0, Val(N))) where N\nPoint(site::Integer, rcoordinate::AbstractVector{<:Number}, icoordinate::AbstractVector{<:Number}=zero(SVector{length(rcoordinate), Int}))\n\nConstruct a labeled point.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalCurve","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalCurve","text":"ReciprocalCurve{K, S<:SVector} <: ReciprocalSpace{K, S}\n\nA curve in the reciprocal space.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalCurve-Tuple{ReciprocalPath}","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalCurve","text":"ReciprocalCurve(path::ReciprocalPath)\n\nConstruct a reciprocal curve from a reciprocal path.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalCurve-Union{Tuple{AbstractVector{<:NTuple{N, Number}}}, Tuple{N}} where N","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalCurve","text":"ReciprocalCurve(curve::AbstractVector{<:NTuple{N, Number}}) where N\nReciprocalCurve(curve::AbstractVector{<:AbstractVector{<:Number}})\nReciprocalCurve{K}(curve::AbstractVector{<:NTuple{N, Number}}) where {K, N}\nReciprocalCurve{K}(curve::AbstractVector{<:AbstractVector{<:Number}}) where K\n\nConstruct a curve in the reciprocal space.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalPath","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalPath","text":"ReciprocalPath{K, S<:SVector, N, R} <: ReciprocalSpace{K, S}\n\nA path in the reciprocal space.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalPath-Tuple{AbstractVector{<:AbstractVector{<:Number}}, NamedTuple{(:points, :labels), <:Tuple{var\"#s15\", var\"#s14\"} where {var\"#s15\"<:Tuple, var\"#s14\"<:Tuple}}}","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalPath","text":"ReciprocalPath(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, contents::NamedTuple{(:points, :labels), <:Tuple{<:Tuple, <:Tuple}}; length=100, ends=nothing)\nReciprocalPath{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, contents::NamedTuple{(:points, :labels), <:Tuple{<:Tuple, <:Tuple}}; length=100, ends=nothing) where K\n\nReciprocalPath(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, points::NTuple{N, Number}...; labels=points, length=100, ends=nothing) where N\nReciprocalPath(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, points::Tuple{Vararg{NTuple{N, Number}}}; labels=points, length=100, ends=nothing) where N\nReciprocalPath{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, points::NTuple{N, Number}...; labels=points, length=100, ends=nothing) where {K, N}\nReciprocalPath{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, points::Tuple{Vararg{NTuple{N, Number}}}; labels=points, length=100, ends=nothing) where {K, N}\n\nReciprocalPath(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, segments::Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}...; labels=segments, length=100, ends=nothing) where N\nReciprocalPath(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, segments::Tuple{Vararg{Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}}}; labels=segments, length=100, ends=nothing) where N\nReciprocalPath{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, segments::Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}...; labels=segments, length=100, ends=nothing) where {K, N}\nReciprocalPath{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, segments::Tuple{Vararg{Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}}}; labels=segments, length=100, ends=nothing) where {K, N}\n\nConstruct a path in the reciprocal space.\n\nnote: Note\nFor connected segments,\nwhen length is an integer, it specifies the length of each segment except for the last whose length will be length+1;\nwhen ends is nothing, the start point will be included while the end point will be not for each segment except for the last both points of which will be included.\nFor disconnected segments, they can be partitioned into several connected parts, and the rules for connected segments apply for each of such connected parts.With the above rules, all the points along the assigned path will be counted once and only once with the largest homogeneity.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalSpace","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalSpace","text":"ReciprocalSpace{K, P<:SVector} <: SimpleNamedVectorSpace{K, P}\n\nAbstract type of reciprocal spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalZone","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalZone","text":"ReciprocalZone{K, S<:SVector, V<:Number} <: ReciprocalSpace{K, S}\n\nA zone in the reciprocal space.\n\n\n\n\n\n","category":"type"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalZone-Tuple{AbstractVector{<:AbstractVector{<:Number}}}","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalZone","text":"ReciprocalZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}; length=100, ends=(true, false))\nReciprocalZone{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}; length=100, ends=(true, false)) where K\n\nReciprocalZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::Pair{<:Number, <:Number}...; length=100, ends=(true, false))\nReciprocalZone{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::Pair{<:Number, <:Number}...; length=100, ends=(true, false)) where K\n\nReciprocalZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::AbstractVector{<:Pair{<:Number, <:Number}}; length=100, ends=(true, false))\nReciprocalZone{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::AbstractVector{<:Pair{<:Number, <:Number}}; length=100, ends=(true, false)) where K\n\nReciprocalZone(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::Tuple{Vararg{Pair{<:Number, <:Number}}}; length=100, ends=(true, false))\nReciprocalZone{K}(reciprocals::AbstractVector{<:AbstractVector{<:Number}}, bounds::Tuple{Vararg{Pair{<:Number, <:Number}}}; length=100, ends=(true, false)) where K\n\nConstruct a rectangular zone in the reciprocal space.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.ReciprocalZone-Union{Tuple{BrillouinZone{K, P}}, Tuple{P}, Tuple{K}} where {K, P<:(𝕂)}","page":"Spatials","title":"QuantumLattices.Spatials.ReciprocalZone","text":"ReciprocalZone(brillouinzone::BrillouinZone)\n\nConstruct a reciprocal zone from a Brillouin zone.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.@hexagon_str-Tuple{String}","page":"Spatials","title":"QuantumLattices.Spatials.@hexagon_str","text":"hexagon\"P₁-P₂-P₃-...\"\nhexagon\"P₁-P₂-P₃-..., 120°\"\nhexagon\"P₁-P₂-P₃-..., 60°\"\n\nConstruct a tuple of start-stop point pairs for the hexagonal reciprocal space.\n\n\n\n\n\n","category":"macro"},{"location":"man/Spatials/#QuantumLattices.Spatials.@line_str-Tuple{String}","page":"Spatials","title":"QuantumLattices.Spatials.@line_str","text":"line\"P₁-P₂-P₃-...\"\n\nConstruct a tuple of start-stop point pairs for the one dimensional reciprocal space.\n\n\n\n\n\n","category":"macro"},{"location":"man/Spatials/#QuantumLattices.Spatials.@rectangle_str-Tuple{String}","page":"Spatials","title":"QuantumLattices.Spatials.@rectangle_str","text":"rectangle\"P₁-P₂-P₃-...\"\n\nConstruct a tuple of start-stop point pairs for the rectangular reciprocal space.\n\n\n\n\n\n","category":"macro"},{"location":"man/Spatials/#Base.eltype-Tuple{Bond}","page":"Spatials","title":"Base.eltype","text":"eltype(bond::Bond)\neltype(::Type{<:Bond{K, P} where K}) where {P<:Point}\n\nGet the point type contained in a generic bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#Base.getindex-Tuple{AbstractLattice, Integer}","page":"Spatials","title":"Base.getindex","text":"getindex(lattice::AbstractLattice, i::Integer) -> SVector\n\nGet the ith coordinate.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#Base.getindex-Tuple{Bond, Integer}","page":"Spatials","title":"Base.getindex","text":"getindex(bond::Bond, i::Integer) -> Point\n\nGet the ith point contained in a generic bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#Base.iterate","page":"Spatials","title":"Base.iterate","text":"iterate(bond::Bond, state=1)\n\nIterate over the points contained in a generic bond.\n\n\n\n\n\n","category":"function"},{"location":"man/Spatials/#Base.length-Tuple{AbstractLattice}","page":"Spatials","title":"Base.length","text":"length(lattice::AbstractLattice) -> Int\n\nGet the number of points contained in a lattice.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#Base.length-Tuple{Bond}","page":"Spatials","title":"Base.length","text":"length(bond::Bond) -> Int\n\nGet the number of points contained in a generic bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#Base.reverse-Tuple{Bond}","page":"Spatials","title":"Base.reverse","text":"reverse(bond::Bond) -> Bond\n\nGet the reversed bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#Base.step-Tuple{ReciprocalPath, Integer}","page":"Spatials","title":"Base.step","text":"step(path::ReciprocalPath, i::Integer) -> scalartype(path)\n\nGet the step between the ith and the (i+1)th points in the path.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.QuantumOperators.scalartype-Union{Tuple{Type{<:AbstractLattice{N, D} where N}}, Tuple{D}} where D<:Number","page":"Spatials","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(::Type{<:AbstractLattice{N, D} where N}) where {D<:Number}\n\nGet the data type of the coordinates of a lattice.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.QuantumOperators.scalartype-Union{Tuple{Type{<:Bond{K, P} where K}}, Tuple{P}} where P<:Point","page":"Spatials","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(::Type{<:Bond{K, P} where K}) where {P<:Point}\n\nGet the data type of the coordinates of the points contained in a generic bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.QuantumOperators.scalartype-Union{Tuple{Type{<:Point{N, D} where N}}, Tuple{D}} where D<:Number","page":"Spatials","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(::Type{<:Point{N, D} where N}) where {D<:Number}\n\nGet the data type of the coordinates of a point.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.azimuth-Tuple{AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.azimuth","text":"azimuth(v::AbstractVector{<:Number}) -> Number\n\nGet the azimuth angle in radians of a vector.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.azimuthd-Tuple{AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.azimuthd","text":"azimuthd(v::AbstractVector{<:Number}) -> Number\n\nGet the azimuth angle in degrees of a vector.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.bonds!-Tuple{Vector, AbstractLattice, Integer}","page":"Spatials","title":"QuantumLattices.Spatials.bonds!","text":"bonds!(bonds::Vector, lattice::AbstractLattice, nneighbor::Integer; coordination::Integer=12)\nbonds!(bonds::Vector, lattice::AbstractLattice, neighbors::Neighbors) -> typeof(bonds)\n\nGet the required bonds of a lattice and append them to the input bonds.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.bonds-Tuple{AbstractLattice, Integer}","page":"Spatials","title":"QuantumLattices.Spatials.bonds","text":"bonds(lattice::AbstractLattice, nneighbor::Integer; coordination::Integer=12) -> Vector{Bond{Int, Point{dimension(lattice), scalartype(lattice)}}}\nbonds(lattice::AbstractLattice, neighbors::Neighbors) -> Vector{Bond{keytype(neighbors), Point{dimension(lattice), scalartype(lattice)}}}\n\nGet the required bonds of a lattice.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.direction-Tuple{Char, Vararg{Any}}","page":"Spatials","title":"QuantumLattices.Spatials.direction","text":"direction(v::Char, args...) -> SVector{3, <:Number}\ndirection(v::Number, unit::Symbol) -> SVector{2, <:Number}\ndirection(v::Tuple{Number, Number}, unit::Symbol) -> SVector{3, <:Number}\ndirection(v::AbstractVector{<:Number}, args...) -> AbstractVector{<:Number}\n\nGet the unit vector that specifies the direction of a vector.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.distance-Tuple{AbstractVector{<:Number}, AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.distance","text":"distance(p₁::AbstractVector{<:Number}, p₂::AbstractVector{<:Number}) -> Number\n\nGet the distance between two points.\n\nnote: Note\nCompared to norm(p₁-p₂), this function avoids the memory allocation for p₁-p₂, thus is more efficient.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.distance-Tuple{ReciprocalPath}","page":"Spatials","title":"QuantumLattices.Spatials.distance","text":"distance(path::ReciprocalPath) -> scalartype(path)\ndistance(path::ReciprocalPath, i::Integer) -> scalartype(path)\ndistance(path::ReciprocalPath, i::Integer, j::Integer) -> scalartype(path)\n\nGet the distance\n\nof the total path,\nfrom the start point to the ith point in the path,\nfrom the ith point to the jth point in the path (when i is greater than j, the value is negative).\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.icoordinate-Tuple{Bond}","page":"Spatials","title":"QuantumLattices.Spatials.icoordinate","text":"icoordinate(bond::Bond) -> SVector\n\nGet the icoordinate of the bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.interlinks-Tuple{AbstractMatrix{<:Number}, AbstractMatrix{<:Number}, Neighbors}","page":"Spatials","title":"QuantumLattices.Spatials.interlinks","text":"interlinks(cluster₁::AbstractMatrix{<:Number}, cluster₂::AbstractMatrix{<:Number}, neighbors::Neighbors) -> Vector{Tuple{Int, Int, Int}}\n\nUse kdtree to get the intercluster nearest neighbors.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.isintracell-Tuple{Bond}","page":"Spatials","title":"QuantumLattices.Spatials.isintracell","text":"isintracell(bond::Bond) -> Bool\n\nJudge whether a bond is intra the unit cell of a lattice.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.isintracell-Tuple{Point}","page":"Spatials","title":"QuantumLattices.Spatials.isintracell","text":"isintracell(point::Point) -> Bool\n\nJudge whether a point is intra the unitcell.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.isintratriangle-Tuple{AbstractVector{<:Number}, AbstractVector{<:Number}, AbstractVector{<:Number}, AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.isintratriangle","text":"isintratriangle(\n p::AbstractVector{<:Number}, p₁::AbstractVector{<:Number}, p₂::AbstractVector{<:Number}, p₃::AbstractVector{<:Number};\n vertexes::NTuple{3, Bool}=(true, true, true), edges::NTuple{3, Bool}=(true, true, true), atol::Real=atol, rtol::Real=rtol\n) -> Bool\n\nJudge whether a point belongs to the interior of a triangle whose vertexes are p₁, 'p₂' and p₃ with the give tolerance. vertexes and edges define whether the interior should contain the vertexes or edges, respectively.\n\nnote: Note\nThe vertexes are in the order (p₁, p₂, p₃) and the edges are in the order (p₁p₂, p₂p₃, p₃p₁).\nThe edges do not contain the vertexes.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.isonline-Tuple{AbstractVector{<:Number}, AbstractVector{<:Number}, AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.isonline","text":"isonline(\n p::AbstractVector{<:Number}, p₁::AbstractVector{<:Number}, p₂::AbstractVector{<:Number};\n ends::Tuple{Bool, Bool}=(true, true), atol::Real=atol, rtol::Real=rtol\n) -> Bool\n\nJudge whether a point is on a line segment whose end points are p₁ and p₂ with the given tolerance. ends defines whether the line segment should contain its ends.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.isparallel-Tuple{AbstractVector{<:Number}, AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.isparallel","text":"isparallel(v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}; atol::Real=atol, rtol::Real=rtol) -> Int\n\nJudge whether two vectors are parallel to each other with the given tolerance, 0 for not parallel, 1 for parallel and -1 for antiparallel.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.issubordinate-Tuple{AbstractVector{<:Number}, AbstractVector{<:AbstractVector{<:Number}}}","page":"Spatials","title":"QuantumLattices.Spatials.issubordinate","text":"issubordinate(coordinate::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}; atol::Real=atol, rtol::Real=rtol) -> Bool\n\nJudge whether a coordinate belongs to a lattice defined by vectors with the given tolerance.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.matrix-Tuple{AbstractVector{<:AbstractVector}}","page":"Spatials","title":"QuantumLattices.Spatials.matrix","text":"matrix(vs::AbstractVector{<:AbstractVector}) -> Matrix\n\nConvert a vector of vector to a matrix.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.minimumlengths","page":"Spatials","title":"QuantumLattices.Spatials.minimumlengths","text":"minimumlengths(cluster::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, nneighbor::Integer=1; coordination::Integer=12) -> Vector{Float}\nminimumlengths(cluster::AbstractMatrix{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, nneighbor::Integer=1; coordination::Integer=12) -> Vector{Float}\n\nUse kdtree to search the lowest several minimum bond lengths within a lattice translated by a cluster.\n\nWhen the translation vectors are not empty, the lattice will be considered periodic in the corresponding directions. Otherwise the lattice will be open in all directions. To search for the bonds across the periodic boundaries, the cluster will be pre-translated to become a supercluster, which has open boundaries but is large enough to contain all the nearest neighbors within the required order. The coordination parameter sets the average number of each order of nearest neighbors. If it is to small, larger bond lengths may not be searched, and the result will contain Inf. This is a sign that you may need a larger coordination. Another situation that Inf appears in the result occurs when the minimum lengths are searched in open lattices. Indeed, the cluster may be too small so that the required order just goes beyond it. In this case the warning message can be safely ignored.\n\n\n\n\n\n","category":"function"},{"location":"man/Spatials/#QuantumLattices.Spatials.polar-Tuple{AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.polar","text":"polar(v::AbstractVector{<:Number}) -> Number\n\nGet the polar angle in radians of a vector.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.polard-Tuple{AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.polard","text":"polard(v::AbstractVector{<:Number}) -> Number\n\nGet the polar angle in degrees of a vector.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.rcoordinate-Tuple{Bond}","page":"Spatials","title":"QuantumLattices.Spatials.rcoordinate","text":"rcoordinate(bond::Bond) -> SVector\n\nGet the rcoordinate of the bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.reciprocals-Tuple{AbstractLattice}","page":"Spatials","title":"QuantumLattices.Spatials.reciprocals","text":"reciprocals(lattice::AbstractLattice) -> Vector{<:SVector}\n\nGet the reciprocal translation vectors of the dual lattice.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.reciprocals-Tuple{AbstractVector{<:AbstractVector{<:Number}}}","page":"Spatials","title":"QuantumLattices.Spatials.reciprocals","text":"reciprocals(vectors::AbstractVector{AbstractVector{<:Number}}) -> AbstractVector{<:AbstractVector{<:Number}}\n\nGet the reciprocals dual to the input vectors.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.rotate-Tuple{AbstractVector{<:Number}, Number}","page":"Spatials","title":"QuantumLattices.Spatials.rotate","text":"rotate(vector::AbstractVector{<:Number}, angle::Number; axis::Tuple{Union{AbstractVector{<:Number}, Nothing}, Tuple{<:Number, <:Number}}=(nothing, (0, 0))) -> AbstractVector{<:Number}\nrotate(cluster::AbstractMatrix{<:Number}, angle::Number; axis::Tuple{Union{AbstractVector{<:Number}, Nothing}, Tuple{<:Number, <:Number}}=(nothing, (0, 0))) -> AbstractMatrix{<:Number}\n\nGet a rotated vector/cluster of the original one by a certain angle around an axis.\n\nThe axis is determined by a point it gets through (nothing can be used to denote the origin), and its polar as well as azimuth angles in radians. The default axis is the z axis.\n\nnote: Note\nThe result is given by the Rodrigues' rotation formula.\nOnly 2 and 3 dimensional vectors can be rotated.\nWhen the input vectors are 2 dimensional, both the polar and azimuth of the axis must be 0.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.save-Tuple{AbstractString, ReciprocalPath, Union{AbstractMatrix{<:Number}, AbstractVector{<:Number}}}","page":"Spatials","title":"QuantumLattices.Spatials.save","text":"save(filename::AbstractString, path::ReciprocalPath, data::Union{AbstractVector{<:Number}, AbstractMatrix{<:Number}})\nsave(filename::AbstractString, path::ReciprocalPath, y::AbstractVector{<:Number}, data::Union{AbstractMatrix{<:Number}, AbstractArray{<:Number, 3}})\nsave(filename::AbstractString, reciprocalspace::Union{BrillouinZone, ReciprocalZone}, data::Union{AbstractMatrix{<:Number}, AbstractArray{<:Number, 3}})\n\nSave data to delimited files.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.selectpath-Tuple{BrillouinZone, NamedTuple{(:points, :labels), <:Tuple{var\"#s91\", var\"#s90\"} where {var\"#s91\"<:Tuple, var\"#s90\"<:Tuple}}}","page":"Spatials","title":"QuantumLattices.Spatials.selectpath","text":"selectpath(brillouinzone::BrillouinZone, contents::NamedTuple{(:points, :labels), <:Tuple{<:Tuple, <:Tuple}}; ends=nothing, atol::Real=atol, rtol::Real=rtol) -> Tuple(ReciprocalPath, Vector{Int})\nselectpath(brillouinzone::BrillouinZone, points::NTuple{N, Number}...; labels=points, ends=nothing, atol::Real=atol, rtol::Real=rtol) where N -> Tuple(ReciprocalPath, Vector{Int})\nselectpath(brillouinzone::BrillouinZone, points::Tuple{Vararg{NTuple{N, Number}}}; labels=points, ends=nothing, atol::Real=atol, rtol::Real=rtol) where N -> Tuple(ReciprocalPath, Vector{Int})\nselectpath(brillouinzone::BrillouinZone, segments::Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}...; labels=segments, ends=nothing, atol::Real=atol, rtol::Real=rtol) where N -> Tuple(ReciprocalPath, Vector{Int})\nselectpath(brillouinzone::BrillouinZone, segments::Tuple{Vararg{Pair{<:NTuple{N, Number}, <:NTuple{N, Number}}}}; labels=segments, ends=nothing, atol::Real=atol, rtol::Real=rtol) where N -> Tuple(ReciprocalPath, Vector{Int})\n\nSelect a path from a BrillouinZone. Return a ReciprocalPath and the positions of the equivalent points in the BrillouinZone.\n\nnote: Note\nFor connected segments, the start point will be included while the stop point will be not for each segment except for the last both points of which will be included if ends is nothing.\nFor disconnected segments, they can be partitioned into several connected parts, and the rule for connected segments applies for each of such connected parts.With the above rules, all the points along the assigned path will be counted once and only once.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.setup-Tuple{Expr}","page":"Spatials","title":"QuantumLattices.Spatials.setup","text":"@recipe plot(path::ReciprocalPath, y::AbstractVector{<:Number}, data::AbstractArray{<:Number, 3}; subtitles=nothing, subtitlefontsize=8, nrow=nothing, ncol=nothing, clims=nothing)\n@recipe plot(reciprocalspace::BrillouinZone, data::AbstractArray{<:Number, 3}; subtitles=nothing, subtitlefontsize=8, nrow=nothing, ncol=nothing, clims=nothing)\n@recipe plot(reciprocalspace::ReciprocalZone, data::AbstractArray{<:Number, 3}; subtitles=nothing, subtitlefontsize=8, nrow=nothing, ncol=nothing, clims=nothing)\n\nDefine the recipe for the heatmap visualization of a series of data on \n\nthe x-y plain with the x axis being a reciprocal path,\na Brillouin zone,\na reciprocal zone.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.shrink-Union{Tuple{N}, Tuple{K}, Tuple{ReciprocalZone{K}, Vararg{OrdinalRange{<:Integer}, N}}} where {K, N}","page":"Spatials","title":"QuantumLattices.Spatials.shrink","text":"shrink(reciprocalzone::ReciprocalZone{K}, ranges::Vararg{OrdinalRange{<:Integer}, N}) where {K, N} -> ReciprocalZone\n\nShrink a reciprocal zone.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.ticks-Tuple{ReciprocalPath}","page":"Spatials","title":"QuantumLattices.Spatials.ticks","text":"ticks(path::ReciprocalPath) -> Tuple{Vector{scalartype(path)}, Vector{String}}\n\nGet the position-label pairs of the ticks of a path.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.tile-Tuple{AbstractVector{<:Number}, AbstractVector{<:AbstractVector{<:Number}}, Any}","page":"Spatials","title":"QuantumLattices.Spatials.tile","text":"tile(cluster::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, translations) -> AbstractMatrix{<:Number}\ntile(cluster::AbstractMatrix{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}, translations) -> AbstractMatrix{<:Number}\n\nTile a supercluster by translations of the input cluster.\n\nBasically, the final supercluster is composed of several parts, each of which is a translation of the original cluster, with the translation vectors specified by vectors and each set of the translation indices contained in translations. When translation vectors are empty, a copy of the original cluster will be returned.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.translate-Tuple{AbstractVector{<:Number}, AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.Spatials.translate","text":"translate(cluster::AbstractVector{<:Number}, vector::AbstractVector{<:Number}) -> AbstractVector{<:Number}\ntranslate(cluster::AbstractMatrix{<:Number}, vector::AbstractVector{<:Number}) -> AbstractMatrix{<:Number}\n\nGet the translated cluster of the original one by a vector.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.volume-Tuple{AbstractVector{<:AbstractVector{<:Number}}}","page":"Spatials","title":"QuantumLattices.Spatials.volume","text":"volume(vectors::AbstractVector{<:AbstractVector{<:Number}}) -> Number\nvolume(v::AbstractVector{<:Number}) -> Number\nvolume(v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}) -> Number\nvolume(v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}, v₃::AbstractVector{<:Number}) -> Number\n\nGet the volume spanned by the input vectors.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.volume-Tuple{BrillouinZone}","page":"Spatials","title":"QuantumLattices.Spatials.volume","text":"volume(brillouinzone::BrillouinZone) -> Number\n\nGet the volume of a Brillouin zone.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.Spatials.volume-Tuple{ReciprocalZone}","page":"Spatials","title":"QuantumLattices.Spatials.volume","text":"volume(reciprocalzone::ReciprocalZone) -> Number\n\nGet the volume of a reciprocal zone.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.decompose-Tuple{AbstractMatrix{<:Number}, AbstractMatrix{<:Number}}","page":"Spatials","title":"QuantumLattices.decompose","text":"decompose(m::AbstractMatrix{<:Number}, m₀::AbstractMatrix{<:Number}) -> Number\ndecompose(m::AbstractMatrix{<:Number}, ms::Tuple{Vararg{AbstractMatrix{<:Number}}}) -> Tuple{Vararg{Number}}\ndecompose(m::AbstractMatrix{<:Number}, ms::AbstractVector{<:AbstractMatrix{<:Number}}) -> Vector{<:Number}\n\nDecompose a matrix.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.decompose-Tuple{AbstractVector{<:Number}, AbstractVector{<:Number}}","page":"Spatials","title":"QuantumLattices.decompose","text":"decompose(v₀::AbstractVector{<:Number}, v₁::AbstractVector{<:Number}) -> Number\ndecompose(v₀::AbstractVector{<:Number}, v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}) -> Tuple{Number, Number}\ndecompose(v₀::AbstractVector{<:Number}, v₁::AbstractVector{<:Number}, v₂::AbstractVector{<:Number}, v₃::AbstractVector{<:Number}) -> Tuple{Number, Number, Number}\ndecompose(v₀::AbstractVector{<:Number}, vs::AbstractVector{<:AbstractVector{<:Number}}) -> Vector{<:Number}\n\nDecompose a vector with respect to input basis vectors.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.dimension-Tuple{AbstractLattice}","page":"Spatials","title":"QuantumLattices.dimension","text":"dimension(lattice::AbstractLattice) -> Int\ndimension(::Type{<:AbstractLattice{N}}) where N -> Int\n\nGet the space dimension of the lattice.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.dimension-Tuple{Bond}","page":"Spatials","title":"QuantumLattices.dimension","text":"dimension(bond::Bond) -> Int\ndimension(::Type{<:Bond{K, P} where K}) where {P<:Point} -> Int\n\nGet the space dimension of a concrete bond.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.dimension-Tuple{Point}","page":"Spatials","title":"QuantumLattices.dimension","text":"dimension(point::Point) -> Int\ndimension(::Type{<:Point{N}}) where N -> Int\n\nGet the spatial dimension of a point.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#QuantumLattices.expand-Tuple{𝕂, AbstractVector{<:AbstractVector{<:Number}}}","page":"Spatials","title":"QuantumLattices.expand","text":"expand(momentum::𝕂, reciprocals::AbstractVector{<:AbstractVector{<:Number}}) -> eltype(reciprocals)\n\nExpand the momentum from integral values to real values with the given reciprocals.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#RecipesBase.apply_recipe","page":"Spatials","title":"RecipesBase.apply_recipe","text":"@recipe plot(lattice::AbstractLattice, neighbors::Union{Int, Neighbors}, filter::Function=bond->true; siteon=false)\n\nDefine the recipe for the visualization of a lattice.\n\n\n\n\n\n","category":"function"},{"location":"man/Spatials/#RecipesBase.apply_recipe-Tuple{AbstractDict{Symbol, Any}, ReciprocalCurve}","page":"Spatials","title":"RecipesBase.apply_recipe","text":"@recipe plot(path::ReciprocalCurve)\n\nDefine the recipe for the visualization of a reciprocal curve.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#RecipesBase.apply_recipe-Tuple{AbstractDict{Symbol, Any}, ReciprocalPath, AbstractVector{<:Number}, AbstractMatrix{<:Number}}","page":"Spatials","title":"RecipesBase.apply_recipe","text":"@recipe plot(path::ReciprocalPath, y::AbstractVector{<:Number}, data::AbstractMatrix{<:Number})\n\nDefine the recipe for the heatmap visualization of data on the x-y plain with the x axis being a reciprocal path.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#RecipesBase.apply_recipe-Tuple{AbstractDict{Symbol, Any}, ReciprocalPath}","page":"Spatials","title":"RecipesBase.apply_recipe","text":"@recipe plot(path::ReciprocalPath)\n\nDefine the recipe for the visualization of a reciprocal path.\n\n\n\n\n\n","category":"method"},{"location":"man/Spatials/#RecipesBase.apply_recipe-Tuple{AbstractDict{Symbol, Any}, ReciprocalSpace}","page":"Spatials","title":"RecipesBase.apply_recipe","text":"@recipe plot(reciprocalspace::ReciprocalSpace)\n\nDefine the recipe for the visualization of a reciprocal space.\n\n\n\n\n\n","category":"method"},{"location":"advanced topics/IndexOrders/","page":"Index orders","title":"Index orders","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"advanced topics/IndexOrders/#Index-orders","page":"Index orders","title":"Index orders","text":"","category":"section"},{"location":"man/DegreesOfFreedom/","page":"Degrees of freedom","title":"Degrees of freedom","text":"CurrentModule = QuantumLattices.DegreesOfFreedom","category":"page"},{"location":"man/DegreesOfFreedom/#Degrees-of-freedom","page":"Degrees of freedom","title":"Degrees of freedom","text":"","category":"section"},{"location":"man/DegreesOfFreedom/","page":"Degrees of freedom","title":"Degrees of freedom","text":"Modules = [DegreesOfFreedom]\nOrder = [:module, :constant, :type, :macro, :function]","category":"page"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.ˢᵗ","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.ˢᵗ","text":"const ˢᵗ = ⁿᵈ = ʳᵈ = ᵗʰ = Ordinal(1)\n\nConstant ordinals.\n\n\n\n\n\n","category":"constant"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.AllEqual","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.AllEqual","text":"AllEqual{Fields} <: Function\n\nAll-equal constraint for the direct product of homogenous simple internal indexes that for every specified field the values of the internal indexes should be all equal.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.AllEqual-Tuple{Vararg{Symbol}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.AllEqual","text":"AllEqual(fields::Tuple{Vararg{Symbol}})\nAllEqual(fields::Symbol...)\n\nConstruct an all-equal constraint.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.AllEqual-Union{Tuple{InternalIndexProd{NTuple{N, I}}}, Tuple{I}, Tuple{N}, Tuple{fields}} where {fields, N, I<:SimpleInternalIndex}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.AllEqual","text":"(constraint::AllEqual{fields})(index::InternalIndexProd{NTuple{N, I}}) where {fields, N, I<:SimpleInternalIndex} -> Bool\n\nJudge whether the direct product of a set of homogenous simple internal indexes is subject to an all-equal constraint.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.AllEqual-Union{Tuple{Type{I}}, Tuple{I}} where I<:SimpleInternalIndex","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.AllEqual","text":"AllEqual(::Type{I}) where {I<:SimpleInternalIndex}\n\nConstruct an all-equal constraint based on the type of a simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Boundary","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Boundary","text":"Boundary{Names}(values::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}) where Names\n\nBoundary twist of operators.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Boundary-Tuple{Operator}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Boundary","text":"(bound::Boundary)(operator::Operator; origin::Union{AbstractVector, Nothing}=nothing) -> Operator\n\nGet the boundary twisted operator.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Component","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Component","text":"Component{T₁, T₂} <: VectorSpace{Tuple{T₁, T₁, T₂}}\n\nA component of a matrix coupling, i.e., a matrix acting on a separated internal space.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.CompositeIndex","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.CompositeIndex","text":"CompositeIndex{I<:Index} <: OperatorIndex\n\nAbstract type of a composite index.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.CompositeInternal","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.CompositeInternal","text":"CompositeInternal{T<:Tuple{Vararg{SimpleInternal}}, I<:InternalIndex} <: Internal{I}\n\nAbstract type of the composition (i.e., direct sum or direct product) of several simple internal spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.ConstrainedInternal","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.ConstrainedInternal","text":"ConstrainedInternal{P<:InternalProd, C<:InternalPattern}\n\nConstrained internal space.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.ConstrainedInternal-Tuple{SimpleInternal, InternalPattern}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.ConstrainedInternal","text":"ConstrainedInternal(internal::SimpleInternal, pattern::InternalPattern)\nConstrainedInternal(internal::InternalProd, pattern::InternalPattern)\n\nConstruct a constrained internal space.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.CoordinatedIndex","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.CoordinatedIndex","text":"CoordinatedIndex{I<:Index, V<:SVector} <: CompositeIndex{I}\n\nCoordinated index, i.e., index with coordinates in the unitcell.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.CoordinatedIndex-Tuple{Index, Any, Any}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.CoordinatedIndex","text":"CoordinatedIndex(index::Index, rcoordinate, icoordinate)\nCoordinatedIndex(index::Index; rcoordinate, icoordinate)\n\nConstruct a coordinated index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Coupling","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Coupling","text":"Coupling{V, P<:Pattern} <: OperatorPack{V, P}\n\nCoupling among internal degrees of freedom at different or same lattice points.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Coupling-Tuple{Pattern}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Coupling","text":"Coupling(value, pattern::Pattern)\nCoupling(pattern::Pattern)\n\nConstruct a coupling.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Coupling-Tuple{Vararg{Index}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Coupling","text":"Coupling(indexes::Index...)\nCoupling(value, indexes::Index...)\nCoupling(value, indexes::Tuple{Vararg{Index}})\n\nConstruct a coupling with the input indexes as the pattern.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Coupling-Union{Tuple{I}, Tuple{N}, Tuple{Union{Colon, NTuple{N, Ordinal}}, Type{I}, Vararg{Union{Colon, NTuple{N, T} where T}}}} where {N, I<:SimpleInternalIndex}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Coupling","text":"Coupling(sites::Union{NTuple{N, Ordinal}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleInternalIndex}\nCoupling(value, sites::Union{NTuple{N, Ordinal}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleInternalIndex}\nCoupling{N}(sites::Union{NTuple{N, Ordinal}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleInternalIndex}\nCoupling{N}(value, sites::Union{NTuple{N, Ordinal}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleInternalIndex}\n\nConstruct a Coupling with the input sites and the fields of a kind of simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Coupling-Union{Tuple{N}, Tuple{Union{Function, Type{<:Function}}, Union{Colon, NTuple{N, Ordinal}}, Vararg{Union{Colon, NTuple{N, T} where T}}}} where N","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Coupling","text":"Coupling(f::Union{Function, Type{<:Function}}, sites::Union{NTuple{N, Ordinal}, Colon}, fields::Union{NTuple{N}, Colon}...) where N\nCoupling(value::Number, f::Union{Function, Type{<:Function}}, sites::Union{NTuple{N, Ordinal}, Colon}, fields::Union{NTuple{N}, Colon}...) where N\nCoupling{N}(f::Union{Function, Type{<:Function}}, sites::Union{NTuple{N, Ordinal}, Colon}, fields::Union{NTuple{N}, Colon}...) where N\nCoupling{N}(value::Number, f::Union{Function, Type{<:Function}}, sites::Union{NTuple{N, Ordinal}, Colon}, fields::Union{NTuple{N}, Colon}...) where N\n\nConstruct a Coupling by a function that can construct an Index with the input sites and the fields of a kind of simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Hilbert","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Hilbert","text":"Hilbert{I<:Internal} <: CompositeDict{Int, I}\n\nHilbert space at a lattice.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Hilbert-Tuple{Internal, Integer}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Hilbert","text":"Hilbert(internal::Internal, num::Integer)\n\nConstruct a Hilbert space with all same internal spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Hilbert-Tuple{Vararg{Internal}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Hilbert","text":"Hilbert(internals::Internal...)\nHilbert(internals::Tuple{Vararg{Internal}})\nHilbert(internals::AbstractVector{<:Internal})\n\nConstruct a Hilbert space with the given internal spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Hilbert-Tuple{Vararg{Pair}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Hilbert","text":"Hilbert(ps::Pair...)\nHilbert(kv)\n\nConstruct a Hilbert space the same way as an OrderedDict.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Index","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Index","text":"Index(site::Union{Int, Ordinal, Colon}, internal::SimpleInternalIndex)\n\nIndex of a degree of freedom, which consist of the spatial part (i.e., the site index) and the internal part (i.e., the internal index).\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Internal","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Internal","text":"Internal{I<:InternalIndex} <: VectorSpace{I}\n\nInternal space at a single point.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalIndex","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalIndex","text":"InternalIndex <: OperatorIndex\n\nInternal index of an internal degree of freedom.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalIndexProd","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalIndexProd","text":"InternalIndexProd{T<:Tuple{Vararg{SimpleInternalIndex}}} <: InternalIndex\n\nDirect product of several simple internal indexes.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalIndexProd-Tuple{Vararg{SimpleInternalIndex}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalIndexProd","text":"InternalIndexProd(contents::SimpleInternalIndex...)\n\nConstruct the direct product of several simple internal indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalPattern","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalPattern","text":"InternalPattern(index::InternalIndexProd, constraint::Function, representation::String=string(constraint))\nInternalPattern{P}(index::InternalIndexProd, constraints::NTuple{N, Function}, representations::NTuple{N, String}=map(string, constraints)) where {P, N}\n\nConstruct an internal pattern for the direct product of a set of simple internal indexes with 1) only one constraint function, and 2) several constraint functions.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalPattern-2","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalPattern","text":"InternalPattern{I, P, N, C<:NTuple{N, Function}} <: QuantumOperator\n\nInternal pattern for the direct product of a set of simple internal indexes with extra constraints.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalPattern-Tuple{SimpleInternalIndex}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalPattern","text":"InternalPattern(index::SimpleInternalIndex)\nInternalPattern(index::InternalIndexProd{<:Tuple{Vararg{I}}}) where {I<:SimpleInternalIndex}\n\nConstruct an internal pattern whose constraint is an AllEqual function for the direct product of a homogeneous set of simple internal indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalProd","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalProd","text":"InternalProd{T<:Tuple{Vararg{SimpleInternal}}, I<:InternalIndex} <: CompositeInternal{T, I}\n\nDirect product of several single internal spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.InternalSum","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.InternalSum","text":"InternalSum{T<:Tuple{Vararg{SimpleInternal}}, I<:InternalIndex} <: CompositeInternal{T, I}\n\nDirect sum of several single internal spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.MatrixCoupling","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.MatrixCoupling","text":"MatrixCoupling{I}(sites::Union{NTuple{2, Ordinal}, NTuple{2, Colon}}, contents::Tuple{Vararg{Component}}) where {I<:SimpleInternalIndex}\nMatrixCoupling(sites::Union{NTuple{2, Ordinal}, Colon}, ::Type{I}, contents::Component...) where {I<:SimpleInternalIndex}\n\nMatrix coupling, i.e., a set of couplings whose coefficients are specified by matrices acting on separated internal spaces.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.MatrixCouplingProd","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.MatrixCouplingProd","text":"MatrixCouplingProd{V<:Number, C<:Tuple{Vararg{MatrixCoupling}}} <: VectorSpace{Coupling}\n\nProduct of matrix couplings together with an overall coefficient.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.MatrixCouplingSum","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.MatrixCouplingSum","text":"MatrixCouplingSum{C<:MatrixCouplingProd, N} <: VectorSpace{Coupling}\n\nSum of the products of matrix couplings.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Metric","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Metric","text":"Metric <: Function\n\nRules for measuring an operator index so that different operator indexes can be compared.\n\nAs a function, every instance should accept only one positional argument, i.e. the operator index to be measured.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.OperatorIndexToTuple","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.OperatorIndexToTuple","text":"OperatorIndexToTuple{Fields} <: Metric\n\nA rule that converts an operator index into a tuple based on the specified type parameter Fields.\n\nHere, Fields must be a tuple of Union{Symbol, Function}, which determines the elements of the converted tuple on an element-by-element basis.\n\nFor the ith element of Fields:\n\nIf it is a Symbol, it represents the name of a single index of an OperatorIndex, and its value will become the corresponding element in the converted tuple.\nIf it is a Function, it should be a trait function of an OperatorIndex, and its return value will become the corresponding element in the converted tuple.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.OperatorIndexToTuple-Tuple{Index}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.OperatorIndexToTuple","text":"(operatorunittotuple::OperatorIndexToTuple)(index::Index) -> Tuple\n\nConvert an index to a tuple.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.OperatorIndexToTuple-Union{Tuple{Type{I}}, Tuple{I}} where I<:Index","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.OperatorIndexToTuple","text":"OperatorIndexToTuple(::Type{I}) where {I<:Index}\n\nConstruct the metric rule from the information of the Index type.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Ordinal","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Ordinal","text":"Ordinal\n\nOrdinal of an Int.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Pattern","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Pattern","text":"Pattern{C<:InternalPattern, S<:Tuple{Vararg{Union{Ordinal, Colon}}}} <: QuantumOperator\n\nCoupling pattern.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Pattern-Tuple{Vararg{Index}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Pattern","text":"Pattern(indexes::Index...)\nPattern(indexes::Tuple{Vararg{Index}})\n\nConstruct a coupling pattern from a set of indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.SimpleInternal","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.SimpleInternal","text":"SimpleInternal{I<:SimpleInternalIndex} <: Internal{I}\n\nSimple internal space at a single point.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.SimpleInternalIndex","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.SimpleInternalIndex","text":"SimpleInternalIndex <: InternalIndex\n\nSimple internal index, i.e., a complete set of indexes to denote an internal degree of freedom.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Table","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Table","text":"Table(indexes::AbstractVector{<:OperatorIndex}, by::Metric=OperatorIndexToTuple(eltype(indexes)))\n\nConvert a set of operator units to the corresponding table of operator index vs. sequence pairs.\n\nThe input operator units are measured by the input by function with the duplicates removed. The resulting unique values are sorted, which determines the sequence of the input indexes. Note that two operator units have the same sequence if their converted values are equal to each other.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Table-2","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Table","text":"Table(hilbert::Hilbert, by::Metric=OperatorIndexToTuple(typeof(hilbert))) -> Table\n\nGet the index-sequence table of a Hilbert space.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Table-3","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Table","text":"Table{I, B<:Metric} <: CompositeDict{I, Int}\n\nTable of operator index v.s. sequence pairs.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Term","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Term","text":"Term{K, I, V, B, C<:TermCoupling, A<:TermAmplitude}\n\nTerm of a quantum lattice system.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.Term-Union{Tuple{K}, Tuple{Symbol, Any, Any, Any, Bool}} where K","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.Term","text":"Term{K}(id::Symbol, value, bondkind, coupling, ishermitian::Bool; amplitude::Union{Function, Nothing}=nothing, ismodulatable::Bool=true) where K\n\nConstruct a term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.TermAmplitude","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.TermAmplitude","text":"TermAmplitude{F} <: TermFunction{F}\n\nFunction for the amplitude of a term.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.TermCoupling","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.TermCoupling","text":"TermCoupling{C<:Coupling, F} <: TermFunction{F}\n\nFunction for the coupling of a term.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.TermFunction","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.TermFunction","text":"TermFunction{F} <: Function\n\nAbstract type for concrete term functions.\n\n\n\n\n\n","category":"type"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.@pattern-Tuple","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.@pattern","text":"@pattern index₁ index₂ ...\n@pattern(index₁, index₂, ...; constraint=...)\n\nConstruct a coupling pattern according to the pattern of the input indexes and an optional constraint.\n\n\n\n\n\n","category":"macro"},{"location":"man/DegreesOfFreedom/#Base.:*-Tuple{MatrixCoupling, MatrixCoupling}","page":"Degrees of freedom","title":"Base.:*","text":"*(mc₁::MatrixCoupling, mc₂::MatrixCoupling) -> MatrixCouplingProd\n*(mc::MatrixCoupling, mcp::MatrixCouplingProd) -> MatrixCouplingProd\n*(mcp::MatrixCouplingProd, mc::MatrixCoupling) -> MatrixCouplingProd\n*(mcp₁::MatrixCouplingProd, mcp₂::MatrixCouplingProd) -> MatrixCouplingProd\n*(mc::MatrixCoupling, factor::Number) -> MatrixCouplingProd\n*(factor::Number, mc::MatrixCoupling) -> MatrixCouplingProd\n*(factor::Number, mcp::MatrixCouplingProd) -> MatrixCouplingProd\n*(mcp::MatrixCouplingProd, factor::Number) -> MatrixCouplingProd\n*(mcs::MatrixCouplingSum, element::Union{Number, MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum\n*(element::Union{Number, MatrixCoupling, MatrixCouplingProd}, mcs::MatrixCouplingSum) -> MatrixCouplingSum\n*(mcs₁::MatrixCouplingSum, mcs₂::MatrixCouplingSum) -> MatrixCouplingSum\n\nProduct between MatrixCouplings and MatrixCouplingProds.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.:+-Tuple{Union{MatrixCoupling, MatrixCouplingProd}, Union{MatrixCoupling, MatrixCouplingProd}}","page":"Degrees of freedom","title":"Base.:+","text":"+(mc₁::Union{MatrixCoupling, MatrixCouplingProd}, mc₂::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum\n+(mc::Union{MatrixCoupling, MatrixCouplingProd}, mcs::MatrixCouplingSum) -> MatrixCouplingSum\n+(mcs::MatrixCouplingSum, mc::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum\n+(mcs₁::MatrixCouplingSum, mcs₂::MatrixCouplingSum) -> MatrixCouplingSum\n\nAddition between MatrixCouplings and MatrixCouplingProds.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.:/-Tuple{MatrixCouplingProd, Number}","page":"Degrees of freedom","title":"Base.:/","text":"/(mcp::MatrixCouplingProd, factor::Number) -> MatrixCouplingProd\n/(mcs::MatrixCouplingSum, factor::Number) -> MatrixCouplingSum\n/(mc::MatrixCoupling, factor::Number) -> MatrixCouplingProd\n//(mcp::MatrixCouplingProd, factor::Number) -> MatrixCouplingProd\n//(mcs::MatrixCouplingSum, factor::Number) -> MatrixCouplingSum\n//(mc::MatrixCoupling, factor::Number) -> MatrixCouplingProd\n-(mc::MatrixCoupling) -> MatrixCouplingProd\n-(mcp::MatrixCouplingProd) -> MatrixCouplingProd\n-(mcs::MatrixCouplingSum) -> MatrixCouplingSum\n-(mc₁::Union{MatrixCoupling, MatrixCouplingProd}, mc₂::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum\n-(mc::Union{MatrixCoupling, MatrixCouplingProd}, mcs::MatrixCouplingSum) -> MatrixCouplingSum\n-(mcs::MatrixCouplingSum, mc::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum\n-(mcs₁::MatrixCouplingSum, mcs₂::MatrixCouplingSum) -> MatrixCouplingSum\n\nDefine right-division, minus and subtraction operator for a MatrixCoupling/MatrixCouplingProd/MatrixCouplingSum.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.:^-Tuple{Union{MatrixCoupling, MatrixCouplingProd, MatrixCouplingSum}, Integer}","page":"Degrees of freedom","title":"Base.:^","text":"^(mc::Union{MatrixCoupling, MatrixCouplingProd, MatrixCouplingSum}, n::Integer) -> Union{MatrixCoupling, MatrixCouplingProd, MatrixCouplingSum}\n\nGet the nth power of a MatrixCoupling/MatrixCouplingProd/MatrixCouplingSum.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.adjoint-Tuple{CoordinatedIndex}","page":"Degrees of freedom","title":"Base.adjoint","text":"adjoint(index::CoordinatedIndex) -> typeof(index)\n\nGet the adjoint of a coordinated index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.adjoint-Tuple{Index}","page":"Degrees of freedom","title":"Base.adjoint","text":"adjoint(index::Index) -> typeof(index)\n\nGet the adjoint of an index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.filter-Tuple{SimpleInternalIndex, CompositeInternal}","page":"Degrees of freedom","title":"Base.filter","text":"filter(ii::SimpleInternalIndex, ci::CompositeInternal) -> Union{Nothing, SimpleInternal, CompositeInternal}\nfilter(::Type{I}, ci::CompositeInternal) where {I<:SimpleInternalIndex} -> Union{Nothing, SimpleInternal, CompositeInternal}\n\nFilter the composite internal space and select those that match the input simple internal index or the type of a simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.filter-Tuple{SimpleInternalIndex, SimpleInternal}","page":"Degrees of freedom","title":"Base.filter","text":"filter(ii::SimpleInternalIndex, i::SimpleInternal) -> Union{Nothing, typeof(internal)}\nfilter(::Type{I}, i::SimpleInternal) where {I<:SimpleInternalIndex} -> Union{Nothing, typeof(internal)}\n\nFilter a simple internal space with respect to the input simple internal index or the type of a simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.filter-Union{Tuple{CI}, Tuple{SimpleInternalIndex, Type{CI}}} where CI<:CompositeInternal","page":"Degrees of freedom","title":"Base.filter","text":"filter(ii::SimpleInternalIndex, ::Type{CI}) where {CI<:CompositeInternal}\nfilter(::Type{I}, ::Type{CI}) where {I<:SimpleInternalIndex, CI<:CompositeInternal}\n\nFilter the type of a composite internal space and select those that match the input simple internal index or the type of a simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.filter-Union{Tuple{SI}, Tuple{SimpleInternalIndex, Type{SI}}} where SI<:SimpleInternal","page":"Degrees of freedom","title":"Base.filter","text":"filter(ii::SimpleInternalIndex, ::Type{SI}) where {SI<:SimpleInternal}\nfilter(::Type{I}, ::Type{SI}) where {I<:SimpleInternalIndex, SI<:SimpleInternal}\n\nFilter the type of a simple internal space with respect to the input simple internal index or the type of a simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.findall-Tuple{Function, Hilbert, Table}","page":"Degrees of freedom","title":"Base.findall","text":"findall(select::Function, hilbert::Hilbert, table::Table) -> Vector{Int}\n\nFind all the sequences of indexes contained in a Hilbert space according to a table and a select function.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.getindex-Tuple{Table, OperatorIndex}","page":"Degrees of freedom","title":"Base.getindex","text":"getindex(table::Table, index::OperatorIndex) -> Int\n\nInquiry the sequence of an operator index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.haskey-Tuple{Table, OperatorIndex}","page":"Degrees of freedom","title":"Base.haskey","text":"haskey(table::Table, index::OperatorIndex) -> Bool\nhaskey(table::Table, indexes::ID{OperatorIndex}) -> Tuple{Vararg{Bool}}\n\nJudge whether a single operator index or a set of operator indexes have been assigned with sequences in table.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.keys-Tuple{Boundary}","page":"Degrees of freedom","title":"Base.keys","text":"keys(bound::Boundary) -> Tuple{Vararg{Symbol}}\nkeys(::Type{<:Boundary{Names}}) where Names -> Names\n\nGet the names of the boundary parameters.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.keys-Union{Tuple{OperatorIndexToTuple{Fields}}, Tuple{Fields}} where Fields","page":"Degrees of freedom","title":"Base.keys","text":"keys(::OperatorIndexToTuple{Fields}) where Fields -> Fields\nkeys(::Type{<:OperatorIndexToTuple{Fields}}) where Fields -> Fields\n\nGet the values of the type parameter Fields.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.match-Tuple{InternalPattern, InternalIndexProd}","page":"Degrees of freedom","title":"Base.match","text":"match(pattern::InternalPattern, index::InternalIndexProd) -> Bool\n\nJudge whether the direct product of a set of simple internal indexes satisfies an internal pattern.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.match-Tuple{SimpleInternalIndex, SimpleInternal}","page":"Degrees of freedom","title":"Base.match","text":"match(ii::SimpleInternalIndex, i::SimpleInternal) -> Bool\nmatch(::Type{I}, i::SimpleInternal) where {I<:SimpleInternalIndex} -> Bool\nmatch(ii::SimpleInternalIndex, ::Type{SI}) where {SI<:SimpleInternal} -> Bool\nmatch(::Type{I}, ::Type{SI}) where {I<:SimpleInternalIndex, SI<:SimpleInternal} -> Bool\n\nJudge whether a simple internal space or the type of a simple internal space matches a simple internal index or the type of a simple internal index.\n\nHere, \"match\" means that the eltype of the simple internal space is consistent with the type of the simple internal index, which usually means that they share the same type name.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.merge!-Tuple{Boundary, Boundary}","page":"Degrees of freedom","title":"Base.merge!","text":"merge!(bound::Boundary, another::Boundary) -> typeof(bound)\n\nMerge the values and vectors of the twisted boundary condition from another one.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.one-Tuple{Term}","page":"Degrees of freedom","title":"Base.one","text":"one(term::Term) -> Term\n\nGet a unit term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.replace-Tuple{Boundary}","page":"Degrees of freedom","title":"Base.replace","text":"replace(bound::Boundary; values=bound.values, vectors=bound.vectors) -> Boundary\n\nReplace the values or vectors of a twisted boundary condition and get the new one.\n\nnote: Note\nThe plain boundary condition keeps plain even when replaced with new values or new vectors.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.replace-Tuple{Term, Any}","page":"Degrees of freedom","title":"Base.replace","text":"replace(term::Term, value) -> Term\n\nReplace the value of a term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.string-Tuple{Term, Bond, Hilbert}","page":"Degrees of freedom","title":"Base.string","text":"string(term::Term, bond::Bond, hilbert::Hilbert) -> String\n\nGet the string representation of a term on a bond with a given Hilbert space.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.union-Tuple{Vararg{Table}}","page":"Degrees of freedom","title":"Base.union","text":"union(tables::Table...) -> Table\n\nUnite several operator index vs. sequence tables.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.valtype-Tuple{Term}","page":"Degrees of freedom","title":"Base.valtype","text":"valtype(term::Term)\nvaltype(::Type{<:Term)\n\nGet the value type of a term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.valtype-Tuple{Tuple{Term, Vararg{Term}}}","page":"Degrees of freedom","title":"Base.valtype","text":"valtype(terms::Tuple{Term, Vararg{Term}})\nvaltype(::Type{<:T}) where {T<:Tuple{Term, Vararg{Term}}}\n\nGet the common value type of a set of terms.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.valtype-Union{Tuple{I}, Tuple{M}, Tuple{Type{M}, Type{I}}} where {M<:OperatorIndexToTuple, I<:Index}","page":"Degrees of freedom","title":"Base.valtype","text":"valtype(::Type{<:OperatorIndexToTuple}, ::Type{<:Index})\n\nGet the valtype of applying an OperatorIndexToTuple rule to an Index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#Base.zero-Tuple{Term}","page":"Degrees of freedom","title":"Base.zero","text":"zero(term::Term) -> Term\n\nGet a zero term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LaTeXStrings.latexstring-Tuple{Coupling}","page":"Degrees of freedom","title":"LaTeXStrings.latexstring","text":"latexstring(coupling::Coupling) -> String\n\nConvert a coupling to the latex format.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LaTeXStrings.latexstring-Tuple{InternalPattern}","page":"Degrees of freedom","title":"LaTeXStrings.latexstring","text":"latexstring(pattern::InternalPattern) -> String\n\nConvert an internal pattern to the latex format.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LaTeXStrings.latexstring-Tuple{Pattern}","page":"Degrees of freedom","title":"LaTeXStrings.latexstring","text":"latexstring(pattern::Pattern) -> String\n\nConvert a coupling pattern to the latex format.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LinearAlgebra.rank-Tuple{CompositeInternal}","page":"Degrees of freedom","title":"LinearAlgebra.rank","text":"rank(ci::CompositeInternal) -> Int\nrank(::Type{<:CompositeInternal{T}}) where {T<:Tuple{Vararg{SimpleInternal}}} -> Int\n\nGet the number of simple internal spaces in a composite internal space.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LinearAlgebra.rank-Tuple{Coupling}","page":"Degrees of freedom","title":"LinearAlgebra.rank","text":"rank(coupling::Coupling) -> Int\nrank(::Type{M}) where {M<:Coupling} -> Int\n\nGet the rank of a coupling.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LinearAlgebra.rank-Tuple{InternalIndexProd}","page":"Degrees of freedom","title":"LinearAlgebra.rank","text":"rank(cii::InternalIndexProd) -> Int\nrank(::Type{<:InternalIndexProd{T}}) where {T<:Tuple{Vararg{SimpleInternalIndex}}} -> Int\n\nGet the number of simple internal indexes in a direct product.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LinearAlgebra.rank-Tuple{InternalPattern, Integer}","page":"Degrees of freedom","title":"LinearAlgebra.rank","text":"rank(pattern::InternalPattern, i::Integer) -> Int\nrank(::Type{P}, i::Integer) where {P<:InternalPattern} -> Int\n\nGet the rank of the direct product of the simple internal indexes that the ith constraint in an internal pattern can apply.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LinearAlgebra.rank-Tuple{InternalPattern}","page":"Degrees of freedom","title":"LinearAlgebra.rank","text":"rank(pattern::InternalPattern) -> Int\nrank(::Type{P}) where {P<:InternalPattern} -> Int\n\nGet the rank of the direct product of the simple internal indexes that an internal pattern can apply.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LinearAlgebra.rank-Tuple{Pattern}","page":"Degrees of freedom","title":"LinearAlgebra.rank","text":"rank(pattern::Pattern) -> Int\nrank(::Type{<:Pattern{<:InternalPattern, S}}) where {S<:Tuple{Vararg{Union{Ordinal, Colon}}}} -> Int\n\nGet the rank of a coupling pattern.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#LinearAlgebra.rank-Tuple{Term}","page":"Degrees of freedom","title":"LinearAlgebra.rank","text":"rank(term::Term) -> Int\nrank(::Type{<:Term) -> Int\n\nGet the rank of a term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.:⊕-Tuple{Vararg{SimpleInternal}}","page":"Degrees of freedom","title":"QuantumLattices.:⊕","text":"⊕(is::SimpleInternal...) -> InternalSum\n⊕(i::SimpleInternal, ci::InternalSum) -> InternalSum\n⊕(ci::InternalSum, i::SimpleInternal) -> InternalSum\n⊕(ci₁::InternalSum, ci₂::InternalSum) -> InternalSum\n\nDirect sum between simple internal spaces and composite internal spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.:⊗-Tuple{Coupling, Coupling}","page":"Degrees of freedom","title":"QuantumLattices.:⊗","text":"*(cp₁::Coupling, cp₂::Coupling) -> Coupling\n⊗(cp₁::Coupling, cp₂::Coupling) -> Coupling\n\nGet the multiplication between two coupling.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.:⊗-Tuple{InternalPattern, InternalPattern}","page":"Degrees of freedom","title":"QuantumLattices.:⊗","text":"⊗(pattern₁::InternalPattern, pattern₂::InternalPattern) -> InternalPattern\n\nGet the combination of two internal patterns.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.:⊗-Tuple{Pattern, Pattern}","page":"Degrees of freedom","title":"QuantumLattices.:⊗","text":"⊗(pattern₁::Pattern, pattern₂::Pattern) -> Pattern\n\nGet the combination of two coupling patterns.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.:⊗-Tuple{Vararg{SimpleInternalIndex}}","page":"Degrees of freedom","title":"QuantumLattices.:⊗","text":"⊗(iis::SimpleInternalIndex...) -> InternalIndexProd\n⊗(ii::SimpleInternalIndex, cii::InternalIndexProd) -> InternalIndexProd\n⊗(cii::InternalIndexProd, ii::SimpleInternalIndex) -> InternalIndexProd\n⊗(cii₁::InternalIndexProd, cii₂::InternalIndexProd) -> InternalIndexProd\n\nDirect product between internal indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.:⊗-Tuple{Vararg{SimpleInternal}}","page":"Degrees of freedom","title":"QuantumLattices.:⊗","text":"⊗(is::SimpleInternal...) -> InternalProd\n⊗(i::SimpleInternal, ci::InternalProd) -> InternalProd\n⊗(ci::InternalProd, i::SimpleInternal) -> InternalProd\n⊗(ci₁::InternalProd, ci₂::InternalProd) -> InternalProd\n\nDirect product between simple internal spaces and composite internal spaces.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.allequalfields-Union{Tuple{Type{I}}, Tuple{I}} where I<:SimpleInternalIndex","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.allequalfields","text":"allequalfields(::Type{I}) where {I<:SimpleInternalIndex} -> Tuple{Vararg{Symbol}}\n\nGet the field names that can be subject to all-equal constraint based on the type of a simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.coordinatedindextype-Tuple{Type{<:SimpleInternal}, Type{<:Point}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.coordinatedindextype","text":"coordinatedindextype(I::Type{<:SimpleInternal}, P::Type{<:Point})\n\nGet the compatible type of the coordinated index based on the type of an internal space and the type of a point.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.indextype-Tuple{CompositeIndex}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.indextype","text":"indextype(::CompositeIndex)\nindextype(::Type{<:CompositeIndex})\n\nGet the index type of a composite index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.indextype-Tuple{Type{<:SimpleInternal}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.indextype","text":"indextype(I::Type{<:SimpleInternal})\n\nGet the compatible type of the index based on the type of an internal space.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.internalindextype-Tuple{Index}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.internalindextype","text":"internalindextype(index::Index)\ninternalindextype(::Type{I}) where {I<:Index}\n\nGet the type of the internal part of an index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.isdefinite-Tuple{Index}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.isdefinite","text":"isdefinite(index::Index) -> Bool\nisdefinite(::Type{<:Index{I}}) where {I<:SimpleInternalIndex} -> Bool\n\nDetermine whether an index denotes a definite degree of freedom.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.isdefinite-Tuple{InternalIndex}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.isdefinite","text":"isdefinite(ii::InternalIndex) -> Bool\nisdefinite(::Type{<:InternalIndex}) -> Bool\n\nJudge whether an internal index denotes a definite internal degree of freedom.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.isdefinite-Tuple{Tuple{Vararg{Index}}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.isdefinite","text":"isdefinite(indexes::Tuple{Vararg{Index}}) -> Bool\nisdefinite(::Type{T}) where {T<:Tuple{Vararg{Index}}} -> Bool\n\nDetermine whether a tuple of indexes denotes a definite degree of freedom.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.partition-Tuple{InternalPattern}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.partition","text":"partition(pattern::InternalPattern) -> Tuple{Vararg{Int}}\npartition(::Type{<:InternalPattern{I, P} where I}) where P -> P\n\nGet the partition of the direct product of a set of simple internal indexes on which the extra constraints operate independently.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.patternrule","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.patternrule","text":"patternrule(value, ::Val{Name}, args...; kwargs...) where Name\n\nBy overriding this function, a named rule for the value of some attributes in a pattern can be defined so that the value can be transformed into the desired one.\n\nIn most cases, such overridden functions define the default rules for the attributes in a pattern when they take on the default value :. \n\n\n\n\n\n","category":"function"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.patternrule-Tuple{Any, Val, Vararg{Any}}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.patternrule","text":"patternrule(value, ::Val, args...; kwargs...)-> typeof(value)\n\nDefault pattern rule unless otherwise specified.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.patternrule-Union{Tuple{Name}, Tuple{T}, Tuple{N}, Tuple{InternalIndexProd{T}, Val{Name}}} where {N, T<:NTuple{N, SimpleInternalIndex}, Name}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.patternrule","text":"patternrule(index::InternalIndexProd{T}, ::Val{Name}) where {N, T<:NTuple{N, SimpleInternalIndex}, Name} -> InternalIndexProd\n\nDefine the default rule for the internal index in an internal pattern.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.patternrule-Union{Tuple{N}, Tuple{NTuple{N, Colon}, Val, Integer}} where N","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.patternrule","text":"patternrule(sites::NTuple{N, Colon}, ::Val, bondlength::Integer) where N -> NTuple{N, Ordinal}\n\nDefine the default rule for the sites of a set of indexes in a coupling pattern.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.plain","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.plain","text":"plain\n\nPlain boundary condition without any twist.\n\n\n\n\n\n","category":"function"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.statistics-Tuple{CompositeIndex}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.statistics","text":"statistics(index::CompositeIndex) -> Symbol\nstatistics(::Type{I}) where {I<:CompositeIndex} -> Symbol\n\nGet the statistics of a composite index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.statistics-Tuple{Index}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.statistics","text":"statistics(index::Index) -> Symbol\nstatistics(::Type{I}) where {I<:Index} -> Symbol\n\nGet the statistics of an index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.statistics-Tuple{SimpleInternalIndex}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.statistics","text":"statistics(ii::SimpleInternalIndex) -> Symbol\n\nGet the statistics of a simple internal index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.DegreesOfFreedom.statistics-Tuple{SimpleInternal}","page":"Degrees of freedom","title":"QuantumLattices.DegreesOfFreedom.statistics","text":"statistics(i::SimpleInternal) -> Symbol\nstatistics(::Type{<:SimpleInternal{I}}) where {I<:SimpleInternalIndex} -> Symbol\n\nGet the statistics of a simple internal space.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.QuantumOperators.operatortype-Union{Tuple{T}, Tuple{H}, Tuple{B}, Tuple{Type{B}, Type{H}, Type{T}}} where {B<:Bond, H<:Hilbert, T<:Term}","page":"Degrees of freedom","title":"QuantumLattices.QuantumOperators.operatortype","text":"operatortype(::Type{B}, ::Type{H}, ::Type{T}) where {B<:Bond, H<:Hilbert, T<:Term}\n\nGet the compatible Operator type from the type of a term, a Hilbert space and a bond.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.QuantumOperators.script-Tuple{CoordinatedIndex, Val{:integercoordinate}}","page":"Degrees of freedom","title":"QuantumLattices.QuantumOperators.script","text":"script(index::CoordinatedIndex, ::Val{:integercoordinate}; vectors, kwargs...)\n\nGet the integer coordinate script of a coordinated index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.QuantumOperators.script-Tuple{CoordinatedIndex, Val{:rcoordinate}}","page":"Degrees of freedom","title":"QuantumLattices.QuantumOperators.script","text":"script(index::CoordinatedIndex, ::Val{:rcoordinate}; kwargs...) -> String\nscript(index::CoordinatedIndex, ::Val{:icoordinate}; kwargs...) -> String\n\nGet the rcoordinate/icoordinate script of a coordinated index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.QuantumOperators.script-Tuple{Index, Val{:site}}","page":"Degrees of freedom","title":"QuantumLattices.QuantumOperators.script","text":"script(index::Index, ::Val{:site}; kwargs...) -> String\nscript(index::Index, attr::Val; kwargs...) -> String\n\nGet the required script of an index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.QuantumOperators.script-Union{Tuple{attr}, Tuple{CompositeIndex, Val{attr}}} where attr","page":"Degrees of freedom","title":"QuantumLattices.QuantumOperators.script","text":"script(index::CompositeIndex, ::Val{attr}; kwargs...) where attr\n\nGet the attr script of a composite index.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.Spatials.icoordinate-Tuple{Operator{<:Number, <:NTuple{N, CoordinatedIndex} where N}}","page":"Degrees of freedom","title":"QuantumLattices.Spatials.icoordinate","text":"icoordinate(opt::Operator{<:Number, <:ID{CoordinatedIndex}}) -> SVector\n\nGet the whole icoordinate of an operator.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.Spatials.nneighbor-Tuple{Term}","page":"Degrees of freedom","title":"QuantumLattices.Spatials.nneighbor","text":"nneighbor(term::Term) -> Int\nnneighbor(terms::Tuple{Term, Vararg{Term}}) -> Int\n\nGet the\n\norder of neighbor in a single term;\nhighest order of neighbors in a set of terms.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.Spatials.rcoordinate-Tuple{Operator{<:Number, <:NTuple{N, CoordinatedIndex} where N}}","page":"Degrees of freedom","title":"QuantumLattices.Spatials.rcoordinate","text":"rcoordinate(opt::Operator{<:Number, <:ID{CoordinatedIndex}}) -> SVector\n\nGet the whole rcoordinate of an operator.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.Toolkit.shape-Tuple{SimpleInternal, SimpleInternalIndex}","page":"Degrees of freedom","title":"QuantumLattices.Toolkit.shape","text":"shape(internal::SimpleInternal, index::SimpleInternalIndex) -> OrdinalRange{Int, Int}\n\nGet the shape of a simple internal space when a labeled simple internal index are considered.\n\nA constrained internal space need this function to generate all the internal indexes that match the internal pattern, which gets a default implementation, i.e.,\n\nshape(internal::SimpleInternal, index::SimpleInternalIndex) = shape(internal)\n\nIt can be overloaded to restrict the shape of a simple internal space based on the input simple internal index to significantly improve efficiency, but this is not necessary.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.expand!-Tuple{Operators, Term, Bond, Hilbert}","page":"Degrees of freedom","title":"QuantumLattices.expand!","text":"expand!(operators::Operators, term::Term, bond::Bond, hilbert::Hilbert; half::Bool=false) -> Operators\nexpand!(operators::Operators, term::Term, bonds, hilbert::Hilbert; half::Bool=false) -> Operators\n\nExpand the operators of a term on a bond/set-of-bonds with a given Hilbert space.\n\nThe half parameter determines the behavior of generating operators, which falls into the following two categories\n\ntrue: \"Hermitian half\" of the generated operators\nfalse: \"Hermitian whole\" of the generated operators\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.expand-Tuple{Term, Bond, Hilbert}","page":"Degrees of freedom","title":"QuantumLattices.expand","text":"expand(term::Term, bond::Bond, hilbert::Hilbert; half::Bool=false) -> Operators\nexpand(term::Term, bonds, hilbert::Hilbert; half::Bool=false) -> Operators\n\nExpand the operators of a term on a bond/set-of-bonds with a given Hilbert space.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.expand-Union{Tuple{Rule}, Tuple{Coupling, Val{Rule}, Bond, Hilbert}} where Rule","page":"Degrees of freedom","title":"QuantumLattices.expand","text":"expand(coupling::Coupling, ::Val{Rule}, bond::Bond, hilbert::Hilbert) where Rule\n\nExpand a coupling with the given bond and Hilbert space under a given named pattern rule.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.id-Tuple{Term}","page":"Degrees of freedom","title":"QuantumLattices.id","text":"id(term::Term) -> Symbol\nid(::Type{<:Term) -> Symbol\n\nGet the id of a term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.kind-Tuple{Term}","page":"Degrees of freedom","title":"QuantumLattices.kind","text":"kind(term::Term) -> Symbol\nkind(::Type{<:Term) -> Symbol\n\nGet the kind of a term.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.permute-Tuple{CoordinatedIndex, CoordinatedIndex}","page":"Degrees of freedom","title":"QuantumLattices.permute","text":"permute(index₁::CoordinatedIndex, index₂::CoordinatedIndex) -> Tuple{Vararg{Operator}}\n\nGet the permutation of two coordinated indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.permute-Tuple{Index, Index}","page":"Degrees of freedom","title":"QuantumLattices.permute","text":"permute(index₁::Index, index₂::Index) -> Tuple{Vararg{Operator}}\n\nGet the permutation of two indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.reset!-Tuple{Table, AbstractVector{<:OperatorIndex}}","page":"Degrees of freedom","title":"QuantumLattices.reset!","text":"reset!(table::Table, indexes::AbstractVector{<:OperatorIndex}) -> Table\n\nReset a table by a new set of indexes.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.reset!-Tuple{Table, Hilbert}","page":"Degrees of freedom","title":"QuantumLattices.reset!","text":"reset!(table::Table, hilbert::Hilbert) -> Table\n\nReset a table by a Hilbert space.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.update!-Tuple{Boundary}","page":"Degrees of freedom","title":"QuantumLattices.update!","text":"update!(bound::Boundary; parameters...) -> Boundary\n\nUpdate the values of the boundary twisted phase.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.update!-Tuple{Term, Vararg{Any}}","page":"Degrees of freedom","title":"QuantumLattices.update!","text":"update!(term::Term, args...; kwargs...) -> Term\n\nUpdate the value of a term if it is ismodulatable.\n\n\n\n\n\n","category":"method"},{"location":"man/DegreesOfFreedom/#QuantumLattices.value-Tuple{Term}","page":"Degrees of freedom","title":"QuantumLattices.value","text":"value(term::Term) -> valtype(term)\n\nGet the value of a term.\n\n\n\n\n\n","category":"method"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"CurrentModule = QuantumLattices","category":"page"},{"location":"unitcell description framework/Introduction/#UnitcellDescriptionIntroduction","page":"Introduction","title":"Introduction","text":"","category":"section"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"A quantum lattice system can be completely described based on its unitcell. Basically, this description should contain three types of information:","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"the spatial information, such as the coordinates of the points contained in the unitcell;\nthe internal degrees of freedom, such as the local algebra acting on the local Hilbert space at each point;\nthe couplings among different degrees of freedom, such as the terms present in the Hamiltonian.","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"In theory, as long as the above information is told, one could easily write down the operator representation of the Hamiltonian of the system. For example, in the phrase \"the single orbital electronic Hubbard model with only nearest neighbor hopping on a one dimensional lattice with only two sites\", \"one dimensional lattice with only two sites\" is the spatial information, \"single orbital electronic\" defines the local Hilbert space and thus the local algebra, and \"Hubbard model with only nearest neighbor hopping\" describes the terms present in the Hamiltonian. From this phrase, we also know that the Hamiltonian of the system is","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"H=tc^_1c_2+tc^_2c_1+tc^_1c_2+tc^_2c_1+Uc^_1c_1c^_1c_1+Uc^_2c_2c^_2c_2","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"where t is the hopping amplitude, U is the Hubbard interaction strength and the electronic creation/annihilation operator c^dagger_isigmac_isigma carries a site index i (i=1 2) and a spin index sigma (sigma=uparrow downarrow). Actually, the unitcell description framework follows exactly after the above train of thought. For example, the aforementioned system can be constructed by the following codes:","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"using QuantumLattices\nusing SymPy: Sym, symbols\n\n# define the unitcell\nlattice = Lattice([zero(Sym)], [one(Sym)])\n\n# define the internal degrees of freedom, i.e., the single-orbital spin-1/2 fermionic algebra\nhilbert = Hilbert(site=>Fock{:f}(1, 2) for site=1:length(lattice))\n\n# define the terms\nt = Hopping(:t, symbols(\"t\", real=true), 1)\nU = Hubbard(:U, symbols(\"U\", real=true))\n\n# get the Hamiltonian\noperators = expand(OperatorGenerator(bonds(lattice, 1), hilbert, (t, U)))","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"The last line displays all the generated operators in the Hamiltonian in the LaTeX format. Here, in the subscript of the electronic annihilation/creation operator, an extra orbital index is also displayed.","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"In the following pages listed below, we will explain in detail how these codes work. Firstly, in the page of Spatial information of a unitcell, we will introduce the construction of the unitcell as well as the ways to obtain the bonds at different orders of nearest neighbors. Secondly, in the page of Internal degrees of freedom, we will explain the hierarchy of the internal degrees of freedom and discuss how they are organized for different categories of quantum systems. Thirdly, in the page of Couplings among different degrees of freedom, we will discuss the ways to specify the terms present in the Hamiltonian. Finally, in the page of Generator of operators, we will show how to combine all to get the operator representation of the Hamiltonian of a quantum lattice system. For more sophisticated information, the manual of this package can also be referred.","category":"page"},{"location":"unitcell description framework/Introduction/","page":"Introduction","title":"Introduction","text":"Pages = [\n \"SpatialInfoOfAUnitcell.md\",\n \"InternalDegreesOfFreedom.md\",\n \"CouplingsAmongDifferentDegreesOfFreedom.md\",\n \"GeneratorOfOperators.md\",\n ]\nDepth = 2","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"CurrentModule = QuantumLattices\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/#Spatial-information-of-a-unitcell","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"","category":"section"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"The first step toward the complete description of a quantum lattice system is the understanding of the spatial information of a unitcell.","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/#Construction-of-a-lattice","page":"Spatial information of a unitcell","title":"Construction of a lattice","text":"","category":"section"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"In general, a lattice has translation symmetry. This symmetry introduces an equivalence relation for the points in a lattice when they can be translated into each other by multiple times of the translation vectors. This observation sets the mathematical foundation of the unitcell construction. As a result, it is enough for a lattice to restrict all points within the origin unitcell together with the translation vectors.","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"Lattice is the simplest structure to encode all the spatial information within the origin unitcell. Apparently, it must contain all the coordinates of the points in the origin unitcell and the translation vectors of the lattice. It also appears to be useful to associate a lattice with a name. Therefore, in this package, Lattice has three attributes:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"name::Symbol: the name of the lattice\ncoordinates::Matrix{<:Number}: the coordinates of the points within the origin unitcell\nvectors::Vector{<:StaticArraysCore.SVector}: the translation vectors of the lattice","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"Lattice can be constructed by offering the coordinates, with optional keyword arguments to specify its name and translation vectors:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> Lattice([0.0])\nLattice(lattice)\n with 1 point:\n [0.0]\n\njulia> Lattice((0.0, 0.0), (0.5, 0.5); vectors=[[1.0, 0.0], [0.0, 1.0]], name=:Square)\nLattice(Square)\n with 2 points:\n [0.0, 0.0]\n [0.5, 0.5]\n with 2 translation vectors:\n [1.0, 0.0]\n [0.0, 1.0]\n\njulia> Lattice(\n (0.0, 0.0, 0.0);\n name=:Cube,\n vectors=[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]\n )\nLattice(Cube)\n with 1 point:\n [0.0, 0.0, 0.0]\n with 3 translation vectors:\n [1.0, 0.0, 0.0]\n [0.0, 1.0, 0.0]\n [0.0, 0.0, 1.0]","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"The coordinates could be specified by vectors or tuples.","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"Iteration over a lattice will get the coordinates of the points in it:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> lattice = Lattice((0.0, 0.0), (0.5, 0.5); vectors=[[1.0, 0.0], [0.0, 1.0]]);\n\njulia> length(lattice)\n2\n\njulia> [lattice[1], lattice[2]]\n2-element Vector{StaticArraysCore.SVector{2, Float64}}:\n [0.0, 0.0]\n [0.5, 0.5]\n\njulia> collect(lattice)\n2-element Vector{StaticArraysCore.SVector{2, Float64}}:\n [0.0, 0.0]\n [0.5, 0.5]","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"The reciprocal translation vectors of the dual lattice can be obtained by reciprocals:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> lattice = Lattice((0.0, 0.0); vectors=[[1.0, 0.0], [0.0, 1.0]]);\n\njulia> reciprocals(lattice)\n2-element StaticArraysCore.SVector{2, StaticArraysCore.SVector{2, Float64}} with indices SOneTo(2):\n [6.283185307179586, -0.0]\n [-0.0, 6.283185307179586]","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/#Request-for-the-bonds-of-a-lattice","page":"Spatial information of a unitcell","title":"Request for the bonds of a lattice","text":"","category":"section"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"Before the introduction of how to obtain the bonds of a lattice, let's discuss more about the unitcell construction to clarify the logic behind the definitions of the Point type and the Bond type in this package.","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/#Point","page":"Spatial information of a unitcell","title":"Point","text":"","category":"section"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"With the translation symmetry, all points of a lattice are equivalent to those within the origin unitcell. However, it becomes complicated when the bonds are requested. The bonds inter different unitcells cannot be compressed into a single unitcell. Therefore, even in the unitcell construction framework, it turns out to be unavoidable to specify a point outside the origin unitcell, which requires extra information beyond a single coordinate if we want to remember which point it is equivalent to within the origin unitcell at the same time. In fact, it is customary in literature to express the coordinate mathbfR of a point in a lattice as mathbfR=mathbfR_i+mathbfr, where mathbfR_i is the integral coordinate of the unitcell the point belongs to and mathbfr is the relative displacement of the point in the unitcell. Apparently, any two of these three coordinates are complete to get the full information. In this package, we choose mathbfR and mathbfR_i as the complete set for a individual lattice point. Besides, we also associate a site index with a point for the fast lookup for its equivalence within the origin unitcell although it is redundant in theory. Thus, the Point defined in this package has three attributes as follows:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"site::Int: the site index of a point that specifies the equivalent point within the origin unitcell\nrcoordinate::StaticArraysCore.SVector: the real coordinate of the point (mathbfR)\nicoordinate::StaticArraysCore.SVector: the integral coordinate of the unitcell the point belongs to (mathbfR_i)","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"At the construction of a Point, rcoordinate and icoordinate can accept tuples or usual vectors as inputs, such as","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> Point(1, [0.0], [0.0])\nPoint(1, [0.0], [0.0])\n\njulia> Point(1, (1.5, 0.0), (1.0, 0.0))\nPoint(1, [1.5, 0.0], [1.0, 0.0])","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"icoordinate can be omitted, then it will be initialized by a zero StaticArraysCore.SVector:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> Point(1, [0.0, 0.5])\nPoint(1, [0.0, 0.5], [0.0, 0.0])","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/#Bond","page":"Spatial information of a unitcell","title":"Bond","text":"","category":"section"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"A bond in the narrow sense consist of two points. However, in quantum lattice systems, it is common to refer to generic bonds with only one or more than two points. In addition, it is also convenient to associate a bond with a kind information, such as the order of the nearest neighbors of the bond. Thus, the Bond is defined as follows:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"kind: the kind information of a generic bond\npoints::Vector{<:Point}: the points a generic bond contains","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> Bond(Point(1, [0.0, 0.0], [0.0, 0.0])) # 1-point bond\nBond(0, Point(1, [0.0, 0.0], [0.0, 0.0]))\n\njulia> Bond(2, Point(1, [0.0, 0.0], [0.0, 0.0]), Point(1, [1.0, 1.0], [1.0, 1.0])) # 2-point bond\nBond(2, Point(1, [0.0, 0.0], [0.0, 0.0]), Point(1, [1.0, 1.0], [1.0, 1.0]))\n\njulia> Bond(:plaquette, Point(1, [0.0, 0.0]), Point(2, [1.0, 0.0]), Point(3, [1.0, 1.0]), Point(4, [0.0, 1.0])) # generic bond with 4 points\nBond(:plaquette, Point(1, [0.0, 0.0], [0.0, 0.0]), Point(2, [1.0, 0.0], [0.0, 0.0]), Point(3, [1.0, 1.0], [0.0, 0.0]), Point(4, [0.0, 1.0], [0.0, 0.0]))","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"It is noted that the kind attribute of a bond with only one point is set to be 0.","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"Iteration over a bond will get the points it contains:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> bond = Bond(2, Point(1, [0.0, 0.0], [0.0, 0.0]), Point(2, [1.0, 0.0], [0.0, 0.0]));\n\njulia> length(bond)\n2\n\njulia> [bond[1], bond[2]]\n2-element Vector{Point{2, Float64}}:\n Point(1, [0.0, 0.0], [0.0, 0.0])\n Point(2, [1.0, 0.0], [0.0, 0.0])\n\njulia> collect(bond)\n2-element Vector{Point{2, Float64}}:\n Point(1, [0.0, 0.0], [0.0, 0.0])\n Point(2, [1.0, 0.0], [0.0, 0.0])","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"The coordinate of a bond as a whole is also defined for those that only contain one or two points. The coordinate of a 1-point bond is defined to be the corresponding coordinate of this point, and the coordinate of a 2-point bond is defined to be the corresponding coordinate of the second point minus that of the first:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> bond1p = Bond(Point(1, [2.0], [1.0]));\n\njulia> rcoordinate(bond1p)\n1-element StaticArraysCore.SVector{1, Float64} with indices SOneTo(1):\n 2.0\n\njulia> icoordinate(bond1p)\n1-element StaticArraysCore.SVector{1, Float64} with indices SOneTo(1):\n 1.0\n\njulia> bond2p = Bond(1, Point(1, [1.0, 1.0], [1.0, 1.0]), Point(2, [0.5, 0.5], [0.0, 0.0]));\n\njulia> rcoordinate(bond2p)\n2-element StaticArraysCore.SVector{2, Float64} with indices SOneTo(2):\n -0.5\n -0.5\n\njulia> icoordinate(bond2p)\n2-element StaticArraysCore.SVector{2, Float64} with indices SOneTo(2):\n -1.0\n -1.0","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/#Generation-of-1-point-and-2-point-bonds-of-a-lattice","page":"Spatial information of a unitcell","title":"Generation of 1-point and 2-point bonds of a lattice","text":"","category":"section"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"In this package, we provide the function bonds to get the 1-point and 2-point bonds of a lattice:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"bonds(lattice::Lattice, nneighbor::Int) -> Vector{<:Bond}\nbonds(lattice::Lattice, neighbors::Neighbors) -> Vector{<:Bond}","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"which is based on the KDTree type provided by the NearestNeighbors.jl package. In the first method, all the bonds up to the nneighborth nearest neighbors are returned, including the 1-point bonds:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> lattice = Lattice([0.0, 0.0]; vectors=[[1.0, 0.0], [0.0, 1.0]]);\n\njulia> bonds(lattice, 2)\n5-element Vector{Bond{Int64, Point{2, Float64}}}:\n Bond(0, Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(2, Point(1, [-1.0, -1.0], [-1.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(1, Point(1, [0.0, -1.0], [0.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(2, Point(1, [1.0, -1.0], [1.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(1, Point(1, [-1.0, 0.0], [-1.0, 0.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"However, this method is not so efficient, as KDTree only searches the bonds with the lengths less than a value, and it does not know the bond lengths for each order of nearest neighbors. Such information must be computed as first. Therefore, in the second method, bonds can accept a new type, the Neighbors, as its second positional parameter to improve the efficiency, which could tell the program the information of the bond lengths in priori:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> lattice = Lattice([0.0, 0.0]; vectors=[[1.0, 0.0], [0.0, 1.0]]);\n\njulia> bonds(lattice, Neighbors(0=>0.0, 1=>1.0, 2=>√2))\n5-element Vector{Bond{Int64, Point{2, Float64}}}:\n Bond(0, Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(2, Point(1, [-1.0, -1.0], [-1.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(1, Point(1, [0.0, -1.0], [0.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(2, Point(1, [1.0, -1.0], [1.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(1, Point(1, [-1.0, 0.0], [-1.0, 0.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"Meanwhile, an instance of Neighbors could also serve as a filter of the generated bonds, which select those bonds with the given bond lengths:","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"julia> lattice = Lattice([0.0, 0.0]; vectors=[[1.0, 0.0], [0.0, 1.0]]);\n\njulia> bonds(lattice, Neighbors(2=>√2))\n2-element Vector{Bond{Int64, Point{2, Float64}}}:\n Bond(2, Point(1, [-1.0, -1.0], [-1.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))\n Bond(2, Point(1, [1.0, -1.0], [1.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))","category":"page"},{"location":"unitcell description framework/SpatialInfoOfAUnitcell/","page":"Spatial information of a unitcell","title":"Spatial information of a unitcell","text":"To obtain generic bonds containing more points, user are encouraged to implement their own bonds methods. Pull requests are welcomed.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Internal-degrees-of-freedom","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Now let's move to the second step, the internal degrees of freedom.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Hierarchy-of-the-internal-degrees-of-freedom","page":"Internal degrees of freedom","title":"Hierarchy of the internal degrees of freedom","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"In general, a lattice Hamiltonian can be expressed by the generators of the algebra that acts on the Hilbert space of the system. For example for the complex fermionic (bosonic) system, the Hilbert space is the Fock space, and the lattice Hamiltonian can be expressed by the generators of the fermionic (bosonic) algebra, i.e., the the creation and annihilation operators c^dagger_alpha c_alpha left(b^dagger_alpha b_alpharight). For another example for the local spin-1/2 system, the Hilbert space is the otimes_alphalvertuparrowrangle lvertdownarrowrangle_alpha space, and the lattice Hamiltonian can be expressed by the generators of the SU(2) spin algebra, i.e., the spin operators S^x_alpha S^y_alpha S^z_alpha or S^+_alpha S^-_alpha S^z_alpha. In both examples, the subscript alpha denotes a complete set of indexes of the internal degrees of freedom of the quantum system. Therefore, the determination of the algebra acting on the system's Hilbert space and its corresponding generators lies at the center of the constructions of the operator representations of lattice Hamiltonians.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The global Hilbert space of a lattice system can be decomposed into the direct product of the local internal spaces \"living\" on individual points, leading to a similar decomposition of the global algebra into local ones. To incorporate with the unitcell construction of the lattice, an extra intermediate representation of the translation-equivalent internal degrees of freedom within the origin unitcell is also needed. Thus, from the microscopic to the macroscopic, we arrive at a three level hierarchy, namely the local-unitcell-global hierarchy, of the internal degrees of freedom.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"At the local or the individual-point level, the local algebra is represented by the type Internal, and a local generator of the local algebra is represented by the type InternalIndex. Both types are abstract types with their concrete subtypes to represent concrete local algebras and concrete local generators of different quantum lattice systems with different internal structures, respectively.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"At the unitcell level, the algebra of the system is represented by the type Hilbert, which defines the concrete local algebras point by point within the origin unitcell. Accordingly, the type Index, which combines a site index and an instance of InternalIndex, could specify a translation-equivalent generator within the origin unitcell.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"At the global or the whole-lattice level, we do not actually need a representation of the algebra of the system, but really do for the generators because we have to specify them outside the origin unitcell when the bond goes across the unitcell boundaries. The type CoordinatedIndex, which combines an instance of Index and the coordinates mathbfR and mathbfR_i of the underlying point, represents a generator at such a level.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The above discussions can be summarized by the following table, which also displays how the spatial part of a quantum lattice system is represented:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":" local (individual-point) level unitcell level global (whole-lattice) level\nspatial Point Lattice \nalgebra Internal and its concrete subtypes Hilbert \ngenerator InternalIndex and its concrete subtypes Index CoordinatedIndex","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Quantum-lattice-systems-with-different-internal-structures","page":"Internal degrees of freedom","title":"Quantum lattice systems with different internal structures","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"In this section, we will explain in detail for the common categories of quantum lattice systems implemented in this package about how their algebras and generators are organized according to the above three level hierarchy.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Canonical-complex-fermionic,-canonical-complex-bosonic-and-hard-core-bosonic-systems","page":"Internal degrees of freedom","title":"Canonical complex fermionic, canonical complex bosonic and hard-core bosonic systems","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Local-level:-Fock-and-FockIndex","page":"Internal degrees of freedom","title":"Local level: Fock and FockIndex","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Roughly speaking, these systems share similar internal structures of local Hilbert spaces termed as the Fock space where the generators of local algebras are the annihilation and creation operators. Besides the nambu index to distinguish whether it is an annihilation one or a creation one, such a generator usually adopts an orbital index and a spin index. Thus, the type FockIndex<:InternalIndex, which specifies a certain local generator of a local Fock algebra, has the following attributes:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"orbital::Int: the orbital index\nspin::Rational{Int}: the spin index, which must be a half integer\nnambu::Int: the nambu index, which must be 1(annihilation) or 2(creation).","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Correspondingly, the type Fock<:Internal, which specifies the local algebra acting on the local Fock space, has the following attributes:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"norbital::Int: the number of allowed orbital indices\nnspin::Int: the number of allowed spin indices","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"To distinguish whether the system is a fermionic one or a bosonic one, FockIndex and Fock take a symbol :f(for fermionic) or :b(for bosonic) to be their first type parameters.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Now let's see some examples.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"An FockIndex instance can be initialized by giving all its three attributes:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> FockIndex{:f}(2, 1//2, 1)\n𝕗(2, 1//2, 1)\n\njulia> FockIndex{:b}(2, 0, 1)\n𝕓(2, 0, 1)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Here, 𝕗 (\\bbf) and 𝕓 (\\bbb) are two functions that are convenient to construct and display instances of FockIndex{:f} and FockIndex{:b}, respectively.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕗(2, 1//2, 1) isa FockIndex{:f}\ntrue\n\njulia> 𝕓(2, 0, 1) isa FockIndex{:b}\ntrue","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The adjoint of an FockIndex instance is also defined:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕗(3, 3//2, 1)'\n𝕗(3, 3//2, 2)\n\njulia> 𝕓(3, 3//2, 2)'\n𝕓(3, 3//2, 1)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Apparently, this operation is nothing but the \"Hermitian conjugate\".","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"A Fock instance can be initialized by giving all its attributes:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Fock{:f}(1, 2)\n4-element Fock{:f}:\n 𝕗(1, -1//2, 1)\n 𝕗(1, 1//2, 1)\n 𝕗(1, -1//2, 2)\n 𝕗(1, 1//2, 2)\n\njulia> Fock{:b}(1, 1)\n2-element Fock{:b}:\n 𝕓(1, 0, 1)\n 𝕓(1, 0, 2)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"As can be seen, a Fock instance behaves like a vector (because the parent type Internal is a subtype of AbstractVector), and its iteration just generates all the allowed FockIndex instances on its associated spatial point:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> fck = Fock{:f}(2, 1);\n\njulia> fck |> typeof |> eltype\nFockIndex{:f, Int64, Rational{Int64}, Int64}\n\njulia> fck |> length\n4\n\njulia> [fck[1], fck[2], fck[3], fck[4]]\n4-element Vector{FockIndex{:f, Int64, Rational{Int64}, Int64}}:\n 𝕗(1, 0, 1)\n 𝕗(2, 0, 1)\n 𝕗(1, 0, 2)\n 𝕗(2, 0, 2)\n\njulia> fck |> collect\n4-element Vector{FockIndex{:f, Int64, Rational{Int64}, Int64}}:\n 𝕗(1, 0, 1)\n 𝕗(2, 0, 1)\n 𝕗(1, 0, 2)\n 𝕗(2, 0, 2)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"This is isomorphic to the mathematical fact that a local algebra is a vector space of the local generators.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Unitcell-level:-Hilbert-and-Index","page":"Internal degrees of freedom","title":"Unitcell level: Hilbert and Index","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"To specify the Fock algebra at the unitcell level, Hilbert associate each point within the origin unitcell with an instance of Fock:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Hilbert(1=>Fock{:f}(1, 2), 2=>Fock{:f}(1, 2))\nHilbert{Fock{:f}} with 2 entries:\n 1 => Fock{:f}(norbital=1, nspin=2)\n 2 => Fock{:f}(norbital=1, nspin=2)\n\njulia> Hilbert(site=>Fock{:f}(2, 2) for site=1:2)\nHilbert{Fock{:f}} with 2 entries:\n 1 => Fock{:f}(norbital=2, nspin=2)\n 2 => Fock{:f}(norbital=2, nspin=2)\n\njulia> Hilbert(Fock{:f}(2, 2), 2)\nHilbert{Fock{:f}} with 2 entries:\n 1 => Fock{:f}(norbital=2, nspin=2)\n 2 => Fock{:f}(norbital=2, nspin=2)\n\njulia> Hilbert([Fock{:f}(2, 2), Fock{:f}(2, 2)])\nHilbert{Fock{:f}} with 2 entries:\n 1 => Fock{:f}(norbital=2, nspin=2)\n 2 => Fock{:f}(norbital=2, nspin=2)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"In general, at different sites, the local Fock algebra could be different:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Hilbert(site=>Fock{:f}(iseven(site) ? 2 : 1, 1) for site=1:2)\nHilbert{Fock{:f}} with 2 entries:\n 1 => Fock{:f}(norbital=1, nspin=1)\n 2 => Fock{:f}(norbital=2, nspin=1)\n\njulia> Hilbert(1=>Fock{:f}(1, 2), 2=>Fock{:b}(1, 2))\nHilbert{Fock} with 2 entries:\n 1 => Fock{:f}(norbital=1, nspin=2)\n 2 => Fock{:b}(norbital=1, nspin=2)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Hilbert itself is a subtype of AbstractDict, the iteration over the keys gives the sites, and the iteration over the values gives the local algebras:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> hilbert = Hilbert(site=>Fock{:f}(iseven(site) ? 2 : 1, 1) for site=1:2);\n\njulia> collect(keys(hilbert))\n2-element Vector{Int64}:\n 1\n 2\n\njulia> collect(values(hilbert))\n2-element Vector{Fock{:f}}:\n Fock{:f}(norbital=1, nspin=1)\n Fock{:f}(norbital=2, nspin=1)\n\njulia> collect(hilbert)\n2-element Vector{Pair{Int64, Fock{:f}}}:\n 1 => Fock{:f}(norbital=1, nspin=1)\n 2 => Fock{:f}(norbital=2, nspin=1)\n\njulia> [hilbert[1], hilbert[2]]\n2-element Vector{Fock{:f}}:\n Fock{:f}(norbital=1, nspin=1)\n Fock{:f}(norbital=2, nspin=1)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"To specify a translation-equivalent generator of the Fock algebra within the unitcell, Index just combines a site::Int attribute and an internal::FockIndex attribute:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> index = Index(1, FockIndex{:f}(1, -1//2, 2))\n𝕗(1, 1, -1//2, 2)\n\njulia> index.site\n1\n\njulia> index.internal\n𝕗(1, -1//2, 2)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Here, the functions 𝕗 and 𝕓 can also construct and display instances of Index{<:FockIndex{:f}} and Index{<:FockIndex{:b}}, respectively.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕗(1, 1, -1//2, 2) isa Index{<:FockIndex{:f}}\ntrue\n\njulia> 𝕓(1, 1, -1//2, 2) isa Index{<:FockIndex{:b}}\ntrue","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The Hermitian conjugate of an Index is also defined:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕗(1, 1, -1//2, 2)'\n𝕗(1, 1, -1//2, 1)\n\njulia> 𝕓(1, 1, -1//2, 1)'\n𝕓(1, 1, -1//2, 2)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Global-level:-CoordinatedIndex","page":"Internal degrees of freedom","title":"Global level: CoordinatedIndex","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Since the local algebra of a quantum lattice system can be defined point by point, the global algebra can be completely compressed into the origin unitcell. However, the generator outside the origin unitcell cannot be avoided because we have to use them to compose the Hamiltonian on the bonds that goes across the unitcell boundaries. This situation is similar to the case of Lattice and Point. Therefore, we take a similar solution for the generators to that is adopted for the Point, i.e., we include the mathbfR coordinate (by the rcoordinate attribute) and the mathbfR_i coordinate (by the icoordinate attribute) of the underlying point together with the index::Index attribute in the CoordinatedIndex type to represent a generator that could be inside or outside the origin unitcell:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> index = CoordinatedIndex(Index(1, FockIndex{:f}(1, 0, 2)), [0.5, 0.0], [0.0, 0.0])\n𝕗(1, 1, 0, 2, [0.5, 0.0], [0.0, 0.0])\n\njulia> index.index\n𝕗(1, 1, 0, 2)\n\njulia> index.rcoordinate\n2-element StaticArraysCore.SVector{2, Float64} with indices SOneTo(2):\n 0.5\n 0.0\n\njulia> index.icoordinate\n2-element StaticArraysCore.SVector{2, Float64} with indices SOneTo(2):\n 0.0\n 0.0\n\njulia> index' # the Hermitian conjugate of a CoordinatedIndex is also defined\n𝕗(1, 1, 0, 1, [0.5, 0.0], [0.0, 0.0])","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Here, as can be expected, the functions 𝕗 and 𝕓 can construct and display instances of CoordinatedIndex{<:Index{<:FockIndex{:f}}} and CoordinatedIndex{<:Index{<:FockIndex{:b}}}, respectively, as well.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕗(1, 1, 0, 2, [0.5, 0.0], [0.0, 0.0]) isa CoordinatedIndex{<:Index{<:FockIndex{:f}}}\ntrue\n\njulia> 𝕓(1, 1, 0, 2, [0.5, 0.0], [0.0, 0.0]) isa CoordinatedIndex{<:Index{<:FockIndex{:b}}}\ntrue","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#SU(2)-spin-systems","page":"Internal degrees of freedom","title":"SU(2) spin systems","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Local-level:-Spin-and-SpinIndex","page":"Internal degrees of freedom","title":"Local level: Spin and SpinIndex","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Spin<:Internal and SpinIndex<:InternalIndex are designed to deal with SU(2) spin systems at the local level.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Although spin systems are essentially bosonic, the commonly-used local Hilbert space is distinct from that of an usual bosonic system: it is the space spanned by the eigenstates of a local S^z operator rather than a Fock space. At the same time, a spin Hamiltonian is usually expressed by local spin operators, such as S^x, S^y, S^z, S^+ and S^-, instead of creation and annihilation operators. Therefore, it is convenient to define another set of concrete subtypes for spin systems.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"To specify which one of the five S^x S^y S^z S^+ S^- a local spin operator is, the type SpinIndex has the following attribute:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"tag::Char: the tag, which must be 'x', 'y', 'z', '+' or '-'.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Correspondingly, the type Spin, which defines the local SU(2) spin algebra, does not need any attribute.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"For SpinIndex and Spin, it is also necessary to know what the total spin is, which is taken as their first type parameters and should be a half-integer or an integer.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Now let's see examples.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"An SpinIndex instance can be initialized as follows","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> SpinIndex{3//2}('x')\n𝕊{3//2}('x')\n\njulia> SpinIndex{1//2}('z')\n𝕊{1//2}('z')\n\njulia> SpinIndex{1}('+')\n𝕊{1}('+')","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Here, the type 𝕊 (\\bbS) plays a similar role in spin systems as 𝕗 and 𝕓 in Fock system.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕊{3//2}('x') isa SpinIndex{3//2}\ntrue","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The \"Hermitian conjugate\" of an SpinIndex instance can be obtained by the adjoint operation:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕊{3//2}('x')'\n𝕊{3//2}('x')\n\njulia> 𝕊{3//2}('y')'\n𝕊{3//2}('y')\n\njulia> 𝕊{3//2}('z')'\n𝕊{3//2}('z')\n\njulia> 𝕊{3//2}('+')'\n𝕊{3//2}('-')\n\njulia> 𝕊{3//2}('-')'\n𝕊{3//2}('+')","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The local spin space is determined by the total spin. The standard matrix representation of an SpinIndex instance on this local spin space can be obtained by the matrix function exported by this package:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕊{1//2}('x') |> matrix\n2×2 Matrix{ComplexF64}:\n 0.0+0.0im 0.5+0.0im\n 0.5+0.0im 0.0+0.0im\n\njulia> 𝕊{1//2}('y') |> matrix\n2×2 Matrix{ComplexF64}:\n 0.0-0.0im -0.0+0.5im\n 0.0-0.5im 0.0-0.0im\n\njulia> 𝕊{1//2}('z') |> matrix\n2×2 Matrix{ComplexF64}:\n -0.5+0.0im -0.0+0.0im\n 0.0+0.0im 0.5+0.0im\n\njulia> 𝕊{1//2}('+') |> matrix\n2×2 Matrix{ComplexF64}:\n 0.0+0.0im 0.0+0.0im\n 1.0+0.0im 0.0+0.0im\n\njulia> 𝕊{1//2}('-') |> matrix\n2×2 Matrix{ComplexF64}:\n 0.0+0.0im 1.0+0.0im\n 0.0+0.0im 0.0+0.0im","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"A Spin instance can be initialized as follows:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Spin{1}()\n5-element Spin{1}:\n 𝕊{1}('x')\n 𝕊{1}('y')\n 𝕊{1}('z')\n 𝕊{1}('+')\n 𝕊{1}('-')\n\njulia> Spin{1//2}()\n5-element Spin{1//2}:\n 𝕊{1//2}('x')\n 𝕊{1//2}('y')\n 𝕊{1//2}('z')\n 𝕊{1//2}('+')\n 𝕊{1//2}('-')","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Similar to Fock, a Spin instance behaves like a vector whose iteration generates all the allowed SpinIndex instances on its associated spatial point:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> sp = Spin{1}();\n\njulia> sp |> typeof |> eltype\nSpinIndex{1, Char}\n\njulia> sp |> length\n5\n\njulia> [sp[1], sp[2], sp[3], sp[4], sp[5]]\n5-element Vector{SpinIndex{1, Char}}:\n 𝕊{1}('x')\n 𝕊{1}('y')\n 𝕊{1}('z')\n 𝕊{1}('+')\n 𝕊{1}('-')\n\njulia> sp |> collect\n5-element Vector{SpinIndex{1, Char}}:\n 𝕊{1}('x')\n 𝕊{1}('y')\n 𝕊{1}('z')\n 𝕊{1}('+')\n 𝕊{1}('-')","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"It is noted that a Spin instance generates SpinIndex instances not only limited to those corresponding to S^x, S^y, S^z, but also those to S^+ and S^- although the former three already forms a complete set of the generators of the local SU(2) spin algebra. This overcomplete feature is for the convenience to the construction of spin Hamiltonians.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Unitcell-and-global-levels:-Hilbert,-Index-and-CoordinatedIndex","page":"Internal degrees of freedom","title":"Unitcell and global levels: Hilbert, Index and CoordinatedIndex","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"At the unitcell and global levels to construct the SU(2) spin algebra and spin generators, it is completely the same to that of the Fock algebra and Fock generators as long as we replace Fock and FockIndex with Spin and SpinIndex, respectively:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Hilbert(1=>Spin{1//2}(), 2=>Spin{1}())\nHilbert{Spin} with 2 entries:\n 1 => Spin{1//2}()\n 2 => Spin{1}()\n\njulia> Index(1, SpinIndex{1//2}('+'))\n𝕊{1//2}(1, '+')\n\njulia> 𝕊{1//2}(1, '+') isa Index{<:SpinIndex{1//2}}\ntrue\n\njulia> CoordinatedIndex(Index(1, SpinIndex{1//2}('-')), [0.5, 0.5], [1.0, 1.0])\n𝕊{1//2}(1, '-', [0.5, 0.5], [1.0, 1.0])\n\njulia> 𝕊{1//2}(1, '-', [0.5, 0.5], [1.0, 1.0]) isa CoordinatedIndex{<:Index{<:SpinIndex{1//2}}}\ntrue","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Phononic-systems","page":"Internal degrees of freedom","title":"Phononic systems","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Local-level:-Phonon-and-PhononIndex","page":"Internal degrees of freedom","title":"Local level: Phonon and PhononIndex","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Phononic systems are also bosonic systems. However, the canonical creation and annihilation operators of phonons depends on the eigenvalues and eigenvectors of the dynamical matrix, making them difficult to be defined locally at each point. Instead, we resort to the displacement (mathbfu) and momentum (mathbfp) operators of lattice vibrations as the generators, which can be easily defined locally. The type PhononIndex<:InternalIndex could specify such a local generator, which has the following attributes:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"direction::Char: the direction, which must be one of 'x', 'y' and 'z', to indicate which spatial directional component of the generator it is","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Correspondingly, the type Phonon<:Internal, which defines the local mathbfu mathbfp algebra of the lattice vibrations, has the following attributes:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"ndirection::Int: the spatial dimension of the lattice vibrations, which must be 1, 2, or 3.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"For PhononIndex and Phonon, it is also necessary to distinguish whether it is for the displacement (mathbfu) or for the momentum (mathbfp). Their first type parameters are designed to solve this problem, with :u and :b denoting mathbfu and mathbfp, respectively.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Now let's see examples:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> PhononIndex{:u}('x')\n𝕦('x')\n\njulia> PhononIndex{:p}('x')\n𝕡('x')\n\njulia> # one-dimensional lattice vibration only has the x component\n\njulia> Phonon{:u}(1)\n1-element Phonon{:u}:\n 𝕦('x')\n\njulia> Phonon{:p}(1)\n1-element Phonon{:p}:\n 𝕡('x')\n\njulia> # two-dimensional lattice vibration only has the x and y components\n\njulia> Phonon{:u}(2) \n2-element Phonon{:u}:\n 𝕦('x')\n 𝕦('y')\n\njulia> Phonon{:p}(2)\n2-element Phonon{:p}:\n 𝕡('x')\n 𝕡('y')\n\njulia> # three-dimensional lattice vibration has the x, y and z components\n\njulia> Phonon{:u}(3)\n3-element Phonon{:u}:\n 𝕦('x')\n 𝕦('y')\n 𝕦('z')\n\njulia> Phonon{:p}(3)\n3-element Phonon{:p}:\n 𝕡('x')\n 𝕡('y')\n 𝕡('z')","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"As is usual, we define functions 𝕦 (\\bbu) and 𝕡 (\\bbp) to construct and display instances of PhononIndex{:u} and PhononIndex{:p} for convenience, respectively.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> 𝕦('x') isa PhononIndex{:u}\ntrue\n\njulia> 𝕡('x') isa PhononIndex{:p}\ntrue","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Unitcell-and-global-levels:-Hilbert,-Index-and-CoordinatedIndex-2","page":"Internal degrees of freedom","title":"Unitcell and global levels: Hilbert, Index and CoordinatedIndex","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"At the unitcell and global levels, lattice-vibration algebras and generators are the same to previous situations by Phonon and PhononIndex replaced with in the corresponding types:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Hilbert(site=>Phonon(2) for site=1:3)\nHilbert{Phonon{:}} with 3 entries:\n 1 => Phonon(ndirection=2)\n 2 => Phonon(ndirection=2)\n 3 => Phonon(ndirection=2)\n\njulia> Index(1, PhononIndex{:u}('x'))\n𝕦(1, 'x')\n\njulia> 𝕦(1, 'x') isa Index{<:PhononIndex{:u}}\ntrue\n\njulia> Index(1, PhononIndex{:p}('x'))\n𝕡(1, 'x')\n\njulia> 𝕡(1, 'x') isa Index{<:PhononIndex{:p}}\ntrue\n\njulia> CoordinatedIndex(Index(1, PhononIndex{:u}('x')), [0.5, 0.5], [1.0, 1.0])\n𝕦(1, 'x', [0.5, 0.5], [1.0, 1.0])\n\njulia> 𝕦(1, 'x', [0.5, 0.5], [1.0, 1.0]) isa CoordinatedIndex{<:Index{<:PhononIndex{:u}}}\ntrue\n\njulia> CoordinatedIndex(Index(1, PhononIndex{:p}('x')), [0.5, 0.5], [1.0, 1.0])\n𝕡(1, 'x', [0.5, 0.5], [1.0, 1.0])\n\njulia> 𝕡(1, 'x', [0.5, 0.5], [1.0, 1.0]) isa CoordinatedIndex{<:Index{<:PhononIndex{:p}}}\ntrue","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"It is noted that Phonon{:} is a special kind of Phonon, which are used to specify the Hilbert space of lattice vibrations. In this way, both the displacement (mathbfu) and the momentum (mathbfp) degrees of freedom can be incorporated.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/#Operator-and-Operators","page":"Internal degrees of freedom","title":"Operator and Operators","text":"","category":"section"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Now we arrive at the core types of this package, the Operator and Operators. They are defined to deal with the mathematical operations, i.e., the +/-/* operations between two elements of the algebra acting on the Hilbert space, and the scalar multiplication between an element of the algebra and a number. Specifically, an Operator represents a product of several generators of the algebra specified at any of the three levels along with a coefficient, and an Operators represents the sum of several instances of Operator.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Operator can be initialized by two ways:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Operator(2, 𝕗(1, -1//2, 2), 𝕗(1, -1//2, 1), 𝕊{1//2}('z'))\nOperator(2, 𝕗(1, -1//2, 2), 𝕗(1, -1//2, 1), 𝕊{1//2}('z'))\n\njulia> 2 * 𝕗(1, 1, -1//2, 2) * 𝕊{1//2}(2, 'z')\nOperator(2, 𝕗(1, 1, -1//2, 2), 𝕊{1//2}(2, 'z'))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"It is noted that the number of the generators can be any natural number.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Although generators at different levels can be producted to make an Operator, it is not recommended to do so because the logic will be muddled:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Operator(2, 𝕗(1, 0, 2), 𝕗(2, 1, 0, 1, [0.0], [0.0])) # never do this !!!\nOperator(2, 𝕗(1, 0, 2), 𝕗(2, 1, 0, 1, [0.0], [0.0]))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Operator can be iterated and indexed by integers, which will give the corresponding generators in the product:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> op = Operator(2, 𝕗(1, 1//2, 2), 𝕗(1, 1//2, 1));\n\njulia> length(op)\n2\n\njulia> [op[1], op[2]]\n2-element Vector{FockIndex{:f, Int64, Rational{Int64}, Int64}}:\n 𝕗(1, 1//2, 2)\n 𝕗(1, 1//2, 1)\n\njulia> collect(op)\n2-element Vector{FockIndex{:f, Int64, Rational{Int64}, Int64}}:\n 𝕗(1, 1//2, 2)\n 𝕗(1, 1//2, 1)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"To get the coefficient of an Operator or all its individual generators as a whole, use the value and id function exported by this package, respectively:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> op = Operator(2, 𝕗(1, 0, 2), 𝕗(1, 0, 1));\n\njulia> value(op)\n2\n\njulia> id(op)\n(𝕗(1, 0, 2), 𝕗(1, 0, 1))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The product between two Operators, or the scalar multiplication between a number and an Operator is also an Operator:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Operator(2, 𝕗(1, 1//2, 2)) * Operator(3, 𝕗(1, 1//2, 1))\nOperator(6, 𝕗(1, 1//2, 2), 𝕗(1, 1//2, 1))\n\njulia> 3 * Operator(2, 𝕗(1, 1//2, 2))\nOperator(6, 𝕗(1, 1//2, 2))\n\njulia> Operator(2, 𝕗(1, 1//2, 2)) * 3\nOperator(6, 𝕗(1, 1//2, 2))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The Hermitian conjugate of an Operator can be obtained by the adjoint operator:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> op = Operator(6, 𝕗(2, 1//2, 2), 𝕗(1, 1//2, 1));\n\njulia> op'\nOperator(6, 𝕗(1, 1//2, 2), 𝕗(2, 1//2, 1))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"There also exists a special Operator, which only has the coefficient:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Operator(2)\nOperator(2)","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Operators can be initialized by two ways:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Operators(Operator(2, 𝕗(1, 1//2, 1)), Operator(3, 𝕗(1, 1//2, 2)))\nOperators with 2 Operator\n Operator(2, 𝕗(1, 1//2, 1))\n Operator(3, 𝕗(1, 1//2, 2))\n\njulia> Operator(2, 𝕗(1, 1//2, 1)) - Operator(3, 𝕓(1, 1//2, 2))\nOperators with 2 Operator\n Operator(2, 𝕗(1, 1//2, 1))\n Operator(-3, 𝕓(1, 1//2, 2))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Similar items are automatically merged during the construction of Operators:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> Operators(Operator(2, 𝕗(1, 1//2, 1)), Operator(3, 𝕗(1, 1//2, 1)))\nOperators with 1 Operator\n Operator(5, 𝕗(1, 1//2, 1))\n\njulia> Operator(2, 𝕗(1, 1//2, 1)) + Operator(3, 𝕗(1, 1//2, 1))\nOperators with 1 Operator\n Operator(5, 𝕗(1, 1//2, 1))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The multiplication between two Operatorses, or between an Operators and an Operator, or between a number and an Operators are defined:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> ops = Operator(2, 𝕗(1, 1//2, 1)) + Operator(3, 𝕗(1, 1//2, 2));\n\njulia> op = Operator(2, 𝕗(2, 1//2, 1));\n\njulia> ops * op\nOperators with 2 Operator\n Operator(4, 𝕗(1, 1//2, 1), 𝕗(2, 1//2, 1))\n Operator(6, 𝕗(1, 1//2, 2), 𝕗(2, 1//2, 1))\n\njulia> op * ops\nOperators with 2 Operator\n Operator(4, 𝕗(2, 1//2, 1), 𝕗(1, 1//2, 1))\n Operator(6, 𝕗(2, 1//2, 1), 𝕗(1, 1//2, 2))\n\njulia> another = Operator(2, 𝕗(1, 1//2, 1)) + Operator(3, 𝕗(1, 1//2, 2));\n\njulia> ops * another \nOperators with 2 Operator\n Operator(6, 𝕗(1, 1//2, 1), 𝕗(1, 1//2, 2))\n Operator(6, 𝕗(1, 1//2, 2), 𝕗(1, 1//2, 1))\n\njulia> 2 * ops\nOperators with 2 Operator\n Operator(4, 𝕗(1, 1//2, 1))\n Operator(6, 𝕗(1, 1//2, 2))\n\njulia> ops * 2\nOperators with 2 Operator\n Operator(4, 𝕗(1, 1//2, 1))\n Operator(6, 𝕗(1, 1//2, 2))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"It is noted that in the result, the distributive law automatically applies. Besides, the fermion operator relation c^2=cdagger^2=0 is also used.","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"As is usual, the Hermitian conjugate of an Operators can be obtained by the adjoint operator:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> op₁ = Operator(6, 𝕗(1, 1//2, 2), 𝕗(2, 1//2, 1));\n\njulia> op₂ = Operator(4, 𝕗(1, 1//2, 1), 𝕗(2, 1//2, 1));\n\njulia> ops = op₁ + op₂;\n\njulia> ops'\nOperators with 2 Operator\n Operator(6, 𝕗(2, 1//2, 2), 𝕗(1, 1//2, 1))\n Operator(4, 𝕗(2, 1//2, 2), 𝕗(1, 1//2, 2))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"Operators can be iterated and indexed:","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"julia> ops = Operator(2, 𝕗(1, 1//2, 1)) + Operator(3, 𝕗(1, 1//2, 2));\n\njulia> collect(ops)\n2-element Vector{Operator{Int64, Tuple{FockIndex{:f, Int64, Rational{Int64}, Int64}}}}:\n Operator(2, 𝕗(1, 1//2, 1))\n Operator(3, 𝕗(1, 1//2, 2))\n\njulia> ops[1]\nOperator(2, 𝕗(1, 1//2, 1))\n\njulia> ops[2]\nOperator(3, 𝕗(1, 1//2, 2))","category":"page"},{"location":"unitcell description framework/InternalDegreesOfFreedom/","page":"Internal degrees of freedom","title":"Internal degrees of freedom","text":"The index order of an Operators is the insertion order of the operators it contains.","category":"page"},{"location":"advanced topics/BoundaryConditions/","page":"Boundary conditions","title":"Boundary conditions","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"advanced topics/BoundaryConditions/#Boundary-conditions","page":"Boundary conditions","title":"Boundary conditions","text":"","category":"section"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"CurrentModule = QuantumLattices.QuantumOperators","category":"page"},{"location":"man/QuantumOperators/#Quantum-operators","page":"Quantum operators","title":"Quantum operators","text":"","category":"section"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"Quantum operators form an algebra over a field, which are vector spaces with a bilinear operation (often called the \"multiplication\") between vectors defined.","category":"page"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"With the help of the structure constants of the algebra, the result of the bilinear operation between any arbitrary two vectors can be expressed by a sum of individual ones. Therefore, in principle, an algebra can be represented by the complete basis set of its corresponding vector space and a rank-3 tensor encapsulating its structure constants. It is noted that the \"bilinear operation\" is not restricted to the usual multiplication. For example, it is the commutator, which is a composition of the usual multiplication and subtraction (for any A and B, the commutator [A, B] is defined as [A, B]≝AB-BA) that serves as the bilinear operator for Lie algebras.","category":"page"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"In general, there are three basic operations on quantum operators, i.e. the scalar multiplication between a scalar and a quantum operator, the usual addition and the usual multiplication between quantum operators. Other complicated operations can be composed from these basic ones. These basic operations are implemented in this module.","category":"page"},{"location":"man/QuantumOperators/#OperatorUnit","page":"Quantum operators","title":"OperatorUnit","text":"","category":"section"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"OperatorUnit is the building block of quantum operators, which specifies the basis of the vector space of the corresponding algebra.","category":"page"},{"location":"man/QuantumOperators/#OperatorProd-and-OperatorSum","page":"Quantum operators","title":"OperatorProd and OperatorSum","text":"","category":"section"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"OperatorProd defines the product operator as an entity of basis quantum operators while OperatorSum defines the summation as an entity of OperatorProds. Both of them are subtypes of QuantumOperator, which is the abstract type for all quantum operators.","category":"page"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"An OperatorProd must have two predefined contents:","category":"page"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"value::Number: the coefficient of the quantum operator\nid::ID: the id of the quantum operator","category":"page"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"Arithmetic operations (+, -, *, /) between a scalar, an OperatorProd or an OperatorSum is defined. See Manual for details.","category":"page"},{"location":"man/QuantumOperators/#Manual","page":"Quantum operators","title":"Manual","text":"","category":"section"},{"location":"man/QuantumOperators/","page":"Quantum operators","title":"Quantum operators","text":"Modules = [QuantumOperators]\nOrder = [:module, :constant, :type, :macro, :function]","category":"page"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.ID","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.ID","text":"ID{U<:OperatorIndex, N}\n\nID of a composite quantum operator, which is an ordered set of operator units.\n\nType alias for NTuple{N, U} where {U<:OperatorIndex}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.ID-Tuple{Vararg{OperatorIndex}}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.ID","text":"ID(id::OperatorIndex...)\nID(u::OperatorIndex, id::ID{OperatorIndex})\nID(id::ID{OperatorIndex}, u::OperatorIndex)\nID(id₁::ID{OperatorIndex}, id₂::ID{OperatorIndex})\n\nGet the id from operator units/ids.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.ID-Union{Tuple{M}, Tuple{N}, Tuple{U}, Tuple{Type{U}, Vararg{NTuple{N, Any}, M}}} where {U<:OperatorIndex, N, M}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.ID","text":"ID(::Type{U}, attrs::Vararg{NTuple{N}, M}) where {U<:OperatorIndex, N, M}\n\nGet the composite id from the components of singular ids.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.LaTeX","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.LaTeX","text":"LaTeX{SP, SB}(body, spdelimiter::String=\", \", sbdelimiter::String=\", \"; options...) where {SP, SB}\n\nLaTeX string representation of quantum operators.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.LinearFunction","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.LinearFunction","text":"LinearFunction{F<:Function} <: LinearTransformation\n\nWrapper a function to be a linear transformation.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.LinearTransformation","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.LinearTransformation","text":"LinearTransformation <: Transformation\n\nAbstract linear transformation on quantum operators.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.LinearTransformation-Tuple{OperatorSet}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.LinearTransformation","text":"(transformation::LinearTransformation)(ms::OperatorSet; kwargs...) -> OperatorSet\n\nGet the linear transformed quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.Matrixization","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.Matrixization","text":"Matrixization <: LinearTransformation\n\nMatrixization transformation.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.Operator","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.Operator","text":"Operator{V, I<:ID{OperatorIndex}} <: OperatorProd{V, I}\n\nOperator.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.OperatorIndex","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.OperatorIndex","text":"OperatorIndex <: QuantumOperator\n\nAn operator index is the irreducible symbolic unit to completely represent a quantum operator.\n\nIt plays the role of the symbols as in usual computer algebras while it can host internal structures, which is convenient to represent quantum operators with complicated spatial and/or internal degrees of freedom.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.OperatorPack","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.OperatorPack","text":"OperatorPack{V, I} <: QuantumOperator\n\nEntity that represent the pack of a number and an id of a quantum operator.\n\nBasically, a concrete subtype should contain two predefined contents:\n\nvalue::V: the coefficient of the pack\nid::I: the id of the pack\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.OperatorProd","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.OperatorProd","text":"OperatorProd{V, I<:Tuple} <: OperatorPack{V, I}\n\nA special kind of OperatorPack, where the relation between the coefficient and each component of the opeator id can be viewed as product.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.OperatorSet","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.OperatorSet","text":"OperatorSet{M<:OperatorPack} <: QuantumOperator\n\nSet of OperatorPacks.\n\nThe relation between two OperatorPacks in an OperatorSet can be viewed as addition.\nBut in general, only iteration over OperatorPacks and length are supported.\nTo use arithmetic operations, please refer to its subtype, OperatorSum.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.OperatorSum","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.OperatorSum","text":"OperatorSum{M<:OperatorPack, I} <: OperatorSet{M}\n\nSum of OperatorPacks.\n\nSimilar items are automatically merged with the aid of the id system.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.OperatorSum-Tuple{Vararg{QuantumOperator}}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.OperatorSum","text":"OperatorSum(ms)\nOperatorSum(ms::QuantumOperator...)\nOperatorSum{M}(ms) where {M<:OperatorPack}\nOperatorSum{M}(ms::QuantumOperator...) where {M<:OperatorPack}\n\nGet the sum of OperatorPacks.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.Operators","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.Operators","text":"Operators{O<:Operator, I<:ID{OperatorIndex}}\n\nA set of operators.\n\nType alias for OperatorSum{O<:Operator, I<:ID{OperatorIndex}}.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.Operators-Tuple{Vararg{Operator}}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.Operators","text":"Operators(opts::Operator...)\nOperators{M}(opts::Operator...)\n\nGet a set of operators.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.Permutation","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.Permutation","text":"Permutation{T} <: LinearTransformation\n\nPermutation transformation.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.Permutation-Tuple{OperatorProd}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.Permutation","text":"(permutation::Permutation)(m::OperatorProd; rev::Bool=false, kwargs...) -> OperatorSum\n\nPermute the operator units of an OperatorProd to the descending order according to the table contained in permutation.\n\nnote: Note\nTo use this function, the user must implement a method of permute, which computes the result of the permutation of two operator units:permute(u₁::OperatorIndex, u₂::OperatorIndex) -> Union{OperatorProd, OperatorSum}Here, u₁ and u₂ are two arbitrary operator units contained in id(m).\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.QuantumOperator","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.QuantumOperator","text":"QuantumOperator\n\nAbstract type of any quantum operator.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.RankFilter","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.RankFilter","text":"RankFilter{R} <: LinearTransformation\n\nRank filter, which filters out the OperatorProd with a given rank R.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.TabledUnitSubstitution","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.TabledUnitSubstitution","text":"TabledUnitSubstitution{U<:OperatorIndex, S<:OperatorSum, T<:AbstractDict{U, S}} <: UnitSubstitution{U, S}\n\nA concrete unit substitution transformation, which stores every substitution of the old OperatorIndexs in its table as a dictionary.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.Transformation","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.Transformation","text":"Transformation <: Function\n\nAbstract transformation on quantum operators.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.UnitSubstitution","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.UnitSubstitution","text":"UnitSubstitution{U<:OperatorIndex, S<:OperatorSum} <: LinearTransformation\n\nUnit substitution transformation, which substitutes each OperatorIndex in the old quantum operators to a new expression represented by an OperatorSum.\n\n\n\n\n\n","category":"type"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.UnitSubstitution-Tuple{OperatorProd}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.UnitSubstitution","text":"(unitsubstitution::UnitSubstitution)(m::OperatorProd; kwargs...) -> OperatorSum\n\nSubstitute every OperatorIndex in an OperatorProd with a new OperatorSum.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.:*-Tuple{Number, OperatorIndex}","page":"Quantum operators","title":"Base.:*","text":"*(factor::Number, m::OperatorIndex) -> Operator\n*(m::OperatorIndex, factor::Number) -> Operator\n*(m₁::OperatorIndex, m₂::OperatorIndex) -> Operator\n*(factor::Number, m::OperatorPack) -> OperatorPack\n*(m::OperatorPack, factor::Number) -> OperatorPack\n*(m₁::OperatorPack, m₂::OperatorIndex) -> OperatorPack\n*(m₁::OperatorIndex, m₁::OperatorPack) -> OperatorPack\n*(m₁::OperatorPack, m₂::OperatorPack) -> OperatorPack\n*(factor::Number, ms::OperatorSum) -> OperatorSum\n*(ms::OperatorSum, factor::Number) -> OperatorSum\n*(m::OperatorIndex, ms::OperatorSum) -> OperatorSum\n*(ms::OperatorSum, m::OperatorIndex) -> OperatorSum\n*(m::OperatorPack, ms::OperatorSum) -> OperatorSum\n*(ms::OperatorSum, m::OperatorPack) -> OperatorSum\n*(ms₁::OperatorSum, ms₂::OperatorSum) -> OperatorSum\n\nOverloaded * between quantum operators or a quantum operator and a number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.:+-Tuple{QuantumOperator}","page":"Quantum operators","title":"Base.:+","text":"+(m::QuantumOperator) -> typeof(m)\n+(m₁::QuantumOperator, m₂::QuantumOperator) -> OperatorSum\n+(factor::Number, m::QuantumOperator) -> OperatorSum\n+(m::QuantumOperator, factor::Number) -> OperatorSum\n\nOverloaded + between quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.:--Tuple{QuantumOperator}","page":"Quantum operators","title":"Base.:-","text":"-(m::QuantumOperator) -> QuantumOperator\n-(m₁::QuantumOperator, m₂::QuantumOperator) -> OperatorSum\n-(factor::Number, m::QuantumOperator) -> OperatorSum\n-(m::QuantumOperator, factor::Number) -> OperatorSum\n\nOverloaded - between quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.:/-Tuple{QuantumOperator, Number}","page":"Quantum operators","title":"Base.:/","text":"/(m::QuantumOperator, factor::Number) -> QuantumOperator\n\nOverloaded / between a quantum operator and a number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.://-Tuple{QuantumOperator, Number}","page":"Quantum operators","title":"Base.://","text":"//(m::QuantumOperator, factor::Number) -> QuantumOperator\n\nOverloaded // between a quantum operator and a number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.:^-Tuple{QuantumOperator, Integer}","page":"Quantum operators","title":"Base.:^","text":"^(m::QuantumOperator, n::Integer) -> QuantumOperator\n\nOverloaded ^ between a quantum operator and an integer.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.adjoint-Tuple{NTuple{N, OperatorIndex} where N}","page":"Quantum operators","title":"Base.adjoint","text":"adjoint(id::ID{OperatorIndex}) -> ID\n\nGet the adjoint of an id.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.adjoint-Tuple{Operators}","page":"Quantum operators","title":"Base.adjoint","text":"adjoint(opts::Operators) -> Operators\n\nGet the adjoint of a set of operators.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.adjoint-Tuple{Operator}","page":"Quantum operators","title":"Base.adjoint","text":"adjoint(m::Operator) -> Operator\n\nGet the adjoint of an operator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.conj-Tuple{OperatorIndex}","page":"Quantum operators","title":"Base.conj","text":"conj(m::OperatorIndex) -> OperatorIndex\nconj(m::OperatorPack) -> OperatorPack\nconj(m::OperatorSum) -> OperatorSum\n\nGet the conjugation.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.convert-Union{Tuple{M}, Tuple{Type{M}, Number}} where M<:OperatorProd","page":"Quantum operators","title":"Base.convert","text":"convert(::Type{M}, m::Number) where {M<:OperatorProd}\n\nConvert a number to a quantum operator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.convert-Union{Tuple{M}, Tuple{Type{M}, OperatorIndex}} where M<:Operator","page":"Quantum operators","title":"Base.convert","text":"convert(::Type{M}, u::OperatorIndex) where {M<:Operator}\n\nConvert an operator index to an operator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.convert-Union{Tuple{M}, Tuple{Type{M}, OperatorPack}} where M<:OperatorPack","page":"Quantum operators","title":"Base.convert","text":"convert(::Type{M}, m::OperatorPack) where {M<:OperatorPack}\n\nConvert a quantum operator from one type to another.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.eltype-Tuple{OperatorProd}","page":"Quantum operators","title":"Base.eltype","text":"eltype(m::OperatorProd)\neltype(::Type{M}) where {M<:OperatorProd}\n\nGet the eltype of an OperatorProd.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.eltype-Tuple{OperatorSet}","page":"Quantum operators","title":"Base.eltype","text":"eltype(ms::OperatorSet)\neltype(::Type{<:OperatorSet{M}}) where {M<:OperatorPack}\n\nGet the eltype of an OperatorSet.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.empty-Tuple{OperatorSum}","page":"Quantum operators","title":"Base.empty","text":"empty(ms::OperatorSum) -> typeof(ms)\nempty!(ms::OperatorSum) -> typeof(ms)\n\nGet an empty copy or empty an OperatorSum.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.getindex-Tuple{OperatorProd, Integer}","page":"Quantum operators","title":"Base.getindex","text":"getindex(m::OperatorProd, i::Integer) -> eltype(idtype(m))\ngetindex(m::OperatorProd, slice) -> OperatorProd\n\nOverloaded [].\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.getindex-Tuple{OperatorSum, Integer}","page":"Quantum operators","title":"Base.getindex","text":"getindex(ms::OperatorSum, index::Integer) -> eltype(ms)\ngetindex(ms::OperatorSum, indexes::AbstractVector{<:Integer}) -> typeof(ms)\ngetindex(ms::OperatorSum, ::Colon) -> typeof(ms)\n\nOverloaded [].\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.getproperty-Tuple{NTuple{N, OperatorIndex} where N, Symbol}","page":"Quantum operators","title":"Base.getproperty","text":"getproperty(id::ID{OperatorIndex}, name::Symbol)\n\nGet the property of a composite id.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.haskey-Tuple{OperatorSum, Any}","page":"Quantum operators","title":"Base.haskey","text":"haskey(ms::OperatorSum, id) -> Bool\n\nJudge whether an OperatorSum contains an OperatorPack with the given id. \n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.isapprox-Tuple{OperatorPack, OperatorPack}","page":"Quantum operators","title":"Base.isapprox","text":"isapprox(m₁::OperatorPack, m₂::OperatorPack; atol::Real=atol, rtol::Real=rtol) -> Bool\n\nCompare two OperatorPacks and judge whether they are approximate to each other.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.isapprox-Tuple{OperatorSum, OperatorSum}","page":"Quantum operators","title":"Base.isapprox","text":"isapprox(ms₁::OperatorSum, ms₂::OperatorSum; atol::Real=atol, rtol::Real=rtol) -> Bool\n\nCompare two OperatorSums and judge whether they are approximate to each other.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.iszero-Tuple{OperatorIndex}","page":"Quantum operators","title":"Base.iszero","text":"iszero(u::OperatorIndex) -> Bool\n\nJudge whether an OperatorIndex is zero, which is defined to be always false.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.iszero-Tuple{OperatorPack}","page":"Quantum operators","title":"Base.iszero","text":"iszero(m::OperatorPack) -> Bool\n\nJudge whether an OperatorPack is zero, i.e., its value is zero.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.iszero-Tuple{OperatorSet}","page":"Quantum operators","title":"Base.iszero","text":"iszero(ms::OperatorSet) -> Bool\n\nJudge whether an OperatorSet is zero, i.e, it does not contain any OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.iszero-Tuple{OperatorSum}","page":"Quantum operators","title":"Base.iszero","text":"iszero(ms::OperatorSum) -> Bool\n\nJudge whether an OperatorSum is zero, i.e, it does not contain any OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.iterate-Tuple{OperatorProd}","page":"Quantum operators","title":"Base.iterate","text":"iterate(m::OperatorProd)\niterate(m::OperatorProd, state)\n\nIterate over the components of the id of an OperatorProd.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.iterate-Tuple{OperatorSum}","page":"Quantum operators","title":"Base.iterate","text":"iterate(ms::OperatorSum)\niterate(ms::OperatorSum, state)\n\nIterate over the OperatorPacks contained in an OperatorSum.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.length-Tuple{OperatorProd}","page":"Quantum operators","title":"Base.length","text":"length(m::OperatorProd) -> Int\n\nGet the length of an OperatorProd.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.length-Tuple{OperatorSum}","page":"Quantum operators","title":"Base.length","text":"length(ms::OperatorSum) -> Int\n\nGet the number of OperatorPacks contained in an OperatorSum.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.map!-Tuple{Function, OperatorSum}","page":"Quantum operators","title":"Base.map!","text":"map!(f::Function, ms::OperatorSum; kwargs...) -> typeof(ms)\n\nIn place map of an OperatorSum by the function f elementally.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.one-Union{Tuple{Type{M}}, Tuple{M}} where M<:OperatorProd","page":"Quantum operators","title":"Base.one","text":"one(::Type{M}) where {M<:OperatorProd}\none(m::OperatorProd)\n\nGet the identity quantum operator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.propertynames-Tuple{NTuple{N, OperatorIndex} where N}","page":"Quantum operators","title":"Base.propertynames","text":"propertynames(::Type{I}) where I<:ID{OperatorIndex} -> Tuple{Vararg{Symbol}}\n\nGet the property names of a composite id.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.replace-Tuple{OperatorPack, Any}","page":"Quantum operators","title":"Base.replace","text":"replace(m::OperatorPack, v) -> OperatorPack\n\nReplace the value of an OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.replace-Tuple{QuantumOperator}","page":"Quantum operators","title":"Base.replace","text":"replace(m::QuantumOperator; kwargs...) -> typeof(m)\n\nReturn a copy of a concrete QuantumOperator with some of the field values replaced by the keyword arguments.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.show-Tuple{IO, MIME{Symbol(\"text/latex\")}, QuantumOperator}","page":"Quantum operators","title":"Base.show","text":"show(io::IO, ::MIME\"text/latex\", m::QuantumOperator)\n\nShow a quantum operator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.split-Tuple{OperatorProd}","page":"Quantum operators","title":"Base.split","text":"split(m::OperatorProd) -> Tuple{valtype(m), Vararg{Any}}\n\nSplit an OperatorProd into the coefficient and a sequence of the components of its id.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.valtype-Tuple{OperatorPack}","page":"Quantum operators","title":"Base.valtype","text":"valtype(m::OperatorPack)\nvaltype(::Type{T}) where {T<:OperatorPack}\n\nGet the type of the value of an OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.zero-Tuple{QuantumOperator}","page":"Quantum operators","title":"Base.zero","text":"zero(m::QuantumOperator)\n\nGet a zero QuantumOperator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#Base.zero-Union{Tuple{Type{M}}, Tuple{M}} where M<:OperatorIndex","page":"Quantum operators","title":"Base.zero","text":"zero(::Type{M}) where {M<:OperatorIndex} -> OperatorSum\nzero(::Type{M}) where {M<:OperatorPack} -> OperatorSum\nzero(::Type{M}) where {M<:OperatorSum} -> OperatorSum\n\nGet the zero sum.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LaTeXStrings.latexstring-Tuple{OperatorIndex}","page":"Quantum operators","title":"LaTeXStrings.latexstring","text":"latexstring(u::OperatorIndex) -> String\n\nLaTeX string representation of an operator index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LaTeXStrings.latexstring-Tuple{OperatorProd}","page":"Quantum operators","title":"LaTeXStrings.latexstring","text":"latexstring(opt::OperatorProd) -> String\n\nGet the string representation of an operator in the LaTeX format.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LaTeXStrings.latexstring-Tuple{OperatorSet}","page":"Quantum operators","title":"LaTeXStrings.latexstring","text":"latexstring(opts::OperatorSet) -> String\n\nGet the string representation of a set of operators in the LaTeX format.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LinearAlgebra.dot-Tuple{QuantumOperator, QuantumOperator}","page":"Quantum operators","title":"LinearAlgebra.dot","text":"dot(m₁::QuantumOperator, m₂::QuantumOperator)\ndot(m::QuantumOperator, c::Number)\ndot(c::Number, m::QuantumOperator)\n\nDot product between two QuantumOperators or between a QuantumOperator and a number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LinearAlgebra.ishermitian-Tuple{NTuple{N, OperatorIndex} where N}","page":"Quantum operators","title":"LinearAlgebra.ishermitian","text":"ishermitian(id::ID{OperatorIndex}) -> Bool\n\nJudge whether an id is Hermitian.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LinearAlgebra.ishermitian-Tuple{Operators}","page":"Quantum operators","title":"LinearAlgebra.ishermitian","text":"ishermitian(opts::Operators) -> Bool\n\nJudge whether a set of operators as a whole is Hermitian.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LinearAlgebra.ishermitian-Tuple{Operator}","page":"Quantum operators","title":"LinearAlgebra.ishermitian","text":"ishermitian(m::Operator) -> Bool\n\nJudge whether an operator is Hermitian.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LinearAlgebra.mul!-Tuple{OperatorSum, Number}","page":"Quantum operators","title":"LinearAlgebra.mul!","text":"mul!(ms::OperatorSum, factor::Number) -> OperatorSum\n\nGet the in-place multiplication of an OperatorSum with a number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LinearAlgebra.rank-Tuple{NTuple{N, OperatorIndex} where N}","page":"Quantum operators","title":"LinearAlgebra.rank","text":"rank(id::ID{OperatorIndex}) -> Int\nrank(::Type{<:ID{OperatorIndex, N}}) where N -> Int\n\nGet the rank of an id.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#LinearAlgebra.rank-Tuple{OperatorProd}","page":"Quantum operators","title":"LinearAlgebra.rank","text":"rank(m::OperatorProd) -> Int\nrank(::Type{M}) where {M<:OperatorProd} -> Int\n\nGet the rank of an OperatorProd.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.equivalenttoscalar-Tuple{QuantumOperator}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.equivalenttoscalar","text":"equivalenttoscalar(m::QuantumOperator) -> Bool\nequivalenttoscalar(::Type{M}) where {M<:QuantumOperator} -> Bool\n\nJudge whether a QuantumOperator is equivalent to a scalar.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.equivalenttoscalar-Tuple{Type{<:OperatorPack}}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.equivalenttoscalar","text":"equivalenttoscalar(::Type{<:OperatorPack})\nequivalenttoscalar(::Type{<:OperatorPack{V, Tuple{}} where V})\n\nJudge whether an OperatorPack is equivalent to a scalar.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.idtype-Tuple{OperatorPack}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.idtype","text":"idtype(m::OperatorPack)\nidtype(::Type{T}) where {T<:OperatorPack}\n\nGet the type of the id of an OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.latexformat-Tuple{Type{<:OperatorIndex}}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.latexformat","text":"latexformat(T::Type{<:OperatorIndex}) -> LaTeX\nlatexformat(T::Type{<:OperatorIndex}, l::LaTeX) -> LaTeX\n\nGet/Set the LaTeX format for a subtype of OperatorIndex.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.latexname-Tuple{Type{<:OperatorIndex}}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.latexname","text":"latexname(T::Type{<:OperatorIndex}) -> Symbol\n\nGet the name of a type of OperatorIndex in the latex format lookups.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.matrix","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.matrix","text":"matrix\n\nGeneric matrix representation.\n\n\n\n\n\n","category":"function"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.operatortype-Tuple{QuantumOperator}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.operatortype","text":"operatortype(m::QuantumOperator)\n\nGet the operator type of a QuantumOperator, which is defined to be the type it corresponds to so that addition between two such objects can be performed directly. Usually, it is a subtype of OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.operatortype-Union{Tuple{Type{M}}, Tuple{M}} where M<:OperatorIndex","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.operatortype","text":"operatortype(::Type{M}) where {M<:OperatorIndex}\noperatortype(::Type{M}) where {M<:OperatorPack}\noperatortype(::Type{M}) where {M<:OperatorSet}\n\nGet the corresponding OperatorPack type of a quantum operator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.scalartype-Tuple{Any}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(t)\nscalartype(::Type{T}) where {T<:Number}\nscalartype(::Type{<:AbstractArray{T}}) where T\nscalartype(::Type{<:Tuple{Vararg{T}}}) where T\n\nGet the scalar type of an object.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.scalartype-Union{Tuple{Type{M}}, Tuple{M}} where M<:QuantumOperator","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(::Type{M}) where {M<:QuantumOperator}\n\nGet the scalar type of a QuantumOperator.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.scalartype-Union{Tuple{Type{T}}, Tuple{T}} where T<:OperatorPack","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.scalartype","text":"scalartype(::Type{T}) where {T<:OperatorPack}\n\nScalar type of the coefficient of an OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.script-Tuple{OperatorIndex, LaTeX, Val{:BD}}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.script","text":"script(u::OperatorIndex, l::LaTeX, ::Val{:BD}) -> Any\nscript(u::OperatorIndex, l::LaTeX, ::Val{:SP}) -> Tuple\nscript(u::OperatorIndex, l::LaTeX, ::Val{:SB}) -> Tuple\n\nGet the body/superscript/subscript of the LaTeX string representation of an operator index.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.script-Tuple{OperatorIndex, Val}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.script","text":"script(u::OperatorIndex, ::Val{}; kwargs...) -> String\n\nDefault script for an operator index, which always return an empty string.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.QuantumOperators.sequence-Tuple{OperatorProd, Any}","page":"Quantum operators","title":"QuantumLattices.QuantumOperators.sequence","text":"sequence(m::OperatorProd, table) -> NTuple{rank(m), Int}\n\nGet the sequence of the id of a quantum operator according to a table.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.add!-Tuple{Any, LinearTransformation, OperatorPack}","page":"Quantum operators","title":"QuantumLattices.add!","text":"add!(destination, transformation::LinearTransformation, op::OperatorPack; kwargs...) -> typeof(destination)\nadd!(destination, transformation::LinearTransformation, op::OperatorSet; kwargs...) -> typeof(destination)\n\nAdd the result of the linear transformation on a quantum operator to the destination.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.add!-Tuple{OperatorSum}","page":"Quantum operators","title":"QuantumLattices.add!","text":"add!(ms::OperatorSum) -> typeof(ms)\nadd!(ms::OperatorSum, m::Union{Number, OperatorIndex, OperatorPack}) -> typeof(ms)\nadd!(ms::OperatorSum, mms::OperatorSum) -> typeof(ms)\n\nGet the in-place addition of quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.div!-Tuple{OperatorSum, Number}","page":"Quantum operators","title":"QuantumLattices.div!","text":"div!(ms::OperatorSum, factor::Number) -> OperatorSum\n\nGet the in-place division of an OperatorSum with a number.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.expand-Tuple{QuantumOperator}","page":"Quantum operators","title":"QuantumLattices.expand","text":"expand(m::QuantumOperator) -> typeof(m)\n\nExpand a QuantumOperator, which is defined to be itself.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.id-Tuple{OperatorPack}","page":"Quantum operators","title":"QuantumLattices.id","text":"id(m::OperatorPack) -> idtype(m)\n\nGet the id of an OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.sub!-Tuple{OperatorSum}","page":"Quantum operators","title":"QuantumLattices.sub!","text":"sub!(ms::OperatorSum) -> typeof(ms)\nsub!(ms::OperatorSum, m::Union{Number, OperatorIndex, OperatorPack}) -> typeof(ms)\nsub!(ms::OperatorSum, mms::OperatorSum) -> typeof(ms)\n\nGet the in-place subtraction of quantum operators.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.update!-Tuple{QuantumOperator}","page":"Quantum operators","title":"QuantumLattices.update!","text":"update!(m::QuantumOperator; parameters...) -> typeof(m)\n\nUpdate the parameters of a QuantumOperator in place and return the updated one.\n\nBy default, the parameter update of a QuantumOperator does nothing.\n\n\n\n\n\n","category":"method"},{"location":"man/QuantumOperators/#QuantumLattices.value-Tuple{OperatorPack}","page":"Quantum operators","title":"QuantumLattices.value","text":"value(m::OperatorPack) -> valtype(m)\n\nGet the value of an OperatorPack.\n\n\n\n\n\n","category":"method"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"CurrentModule = QuantumLattices\nDocTestFilters = [r\"im +[-\\+]0\\.0[-\\+]\"]\nDocTestSetup = quote\n push!(LOAD_PATH, \"../../../src/\")\n using QuantumLattices\nend","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"using QuantumLattices\nusing SymPy: Sym, symbols","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/#Generator-of-operators","page":"Generator of operators","title":"Generator of operators","text":"","category":"section"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"In previous pages we have introduced the essential elements in detail of a quantum lattice system in the unitcell description framework. In this page, we will discuss how such elements can be incorporated to get the operator representation of the lattice Hamiltonian.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/#Operator-formed-lattice-Hamiltonians","page":"Generator of operators","title":"Operator-formed lattice Hamiltonians","text":"","category":"section"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"The essential elements to obtain an operator-formed lattice Hamiltonian are 1) terms, 2) bonds and 3) Hilbert space.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Accordingly, OperatorGenerator is the type to incorporate all these elements:","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"OperatorGenerator(bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term})","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Then, the operator representation of the lattice Hamiltonian can be obtained by the expand function:","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"expand(gen::OperatorGenerator)","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"which is based on the expansion of terms introduced in the last section of the previous page Couplings among different degrees of freedom.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Now, let's go back to the example proposed in the page of Introduction:","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"lattice = Lattice([zero(Sym)], [one(Sym)]);\nhilbert = Hilbert(site=>Fock{:f}(1, 2) for site=1:length(lattice));\nt = Hopping(:t, symbols(\"t\", real=true), 1);\nU = Hubbard(:U, symbols(\"U\", real=true));\noperators = expand(OperatorGenerator(bonds(lattice, 1), hilbert, (t, U)))","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Note to run the above codes, SymPy.Sym and SymPy.symbols should be imported first.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"The LaTeX formatted outputs will be discussed in the page of LaTeX formatted outputs.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Here, we have two comments:","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"In the construction of OperatorGenerator, a vector of Bonds other than a Lattice is required. Indeed, it is more flexible to control the generated operators by passing a vector of Bonds. By restricting the range of the input bonds, a certain subset of the lattice Hamiltonian can be easily obtained, which is sometimes useful in some quantum many-body algorithms.\nThe Hilbert space is essential because in general not all information of the local generators of a concrete quantum lattice system is contained in the terms. Remind: 1) the statistics of particles or the total spin of local spins is usually omitted in the coupling pattern of a term, and 2) the total number of local orbital/spin degrees of freedom, or the dimension of lattice vibrations, cannot be determined solely by the information provided by the coupling pattern of a term. Therefore, in order to obtain the lattice Hamiltonian, such incomplete information must be supplemented by the Hilbert space.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/#Parameters-tuning-of-lattice-Hamiltonians","page":"Generator of operators","title":"Parameters tuning of lattice Hamiltonians","text":"","category":"section"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"It is customary to tune the parameters of a lattice Hamiltonian. This can be achieved by the update! function exported by this package:","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"update!(gen::OperatorGenerator; termid₁=termvalue₁, termid₁=termvalue₂, ...)","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Here, termidᵢ (i = 1, 2, ...) is the id of a term in the lattice Hamiltonian, and termvalueᵢ is the new overall coefficient of this term.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"The parameters of the terms in an OperatorGenerator can be requested by the type Parameters (a type alias of NamedTuple):","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Parameters(gen::OperatorGenerator) -> Parameters","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"Let's see an example.","category":"page"},{"location":"unitcell description framework/GeneratorOfOperators/","page":"Generator of operators","title":"Generator of operators","text":"julia> lattice = Lattice([0.0], [1.0]);\n\njulia> hilbert = Hilbert(site=>Fock{:f}(1, 2) for site=1:length(lattice));\n\njulia> t = Hopping(:t, 1.0, 1);\n\njulia> gen = OperatorGenerator(bonds(lattice, 1), hilbert, t);\n\njulia> Parameters(gen)\n(t = 1.0,)\n\njulia> expand(gen)\nOperators with 4 Operator\n Operator(1.0, 𝕗(2, 1, -1//2, 2, [1.0], [0.0]), 𝕗(1, 1, -1//2, 1, [0.0], [0.0]))\n Operator(1.0, 𝕗(1, 1, -1//2, 2, [0.0], [0.0]), 𝕗(2, 1, -1//2, 1, [1.0], [0.0]))\n Operator(1.0, 𝕗(2, 1, 1//2, 2, [1.0], [0.0]), 𝕗(1, 1, 1//2, 1, [0.0], [0.0]))\n Operator(1.0, 𝕗(1, 1, 1//2, 2, [0.0], [0.0]), 𝕗(2, 1, 1//2, 1, [1.0], [0.0]))\n\njulia> update!(gen; t=2.0);\n\njulia> Parameters(gen)\n(t = 2.0,)\n\njulia> expand(gen)\nOperators with 4 Operator\n Operator(2.0, 𝕗(2, 1, -1//2, 2, [1.0], [0.0]), 𝕗(1, 1, -1//2, 1, [0.0], [0.0]))\n Operator(2.0, 𝕗(1, 1, -1//2, 2, [0.0], [0.0]), 𝕗(2, 1, -1//2, 1, [1.0], [0.0]))\n Operator(2.0, 𝕗(2, 1, 1//2, 2, [1.0], [0.0]), 𝕗(1, 1, 1//2, 1, [0.0], [0.0]))\n Operator(2.0, 𝕗(1, 1, 1//2, 2, [0.0], [0.0]), 𝕗(2, 1, 1//2, 1, [1.0], [0.0]))","category":"page"},{"location":"#QuantumLattices.jl","page":"Home","title":"QuantumLattices.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"(Image: CI) (Image: codecov) (Image: ) (Image: ) (Image: 996.icu) (Image: LICENSE) (Image: LICENSE) (Image: Code Style: Blue) (Image: ColPrac: Contributor's Guide on Collaborative Practices for Community Packages)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Julia package for the construction of quantum lattice systems.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Welcome to QuantumLattices. Here we provide a general framework to construct the operator-formed Hamiltonian of any quantum lattice system, with the inputs as simple as its description by the natural language. This operator-formed Hamiltonian supports complete symbolic computations when combined with SymPy, and can serve as a convenient frontend of quantum many-body algorithms, such as TBA (tight-bind approximation), LSWT (linear spin wave theory), SCMF (self-consistent mean field theory), ED (exact diagonalization), CPT/VCA (cluster perturbation theory / variational cluster approach), DMRG (density matrix renormalization group), RPA (random phase approximation), etc. Generic interfaces are defined to provide a unified access to these algorithms with automatic project management.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In Julia v1.8+, please type ] in the REPL to use the package mode, then type this command:","category":"page"},{"location":"","page":"Home","title":"Home","text":"pkg> add QuantumLattices","category":"page"},{"location":"#Package-Features","page":"Home","title":"Package Features","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The mathematical foundations of our package is that the operators in a lattice Hamiltonian:","category":"page"},{"location":"","page":"Home","title":"Home","text":"act on local Hilbert spaces, and\nform an algebra over the complex field.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Based on this, the package has the following features:","category":"page"},{"location":"","page":"Home","title":"Home","text":"Unitcell Description Framework: the Hamiltonian can be constructed based on the unitcell of a lattice with the information of the local algebra acting on the local Hilbert space living on each point and the terms that couples different degrees of freedom on the same or different points. Such information can be input into the program as simple as describing the quantum system in a usual research paper.\nComplete Symbolic Computation: with only this package, symbolic computation between operators is realized while the coefficient of any operator remains numeric; by integrating it with SymPy, complete symbolic computation can be achieved and no modifications need be made on the methods in this package.\nGeneric Frontend of Many-Body Algorithms: with the operator-formed Hamiltonian as the foothold, quantum many-body algorithms can be initialized in quite similar ways with only minor modifications needed. Moreover, automatic project management is realized, including that of result recording, data caching, parameter updating, information logging, dependency managing, etc.","category":"page"},{"location":"#Supported-Systems","page":"Home","title":"Supported Systems","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Four common categories of quantum lattice systems in condensed matter physics are supported:","category":"page"},{"location":"","page":"Home","title":"Home","text":"canonical complex fermionic systems\ncanonical complex and hard-core bosonic systems\nSU(2) spin systems\nPhononic systems","category":"page"},{"location":"","page":"Home","title":"Home","text":"Furthermore, other systems can be supported easily by extending the generic protocols provided in this package.","category":"page"},{"location":"#Supported-Algorithms","page":"Home","title":"Supported Algorithms","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Concrete algorithms could be considered as the \"backend\" of quantum lattice systems. They are developed in separate packages (still in progress):","category":"page"},{"location":"","page":"Home","title":"Home","text":"TBA: tight-binding approximation for complex-fermionic/complex-bosonic/phononic systems;\nLSWT: linear spin wave theory for magnetically ordered local-spin systems;\nSCMF: self-consistent mean field theory for complex fermionic systems;\nED: exact diagonalization for complex-fermionic/hard-core-bosonic/local-spin systems;\nCPT/VCA: cluster perturbation theory and variational cluster approach for complex fermionic and local spin systems;\nDMRG: density matrix renormalization group for complex-fermionic/hard-core-bosonic/local-spin systems based on TensorKit and MPSKit;\nRPA: random phase approximation for complex fermionic systems.","category":"page"},{"location":"#Getting-Started","page":"Home","title":"Getting Started","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Tutorials: unitcell description\nTutorials: advanced topics","category":"page"},{"location":"#Note","page":"Home","title":"Note","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Due to the fast development of this package, releases with different minor version numbers are not guaranteed to be compatible with previous ones before the release of v1.0.0. Comments are welcomed in the GitHub issues.","category":"page"},{"location":"#Contact","page":"Home","title":"Contact","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"waltergu1989@gmail.com","category":"page"},{"location":"#Python-counterpart","page":"Home","title":"Python counterpart","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"HamiltonianPy: in fact, the authors of this Julia package worked on the python package at first and only turned to Julia later.","category":"page"}] } diff --git a/dev/unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/index.html b/dev/unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/index.html index d06ad3ac..e756b57a 100644 --- a/dev/unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/index.html +++ b/dev/unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom/index.html @@ -471,4 +471,4 @@ Operator(1.0, 𝕗(2, 1, -1//2, 2, [-0.5], [-1.0]), 𝕗(1, 1, -1//2, 1, [0.0], [0.0])) Operator(1.0, 𝕗(1, 1, -1//2, 2, [0.0], [0.0]), 𝕗(2, 1, -1//2, 1, [-0.5], [-1.0])) Operator(1.0, 𝕗(2, 1, 1//2, 2, [-0.5], [-1.0]), 𝕗(1, 1, 1//2, 1, [0.0], [0.0])) - Operator(1.0, 𝕗(1, 1, 1//2, 2, [0.0], [0.0]), 𝕗(2, 1, 1//2, 1, [-0.5], [-1.0])) + Operator(1.0, 𝕗(1, 1, 1//2, 2, [0.0], [0.0]), 𝕗(2, 1, 1//2, 1, [-0.5], [-1.0])) diff --git a/dev/unitcell description framework/GeneratorOfOperators/index.html b/dev/unitcell description framework/GeneratorOfOperators/index.html index 20eeb2d9..51ae430b 100644 --- a/dev/unitcell description framework/GeneratorOfOperators/index.html +++ b/dev/unitcell description framework/GeneratorOfOperators/index.html @@ -37,4 +37,4 @@ Operator(2.0, 𝕗(2, 1, -1//2, 2, [1.0], [0.0]), 𝕗(1, 1, -1//2, 1, [0.0], [0.0])) Operator(2.0, 𝕗(1, 1, -1//2, 2, [0.0], [0.0]), 𝕗(2, 1, -1//2, 1, [1.0], [0.0])) Operator(2.0, 𝕗(2, 1, 1//2, 2, [1.0], [0.0]), 𝕗(1, 1, 1//2, 1, [0.0], [0.0])) - Operator(2.0, 𝕗(1, 1, 1//2, 2, [0.0], [0.0]), 𝕗(2, 1, 1//2, 1, [1.0], [0.0])) + Operator(2.0, 𝕗(1, 1, 1//2, 2, [0.0], [0.0]), 𝕗(2, 1, 1//2, 1, [1.0], [0.0])) diff --git a/dev/unitcell description framework/InternalDegreesOfFreedom/index.html b/dev/unitcell description framework/InternalDegreesOfFreedom/index.html index 3e900ab8..7bd7bdcd 100644 --- a/dev/unitcell description framework/InternalDegreesOfFreedom/index.html +++ b/dev/unitcell description framework/InternalDegreesOfFreedom/index.html @@ -392,4 +392,4 @@ Operator(2, 𝕗(1, 1//2, 1)) julia> ops[2] -Operator(3, 𝕗(1, 1//2, 2))

The index order of an Operators is the insertion order of the operators it contains.

+Operator(3, 𝕗(1, 1//2, 2))

The index order of an Operators is the insertion order of the operators it contains.

diff --git a/dev/unitcell description framework/Introduction/index.html b/dev/unitcell description framework/Introduction/index.html index 9248900f..85a675cc 100644 --- a/dev/unitcell description framework/Introduction/index.html +++ b/dev/unitcell description framework/Introduction/index.html @@ -17,4 +17,4 @@ U = Hubbard(:U, symbols("U", real=true)) # get the Hamiltonian -operators = expand(OperatorGenerator(bonds(lattice, 1), hilbert, (t, U)))

\[tc^{\dagger}_{2,\,1,\,\downarrow}c^{}_{1,\,1,\,\downarrow}+tc^{\dagger}_{1,\,1,\,\downarrow}c^{}_{2,\,1,\,\downarrow}+tc^{\dagger}_{2,\,1,\,\uparrow}c^{}_{1,\,1,\,\uparrow}+tc^{\dagger}_{1,\,1,\,\uparrow}c^{}_{2,\,1,\,\uparrow}+Uc^{\dagger}_{1,\,1,\,\uparrow}c^{}_{1,\,1,\,\uparrow}c^{\dagger}_{1,\,1,\,\downarrow}c^{}_{1,\,1,\,\downarrow}+Uc^{\dagger}_{2,\,1,\,\uparrow}c^{}_{2,\,1,\,\uparrow}c^{\dagger}_{2,\,1,\,\downarrow}c^{}_{2,\,1,\,\downarrow}\]

The last line displays all the generated operators in the Hamiltonian in the LaTeX format. Here, in the subscript of the electronic annihilation/creation operator, an extra orbital index is also displayed.

In the following pages listed below, we will explain in detail how these codes work. Firstly, in the page of Spatial information of a unitcell, we will introduce the construction of the unitcell as well as the ways to obtain the bonds at different orders of nearest neighbors. Secondly, in the page of Internal degrees of freedom, we will explain the hierarchy of the internal degrees of freedom and discuss how they are organized for different categories of quantum systems. Thirdly, in the page of Couplings among different degrees of freedom, we will discuss the ways to specify the terms present in the Hamiltonian. Finally, in the page of Generator of operators, we will show how to combine all to get the operator representation of the Hamiltonian of a quantum lattice system. For more sophisticated information, the manual of this package can also be referred.

+operators = expand(OperatorGenerator(bonds(lattice, 1), hilbert, (t, U)))

\[tc^{\dagger}_{2,\,1,\,\downarrow}c^{}_{1,\,1,\,\downarrow}+tc^{\dagger}_{1,\,1,\,\downarrow}c^{}_{2,\,1,\,\downarrow}+tc^{\dagger}_{2,\,1,\,\uparrow}c^{}_{1,\,1,\,\uparrow}+tc^{\dagger}_{1,\,1,\,\uparrow}c^{}_{2,\,1,\,\uparrow}+Uc^{\dagger}_{1,\,1,\,\uparrow}c^{}_{1,\,1,\,\uparrow}c^{\dagger}_{1,\,1,\,\downarrow}c^{}_{1,\,1,\,\downarrow}+Uc^{\dagger}_{2,\,1,\,\uparrow}c^{}_{2,\,1,\,\uparrow}c^{\dagger}_{2,\,1,\,\downarrow}c^{}_{2,\,1,\,\downarrow}\]

The last line displays all the generated operators in the Hamiltonian in the LaTeX format. Here, in the subscript of the electronic annihilation/creation operator, an extra orbital index is also displayed.

In the following pages listed below, we will explain in detail how these codes work. Firstly, in the page of Spatial information of a unitcell, we will introduce the construction of the unitcell as well as the ways to obtain the bonds at different orders of nearest neighbors. Secondly, in the page of Internal degrees of freedom, we will explain the hierarchy of the internal degrees of freedom and discuss how they are organized for different categories of quantum systems. Thirdly, in the page of Couplings among different degrees of freedom, we will discuss the ways to specify the terms present in the Hamiltonian. Finally, in the page of Generator of operators, we will show how to combine all to get the operator representation of the Hamiltonian of a quantum lattice system. For more sophisticated information, the manual of this package can also be referred.

diff --git a/dev/unitcell description framework/SpatialInfoOfAUnitcell/index.html b/dev/unitcell description framework/SpatialInfoOfAUnitcell/index.html index 26028cbe..b4d0e5eb 100644 --- a/dev/unitcell description framework/SpatialInfoOfAUnitcell/index.html +++ b/dev/unitcell description framework/SpatialInfoOfAUnitcell/index.html @@ -113,4 +113,4 @@ julia> bonds(lattice, Neighbors(2=>√2)) 2-element Vector{Bond{Int64, Point{2, Float64}}}: Bond(2, Point(1, [-1.0, -1.0], [-1.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0])) - Bond(2, Point(1, [1.0, -1.0], [1.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))

To obtain generic bonds containing more points, user are encouraged to implement their own bonds methods. Pull requests are welcomed.

+ Bond(2, Point(1, [1.0, -1.0], [1.0, -1.0]), Point(1, [0.0, 0.0], [0.0, 0.0]))

To obtain generic bonds containing more points, user are encouraged to implement their own bonds methods. Pull requests are welcomed.