openjij
Framework for the Ising model and QUBO.
|
Classes | |
struct | get_base_class |
meta function for linear-searching base class of "derived_class" from the variadic template list (head_base_class ... tail_base_class). More... | |
struct | get_base_class< derived_class, base_class > |
meta function for linear-searching base class of "derived_class" from the variadic template list (head_base_class ... tail_base_class). More... | |
struct | get_eigen_matrix_type |
get Eigen Matrix type from Graph Type More... | |
struct | get_eigen_matrix_type< graph::Dense< FloatType >, Options > |
get Eigen Matrix type from Graph Type More... | |
struct | get_eigen_matrix_type< graph::Sparse< FloatType >, Options > |
get Eigen Matrix type from Graph Type More... | |
struct | IndexHash |
Hash struct of IndexType. More... | |
struct | IndexPairHash |
Hash struct of std::pair<IndexType>. More... | |
struct | IndexVectorHash |
Hash struct of std::vector<AnyIndexType>. More... | |
struct | is_same_template |
check if two template template parameters are the same. More... | |
struct | is_same_template< T, T > |
check if two template template parameters are the same. More... | |
struct | PairHash |
hash class for std::pair More... | |
struct | Schedule |
schedule struct More... | |
struct | UnionFind |
struct | UpdaterParameter |
updater parameter for monte carlo simulation More... | |
struct | UpdaterParameter< system::classical_constraint_system > |
updater paramter for classical ising model with a single constraint More... | |
struct | UpdaterParameter< system::classical_system > |
updater parameter for classical ising system More... | |
struct | UpdaterParameter< system::transverse_field_system > |
updater paramter for transverse ising model More... | |
struct | VectorHash |
Hash struct of std::vector<T>. More... | |
class | Xorshift |
xorshift random generator for c++11 random More... | |
Typedefs | |
using | AnyTupleType = std::vector< std::variant< std::int32_t, std::string > > |
Vector type of integer and string. | |
using | IndexType = std::variant< std::int32_t, std::string, AnyTupleType > |
The index type of binary variables. | |
using | ClassicalUpdaterParameter = UpdaterParameter< system::classical_system > |
ClassicalUpdaterParameter alias. | |
using | ClassicalConstraintUpdaterParameter = UpdaterParameter< system::classical_constraint_system > |
ClassicalUpdaterParameter alias. | |
using | TransverseFieldUpdaterParameter = UpdaterParameter< system::transverse_field_system > |
TransverseFieldUpdaterParameter alias. | |
template<typename SystemType > | |
using | ScheduleList = std::vector< Schedule< SystemType > > |
schedule list alias | |
using | ClassicalScheduleList = ScheduleList< system::classical_system > |
ClassicalScheduleList alias. | |
using | TransverseFieldScheduleList = ScheduleList< system::transverse_field_system > |
TransverseFieldScheduleList alias. | |
using | ClassicalConstraintScheduleList = ScheduleList< system::classical_constraint_system > |
ClassicalConstraintScheduleList alias. | |
Enumerations | |
enum class | TemperatureSchedule { LINEAR , GEOMETRIC } |
Functions | |
template<typename ForwardIterator , typename T > | |
void | make_geometric_progression (ForwardIterator first, ForwardIterator last, T value, T ratio) |
template<typename FloatType , int Options = Eigen::ColMajor> | |
static Eigen::Matrix< FloatType, Eigen::Dynamic, 1, Options > | gen_vector_from_std_vector (const graph::Spins &init_spin) |
generate Eigen Vector from std::vector | |
template<typename FloatType , int Options = Eigen::ColMajor> | |
static Eigen::Matrix< FloatType, Eigen::Dynamic, Eigen::Dynamic, Options > | gen_matrix_from_trotter_spins (const std::vector< graph::Spins > &trotter_spins) |
generate Eigen Matrix from TrotterSpins | |
template<int Options = Eigen::ColMajor, typename FloatType > | |
static Eigen::Matrix< FloatType, Eigen::Dynamic, Eigen::Dynamic, Options > | gen_matrix_from_graph (const graph::Dense< FloatType > &graph) |
generate Eigen Dense Matrix from Dense graph | |
template<int Options = Eigen::ColMajor, typename FloatType > | |
static Eigen::SparseMatrix< FloatType, Options > | gen_matrix_from_graph (const graph::Sparse< FloatType > &graph) |
generate Eigen Sparse Matrix from Sparse graph | |
template<class C_key , class C_value , class Hash > | |
void | insert_or_assign (std::unordered_map< C_key, C_value, Hash > &um, const C_key &key, const C_value &val) |
Insert or assign a element of unordered_map (for C++14 or C++11) | |
template<typename T , typename... Args> | |
std::unique_ptr< T > | make_unique (Args &&...args) |
make_unique function | |
ClassicalScheduleList | make_classical_schedule_list (double beta_min, double beta_max, std::size_t one_mc_step, std::size_t num_call_updater) |
helper function for making classical schedule list with geometric series of inverse temperatures. | |
TransverseFieldScheduleList | make_transverse_field_schedule_list (double beta, std::size_t one_mc_step, std::size_t num_call_updater) |
helper function for making transverse field system schedule list with arithmetic sequence of annealing schedule (s) | |
ClassicalConstraintScheduleList | make_classical_constraint_schedule_list (double lambda, double beta_min, double beta_max, std::size_t one_mc_step, std::size_t num_call_updater) |
helper function for making classical constraint schedule list with geometric series of inverse temperatures (with constraint parameter fixed). | |
template<typename SystemType > | |
ScheduleList< SystemType > | make_schedule_list (const std::vector< std::pair< typename UpdaterParameter< SystemType >::Tuple, std::size_t > > &tuplelist) |
helper function for making schedulelist from list of tuples | |
template<typename FloatType > | |
std::vector< FloatType > | GenerateLinearBetaSchedule (const FloatType beta_min, const FloatType beta_max, const std::int32_t num_sweeps) |
Generate linear temperature schedule. | |
template<typename FloatType > | |
std::vector< FloatType > | GenerateGeometricBetaSchedule (const FloatType beta_min, const FloatType beta_max, const std::int32_t num_sweeps) |
Generate geometric temperature schedule. | |
template<typename FloatType > | |
std::vector< FloatType > | GenerateBetaList (const TemperatureSchedule schedule_type, const FloatType beta_min, const FloatType beta_max, const std::int32_t num_sweeps) |
Generate temperature schedule from specific schedule. | |
Variables | |
template<typename FloatType > | |
const FloatType | THRESHOLD = 0.00000001 |
using openjij::utility::AnyTupleType = typedef std::vector<std::variant<std::int32_t, std::string> > |
Vector type of integer and string.
using openjij::utility::ClassicalConstraintScheduleList = typedef ScheduleList<system::classical_constraint_system> |
ClassicalConstraintScheduleList alias.
using openjij::utility::ClassicalConstraintUpdaterParameter = typedef UpdaterParameter<system::classical_constraint_system> |
ClassicalUpdaterParameter alias.
using openjij::utility::ClassicalScheduleList = typedef ScheduleList<system::classical_system> |
ClassicalScheduleList alias.
using openjij::utility::ClassicalUpdaterParameter = typedef UpdaterParameter<system::classical_system> |
ClassicalUpdaterParameter alias.
using openjij::utility::IndexType = typedef std::variant<std::int32_t, std::string, AnyTupleType> |
The index type of binary variables.
using openjij::utility::ScheduleList = typedef std::vector<Schedule<SystemType> > |
schedule list alias
SystemType | system type |
using openjij::utility::TransverseFieldScheduleList = typedef ScheduleList<system::transverse_field_system> |
TransverseFieldScheduleList alias.
using openjij::utility::TransverseFieldUpdaterParameter = typedef UpdaterParameter<system::transverse_field_system> |
TransverseFieldUpdaterParameter alias.
|
strong |
|
inlinestatic |
generate Eigen Dense Matrix from Dense graph
Options | Eigen Options (RowMajor or ColMajor) |
FloatType |
graph |
References openjij::graph::Graph::get_num_spins(), openjij::graph::Dense< FloatType >::h(), and openjij::graph::Dense< FloatType >::J().
|
inlinestatic |
generate Eigen Sparse Matrix from Sparse graph
Options | Eigen Options (RowMajor or ColMajor) |
FloatType |
graph |
References openjij::graph::Sparse< FloatType >::adj_nodes(), openjij::graph::Graph::get_num_spins(), openjij::graph::Sparse< FloatType >::h(), and openjij::graph::Sparse< FloatType >::J().
|
inlinestatic |
generate Eigen Matrix from TrotterSpins
FloatType | |
Options | Eigen Options (RowMajor or ColMajor) |
trotter_spins |
|
inlinestatic |
generate Eigen Vector from std::vector
FloatType | |
Options | Eigen Options (RowMajor or ColMajor) |
init_spin |
std::vector< FloatType > openjij::utility::GenerateBetaList | ( | const TemperatureSchedule | schedule_type, |
const FloatType | beta_min, | ||
const FloatType | beta_max, | ||
const std::int32_t | num_sweeps | ||
) |
Generate temperature schedule from specific schedule.
FloatType | Floating point type |
schedule_type | The type of temperature schedule |
beta_min | The minimum value of inverse temperature |
beta_max | The maximum value of inverse temperature |
num_sweeps | The number of sweeps |
References GenerateGeometricBetaSchedule(), GenerateLinearBetaSchedule(), GEOMETRIC, and LINEAR.
Referenced by openjij::sampler::SASampler< ModelType >::TemplateSampler().
std::vector< FloatType > openjij::utility::GenerateGeometricBetaSchedule | ( | const FloatType | beta_min, |
const FloatType | beta_max, | ||
const std::int32_t | num_sweeps | ||
) |
Generate geometric temperature schedule.
FloatType | Floating point type |
beta_min | The minimum value of inverse temperature |
beta_max | The maximum value of inverse temperature |
num_sweeps | The number of sweeps |
Referenced by GenerateBetaList().
std::vector< FloatType > openjij::utility::GenerateLinearBetaSchedule | ( | const FloatType | beta_min, |
const FloatType | beta_max, | ||
const std::int32_t | num_sweeps | ||
) |
Generate linear temperature schedule.
FloatType | Floating point type |
beta_min | The minimum value of inverse temperature |
beta_max | The maximum value of inverse temperature |
num_sweeps | The number of sweeps |
Referenced by GenerateBetaList().
|
inline |
Insert or assign a element of unordered_map (for C++14 or C++11)
C_key | |
C_value | |
Hash |
um | |
key | |
val |
ClassicalConstraintScheduleList openjij::utility::make_classical_constraint_schedule_list | ( | double | lambda, |
double | beta_min, | ||
double | beta_max, | ||
std::size_t | one_mc_step, | ||
std::size_t | num_call_updater | ||
) |
helper function for making classical constraint schedule list with geometric series of inverse temperatures (with constraint parameter fixed).
lambda | constraint paraemeters |
beta_min | |
beta_max | |
one_mc_step | |
num_call_updater |
Referenced by PYBIND11_MODULE().
ClassicalScheduleList openjij::utility::make_classical_schedule_list | ( | double | beta_min, |
double | beta_max, | ||
std::size_t | one_mc_step, | ||
std::size_t | num_call_updater | ||
) |
helper function for making classical schedule list with geometric series of inverse temperatures.
beta_min | initial (minimal) value of beta |
beta_max | final (maximal) value of beta |
one_mc_step | number of mc step for each temperature |
num_call_updater | number of updater calls |
Referenced by PYBIND11_MODULE().
void openjij::utility::make_geometric_progression | ( | ForwardIterator | first, |
ForwardIterator | last, | ||
T | value, | ||
T | ratio | ||
) |
ScheduleList< SystemType > openjij::utility::make_schedule_list | ( | const std::vector< std::pair< typename UpdaterParameter< SystemType >::Tuple, std::size_t > > & | tuplelist | ) |
helper function for making schedulelist from list of tuples
SystemType |
tuplelist |
TransverseFieldScheduleList openjij::utility::make_transverse_field_schedule_list | ( | double | beta, |
std::size_t | one_mc_step, | ||
std::size_t | num_call_updater | ||
) |
helper function for making transverse field system schedule list with arithmetic sequence of annealing schedule (s)
beta | inverse temperature |
one_mc_step | number of mc step for each temperature |
num_call_updater | number of updater calls |
Referenced by PYBIND11_MODULE().
std::unique_ptr< T > openjij::utility::make_unique | ( | Args &&... | args | ) |
make_unique function
T | |
...Args |
...args |