grassmann_number
- class grassmanntn.arith.grassmann_number(data, generator)
An object representing a Grassmann number.
Note
This is a class definition function. To define a new Grassmann variable, use set_anticommutative() instead.
Parameters:
data:
numpy.ndarray
A vector containing all the coefficients. \(C_{i_1i_2\cdots i_n}\) (vectorized).
generator: a list of
str
A list of symbols for Grassmann generators \(\theta_1,\theta_2,\cdots,\theta_n\).
Returns:
out: grassmann_number
A Grassmann number \(\psi=\sum_{i_1,i_2,\cdots,i_n}C_{i_1i_2\cdots i_n}\theta_1^{i_1},\theta_2^{i_2},\cdots,\theta_n^{i_n}\).
Attributes
size:
int
Returns the size of the Grassmann algebra containing this variable.
basis:
list
Returns an ordered list of
str
representing the generators. For data protection, this list is not modifiable.
Unary and binary operations
Addition: <self>+<other> and <other>+<self>
Returns the sum of two Grassmann numbers (or scalars).
Multiplication: <self>*<other> and <other>*<self>
Returns a multiplication of two Grassmann numbers (or scalars). This is not commutative in general!
Subtraction: <self>-<other> and <other>-<self>
Returns the difference of two Grassmann numbers (or scalars).
Scalar division: <self>/<other>
Returns the divisiion of <self> by a scalar.
Power: <self>^<other>
Raising to a power of some integer. Real and complex powers are not supported.
Exponentiation: <other>^<self>
Returns exp(log(<other>)*<self>). The base <other> can be any non-Grassmann scalar.
Unary plus: +<self>
Returns <self>
Negation: -<self>
Returns (-1)*<self>
Methods
is_grassmann():
Returns True if it contains Grassmann numbers (even or odd).
is_even():
Returns True if every term is Grassmann even.
is_odd():
Returns True if every term is Grassmann odd.
get_coeff(basis=`None`):
See get_coeff().