BQPJSON

Format

Generating BQPJSON Files

using QUBOTools

# Create a model
model = QUBOTools.Model{Int,Float64,Int}(
    Dict{Int,Float64}(1 => 0.0, 3 => 0.4, 5 => -4.4),
    Dict{Tuple{Int,Int},Float64}((1, 3) => -0.8, (1, 5) => 6.0);
    scale = 2.7,
    offset = 1.93,
    domain = :bool,
    metadata = Dict("id" => 2, "description" => "Simple QUBO Problem")
)

# Write to file
QUBOTools.write_model("output.bool.json", model)

Example Output

{
  "linear_terms": [
    {
      "id": 2,
      "coeff": 0.4
    },
    {
      "id": 3,
      "coeff": -4.4
    }
  ],
  "variable_domain": "boolean",
  "offset": 1.93,
  "id": 2,
  "variable_ids": [
    1,
    2,
    3
  ],
  "quadratic_terms": [
    {
      "id_head": 1,
      "coeff": -0.8,
      "id_tail": 2
    },
    {
      "id_head": 1,
      "coeff": 6.0,
      "id_tail": 3
    }
  ],
  "metadata": {},
  "scale": 2.7,
  "version": "1.0.0",
  "description": "Simple QUBO Problem"
}

References