Predefined YASTN tensors#
In YASTN, we predefined several classes containing sets of standard operators, which can be employed in simulations of many typical physical models.
Spin-1/2 and Pauli matrices#
- class yastn.operators.Spin12(**kwargs)[source]#
A set of standard operators for 2-dimensional Hilbert space. Defines identity \(I\) , spin-1/2 operators \(S^x,\ S^y,\ S^z\), raising and lowering operators \(S^+,\ S^-\), Pauli matrices \(X,\ Y,\ Z\) (if allowed by symmetry). Class contains also eigenvectors of \(S^z\), \(S^x\), \(S^y\), and local Hilbert space that is
yastn.Leg
.- Parameters:
sym (str) – Explicit symmetry to be used. Allowed options are
'dense'
,'Z2'
, or'U1'
.kwargs – Other YASTN configuration parameters can be provided, see
yastn.make_config()
.
Notes
The following basis ordering and charge conventions are assumed
For
sym='dense'
, the basis order is (z=+1, z=-1).For
sym='Z2'
, charge t=0 \(\rightarrow\) z=1, t=1 \(\rightarrow\) z=-1; i.e., \(z = e^{i \pi t}\).For
sym='U1'
, charge t=-1 \(\rightarrow\) z=-1, t=1 \(\rightarrow\) z=1; i.e., z = t.
When using
yastn.to_numpy()
to recover usual dense representation of the algebra forsym='U1'
symmetry,reverse=True
is required since by default the charges are ordered in the increasing order.Default configuration sets
fermionic
toFalse
.
Spin-1#
- class yastn.operators.Spin1(**kwargs)[source]#
A set of standard operators for 3-dimensional Hilbert space as Spin-1 representation of su(2) algebra. Defines identity, \(S^z,\ S^x,\ S^y\) operators and \(S^+,\ S^-\) raising and lowering operators (if allowed by symmetry). Define eigenvectors of \(S^z\), \(S^x\), \(S^y\), and local Hilbert space as a
yastn.Leg
.- Parameters:
sym (str) – Explicit symmetry to be used. Allowed options are
'dense'
,'Z3'
, or'U1'
.kwargs – Other YASTN configuration parameters can be provided, see
yastn.make_config()
.
Notes
The following basis ordering and charge conventions are assumed
For
sym='dense'
, the basis order is (sz=+1, sz=0, sz=-1).For
sym='Z3'
, charge t=0 \(\rightarrow\) sz=+1, t=1 \(\rightarrow\) sz=0; t=2 \(\rightarrow\) sz=-1.For
sym='U1'
, charge t=-1 \(\rightarrow\) sz=-1, t=0 \(\rightarrow\) sz=0, t=1 \(\rightarrow\) sz=1; i.e., sz = t.
When using
yastn.to_numpy()
to recover usual dense representation of the algebra forsym='U1'
symmetry,reverse=True
is required since by default the charges are ordered in the increasing order.Default configuration sets
fermionic
toFalse
.- g() Tensor [source]#
Returns rank-2 metric tensor g, such that the quadratic Casimir in terms of basis \(\vec{S} = [S^z; S^+; S^-]\) can be computed as \(\vec{S}^T g \vec{S}\). The signature of g is
0(+1)--g--1(+1)
Spinless fermions#
- class yastn.operators.SpinlessFermions(**kwargs)[source]#
Predefine operators for spinless fermions.
Standard operators for single fermionic species and 2-dimensional Hilbert space. Defines identity, creation, annihilation, and density operators. Defines vectors for empty and occupied states, and local Hilbert space as a
yastn.Leg
.- Parameters:
sym (str) – Explicit symmetry to be used. Allowed options are
'Z2'
, or'U1'
.kwargs (any) – Passed to
yastn.make_config()
to change backend, default_device or other config parameters.
Fixes
fermionic
fields in config toTrue
.
Spinful fermions#
- class yastn.operators.SpinfulFermions(**kwargs)[source]#
Predefine operators for spinful fermions.
Generator of standard operators for local Hilbert space with two fermionic species and 4-dimensional Hilbert space.
Predefine identity, creation, annihilation, density, and spin operators. Defines vectors with possible occupations, and local Hilbert space as a
yastn.Leg
.- Parameters:
sym (str) – Explicit symmetry to be used. Allowed options are
'Z2'
,'U1'
,'U1xU1'
, or'U1xU1xZ2'
.kwargs (any) – Passed to
yastn.make_config()
to change backend, default_device or other config parameters.
Notes
Fermionic field in config is fixed such that:
For
'Z2'
,'U1'
and'U1xU1xZ2'
, the two species (spin-up and spin-down) are treated as indistinguishable. In that case, creation and annihilation operators of the two species anti-commute (fermionic statistics is encoded in the Z2 channel of U1xU1xZ2).For
'U1xU1'
the two species (spin-up and spin-down) are treated as distinguishable. In that case, creation and annihilation operators of the two species commute.
- c(spin='u') Tensor [source]#
Annihilation operator, with
spin='u'
for spin-up, andspin='d'
for spin-down.
- cp(spin='u') Tensor [source]#
Creation operator, with
spin='u'
for spin-up, andspin='d'
for spin-down.