Workspace object for taking snapshots from matrix-product State. More...
#include <snapshots.h>
Classes | |
struct | SSM |
Structure representing single-site measurement subspace-projector and eigenvalue as well as probability to measure outcome. More... | |
Public Member Functions | |
std::vector< SSM > | get_last_ssm_decomposition () const |
Return last sso decomposition. More... | |
State & | get_state () |
Get state. More... | |
SRDef | measure_sso (const Lattice &_lattice, const std::string &_sso, const Index &_site) |
Measure single-site operator and collapse tensor at given site. More... | |
std::vector< SRDef > | measure_ssos (const Lattice &_lattice, const std::string &_sso) |
Measure single-site operator at every site and collapse state. More... | |
void | set_state (const State &_state) |
Set state and reset workspace. More... | |
Workspace (const Index _seed=0) | |
Constructor initializing workspace, if seed > 0 then random number generator is initialized (see Random::initReproducible) More... | |
Workspace (const State &_psi, const Index _seed=0) | |
Constructor initializing workspace with state, if seed > 0 then random number generator is initialized (see Random::initReproducible) More... | |
Protected Member Functions | |
void | decompose_sso (const Lattice &_lattice, const std::string &_sso_id, const Index &_site, std::vector< SSM > &_result) |
Decomposes single-site operator into projectors to eigenspaces and eigenvalues. More... | |
std::vector< SSM >::const_iterator | draw_ssm_sample (const std::vector< SSM > &_ssm_decomposition) |
Sample single-site measurement. More... | |
void | move_to_site (const Index &_site) |
Move center of orthogonality to site. More... | |
Protected Attributes | |
State | psi |
The state. More... | |
Private Attributes | |
bool | full_normalize |
Flag to decide if full normalization sweep is required. More... | |
Random::Engine | gen |
Random number generator. More... | |
std::vector< SSM > | last_ssm_decomposition |
Store last sso decomposition. More... | |
Index | last_visited |
Store last collapsed site. More... | |
Workspace object for taking snapshots from matrix-product State.
Object of this class wraps snapshot operations acting on MPS. The state can be collapsed both, either partially or completely while performing projective measurements, emulating snapshot experiments. After a snapshot measurement w.r.t. to an observable \(\hat O\) on a site with measurement outcome \(\O_alpha\), the corresponding site tensor is uncorrelated with the remaining site tensors and represents the eigenstate \(\ket{\alpha}\) of the measurement operator belonging to the measurement outcome. This way, perfect sampling can be realized by subsequently collapsing sites, drawing the measurement outcome probabilities from the correct, conditional joint probability distribution.
Note that the workspace object creates a copy of the input state on creation.