Skip to content

RandomState

A random state with normal distributed coefficients

Source random_state.hpp

Constructors

RandomState(seed::Int64 = 42, normalized::Bool = true)
RandomState(int64_t seed = 42, bool normalized = true);
Parameter Description
seed random seed determining which random numbers are put
normalized flag whether the State is normalized

Methods

seed

Returns the seed of the random state

seed(state::RandomState)
int64_t seed() const;

size

Returns whether the state is normalized.

normalized(state::RandomState)
bool normalized() const;

Usage Example

block = Spinhalf(2)
state = State(block, real=false)  # complex State
rstate1 = RandomState(1234)
fill(state, rstate1)
display(vector(state))

rstate2 = RandomState(4321)
fill(state, rstate2)
display(vector(state))

fill(state, rstate1)
display(vector(state))
auto block = Spinhalf(2);
auto state = State(block, false);  // complex State
auto rstate1 = RandomState(1234);
fill(state, rstate1);
XDIAG_SHOW(state.vectorC());

auto rstate2 = RandomState(4321);
fill(state, rstate2);
XDIAG_SHOW(state.vectorC());

fill(state, rstate1);
XDIAG_SHOW(state.vectorC());