Skip to content

Creating specific States

Sources create_state.hpp, create_state.cpp

product_state

Creates a filled product state. The local states are encoded using an integer.

Constructors

product_state(block::Block, local_states::Vector{Int64}; real::Bool=true)
State product_state(Block const &block, std::vector<int64_t> const &local_state, bool real = true);

Parameters

Name Description
block block on which the state is defined
local_states local configurations of the product state
real flag whether real state is created

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.

random_state

Create a filled random state with normal \(\mathcal{N}(0, 1)\) distributed coefficients.

random_state(block::Block; real::Bool=true, ncols::Int64=1, seed::Int64=42, normalized::Bool=true
State random_state(Block const &block, bool real = true, int64_t ncols = 1, int64_t seed = 42, bool normalized = true);

Parameters

Name Description
block block on which the state is defined
real flag whether real state is created
ncols number of columns in the state
seed random seed determining the precise random numbers
normalized flag whether the state is normalized

zero_state

Create a filled state with all zero entries.

zero_state(block::Block; real::Bool=true, ncols::Int64=1)
State zero_state(Block const &block, bool real = true, int64_t ncols = 1);

Parameters

Name Description
block block on which the state is defined
real flag whether real state is created
ncols number of columns in the state

zero

Set all coefficients of a given state to zero.

zero(state::State)
void zero(State &state);

Usage Example

block = Spinhalf(2)
state = product_state(block, [1, 0])
display(vector(state))

zero(state)
display(vector(state))

state = random_state(block, real=false, seed=1234, normalized=true)
display(vector(state))

state = zero_state(block, real=true, ncols=2)
display(matrix(state))
auto block = Spinhalf(2);
auto state = product_state(block, {1, 0});
XDIAG_SHOW(state.vector());

zero(state);
XDIAG_SHOW(state.vector());

state = random_state(block, false, 1, 1234, true);
XDIAG_SHOW(state.vectorC());

state = zero_state(block, true, 2);
XDIAG_SHOW(state.vector());