QMTensors
ElemCo.QMTensors — Module
QMTensors module
This module provides definitions for useful quantum-mechanical tensors.
Exported types and functions
ElemCo.QMTensors.SpinMatrix — Type
SpinMatrixA type to store a one-electron matrix (spin aware).
The first matrix corresponds to the alpha electron, and the second matrix is beta. If the matrix is restricted, the beta matrix refers to the alpha matrix.
ElemCo.QMTensors.SpinVector — Type
SpinVectorA simple container for spin-dependent vectors (α and β). Fields α and β store the alpha and beta spin components respectively.
Constructors
SpinVector(v, w): Create with separate α and β vectorsSpinVector(v): Create restricted vector (β === α)
ElemCo.QMTensors.detri_doubles — Method
detri_doubles(T2)Convert a doubles amplitude tensor T2 in the form (a,b,ij) to the full form (a,b,i,j). Here, ij is the upper triangular index for occupied orbitals i <= j.
ElemCo.QMTensors.detri_samespin_doubles — Method
detri_samespin_doubles(T2)Convert a doubles amplitude tensor T2 in the form (ab,ij) to the full form (a,b,i,j) using the permutational symmetry $T^{ij}_{ab} = T^{ji}_{ba} = -T^{ij}_{ba} = -T^{ji}_{ab}$.
Here, ab and ij are the strict upper triangular indices for virtual and occupied orbitals a < b, i < j.
ElemCo.QMTensors.is_restricted — Method
is_restricted(mat::SpinMatrix)Check if the spin-matrix is restricted (i.e, β === α).
ElemCo.QMTensors.lentri_from_norb — Method
lentri_from_norb(n, N)Return the length of the upper triangular part of a tensor of dimension n^N.
ElemCo.QMTensors.lentri_from_norb — Method
lentri_from_norb(n)Return the length of the upper triangular part of a tensor of dimension n×n.
ElemCo.QMTensors.norb_from_lentri — Method
norb_from_lentri(triN, N)Return the number of orbitals from the triangular index of size triN.
ElemCo.QMTensors.norb_from_lentri — Method
norb_from_lentri(tri2)Return the number of orbitals from the length of triangular index tri (for dimension n×n).
ElemCo.QMTensors.norb_from_strict_lentri — Method
norb_from_strict_lentri(triN, N)Return the number of orbitals from the length of strict triangular index of size triN.
ElemCo.QMTensors.norb_from_strict_lentri — Method
norb_from_strict_lentri(tri2)Return the number of orbitals from the length of strict triangular index tri2 (for dimension n×n).
ElemCo.QMTensors.restrict! — Method
restrict!(mat::SpinMatrix)Restrict the molecular orbitals (β = α).
ElemCo.QMTensors.strict_lentri_from_norb — Method
strict_lentri_from_norb(n, N)Return the length of the strict upper triangular part of a tensor of dimension n^N.
ElemCo.QMTensors.strict_lentri_from_norb — Method
strict_lentri_from_norb(n)Return the length of the strict upper triangular part of a tensor of dimension n×n.
ElemCo.QMTensors.strict_uppertriangular_cut — Method
strict_uppertriangular_cut(norb)Return all indices for original dimension norb×norb corresponding to the strict upper triangular part.
ElemCo.QMTensors.strict_uppertriangular_cut3 — Method
strict_uppertriangular_cut3(norb)Return all indices for original dimension norb×norb×norb corresponding to the strict upper triangular part.
ElemCo.QMTensors.strict_uppertriangular_range — Method
strict_uppertriangular_range(i2)Return range for the uppertriangular index (i1 <= i2) without diagonal (i1 < i2) for a given i2.
ElemCo.QMTensors.strict_uppertriangular_range — Method
strict_uppertriangular_range(inds::Vararg{Int, N}) where NReturn range for the uppertriangular index (i1 <= i2 <= i3 <= ...) without diagonal (i1 < i2 <= i3 <= ...) for given i2, i3, ...
ElemCo.QMTensors.swapped_strict_uppertriangular_cut — Method
swapped_strict_uppertriangular_cut(norb)Return all indices for original dimension norb×norb corresponding to the strict upper triangular part, but with the two indices swapped, i.e., (j,i) instead of (i,j).
ElemCo.QMTensors.swapped_uppertriangular_cut — Method
swapped_uppertriangular_cut(norb)Return all indices for original dimension norb×norb corresponding to the upper triangular part, but with the two indices swapped, i.e., (j,i) instead of (i,j).
ElemCo.QMTensors.unrestrict! — Method
unrestrict!(mat::SpinMatrix)Unrestrict the spin matrix.
ElemCo.QMTensors.uppertriangular_cut — Method
uppertriangular_cut(norb)Return all indices for original dimension norb×norb corresponding to the upper triangular part.
ElemCo.QMTensors.uppertriangular_cut3 — Method
uppertriangular_cut3(norb)Return all indices for original dimension norb×norb×norb corresponding to the upper triangular part.
ElemCo.QMTensors.uppertriangular_index — Method
uppertriangular_index(i1, i2, i3)Return uppertriangular index from three indices i1 <= i2 <= i3.
ElemCo.QMTensors.uppertriangular_index — Method
uppertriangular_index(i1, i2)Return uppertriangular index from two indices i1 <= i2.
ElemCo.QMTensors.uppertriangular_index — Method
uppertriangular_index(inds::Vararg{Int, N})Return uppertriangular index from a set of indices i1 <= i2 <= ... <= iN.
ElemCo.QMTensors.uppertriangular_range — Method
uppertriangular_range(i2)Return range for the uppertriangular index (i1 <= i2) for a given i2.
ElemCo.QMTensors.uppertriangular_range — Method
uppertriangular_range(inds::Vararg{Int, N}) where NReturn range for the uppertriangular index (i1 <= i2 <= i3 <= ...) for given i2, i3, ...