> ## 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.

# Get Circuit Metrics Evolution

> Get the ordered analytics snapshots recorded for a circuit.

Use this tool to show how metrics such as depth, two-qubit gate count, and
qubit count changed across successive transformations of a circuit, for
example original to transpiled to compressed.

When to Use:
    - Call this when the caller asks how a circuit improved or degraded
      through transpilation or compression.
    - Call this after ``compute_circuit_analytics`` with
      ``analytics_type='evolution'`` has recorded a snapshot.

Constraints:
    - An empty list is a valid result and means no evolution snapshots have
      been recorded for this circuit yet.
    - Snapshots are stored per circuit, so compare against the parent
      circuit ID rather than expecting cross-circuit history here.

Notes:
    - For agent-facing output, report the first and last snapshot plus the
      delta on the metrics the caller cares about instead of every entry.

Args:
    circuit_id: Circuit identifier from a prior MCP response.
    user: Authenticated user resolved from the API key.
    db: Active database session.

Returns:
    Analytics snapshots in recorded order, oldest first.

Raises:
    HTTPException: Raised with ``404`` when the circuit or its experiment is
        not available to the caller.



## OpenAPI

````yaml https://api.haiqu.ai/openapi.json get /ai/circuit/{circuit_id}/metrics_evolution
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.5.0
servers: []
security: []
paths:
  /ai/circuit/{circuit_id}/metrics_evolution:
    get:
      summary: Get Circuit Metrics Evolution
      description: >-
        Get the ordered analytics snapshots recorded for a circuit.


        Use this tool to show how metrics such as depth, two-qubit gate count,
        and

        qubit count changed across successive transformations of a circuit, for

        example original to transpiled to compressed.


        When to Use:
            - Call this when the caller asks how a circuit improved or degraded
              through transpilation or compression.
            - Call this after ``compute_circuit_analytics`` with
              ``analytics_type='evolution'`` has recorded a snapshot.

        Constraints:
            - An empty list is a valid result and means no evolution snapshots have
              been recorded for this circuit yet.
            - Snapshots are stored per circuit, so compare against the parent
              circuit ID rather than expecting cross-circuit history here.

        Notes:
            - For agent-facing output, report the first and last snapshot plus the
              delta on the metrics the caller cares about instead of every entry.

        Args:
            circuit_id: Circuit identifier from a prior MCP response.
            user: Authenticated user resolved from the API key.
            db: Active database session.

        Returns:
            Analytics snapshots in recorded order, oldest first.

        Raises:
            HTTPException: Raised with ``404`` when the circuit or its experiment is
                not available to the caller.
      operationId: get_circuit_metrics_evolution
      parameters:
        - name: circuit_id
          in: path
          required: true
          schema:
            type: string
            title: Circuit Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CircuitAnalyticsModel'
                title: Response Get Circuit Metrics Evolution
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyQuery: []
        - APIKeyHeader: []
components:
  schemas:
    CircuitAnalyticsModel:
      properties:
        qubits:
          type: integer
          minimum: 1
          title: Qubits
          description: Number of qubits (must be >= 1)
        num_qubits_active:
          anyOf:
            - type: integer
            - type: 'null'
          title: Num Qubits Active
        num_parameters:
          anyOf:
            - type: integer
            - type: 'null'
          title: Num Parameters
        depth:
          type: integer
          title: Depth
        depth_2q:
          type: integer
          title: Depth 2Q
        gates_1q:
          type: integer
          title: Gates 1Q
        gates_2q:
          type: integer
          title: Gates 2Q
        other_gates:
          anyOf:
            - type: integer
            - type: 'null'
          title: Other Gates
        gates_total:
          type: integer
          title: Gates Total
        other_ops:
          type: integer
          title: Other Ops
        instructions_total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Instructions Total
        operations_counts:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Operations Counts
        gate_size_distribution:
          anyOf:
            - additionalProperties:
                type: number
              type: object
            - type: 'null'
          title: Gate Size Distribution
        gate_diversity:
          anyOf:
            - additionalProperties:
                type: number
              type: object
            - type: 'null'
          title: Gate Diversity
        gate_diversity_basis_gates:
          anyOf:
            - additionalProperties:
                type: number
              type: object
            - type: 'null'
          title: Gate Diversity Basis Gates
        gate_count_distribution:
          anyOf:
            - additionalProperties:
                type: integer
              type: object
            - type: 'null'
          title: Gate Count Distribution
        program_communication:
          anyOf:
            - type: number
            - type: string
            - type: 'null'
          title: Program Communication
          default: N/A
        critical_depth:
          anyOf:
            - type: number
            - type: string
            - type: 'null'
          title: Critical Depth
          default: N/A
        entanglement_ratio:
          anyOf:
            - type: number
            - type: string
            - type: 'null'
          title: Entanglement Ratio
          default: N/A
        parallelism:
          anyOf:
            - type: number
            - type: string
            - type: 'null'
          title: Parallelism
          default: N/A
        liveness_per_qubit:
          anyOf:
            - items: {}
              type: array
            - type: string
            - type: 'null'
          title: Liveness Per Qubit
          default: N/A
        liveness:
          anyOf:
            - type: number
            - type: string
            - type: 'null'
          title: Liveness
          default: N/A
        correlation_matrix:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Correlation Matrix
        kl_divergence:
          anyOf:
            - type: number
            - type: string
            - type: 'null'
          title: Kl Divergence
          default: N/A
        entanglement_capability:
          anyOf:
            - type: number
            - type: string
            - type: 'null'
          title: Entanglement Capability
          default: N/A
        expressibility:
          anyOf:
            - type: number
            - type: string
            - type: 'null'
          title: Expressibility
          default: N/A
        quantum_fisher_information_matrix:
          anyOf:
            - items: {}
              type: array
            - type: string
            - type: 'null'
          title: Quantum Fisher Information Matrix
          default: N/A
        circuit_normalized:
          anyOf:
            - type: string
            - type: 'null'
          title: Circuit Normalized
      type: object
      required:
        - qubits
        - depth
        - depth_2q
        - gates_1q
        - gates_2q
        - gates_total
        - other_ops
      title: CircuitAnalyticsModel
      description: Data model for circuit metrics.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````