openjij
Framework for the Ising model and QUBO.
|
#include <ising_polynomial_model.hpp>
Public Types | |
using | ValueType = FloatType |
The value type. | |
using | IndexType = utility::IndexType |
The index type. | |
using | IndexHash = utility::IndexHash |
The hash for IndexType. | |
using | VariableType = std::int8_t |
The variable type, which here represents binary variables \( x_i\in \{0, 1\} \). | |
Public Member Functions | |
IsingPolynomialModel (std::vector< std::vector< IndexType > > &key_list, std::vector< ValueType > &value_list) | |
std::int32_t | GetDegree () const |
Get the degree of the polynomial interactions. | |
std::int32_t | GetSystemSize () const |
Get the system size. | |
const std::vector< IndexType > & | GetIndexList () const |
Get the index list of the polynomial interactions. | |
const std::unordered_map< IndexType, std::int32_t, IndexHash > & | GetIndexMap () const |
Get the mapping from the index to the integer. | |
const std::vector< std::pair< std::vector< std::int32_t >, ValueType > > & | GetKeyValueList () const |
Get the integer key and value list as pair. | |
const std::vector< std::vector< std::size_t > > & | GetAdjacencyList () const |
Get the adjacency list, which stored the integer index of the polynomial interaction specified by the site index. | |
ValueType | GetEstimatedMinEnergyDifference () const |
Get estimated minimum energy difference. | |
ValueType | GetEstimatedMaxEnergyDifference () const |
Get estimated maximum energy difference. | |
ValueType | CalculateEnergy (const std::vector< VariableType > &variables) const |
Calculate energy corresponding to the variable configuration. | |
Private Attributes | |
std::int32_t | degree_ = 0 |
The degree of the interactions. | |
std::int32_t | system_size_ = 0 |
The system size. | |
std::vector< IndexType > | index_list_ |
The index list of the interactions. | |
std::unordered_map< IndexType, std::int32_t, IndexHash > | index_map_ |
The mapping from the index to the integer. | |
std::vector< std::pair< std::vector< std::int32_t >, ValueType > > | key_value_list_ |
The integer key and value list as pair. | |
std::vector< std::vector< std::size_t > > | adjacency_list_ |
The adjacency list, which stored the integer index of the polynomial interaction specified by the site index. | |
ValueType | estimated_min_energy_difference_ = 0 |
The estimated minimum energy difference. | |
ValueType | estimated_max_energy_difference_ = 0 |
The estimated maximum energy difference. | |
const ValueType | min_max_energy_difference_ratio_ = 1e-08 |
The ratio of minimum and maximum energy difference set by 1e-08. | |
using openjij::graph::IsingPolynomialModel< FloatType >::IndexHash = utility::IndexHash |
The hash for IndexType.
using openjij::graph::IsingPolynomialModel< FloatType >::IndexType = utility::IndexType |
The index type.
using openjij::graph::IsingPolynomialModel< FloatType >::ValueType = FloatType |
The value type.
using openjij::graph::IsingPolynomialModel< FloatType >::VariableType = std::int8_t |
The variable type, which here represents binary variables \( x_i\in \{0, 1\} \).
|
inline |
References openjij::graph::IsingPolynomialModel< FloatType >::adjacency_list_, openjij::graph::IsingPolynomialModel< FloatType >::degree_, openjij::graph::IsingPolynomialModel< FloatType >::estimated_max_energy_difference_, openjij::graph::IsingPolynomialModel< FloatType >::estimated_min_energy_difference_, openjij::graph::IsingPolynomialModel< FloatType >::index_list_, openjij::graph::IsingPolynomialModel< FloatType >::index_map_, openjij::graph::json_parse(), openjij::graph::IsingPolynomialModel< FloatType >::key_value_list_, openjij::graph::IsingPolynomialModel< FloatType >::min_max_energy_difference_ratio_, and openjij::graph::IsingPolynomialModel< FloatType >::system_size_.
|
inline |
Calculate energy corresponding to the variable configuration.
variables | The variable configuration. |
References openjij::graph::json_parse(), openjij::graph::IsingPolynomialModel< FloatType >::key_value_list_, and openjij::graph::IsingPolynomialModel< FloatType >::system_size_.
|
inline |
Get the adjacency list, which stored the integer index of the polynomial interaction specified by the site index.
References openjij::graph::IsingPolynomialModel< FloatType >::adjacency_list_.
|
inline |
Get the degree of the polynomial interactions.
References openjij::graph::IsingPolynomialModel< FloatType >::degree_.
|
inline |
Get estimated maximum energy difference.
References openjij::graph::IsingPolynomialModel< FloatType >::estimated_max_energy_difference_.
|
inline |
Get estimated minimum energy difference.
References openjij::graph::IsingPolynomialModel< FloatType >::estimated_min_energy_difference_.
|
inline |
Get the index list of the polynomial interactions.
References openjij::graph::IsingPolynomialModel< FloatType >::index_list_.
|
inline |
Get the mapping from the index to the integer.
References openjij::graph::IsingPolynomialModel< FloatType >::index_map_.
|
inline |
Get the integer key and value list as pair.
References openjij::graph::IsingPolynomialModel< FloatType >::key_value_list_.
|
inline |
Get the system size.
References openjij::graph::IsingPolynomialModel< FloatType >::index_list_.
|
private |
The adjacency list, which stored the integer index of the polynomial interaction specified by the site index.
Referenced by openjij::graph::IsingPolynomialModel< FloatType >::GetAdjacencyList(), and openjij::graph::IsingPolynomialModel< FloatType >::IsingPolynomialModel().
|
private |
The degree of the interactions.
Referenced by openjij::graph::IsingPolynomialModel< FloatType >::GetDegree(), and openjij::graph::IsingPolynomialModel< FloatType >::IsingPolynomialModel().
|
private |
The estimated maximum energy difference.
Referenced by openjij::graph::IsingPolynomialModel< FloatType >::GetEstimatedMaxEnergyDifference(), and openjij::graph::IsingPolynomialModel< FloatType >::IsingPolynomialModel().
|
private |
The estimated minimum energy difference.
Referenced by openjij::graph::IsingPolynomialModel< FloatType >::GetEstimatedMinEnergyDifference(), and openjij::graph::IsingPolynomialModel< FloatType >::IsingPolynomialModel().
|
private |
The index list of the interactions.
Referenced by openjij::graph::IsingPolynomialModel< FloatType >::GetIndexList(), openjij::graph::IsingPolynomialModel< FloatType >::GetSystemSize(), and openjij::graph::IsingPolynomialModel< FloatType >::IsingPolynomialModel().
|
private |
The mapping from the index to the integer.
Referenced by openjij::graph::IsingPolynomialModel< FloatType >::GetIndexMap(), and openjij::graph::IsingPolynomialModel< FloatType >::IsingPolynomialModel().
|
private |
The integer key and value list as pair.
Referenced by openjij::graph::IsingPolynomialModel< FloatType >::CalculateEnergy(), openjij::graph::IsingPolynomialModel< FloatType >::GetKeyValueList(), and openjij::graph::IsingPolynomialModel< FloatType >::IsingPolynomialModel().
|
private |
The ratio of minimum and maximum energy difference set by 1e-08.
\[ {\rm ratio} = \frac{\Delat E_{{\rm min}}}{\Delat E_{{\rm max}}}\]
Referenced by openjij::graph::IsingPolynomialModel< FloatType >::IsingPolynomialModel().
|
private |
The system size.
Referenced by openjij::graph::IsingPolynomialModel< FloatType >::CalculateEnergy(), and openjij::graph::IsingPolynomialModel< FloatType >::IsingPolynomialModel().