count
Method of Fbit.
Overloads
| Name | Description |
|---|---|
count(const List<integer> sites) -> integer | Returns the sum of the occupation numbers of a subset of sites (interpreted as integers) in the product state. |
count() -> integer | Returns the sum of the occupation numbers (interpreted as integers) in the product state. |
count(const List<integer> sites) -> integer
Returns the sum of the occupation numbers of a subset of sites (interpreted as integers) in the product state.
Parameters
- sites: List of sites to count the number of fermions
Example
Fbit("10010001").count([0,3,4]) // Returns 2
count() -> integer
Returns the sum of the occupation numbers (interpreted as integers) in the product state.
Example
Fbit("10010001").count() // Returns 3