> ## Documentation Index
> Fetch the complete documentation index at: https://docs.haiqu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Postprocess Skqd

> Submit an SKQD postprocessing job (async worker).

Creates an SKQDJob in the database and dispatches it to a background worker
for SQD diagonalization. The heavy computation runs asynchronously so the
user's CPU is never blocked.

Args:
    user (User): User authenticated with api key.
    data (SKQDSubmitModel): SKQD job arguments (Hamiltonian tensors, results, params).
    db: Database.

Returns:
    SKQDJobModel: The new job object. Poll with GET /jobs/{id} for status.



## OpenAPI

````yaml https://api.haiqu.ai/openapi.json post /postprocess_skqd
openapi: 3.1.0
info:
  title: Haiqu API
  summary: Haiqu RESTful API service.
  description: Cloud service providing the access to Haiqu cloud runtime
  contact:
    name: Haiqu Inc.
    url: https://haiqu.ai/
    email: info@haiqu.ai
  version: 1.4.0
servers: []
security: []
paths:
  /postprocess_skqd:
    post:
      summary: Postprocess Skqd
      description: >-
        Submit an SKQD postprocessing job (async worker).


        Creates an SKQDJob in the database and dispatches it to a background
        worker

        for SQD diagonalization. The heavy computation runs asynchronously so
        the

        user's CPU is never blocked.


        Args:
            user (User): User authenticated with api key.
            data (SKQDSubmitModel): SKQD job arguments (Hamiltonian tensors, results, params).
            db: Database.

        Returns:
            SKQDJobModel: The new job object. Poll with GET /jobs/{id} for status.
      operationId: postprocess_skqd_postprocess_skqd_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SKQDSubmitModel'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SKQDJobModel'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyQuery: []
        - APIKeyHeader: []
components:
  schemas:
    SKQDSubmitModel:
      properties:
        experiment_id:
          type: string
          title: Experiment Id
        name:
          type: string
          title: Name
          default: SKQD Postprocessing
        h1e:
          items:
            items:
              type: number
            type: array
          type: array
          title: H1E
        h2e:
          items:
            items:
              items:
                items:
                  type: number
                type: array
              type: array
            type: array
          type: array
          title: H2E
        results:
          items:
            additionalProperties:
              type: number
            type: object
          type: array
          title: Results
        num_shots:
          type: integer
          title: Num Shots
        norb:
          type: integer
          title: Norb
        nelec:
          prefixItems:
            - type: integer
            - type: integer
          type: array
          maxItems: 2
          minItems: 2
          title: Nelec
        params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Params
      type: object
      required:
        - experiment_id
        - h1e
        - h2e
        - results
        - num_shots
        - norb
        - nelec
      title: SKQDSubmitModel
      description: Data model for SKQD postprocessing job submission.
    SKQDJobModel:
      properties:
        id:
          type: string
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        user_id:
          type: integer
          title: User Id
        experiment_id:
          type: string
          title: Experiment Id
        status:
          $ref: '#/components/schemas/JobStatus'
        job_type:
          $ref: '#/components/schemas/JobType'
        device_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Device Id
          default: Haiqu OS
        creation_date:
          type: string
          format: date-time
          title: Creation Date
        run_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Run Date
        finish_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finish Date
        logs:
          anyOf:
            - type: string
            - type: 'null'
          title: Logs
        quality:
          anyOf:
            - type: number
            - type: 'null'
          title: Quality
        info:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Info
        time:
          anyOf:
            - type: number
            - type: 'null'
          title: Time
        parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - items: {}
              type: array
            - type: 'null'
          title: Parameters
        h1e:
          anyOf:
            - items:
                items:
                  type: number
                type: array
              type: array
            - type: 'null'
          title: H1E
        h2e:
          anyOf:
            - items:
                items:
                  items:
                    items:
                      type: number
                    type: array
                  type: array
                type: array
              type: array
            - type: 'null'
          title: H2E
        results:
          anyOf:
            - items:
                additionalProperties:
                  type: number
                type: object
              type: array
            - type: 'null'
          title: Results
        num_shots:
          anyOf:
            - type: integer
            - type: 'null'
          title: Num Shots
        norb:
          anyOf:
            - type: integer
            - type: 'null'
          title: Norb
        nelec:
          anyOf:
            - prefixItems:
                - type: integer
                - type: integer
              type: array
              maxItems: 2
              minItems: 2
            - type: 'null'
          title: Nelec
        params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Params
      type: object
      required:
        - id
        - user_id
        - experiment_id
        - status
        - job_type
        - creation_date
      title: SKQDJobModel
      description: |-
        Job model for SKQD postprocessing jobs.

        Output data (energy, subspace_dimension, iteration_history) is stored
        in the inherited ``info`` dict so that adding or removing output fields
        does not require a database migration.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    JobStatus:
      type: string
      enum:
        - Submitted
        - Initializing
        - Queued
        - Validating
        - Running
        - Cancelled
        - Done
        - Error
      title: JobStatus
      description: Class for job status.
    JobType:
      type: string
      enum:
        - User local job
        - Analytics
        - Device specific analytics
        - Data Loading
        - Hybrid
        - Run
        - State Compression
        - Transpilation
        - Variational
        - Pretraining
        - SKQD
      title: JobType
      description: Class for job types.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyQuery:
      type: apiKey
      in: query
      name: HAIQU_API_KEY
    APIKeyHeader:
      type: apiKey
      in: header
      name: authorization

````