{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mahastrategies-com/json-schema/mahastrategies-com-tensor-network-job-request-schema.json",
  "title": "TensorNetworkJobRequest",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mahastrategies-com-openapi.json#/components/schemas/TensorNetworkJobRequest",
  "type": "object",
  "required": [
    "clientRequestId",
    "problem"
  ],
  "additionalProperties": false,
  "properties": {
    "clientRequestId": {
      "type": "string",
      "minLength": 8,
      "maxLength": 120
    },
    "problem": {
      "type": "object",
      "required": [
        "formulation",
        "size",
        "terms"
      ],
      "additionalProperties": false,
      "properties": {
        "formulation": {
          "type": "string",
          "enum": [
            "qubo",
            "ising"
          ]
        },
        "size": {
          "type": "integer",
          "minimum": 1,
          "maximum": 256
        },
        "terms": {
          "type": "array",
          "minItems": 1,
          "maxItems": 32896,
          "items": {
            "$ref": "#/$defs/QuboTerm"
          }
        }
      }
    },
    "solver": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "bondDimension": {
          "type": "integer",
          "minimum": 2,
          "maximum": 4096,
          "default": 256
        },
        "exactThreshold": {
          "type": "integer",
          "minimum": 0,
          "maximum": 18,
          "default": 18
        }
      }
    },
    "target": {
      "type": "string",
      "const": "gpu",
      "default": "gpu"
    },
    "timeoutSeconds": {
      "type": "integer",
      "minimum": 1,
      "maximum": 600,
      "default": 120
    }
  },
  "$defs": {
    "QuboTerm": {
      "type": "object",
      "required": [
        "i",
        "j",
        "value"
      ],
      "additionalProperties": false,
      "properties": {
        "i": {
          "type": "integer",
          "minimum": 0,
          "maximum": 255
        },
        "j": {
          "type": "integer",
          "minimum": 0,
          "maximum": 255
        },
        "value": {
          "type": "number"
        }
      }
    }
  }
}