ComplexSign¶
- class zixy.container.coeffs.ComplexSign(source: int | ComplexSign | ComplexSign = 0)[source]¶
Bases:
RootOfUnityA complex sign, i.e. a fourth root of unity (1, i, -1, or -i).
- __abs__() ComplexSign[source]¶
Return the absolute value of
self.
- __float__() float[source]¶
Convert
selfto a floating point value.- Raises:
ValueError – If the value of
selfis not representable as a float.
See also
- __imul__(rhs: int | float | complex | Sign | ComplexSign | Expr) Self[source]¶
Multiply
selfbyrhs.- Raises:
ValueError – If the result of the multiplication cannot be represented by the type of
self.
- __init__(source: int | ComplexSign | ComplexSign = 0)[source]¶
Initialize the complex sign.
- Parameters:
source – Either an integer interpreted as the exponent \(k\) such that the value of the complex sign is \(i^k\), a Rust-bound
ComplexSigninstance, or an existingComplexSigninstance.
- __int__() int[source]¶
Convert
selfto an integer value.- Raises:
ValueError – If the value of
selfis not representable as an integer.
- __mul__(other: int | float | complex | Sign | ComplexSign | Expr) int | float | complex | Sign | ComplexSign | Expr[source]¶
- Overloads:
self, other (float) → complex
self, other (complex) → complex
self, other (Sign) → ComplexSign
self, other (ComplexSign) → ComplexSign
self, other (Expr) → Expr
Out-of-place multiplication of
selfbyother.Note
The return type is determined by the type of the right-hand operand
other, with appropriate type promotion rules.
- __neg__() ComplexSign[source]¶
Return the negation of
self.
- __rmul__(other: int | float | complex | Sign | ComplexSign | Expr) int | float | complex | Sign | ComplexSign | Expr[source]¶
- Overloads:
self, other (float) → complex
self, other (complex) → complex
self, other (Sign) → ComplexSign
self, other (ComplexSign) → ComplexSign
self, other (Expr) → Expr
Out-of-place multiplication of
otherbyself.See also
- __rtruediv__(other: int | float | complex | Sign | ComplexSign | Expr) int | float | complex | Sign | ComplexSign | Expr[source]¶
- Overloads:
self, other (float) → complex
self, other (complex) → complex
self, other (Sign) → ComplexSign
self, other (ComplexSign) → ComplexSign
self, other (Expr) → Expr
Out-of-place division of
otherbyself.See also
- __truediv__(other: int | float | complex | Sign | ComplexSign | Expr) int | float | complex | Sign | ComplexSign | Expr[source]¶
- Overloads:
self, other (float) → complex
self, other (complex) → complex
self, other (Sign) → ComplexSign
self, other (ComplexSign) → ComplexSign
self, other (Expr) → Expr
Out-of-place division of
selfbyother.See also
- classmethod from_complex(value: complex | float) ComplexSign[source]¶
Construct an instance of
clsfrom a complex value.- Raises:
ValueError – If
valueis not exactly representable ascls.
- classmethod from_numeric(value: complex | float) ComplexSign¶
Construct an instance of
clsfrom a complex value.- Raises:
ValueError – If
valueis not exactly representable ascls.