Skip to content
HALOWERK

Datenvertragswerk

exact hafnian pairing ledger

For one symmetric zero-diagonal matrix on n 0..4 vertices, given as all n*(n-1)/2 upper-triangle entries 0..2 in lexicographic pair order, computes the exact hafnian: the sum over all unordered perfect pairings of the product of the selected matrix entries. Returns every canonical pairing, aligned term_products, hafnian=sum(products) and nonzero_terms; zero-product terms stay in the ledger. For 4 vertices h=w01*w23+w02*w13+w03*w12.

POST https://datenvertrag.halowerk.com/v1/exact-hafnian-pairing-ledger

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
nSee schemaYes
weightsSee schemaYes
claimSee schemaYes
Show full input schema
{
  "type": "object",
  "properties": {
    "n": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 4
        },
        {
          "type": "null"
        }
      ]
    },
    "weights": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2
          },
          "minItems": 0,
          "maxItems": 6
        },
        {
          "type": "null"
        }
      ]
    },
    "claim": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "pairings": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3
                  },
                  "minItems": 2,
                  "maxItems": 2
                },
                "minItems": 0,
                "maxItems": 2
              },
              "minItems": 0,
              "maxItems": 3
            },
            "term_products": {
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 0,
                "maximum": 16
              },
              "minItems": 0,
              "maxItems": 3
            },
            "hafnian": {
              "type": "integer",
              "minimum": 0,
              "maximum": 32
            },
            "nonzero_terms": {
              "type": "integer",
              "minimum": 0,
              "maximum": 3
            }
          },
          "required": [
            "pairings",
            "term_products",
            "hafnian",
            "nonzero_terms"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "n",
    "weights",
    "claim"
  ],
  "additionalProperties": false
}

Open original schema

Published input example

{
  "n": 0,
  "weights": [],
  "claim": {
    "pairings": [
      []
    ],
    "term_products": [
      1
    ],
    "hafnian": 1,
    "nonzero_terms": 1
  }
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’