ProductState
A product state of local configurations on a given number of sites. The local states are encoded using an integer. Each integer represents a certain local physical state which differs from block to block. Here is a summary for each one of the main 5 block types:
Fermion
| Integer | Configuration | Symbol |
|---|---|---|
0 |
empty | ○ |
1 |
occupied fermion | ● |
Boson
The local configuration of a site is simply the occupation number, i.e. an integer in \(0, 1, \ldots, d-1\).
Spinhalf
| Integer | Configuration | Symbol |
|---|---|---|
0 |
down-spin | ↓ |
1 |
up-spin | ↑ |
tJ
| Integer | Configuration | Symbol |
|---|---|---|
0 |
empty | ○ |
1 |
up-spin electron | ↑ |
2 |
down-spin electron | ↓ |
Electron
| Integer | Configuration | Symbol |
|---|---|---|
0 |
empty | ○ |
1 |
up-spin electron | ↑ |
2 |
down-spin electron | ↓ |
3 |
doubly occupied | ⇅ |
For the fermionic blocks, Fermion,tJ, Electron a sign convention for normal ordering is chosen as explained in normal ordering.
Sources: product_state.hpp · product_state.cpp
Constructors
| Parameter | Description |
|---|---|
| nsites | construct a product state on nsites |
| local_states | the local configurations of the product state |
Iteration
A ProductState can be iterated over, where at each iteration the string of the local configuration is retured. Here is an example:
Methods
nsites
Returns the number of sites of the product state
size
Returns the number of sites of the product state. Same as "nsites".
setindex! / operator[]
Sets the local configuration at the given site index to the given string.
getindex / operator[]
Returns the string of the local configuration at the given site index.
push! / push_back
Adds a local configuration add the end of the product state.
Usage Example
auto pstate = ProductState({1, 2, 0, 3});
for (auto s : pstate) {
Log("{}", s);
}
XDIAG_SHOW(to_string(pstate));
pstate = ProductState();
pstate.push_back(2);
pstate.push_back(1);
pstate.push_back(2);
XDIAG_SHOW(pstate.nsites());
for (auto s : pstate) {
Log("{}", s);
}
XDIAG_SHOW(to_string(pstate));