integer
Overloads
| Name | Description |
|---|---|
integer(const Qbit qbit) -> integer | Returns the integer representation of the qubit state. |
integer(const Fbit fbit) -> integer | Returns the integer representation of the fermionic product state. |
integer(const Qbit qbit) -> integer
Returns the integer representation of the qubit state.
Given the product state , then the integer method returns , where is the number of sites.
Example
Qbit("0011").integer() // Returns (2**2 + 2**3) = 12
integer(const Fbit fbit) -> integer
Returns the integer representation of the fermionic product state.
Given the product state , then the get_representation method returns , where is the number of sites.
Example
integer(Fbit("0011")) // Returns (2**2 + 2**3) = 12