| Copyright | (c) Masahiro Sakai 2018 | 
|---|---|
| License | BSD-style | 
| Maintainer | masahiro.sakai@gmail.com | 
| Stability | provisional | 
| Portability | non-portable | 
| Safe Haskell | Safe-Inferred | 
| Language | Haskell2010 | 
| Extensions | 
 | 
ToySolver.QUBO
Description
Synopsis
- data Problem a = Problem {- quboNumVars :: !Int
- quboMatrix :: IntMap (IntMap a)
 
- type Solution = UArray Int Bool
- eval :: Num a => Solution -> Problem a -> a
- data IsingModel a = IsingModel {- isingNumVars :: !Int
- isingInteraction :: IntMap (IntMap a)
- isingExternalMagneticField :: IntMap a
 
- evalIsingModel :: Num a => Solution -> IsingModel a -> a
QUBO (quadratic unconstrained boolean optimization)
QUBO (quadratic unconstrained boolean optimization) problem.
Minimize \(\sum_{i\le j} Q_{i,j} x_i x_j\) where \(x_i \in \{0,1\}\) for \(i \in \{0 \ldots N-1\}\).
In the Solution type. 0 and 1 are represented as False and True respectively.
Constructors
| Problem | |
| Fields 
 | |
Ising Model
data IsingModel a Source #
Ising model.
Minimize \(\sum_{i<j} J_{i,j} \sigma_i \sigma_j + \sum_i h_i \sigma_i\) where \(\sigma_i \in \{-1,+1\}\) for \(i \in \{0 \ldots N-1\}\).
In the Solution type. -1 and +1 are represented as False and True respectively.
Constructors
| IsingModel | |
| Fields 
 | |
Instances
| Show a => Show (IsingModel a) Source # | |
| Defined in ToySolver.QUBO Methods showsPrec :: Int -> IsingModel a -> ShowS # show :: IsingModel a -> String # showList :: [IsingModel a] -> ShowS # | |
| Eq a => Eq (IsingModel a) Source # | |
| Defined in ToySolver.QUBO | |
evalIsingModel :: Num a => Solution -> IsingModel a -> a Source #