openjij
Framework for the Ising model and QUBO.
Loading...
Searching...
No Matches
openjij::graph Namespace Reference

Classes

class  BinaryPolynomialModel
 
class  Chimera
 chimera lattice graph More...
 
class  CSRSparse
 CSRSparse graph: just store CSR Sparse Matrix (Eigen::Sparse) The Hamiltonian is like. More...
 
class  Dense
 two-body all-to-all interactions The Hamiltonian is like More...
 
class  Graph
 Abstract graph class. More...
 
class  IsingPolynomialModel
 
class  Polynomial
 Polynomial graph class, which can treat many-body interactions. More...
 
class  Sparse
 Sparse graph: two-body intereactions with O(1) connectivity The Hamiltonian is like. More...
 
class  Square
 square lattice graph More...
 

Typedefs

using ChimeraIndex = std::tuple< std::size_t, std::size_t, std::size_t >
 Chimera index (row, column, in-chimera) The structure of in-chimera is as follows in-chimera index.
 
using Spin = int
 
using Spins = std::vector< Spin >
 
using Binary = int
 
using Binaries = std::vector< Binary >
 
using Index = std::size_t
 
using Nodes = std::vector< Index >
 
using json = nlohmann::json
 
using RowColumn = std::pair< std::size_t, std::size_t >
 Row x Column type.
 

Enumerations

enum class  ChimeraDir {
  PLUS_R , MINUS_R , PLUS_C , MINUS_C ,
  IN_0or4 , IN_1or5 , IN_2or6 , IN_3or7
}
 direction in chimera graph More...
 
enum class  Dir { PLUS_R , MINUS_R , PLUS_C , MINUS_C }
 direction enum class More...
 

Functions

template<typename FloatType , typename CimodDataType >
auto json_parse (const json &obj, bool relabel=true)
 parse json object from bqm.to_serializable
 
template<typename FloatType >
auto json_parse_polynomial (const nlohmann::json &obj, const bool relabel=true)
 

Typedef Documentation

◆ Binaries

◆ Binary

◆ ChimeraIndex

using openjij::graph::ChimeraIndex = typedef std::tuple<std::size_t, std::size_t, std::size_t>

Chimera index (row, column, in-chimera) The structure of in-chimera is as follows in-chimera index.

 0 - 4
   x
 1 - 5
   x
 2 - 6
   x
 3 - 7

◆ Index

◆ json

◆ Nodes

◆ RowColumn

using openjij::graph::RowColumn = typedef std::pair<std::size_t, std::size_t>

Row x Column type.

◆ Spin

◆ Spins

Enumeration Type Documentation

◆ ChimeraDir

direction in chimera graph

Enumerator
PLUS_R 

plus-row direction: (r, c, ind) -> (r+1, c, ind)

MINUS_R 

minus-row direction: (r, c, ind) -> (r-1, c, ind)

PLUS_C 

plus-column direction: (r, c, ind) -> (r, c+1, ind)

MINUS_C 

minus-column direction: (r, c, ind) -> (r, c-1, ind)

IN_0or4 

inside-chimera 0or4 direction: (r, c, ind) -> (r, c, 0or4)

IN_1or5 

inside-chimera 1or5 direction: (r, c, ind) -> (r, c, 1or5)

IN_2or6 

inside-chimera 2or6 direction: (r, c, ind) -> (r, c, 2or6)

IN_3or7 

inside-chimera 3or7 direction: (r, c, ind) -> (r, c, 3or7)

◆ Dir

direction enum class

Enumerator
PLUS_R 

plus-row direction: (r, c) -> (r+1, c)

MINUS_R 

minus-row direction: (r, c) -> (r-1, c)

PLUS_C 

plus-column direction: (r, c) -> (r, c+1)

MINUS_C 

minux-column direction: (r, c) -> (r, c-1)

Function Documentation

◆ json_parse()

template<typename FloatType , typename CimodDataType >
auto openjij::graph::json_parse ( const json obj,
bool  relabel = true 
)
inline

parse json object from bqm.to_serializable

