Skip to main content

count

Method of Fbit.

Overloads

NameDescription
count(const List<integer> sites) -> integerReturns the sum of the occupation numbers of a subset of sites (interpreted as integers) in the product state.
count() -> integerReturns 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