Predefined YASTN tensors#
In YASTN there are a number of predefined bases for typical models. These can be used to generate a model of given physical definition. For more general case a custom operator basis class can be defined.
Spin-1/2 and Pauli matrices#
- class yastn.operators.Spin12(**kwargs)[source]#
A set of standard operators for 2-dimensional Hilbert space. Defines identity, \(S^z,\ S^x,\ S^y\) operators and \(S^+,\ S^-\) raising and lowering operators, and Pauli matrices (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
.- I() yastn.Tensor [source]#
Identity operator.
- sm() yastn.Tensor [source]#
Spin-1/2 lowering operator \(S^-=S^x - iS^y\).
- sp() yastn.Tensor [source]#
Spin-1/2 raising operator \(S^+=S^x + iS^y\).
- sx() yastn.Tensor [source]#
Spin-1/2 \(S^x\) operator
- sy() yastn.Tensor [source]#
Spin-1/2 \(S^y\) operator
- sz() yastn.Tensor [source]#
Spin-1/2 \(S^z\) operator
- vec_x(val=1) yastn.Tensor [source]#
Normalized eigenvectors of \(\sigma^x\).
- vec_y(val=1) yastn.Tensor [source]#
Normalized eigenvectors of \(\sigma^y\).
- vec_z(val=1) yastn.Tensor [source]#
Normalized eigenvectors of \(\sigma^z\).
- x() yastn.Tensor [source]#
Pauli \(\sigma^x\) operator.
- y() yastn.Tensor [source]#
Pauli \(\sigma^y\) operator.
- z() yastn.Tensor [source]#
Pauli \(\sigma^z\) operator.
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
.- I() yastn.Tensor [source]#
Identity operator.
- g() yastn.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)
- sm() yastn.Tensor [source]#
Spin-1 lowering operator \(S^-=S^x - iS^y\).
- sp() yastn.Tensor [source]#
Spin-1 raising operator \(S^+=S^x + iS^y\).
- sx() yastn.Tensor [source]#
Spin-1 \(S^x\) operator.
- sy() yastn.Tensor [source]#
Spin-1 \(S^y\) operator.
- sz() yastn.Tensor [source]#
Spin-1 \(S^z\) operator.
- vec_s() yastn.Tensor [source]#
Returns vector of Spin-1 generators, in order: \(S^z, S^+, S^-\). The generators are indexed by first index of the resulting rank-3 tensors. Signature convention is
2(-1) | 0(-1)--S | 1(+1)
- vec_x(val=1) yastn.Tensor [source]#
Normalized eigenvectors of \(S^x\).
- vec_y(val=1) yastn.Tensor [source]#
Normalized eigenvectors of \(S^y\).
- vec_z(val=1) yastn.Tensor [source]#
Normalized eigenvectors of \(S^z\).
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
.- I() yastn.Tensor [source]#
Identity operator.
- c() yastn.Tensor [source]#
Lowering operator.
- cp() yastn.Tensor [source]#
Raising operator.
- n() yastn.Tensor [source]#
Particle number operator.
- vec_n(val=0) yastn.Tensor [source]#
State with occupation 0 or 1.
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).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.
- I() yastn.Tensor [source]#
Identity operator in 4-dimensional Hilbert space.
- c(spin='u') yastn.Tensor [source]#
Annihilation operator, with
spin='u'
for spin-up, andspin='d'
for spin-down.
- cp(spin='u') yastn.Tensor [source]#
Creation operator, with
spin='u'
for spin-up, andspin='d'
for spin-down.
- n(spin='u') yastn.Tensor [source]#
Particle number operator, with
spin='u'
for spin-up, andspin='d'
for spin-down.
- vec_n(val=(0, 0)) yastn.Tensor [source]#
State with occupation given by tuple (nu, nd).