openjij
Framework for the Ising model and QUBO.
Loading...
Searching...
No Matches
openjij::graph::IsingPolynomialModel< FloatType > Class Template Reference

#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.

Member Typedef Documentation

◆ IndexHash

The hash for IndexType.

◆ IndexType

The index type.

◆ ValueType

template<typename FloatType>
using openjij::graph::IsingPolynomialModel< FloatType >::ValueType = FloatType

The value type.

◆ VariableType

template<typename FloatType>
using openjij::graph::IsingPolynomialModel< FloatType >::VariableType = std::int8_t

The variable type, which here represents binary variables \( x_i\in \{0, 1\} \).

Constructor & Destructor Documentation

◆ IsingPolynomialModel()

template<typename FloatType>
openjij::graph::IsingPolynomialModel< FloatType >::IsingPolynomialModel ( std::vector< std::vector< IndexType > > & key_list,
std::vector< ValueType > & value_list )
inline

Member Function Documentation

◆ CalculateEnergy()

template<typename FloatType>
ValueType openjij::graph::IsingPolynomialModel< FloatType >::CalculateEnergy ( const std::vector< VariableType > & variables) const
inline

Calculate energy corresponding to the variable configuration.

Parameters
variablesThe variable configuration.
Returns
The energy.

References key_value_list_, and system_size_.

◆ GetAdjacencyList()

template<typename FloatType>
const std::vector< std::vector< std::size_t > > & openjij::graph::IsingPolynomialModel< FloatType >::GetAdjacencyList ( ) const
inline

Get the adjacency list, which stored the integer index of the polynomial interaction specified by the site index.

Returns
The adjacency list.

References adjacency_list_.

◆ GetDegree()

template<typename FloatType>
std::int32_t openjij::graph::IsingPolynomialModel< FloatType >::GetDegree ( ) const
inline

Get the degree of the polynomial interactions.

Returns
The degree.

References degree_.

◆ GetEstimatedMaxEnergyDifference()

template<typename FloatType>
ValueType openjij::graph::IsingPolynomialModel< FloatType >::GetEstimatedMaxEnergyDifference ( ) const
inline

Get estimated maximum energy difference.

Returns
The estimated maximum energy difference.

References estimated_max_energy_difference_.

◆ GetEstimatedMinEnergyDifference()

template<typename FloatType>
ValueType openjij::graph::IsingPolynomialModel< FloatType >::GetEstimatedMinEnergyDifference ( ) const
inline

Get estimated minimum energy difference.

Returns
The estimated minimum energy difference.

References estimated_min_energy_difference_.

◆ GetIndexList()

template<typename FloatType>
const std::vector< IndexType > & openjij::graph::IsingPolynomialModel< FloatType >::GetIndexList ( ) const
inline

Get the index list of the polynomial interactions.

Returns
The index list.

References index_list_.

◆ GetIndexMap()

template<typename FloatType>
const std::unordered_map< IndexType, std::int32_t, IndexHash > & openjij::graph::IsingPolynomialModel< FloatType >::GetIndexMap ( ) const
inline

Get the mapping from the index to the integer.

Returns
The index map.

References index_map_.

◆ GetKeyValueList()

template<typename FloatType>
const std::vector< std::pair< std::vector< std::int32_t >, ValueType > > & openjij::graph::IsingPolynomialModel< FloatType >::GetKeyValueList ( ) const
inline

Get the integer key and value list as pair.

Returns
The integer key and value list as pair.

References key_value_list_.

◆ GetSystemSize()

template<typename FloatType>
std::int32_t openjij::graph::IsingPolynomialModel< FloatType >::GetSystemSize ( ) const
inline

Get the system size.

Returns
The system size.

References index_list_.

Member Data Documentation

◆ adjacency_list_

template<typename FloatType>
std::vector<std::vector<std::size_t> > openjij::graph::IsingPolynomialModel< FloatType >::adjacency_list_
private

The adjacency list, which stored the integer index of the polynomial interaction specified by the site index.

Referenced by GetAdjacencyList(), and IsingPolynomialModel().

◆ degree_

template<typename FloatType>
std::int32_t openjij::graph::IsingPolynomialModel< FloatType >::degree_ = 0
private

The degree of the interactions.

Referenced by GetDegree(), and IsingPolynomialModel().

◆ estimated_max_energy_difference_

template<typename FloatType>
ValueType openjij::graph::IsingPolynomialModel< FloatType >::estimated_max_energy_difference_ = 0
private

The estimated maximum energy difference.

Referenced by GetEstimatedMaxEnergyDifference(), and IsingPolynomialModel().

◆ estimated_min_energy_difference_

template<typename FloatType>
ValueType openjij::graph::IsingPolynomialModel< FloatType >::estimated_min_energy_difference_ = 0
private

The estimated minimum energy difference.

Referenced by GetEstimatedMinEnergyDifference(), and IsingPolynomialModel().

◆ index_list_

template<typename FloatType>
std::vector<IndexType> openjij::graph::IsingPolynomialModel< FloatType >::index_list_
private

The index list of the interactions.

Referenced by GetIndexList(), GetSystemSize(), and IsingPolynomialModel().

◆ index_map_

template<typename FloatType>
std::unordered_map<IndexType, std::int32_t, IndexHash> openjij::graph::IsingPolynomialModel< FloatType >::index_map_
private

The mapping from the index to the integer.

Referenced by GetIndexMap(), and IsingPolynomialModel().

◆ key_value_list_

template<typename FloatType>
std::vector<std::pair<std::vector<std::int32_t>, ValueType> > openjij::graph::IsingPolynomialModel< FloatType >::key_value_list_
private

The integer key and value list as pair.

Referenced by CalculateEnergy(), GetKeyValueList(), and IsingPolynomialModel().

◆ min_max_energy_difference_ratio_

template<typename FloatType>
const ValueType openjij::graph::IsingPolynomialModel< FloatType >::min_max_energy_difference_ratio_ = 1e-08
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 IsingPolynomialModel().

◆ system_size_

template<typename FloatType>
std::int32_t openjij::graph::IsingPolynomialModel< FloatType >::system_size_ = 0
private

The system size.

Referenced by CalculateEnergy(), and IsingPolynomialModel().


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