The Compiler

Work in progress

We hope to write this part of the documentation soon. Please come back later!

Compilation Steps

Setup

ToQUBO.Compiler.reset! — Function
reset!(model::Virtual.Model, arch::AbstractArchitecture)

Discard generated target variables, mappings, applied penalties, backend caches and compilation/feasibility status, and empty the attached child optimizer and its results. Preserve the source model and persistent compiler, variable, constraint and optimizer settings, including penalties updated by refinement. Compilation invokes this reset before rebuilding generated state.

source

Parsing

ToQUBO.Compiler.parse! — Function
parse!(
    model::Virtual.Model{T},
    g::PBO.PBF{VI,T},
    f::MOI.AbstractFunction,
    arch::AbstractArchitecture
) where {T}

Parses the given MOI function f into PBF g.

source

Reformulation

ToQUBO.Compiler.sense! — Function
sense!(model::Virtual.Model, ::AbstractArchitecture)

Copies MOI.ObjectiveSense from model.source_model to model.target_model.

source

Copying

ToQUBO.Compiler.isqubo — Function
isqubo(model::MOI.ModelLike)

Tells if a given model is ready to be interpreted as a QUBO model.

For it to be true, a few conditions must be met:

  1. All variables must be binary (MOI.VariableIndex ∈ MOI.ZeroOne)
  2. No other constraints are allowed
  3. The objective function must be of type MOI.ScalarQuadraticFunction, MOI.ScalarAffineFunction or MOI.VariableIndex
  4. The objective sense must be either MOI.MIN_SENSE or MOI.MAX_SENSE
source

Hamiltonian Assembly