SignTerm¶
- class zixy.fermion.SignTerm(modes: int | Modes = 0, source: Cmpnt[ImplT, SpecT] | SpecT | tuple[SpecT | Cmpnt[ImplT, SpecT], CoeffT | None] = '')[source]¶
Bases:
Term[Sign]A term consisting of a normal-ordered fermionic string and a sign coefficient.
A single mode-based term consisting of a normal-ordered fermionic string and a
Signthat may be an owning instance referencing a single element in aTermDatainstance, or a view on an element in another collection.- __init__(modes: int | Modes = 0, source: Cmpnt[ImplT, SpecT] | SpecT | tuple[SpecT | Cmpnt[ImplT, SpecT], CoeffT | None] = '')¶
Initialize the term.
- Parameters:
modes – The mode space or number of modes.
source – The term specifier to use for initial value.
- __mul__(rhs: OtherCoeffT | String | Term[OtherCoeffT]) Term[Any] | TermSum[Any][source]¶
- Overloads:
self, rhs (Sign) → SignTerm
self, rhs (ComplexSign) → ComplexTerm
self, rhs (float) → RealTerm
self, rhs (complex) → ComplexTerm
self, rhs (Expr) → SymbolicTerm
self, rhs (String) → SignTermSum
self, rhs (SignTerm) → SignTermSum
self, rhs (RealTerm) → RealTermSum
self, rhs (ComplexTerm) → ComplexTermSum
self, rhs (SymbolicTerm) → SymbolicTermSum
Multiplication of
selfbyrhs.
- __rmul__(lhs: OtherCoeffT | String | Term[OtherCoeffT]) Term[Any] | TermSum[Any][source]¶
- Overloads:
self, lhs (Sign) → SignTerm
self, lhs (ComplexSign) → ComplexTerm
self, lhs (float) → RealTerm
self, lhs (complex) → ComplexTerm
self, lhs (Expr) → SymbolicTerm
self, lhs (String) → SignTermSum
self, lhs (SignTerm) → SignTermSum
self, lhs (RealTerm) → RealTermSum
self, lhs (ComplexTerm) → ComplexTermSum
self, lhs (SymbolicTerm) → SymbolicTermSum
Multiplication of
lhsbyself.
- aliases(other: Term[Any, Any, Any]) bool¶
Determine whether
selfis a view of the same component asother.
- clear() None¶
Set the value of the component to zero and the coefficient to unity.
Note
This method operates in-place.
- property coeff: CoeffT¶
Get a copy of the coefficient of
self.
- classmethod from_cmpnt_coeff(cmpnt: Cmpnt[ImplT, SpecT], coeff: CoeffT) Self¶
Factory to make an instance of
clsfrom a component and a coefficient.- Parameters:
cmpnt – Component to copy from.
coeff – Coefficient scaling the
cmpntin the new instance.
- Returns:
An instance of
clswith the given component and coefficient.
- classmethod from_str(source: str, *args: Any, **kwargs: Any) Self¶
Create an instance of
clsfrom a string.- Parameters:
source – String to parse.
*args – Positional arguments to forward to the component constructor.
**kwargs – Keyword arguments to forward to the component constructor.
- Returns:
An instance of
clsparsed fromsource.
- into(t: type[OutT]) OutT¶
Clone
selfinto a new related container of typet.- Parameters:
t – Type of the new container to create.
- Returns:
A new instance of
tcontaining the same data asself.
- property modes: Modes¶
Get the modes corresponding to
self.
- classmethod parse(source: str) Self¶
Parse a string into an instance of
cls.- Deprecated:
use
from_str()instead.
- Parameters:
source – String to parse.
- Returns:
An instance of
clsparsed fromsource.