Fbit
An object representing a product state of fermionic modes.
This class represents a product state of fermionic modes together with its associated multiplicative coefficient. Each fermionic mode ( or ) corresponds respectively to an unoccupied and occupied site. In other words, given the fermionic number operator , one has that The number of fermionic modes in the product state corresponds to the number of sites on which it has support.
Factories
Fbit(const string bitstring) -> Fbit
Constructs a fermionic product state from a string of consecutive characters "" and "".
Parameters
- bitstring: A string representing the states of the fermionic modes in the product state.
Example
Fbit("00110") // Returns (1 + 0i)|00110>
Fbit(integer num_sites) -> Fbit
Constructs a fermionic product state of size num_sites with every fermionic mode set to .
Parameters
- num_sites: The number of fermionic modes in the product state in a one to one correspondence with the sites.
Example
Fbit(4) // Returns (1 + 0i)|0000>
Fbit(const string bitstring, complex coefficient) -> Fbit
Constructs a fermionic product state from a string of "" and "" with a specified complex multiplicative coefficient.
Parameters
- bitstring: A string representing the states of the fermionic modes in the product state.
- coefficient: The coefficient that multiplies the fermion product state.
Example
Fbit("00110", 2.0 + 5.0i) // Returns (2 + 5i)|00110>
Fbit(const string bitstring, bool coefficient) -> Fbit
Constructs a fermionic product state from a string of "" and "" with a specified bool (converted to complex) multiplicative coefficient.
Parameters
- bitstring: A string representing the states of the fermionic modes in the product state.
- coefficient: The coefficient that multiplies the fermion product state.
Example
Fbit("00110", true) // Returns (1 + 0i)|00110>
Fbit(const string bitstring, real coefficient) -> Fbit
Constructs a fermionic product state from a string of "" and "" with a specified real (converted to complex) multiplicative coefficient.
Parameters
- bitstring: A string representing the states of the fermionic modes in the product state.
- coefficient: The coefficient that multiplies the fermion product state.
Example
Fbit("00110", 2.0) // Returns (2 + 0i)|00110>
Fbit(const string bitstring, integer coefficient) -> Fbit
Constructs a fermionic product state from a string of "" and "" with a specified integer (converted to complex) multiplicative coefficient.
Parameters
- bitstring: A string representing the states of the fermionic modes in the product state.
- coefficient: The coefficient that multiplies the fermion product state.
Example
Fbit("00110", 3) // Returns (3 + 0i)|00110>
Fbit(integer num_sites, complex coefficient) -> Fbit
Constructs a fermionic product state of size num_sites with every fermionic mode set to with a specified complex multiplicative coefficient.
Parameters
- num_sites: The number of fermionic modes in the product state in a one to one correspondence with the sites.
- coefficient: The coefficient that multiplies the fermion product state.
Example
Fbit(4, 2.0 + 5.0i) // Returns (2 + 5i)|0000>
Fbit(integer num_sites, bool coefficient) -> Fbit
Constructs a fermionic product state of size num_sites with every fermionic mode set to with a specified bool (converted to complex) multiplicative coefficient.
Parameters
- num_sites: The number of fermionic modes in the product state in a one to one correspondence with the sites.
- coefficient: The coefficient that multiplies the fermion product state.
Example
Fbit(4, true) // Returns (1 + 0i)|0000>
Fbit(integer num_sites, real coefficient) -> Fbit
Constructs a fermionic product state of size num_sites with every fermionic mode set to with a specified real (converted to complex) multiplicative coefficient.
Parameters
- num_sites: The number of fermionic modes in the product state in a one to one correspondence with the sites.
- coefficient: The coefficient that multiplies the fermion product state.
Example
Fbit(4, 2.0) // Returns (2 + 0i)|0000>
Fbit(integer num_sites, integer coefficient) -> Fbit
Constructs a fermionic product state of size num_sites with every fermionic mode set to with a specified integer (converted to complex) multiplicative coefficient.
Parameters
- num_sites: The number of fermionic modes in the product state in a one to one correspondence with the sites.
- coefficient: The coefficient that multiplies the fermion product state.
Example
Fbit(4, 3) // Returns (3 + 0i)|0000>
Symbols
| Name | Description |
|---|---|
= | Assignment operator for Fbit objects. |
[] | Returns the state of the fermionic mode (interpreted as an integer) at the specified site. |
Members
| Name | Description |
|---|---|
| count | Returns the sum of the occupation numbers of a subset of sites (interpreted as integers) in the product state. |
| create | Applies the creation operator on the fermionic product state in place. |
| created | Returns a copy of the product state on which the creation operator was applied. |
| destroy | Applies the annihilation operator on the fermionic product state in place. |
| destroyed | Returns a copy of the product state on which the annihilation operator was applied. |
| flip | This method modifies the Fbit object in place by flipping the state of the fermionic modes at the specified sites. |
| flipped | Returns a copy of the product state with the fermionic mode at the specified site flipped. |
| get_state | Returns the state of the fermionic mode (interpreted as an integer) at the specified site. |
| insert | Inserts a fermionic mode set to 0 at the specified site. |
| inserted | Returns a copy of the product state with a fermionic mode in the "" state inserted on the left of the fermionic mode at the specified site. |
| period | Returns the number of times the fermionic modes have to be circularly shifted to the right by a number of sites equal to the provided integer before the obtained product state is equal to the starting product state. |
| reflect | Reverses the product state (reversed end-to-end) in place. |
| reflected | Returns a copy of the reflected (reversed end-to-end) product state. |
| set_representation | Sets the integer representation of the Fbit. |
| split | Splits the product state into a pair of Fbit objects according to a specified set of states for the resulting left and right product state. |
| swap | This methods swaps the fermionic modes of the product state at the specified sites in place. |
| swapped | Returns a copy of the Fbit object with two specified fermionic modes swapped. |
| translate | Circularly shifts in place the fermionic modes of the product state by site to the right. |
| translated | Returns a copy of the product state with its fermionic modes shifted by site to the right. |