|
openjij
Framework for the Ising model and QUBO.
|
two-body all-to-all interactions The Hamiltonian is like More...
#include <dense.hpp>


Public Types | |
| using | Interactions |
| interaction type (Eigen) The stored matrix has the following triangular form: | |
| using | value_type = FloatType |
| float type | |
Public Member Functions | |
| Dense (std::size_t num_spins) | |
| Dense constructor. | |
| Dense (const json &j) | |
| Dense constructor (from nlohmann::json). | |
| void | set_interaction_matrix (const Interactions &interaction) |
| set interaction matrix from Eigen Matrix. | |
| Dense (const Dense< FloatType > &)=default | |
| Dense copy constructor. | |
| Dense (Dense< FloatType > &&)=default | |
| Dense move constructor. | |
| FloatType | calc_energy (const Spins &spins) const |
| calculate total energy | |
| FloatType | calc_energy (const Eigen::Matrix< FloatType, Eigen::Dynamic, 1, Eigen::ColMajor > &spins) const |
| FloatType | energy (const Spins &spins) const |
| calculate total energy | |
| FloatType | energy (const Eigen::Matrix< FloatType, Eigen::Dynamic, 1, Eigen::ColMajor > &spins) const |
| FloatType & | J (Index i, Index j) |
| access J_{ij} | |
| const FloatType & | J (Index i, Index j) const |
| access J_{ij} | |
| FloatType & | h (Index i) |
| access h_{i} (local field) | |
| const FloatType & | h (Index i) const |
| access h_{i} (local field) | |
| const Interactions | get_interactions () const |
| get interactions (Eigen Matrix) | |
| Public Member Functions inherited from openjij::graph::Graph | |
| Graph (std::size_t num_spins) | |
| Graph constructor. | |
| template<typename RandomNumberEngine> | |
| const Spins | gen_spin (RandomNumberEngine &random_numder_engine) const |
| generate spins randomly. | |
| template<typename RandomNumberEngine> | |
| const Binaries | gen_binary (RandomNumberEngine &random_numder_engine) const |
| generate spins randomly. | |
| std::size_t | get_num_spins () const noexcept |
| get number of spins | |
| std::size_t | size () const noexcept |
| get number of spins | |
Private Attributes | |
| Interactions | _J |
| interactions | |
two-body all-to-all interactions The Hamiltonian is like
\[H = \sum_{i<j}J_{ij} \sigma_i \sigma_j + \sum_{i}h_{i} \sigma_i \]
| using openjij::graph::Dense< FloatType >::Interactions |
interaction type (Eigen) The stored matrix has the following triangular form:
\[\begin{pmatrix} J_{0,0} & J_{0,1} & \cdots & J_{0,N-1} & h_{0}\\ 0 & J_{1,1} & \cdots & J_{1,N-1} & h_{1}\\ \vdots & \vdots & \vdots & \vdots & \vdots \\ 0 & 0 & \cdots & J_{N-1,N-1} & h_{N-1}\\ 0 & 0 & \cdots & 0 & 1 \\ \end{pmatrix} \]
| using openjij::graph::Dense< FloatType >::value_type = FloatType |
float type
|
inlineexplicit |
|
inline |
Dense constructor (from nlohmann::json).
| j | JSON object this object must be a serialized object of dense BQM. |
References Dense(), and openjij::graph::json_parse().

|
default |
|
default |
|
inline |
|
inline |
calculate total energy
| spins |
References energy().
Referenced by openjij::declare_Dense().


|
inline |
References energy(), and openjij::graph::Graph::get_num_spins().

|
inline |
calculate total energy
| spins |
References _J, and openjij::graph::Graph::get_num_spins().
Referenced by calc_energy(), calc_energy(), and energy().


|
inline |
get interactions (Eigen Matrix)
The returned matrix has the following symmetric form:
\[\begin{pmatrix} J_{0,0} & J_{0,1} & \cdots & J_{0,N-1} & h_{0}\\ J_{0,1} & J_{1,1} & \cdots & J_{1,N-1} & h_{1}\\ \vdots & \vdots & \vdots & \vdots & \vdots \\ J_{0,N-1} & J_{N-1,1} & \cdots & J_{N-1,N-1} & h_{N-1}\\ h_{0} & h_{1} & \cdots & h_{N-1} & 1 \\ \end{pmatrix} \]
Referenced by openjij::declare_Dense().

|
inline |
access h_{i} (local field)
| i | Index i |
References openjij::graph::Graph::get_num_spins(), and J().
Referenced by openjij::declare_Dense().


|
inline |
access h_{i} (local field)
| i | Index i |
References openjij::graph::Graph::get_num_spins(), and J().

|
inline |
access J_{ij}
References _J, and openjij::graph::Graph::get_num_spins().
Referenced by openjij::declare_Dense(), h(), and h().


|
inline |
access J_{ij}
References _J, and openjij::graph::Graph::get_num_spins().

|
inline |
set interaction matrix from Eigen Matrix.
| interaction | Eigen matrix |
References _J, and openjij::graph::Graph::get_num_spins().
Referenced by openjij::declare_Dense().


|
private |
interactions
Referenced by Dense(), energy(), J(), J(), and set_interaction_matrix().