QuIDS: Quantum Irregular Dynamic Simulator
Public Member Functions | Data Fields | Protected Attributes | Friends
quids::iteration Class Reference

iteration (wave function) representation class More...

#include <quids.hpp>

Inheritance diagram for quids::iteration:
quids::mpi::mpi_iteration

Public Member Functions

 iteration ()
 simple empty wavefunction constructor
 
 iteration (char *object_begin_, char *object_end_)
 constructor that insert a single object with magnitude 1 More...
 
void append (char const *object_begin_, char const *object_end_, mag_t const mag=1)
 function that insert a single object with a given magnitude More...
 
void pop (size_t n=1, bool normalize_=true)
 function that removes a given number of object from the "tail" of the memory representation More...
 
PROBA_TYPE average_value (const observable_t observable) const
 function to get the average value of a custom observable More...
 
void get_object (size_t const object_id, char *&object_begin_, uint &object_size_, mag_t *&mag)
 function to access a particular object (read-write access) More...
 
void get_object (size_t const object_id, char const *&object_begin_, uint &object_size_, mag_t &mag) const
 function to access a particular object (read-only access) More...
 

Data Fields

size_t num_object = 0
 number of objects contained in the wave function
 
PROBA_TYPE total_proba = 1
 total probability retained after previous truncation (if any).
 

Protected Attributes

size_t truncated_num_object = 0
 
uint ub_symbolic_object_size = 0
 
utils::fast_vector< mag_tmagnitude
 
utils::fast_vector< char > objects
 
utils::fast_vector< size_t > object_begin
 
utils::fast_vector< uint > object_size
 
utils::fast_vector< uint > num_childs
 
utils::fast_vector< size_t > child_begin
 
utils::fast_vector< size_t > truncated_oid
 
utils::fast_vector< float > random_selector
 

Friends

void simulate (it_t &iteration, rule_t const *rule, it_t &next_iteration, sy_it_t &symbolic_iteration, size_t max_num_object, debug_t mid_step_function)
 function to apply a dynamic to a wavefunction More...
 
void simulate (it_t &iteration, modifier_t const rule)
 function to apply a modifer to a wave function More...
 

Detailed Description

iteration (wave function) representation class

Constructor & Destructor Documentation

◆ iteration()

quids::iteration::iteration ( char *  object_begin_,
char *  object_end_ 
)
inline

constructor that insert a single object with magnitude 1

Parameters
[in]object_begin_,object_end_delimitations of the object to insert.

Member Function Documentation

◆ append()

void quids::iteration::append ( char const *  object_begin_,
char const *  object_end_,
mag_t const  mag = 1 
)
inline

function that insert a single object with a given magnitude

Parameters
[in]object_begin_,object_end_delimitations of the object to insert.
[in]magmagnitude given to the object after insertion

◆ average_value()

PROBA_TYPE quids::iteration::average_value ( const observable_t  observable) const
inline

function to get the average value of a custom observable

Parameters
[in]observableobservable that should be computed.

◆ get_object() [1/2]

void quids::iteration::get_object ( size_t const  object_id,
char *&  object_begin_,
uint &  object_size_,
mag_t *&  mag 
)
inline

function to access a particular object (read-write access)

Parameters
[in]object_ididentifier of the object to get (0 being the first object etc...).
[out]object_begin_begining of the object memory representation.
[out]object_sizesize of the memory representation of the object.
[out]magmagnitude of the object.

◆ get_object() [2/2]

void quids::iteration::get_object ( size_t const  object_id,
char const *&  object_begin_,
uint &  object_size_,
mag_t mag 
) const
inline

function to access a particular object (read-only access)

Parameters
[in]object_ididentifier of the object to get (0 being the first object etc...).
[out]object_begin_begining of the object memory representation.
[out]object_sizesize of the memory representation of the object.
[out]magmagnitude of the object.

◆ pop()

void quids::iteration::pop ( size_t  n = 1,
bool  normalize_ = true 
)
inline

function that removes a given number of object from the "tail" of the memory representation

Parameters
[in]nnumber of objects to remove
[in]normalizewether to normalize after removing objects or not

Friends And Related Function Documentation

◆ simulate [1/2]

void simulate ( it_t iteration,
modifier_t const  rule 
)
friend

function to apply a modifer to a wave function

Parameters
[in]iterationwavefunction that the modifier will be applied to.
[in]rulemodifer that will be applied

◆ simulate [2/2]

void simulate ( it_t iteration,
rule_t const *  rule,
it_t next_iteration,
sy_it_t symbolic_iteration,
size_t  max_num_object = 0,
debug_t  mid_step_function = [](const char*){} 
)
friend

function to apply a dynamic to a wavefunction

Parameters
[in]iterationwavefunction that the dynamic will be applied to.
[in]ruledynamic that will be applied.
[out]next_iterationwave function that will be overwritten to then contained the final wave function.
[out]symbolic_iterationsymbolic iteration that will be used.
[in]max_num_objectmaximum number of objects to be kept, -1 means no maximum, 0 means automaticaly finding the maximum ammount of objects that can be kept in memory.
[in]mid_step_functiondebuging function called between steps.

The documentation for this class was generated from the following file: