glucat
0.8.2
|
Public Member Functions | |
def | __cinit__ (self, other=0) |
def | __dealloc__ (self) |
def | __richcmp__ (lhs, rhs, int, op) |
def | __setitem__ (self, idx, val) |
def | __getitem__ (self, idx) |
def | __contains__ (self, idx) |
def | __iter__ (self) |
def | __invert__ (self) |
def | __xor__ (lhs, rhs) |
def | __ixor__ (self, rhs) |
def | __and__ (lhs, rhs) |
def | __iand__ (self, rhs) |
def | __or__ (lhs, rhs) |
def | __ior__ (self, rhs) |
def | count (self) |
def | count_neg (self) |
def | count_pos (self) |
def | min (self) |
def | max (self) |
def | hash_fn (self) |
def | sign_of_mult (self, rhs) |
def | sign_of_square (self) |
def | __repr__ (self) |
def | __str__ (self) |
Public Attributes | |
instance | |
Return the C++ IndexSet instance wrapped by index_set(obj).
Python class index_set wraps C++ class IndexSet.
Definition at line 39 of file PyClical.pyx.
def PyClical.index_set.__and__ | ( | lhs, | |
rhs | |||
) |
Set intersection: and. >>> print index_set({1}) & index_set({2}) {} >>> print index_set({1,2}) & index_set({2}) {2}
Definition at line 269 of file PyClical.pyx.
def PyClical.index_set.__cinit__ | ( | self, | |
other = 0 |
|||
) |
Construct an object of type index_set. >>> print index_set(1) {1} >>> print index_set({1,2}) {1,2} >>> print index_set(index_set({1,2})) {1,2} >>> print index_set({1,2}) {1,2} >>> print index_set({1,2,1}) {1,2} >>> print index_set("{1,2,1}") {1,2} >>> print index_set("") {}
Definition at line 73 of file PyClical.pyx.
def PyClical.index_set.__contains__ | ( | self, | |
idx | |||
) |
Check that an index_set object contains the index idx: idx in self. >>> 1 in index_set({1}) True >>> 2 in index_set({1}) False >>> -1 in index_set({2}) False >>> 1 in index_set({2}) False >>> 2 in index_set({2}) True >>> 33 in index_set({2}) False
Definition at line 208 of file PyClical.pyx.
def PyClical.index_set.__dealloc__ | ( | self | ) |
Clean up by deallocating the instance of C++ class IndexSet.
Definition at line 114 of file PyClical.pyx.
References PyClical.index_set.instance.
def PyClical.index_set.__getitem__ | ( | self, | |
idx | |||
) |
Get the value of an index_set object at an index. >>> index_set({1})[1] True >>> index_set({1})[2] False >>> index_set({2})[-1] False >>> index_set({2})[1] False >>> index_set({2})[2] True >>> index_set({2})[33] False
Definition at line 189 of file PyClical.pyx.
def PyClical.index_set.__iand__ | ( | self, | |
rhs | |||
) |
Set intersection: and. >>> x = index_set({1}); x &= index_set({2}); print x {} >>> x = index_set({1,2}); x &= index_set({2}); print x {2}
Definition at line 280 of file PyClical.pyx.
def PyClical.index_set.__invert__ | ( | self | ) |
Set complement: not. >>> print ~index_set({-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}) {-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32}
Definition at line 238 of file PyClical.pyx.
def PyClical.index_set.__ior__ | ( | self, | |
rhs | |||
) |
Set union: or. >>> x = index_set({1}); x |= index_set({2}); print x {1,2} >>> x = index_set({1,2}); x |= index_set({2}); print x {1,2}
Definition at line 302 of file PyClical.pyx.
def PyClical.index_set.__iter__ | ( | self | ) |
Iterate over the indices of an index_set. >>> for i in index_set({-3,4,7}): print i, -3 4 7
Definition at line 227 of file PyClical.pyx.
References glucat::index_set< LO, HI >.max(), PyClical.index_set.max(), glucat::index_set< LO, HI >.min(), and PyClical.index_set.min().
def PyClical.index_set.__ixor__ | ( | self, | |
rhs | |||
) |
Symmetric set difference: exclusive or. >>> x = index_set({1}); x ^= index_set({2}); print x {1,2} >>> x = index_set({1,2}); x ^= index_set({2}); print x {1}
Definition at line 258 of file PyClical.pyx.
def PyClical.index_set.__or__ | ( | lhs, | |
rhs | |||
) |
Set union: or. >>> print index_set({1}) | index_set({2}) {1,2} >>> print index_set({1,2}) | index_set({2}) {1,2}
Definition at line 291 of file PyClical.pyx.
def PyClical.index_set.__repr__ | ( | self | ) |
The “official” string representation of self. >>> index_set({1,2}).__repr__() 'index_set({1,2})' >>> repr(index_set({1,2})) 'index_set({1,2})'
Definition at line 382 of file PyClical.pyx.
References index_set_to_repr().
def PyClical.index_set.__richcmp__ | ( | lhs, | |
rhs, | |||
int, | |||
op | |||
) |
Compare two objects of class index_set. >>> index_set(1) == index_set({1}) True >>> index_set({1}) != index_set({1}) False >>> index_set({1}) != index_set({2}) True >>> index_set({1}) == index_set({2}) False >>> index_set({1}) < index_set({2}) True >>> index_set({1}) <= index_set({2}) True >>> index_set({1}) > index_set({2}) False >>> index_set({1}) >= index_set({2}) False
Definition at line 120 of file PyClical.pyx.
def PyClical.index_set.__setitem__ | ( | self, | |
idx, | |||
val | |||
) |
Set the value of an index_set object at index idx to value val. >>> s=index_set({1}); s[2] = True; print s {1,2} >>> s=index_set({1,2}); s[1] = False; print s {2}
Definition at line 177 of file PyClical.pyx.
def PyClical.index_set.__str__ | ( | self | ) |
The “informal” string representation of self. >>> index_set({1,2}).__str__() '{1,2}' >>> str(index_set({1,2})) '{1,2}'
Definition at line 393 of file PyClical.pyx.
References index_set_to_str().
def PyClical.index_set.__xor__ | ( | lhs, | |
rhs | |||
) |
Symmetric set difference: exclusive or. >>> print index_set({1}) ^ index_set({2}) {1,2} >>> print index_set({1,2}) ^ index_set({2}) {1}
Definition at line 247 of file PyClical.pyx.
def PyClical.index_set.count | ( | self | ) |
Cardinality: Number of indices included in set. >>> index_set({-1,1,2}).count() 3
Definition at line 313 of file PyClical.pyx.
def PyClical.index_set.count_neg | ( | self | ) |
Number of negative indices included in set. >>> index_set({-1,1,2}).count_neg() 1
Definition at line 322 of file PyClical.pyx.
def PyClical.index_set.count_pos | ( | self | ) |
Number of positive indices included in set. >>> index_set({-1,1,2}).count_pos() 2
Definition at line 331 of file PyClical.pyx.
def PyClical.index_set.hash_fn | ( | self | ) |
Hash function.
Definition at line 358 of file PyClical.pyx.
def PyClical.index_set.max | ( | self | ) |
Maximum member. >>> index_set({-1,1,2}).max() 2
Definition at line 349 of file PyClical.pyx.
Referenced by PyClical.index_set.__iter__().
def PyClical.index_set.min | ( | self | ) |
Minimum member. >>> index_set({-1,1,2}).min() -1
Definition at line 340 of file PyClical.pyx.
Referenced by PyClical.index_set.__iter__().
def PyClical.index_set.sign_of_mult | ( | self, | |
rhs | |||
) |
Sign of geometric product of two Clifford basis elements. >>> s = index_set({1,2}); t=index_set({-1}); s.sign_of_mult(t) 1
Definition at line 364 of file PyClical.pyx.
def PyClical.index_set.sign_of_square | ( | self | ) |
Sign of geometric square of a Clifford basis element. >>> s = index_set({1,2}); s.sign_of_square() -1
Definition at line 373 of file PyClical.pyx.
PyClical.index_set.instance |
Definition at line 94 of file PyClical.pyx.
Referenced by PyClical.index_set.__dealloc__(), and PyClical.clifford.__dealloc__().