{
  "schemaVersion": 1,
  "slug": "matrix-multiply-calculator",
  "category": "math",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "4bd648ea8f7582b9e6bfb9eb441b0ed5007e3d0cedc95ec263b19e2079e4f126",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/matrix-multiply-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "C = A × B; det(C) = c11 × c22 − c12 × c21; det(A) = a11 × a22 − a12 × a21",
    "vars": [
      [
        "cᵢⱼ",
        "element of product C"
      ],
      [
        "aᵢₖ",
        "element of A"
      ],
      [
        "bₖⱼ",
        "element of B"
      ],
      [
        "C",
        "C = A × B (2×2)"
      ],
      [
        "det(AB)",
        "determinant of the product matrix"
      ]
    ],
    "note": "Standard 2×2 matrix product; k runs 1–2. Determinants of A and B are ad − bc for each input matrix."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const c11=a11*b11+a12*b21,c12=a11*b12+a12*b22,c21=a21*b11+a22*b21,c22=a21*b12+a22*b22;return{c11,c12,c21,c22,determinantProduct:c11*c22-c12*c21,determinantA:a11*a22-a12*a21,determinantB:b11*b22-b12*b21};",
    "inputs": [
      {
        "name": "a11",
        "type": "number",
        "default": 1,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "a12",
        "type": "number",
        "default": 2,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "a21",
        "type": "number",
        "default": 3,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "a22",
        "type": "number",
        "default": 4,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "b11",
        "type": "number",
        "default": 5,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "b12",
        "type": "number",
        "default": 6,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "b21",
        "type": "number",
        "default": 7,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "b22",
        "type": "number",
        "default": 8,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      }
    ],
    "outputs": [
      {
        "name": "c11",
        "precision": 4,
        "unit": ""
      },
      {
        "name": "c12",
        "precision": 4,
        "unit": ""
      },
      {
        "name": "c21",
        "precision": 4,
        "unit": ""
      },
      {
        "name": "c22",
        "precision": 4,
        "unit": ""
      },
      {
        "name": "determinantA",
        "precision": 4,
        "unit": ""
      },
      {
        "name": "determinantB",
        "precision": 4,
        "unit": ""
      },
      {
        "name": "determinantProduct",
        "precision": 4,
        "unit": ""
      }
    ],
    "interpret": null
  }
}
