{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://sidrichardsquantum.github.io/Quantum_Backend_Bench/schemas/internal-circuit.schema.json",
  "additionalProperties": false,
  "properties": {
    "bit_order": {
      "type": "string"
    },
    "classical_registers": {
      "additionalProperties": {
        "items": {
          "minimum": 0,
          "type": "integer"
        },
        "type": "array"
      },
      "type": "object"
    },
    "global_phase": {
      "type": "number"
    },
    "measurement_keys": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object"
    },
    "measurements": {
      "items": {
        "minimum": 0,
        "type": "integer"
      },
      "type": "array"
    },
    "n_qubits": {
      "minimum": 1,
      "type": "integer"
    },
    "noise": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "channel": {
            "enum": [
              "depolarizing",
              "bit_flip",
              "phase_flip",
              "amplitude_damping",
              "readout_error"
            ],
            "type": "string"
          },
          "probability": {
            "minimum": 0,
            "type": "number"
          },
          "targets": {
            "items": {
              "minimum": 0,
              "type": "integer"
            },
            "type": "array"
          }
        },
        "required": [
          "channel",
          "targets",
          "probability"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "operations": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "gate": {
            "enum": [
              "H",
              "X",
              "Y",
              "Z",
              "S",
              "T",
              "RX",
              "RY",
              "RZ",
              "CNOT",
              "CZ",
              "SWAP",
              "CPHASE",
              "SX",
              "P",
              "PHASE",
              "U",
              "CCX",
              "CRX",
              "CRY",
              "CRZ",
              "RESET",
              "BARRIER",
              "DELAY"
            ],
            "type": "string"
          },
          "params": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string"
                }
              ]
            },
            "type": "object"
          },
          "qubits": {
            "items": {
              "minimum": 0,
              "type": "integer"
            },
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "gate",
          "qubits"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "quantum_registers": {
      "additionalProperties": {
        "items": {
          "minimum": 0,
          "type": "integer"
        },
        "type": "array"
      },
      "type": "object"
    },
    "schema_version": {
      "const": "0.1"
    }
  },
  "required": [
    "schema_version",
    "n_qubits",
    "operations",
    "measurements"
  ],
  "title": "quantum-backend-bench internal-circuit",
  "type": "object"
}