Template Parameters
FloatType
CimodDataTypeDataType of cimod (cimod::Dense, cimod::Sparse, or cimod::Dict)
Parameters
objJSON object
relabelre-label variable_labels. Disable the option if the model has specified topology (such as square lattice or chimera model). if the option is disabled, IndexType of JSON must be an integer.
Returns
BinaryQuadraticModel with IndexType=size_t

References json_parse().

Referenced by openjij::graph::Square< FloatType >::_checkpair(), openjij::graph::Sparse< FloatType >::adj_nodes(), openjij::graph::CSRSparse< FloatType >::calc_energy(), openjij::graph::Dense< FloatType >::calc_energy(), openjij::graph::Sparse< FloatType >::calc_energy(), openjij::graph::Polynomial< FloatType >::calc_energy(), openjij::graph::IsingPolynomialModel< FloatType >::CalculateEnergy(), openjij::graph::Polynomial< FloatType >::CheckKeyValid(), openjij::graph::Chimera< FloatType >::Chimera(), openjij::system::ClassicalIsingPolynomial< graph::Polynomial< FloatType > >::ClassicalIsingPolynomial(), openjij::graph::CSRSparse< FloatType >::CSRSparse(), openjij::declare_Chimera(), openjij::declare_Dense(), openjij::declare_Polynomial(), openjij::declare_Sparse(), openjij::declare_Square(), openjij::graph::Dense< FloatType >::Dense(), openjij::graph::CSRSparse< FloatType >::energy(), openjij::graph::Dense< FloatType >::energy(), openjij::graph::Sparse< FloatType >::energy(), openjij::graph::CSRSparse< FloatType >::energy(), openjij::graph::Dense< FloatType >::energy(), openjij::graph::Sparse< FloatType >::energy(), openjij::graph::Polynomial< FloatType >::energy(), openjij::graph::Graph::gen_binary(), openjij::graph::Graph::gen_spin(), openjij::graph::CSRSparse< FloatType >::get_interactions(), openjij::graph::Dense< FloatType >::get_interactions(), openjij::graph::Polynomial< FloatType >::get_polynomial(), openjij::graph::Dense< FloatType >::h(), openjij::graph::Sparse< FloatType >::h(), openjij::graph::Dense< FloatType >::h(), openjij::graph::Sparse< FloatType >::h(), openjij::graph::Square< FloatType >::h(), openjij::graph::Square< FloatType >::h(), openjij::graph::Chimera< FloatType >::h(), openjij::graph::Chimera< FloatType >::h(), openjij::graph::IsingPolynomialModel< FloatType >::IsingPolynomialModel(), openjij::graph::Polynomial< FloatType >::J(), openjij::graph::Polynomial< FloatType >::J(), openjij::graph::Polynomial< FloatType >::J(), openjij::graph::Polynomial< FloatType >::J(), openjij::graph::Dense< FloatType >::J(), openjij::graph::Sparse< FloatType >::J(), openjij::graph::Dense< FloatType >::J(), openjij::graph::Sparse< FloatType >::J(), openjij::graph::Square< FloatType >::J(), openjij::graph::Square< FloatType >::J(), openjij::graph::Chimera< FloatType >::J(), openjij::graph::Chimera< FloatType >::J(), openjij::graph::Polynomial< FloatType >::J(), openjij::graph::Polynomial< FloatType >::J(), json_parse(), json_parse_polynomial(), openjij::system::KLocalPolynomial< graph::Polynomial< FloatType > >::KLocalPolynomial(), openjij::graph::Polynomial< FloatType >::Polynomial(), openjij::graph::Sparse< FloatType >::set_adj_node(), openjij::graph::Dense< FloatType >::set_interaction_matrix(), openjij::graph::Sparse< FloatType >::Sparse(), openjij::graph::Square< FloatType >::spin(), openjij::graph::Chimera< FloatType >::spin(), openjij::graph::Square< FloatType >::spin(), openjij::graph::Chimera< FloatType >::spin(), openjij::graph::Square< FloatType >::Square(), openjij::graph::Square< FloatType >::Square(), openjij::graph::Square< FloatType >::to_ind(), and openjij::graph::Square< FloatType >::to_rc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ json_parse_polynomial()

template<typename FloatType >
auto openjij::graph::json_parse_polynomial ( const nlohmann::json &  obj,
const bool  relabel = true 
)
inline

References json_parse().

Here is the call graph for this function: