insert
Method of Fbit.
Overloads
| Name | Description |
|---|---|
insert(const integer site) -> Fbit | Inserts a fermionic mode set to 0 at the specified site. |
insert(const integer site, const bool value) -> Fbit | Inserts a fermionic mode set to 0 at the specified site. |
insert(const integer site, const integer value) -> Fbit | Inserts a fermionic mode set to 0 at the specified site. |
insert(const integer site) -> Fbit
Inserts a fermionic mode set to 0 at the specified site.
Modifies the Fbit object in place by adding a fermionic mode in the "0" state to the left of the fermionic mode at the specified site.
Parameters
- site: The site of the fermionic mode being queried in the product state.
Example
Fbit("0011").insert(2) // Returns (1 + 0i)|00011>
Fbit("0011").insert(4) // Returns (1 + 0i)|00110>
// Fbit("0011").insert(5) //Error "The specified site is out of bound."
insert(const integer site, const bool value) -> Fbit
Inserts a fermionic mode set to 0 at the specified site.
Modifies the Fbit object in place by adding a fermionic mode in the "0" state to the left of the fermionic mode at the specified site.
Parameters
- site: The site of the fermionic mode being queried in the product state.
- value: The value of the inserted state (0 or 1)
Example
Fbit("0011").insert(2) // Returns (1 + 0i)|00101>
Fbit("0011").insert(4) // Returns (1 + 0i)|00110>
// Fbit("0011").insert(5) //Error "The specified site is out of bound."
insert(const integer site, const integer value) -> Fbit
Inserts a fermionic mode set to 0 at the specified site.
Modifies the Fbit object in place by adding a fermionic mode in the "0" state to the left of the fermionic mode at the specified site.
Parameters
- site: The site of the fermionic mode being queried in the product state.
- value: The value of the inserted state (0 or 1)
Example
Fbit("0011").insert(2) // Returns (1 + 0i)|00101>
Fbit("0011").insert(4) // Returns (1 + 0i)|00110>
// Fbit("0011").insert(5) //Error "The specified site is out of bound."