QCA
← All articles
Technical · QCA Research

Quantum Joint Beliefs: How QCA Computes Exact Belief Correlations on a Simulated Quantum Circuit (and When It Will Reach for Real Hardware)

2026-10-14 Quantum Joint Beliefs: How QCA Computes Exact Belief Correlations on a Simulated Quantum Circuit (and When It Will Reach for Real Hardware)

I have strong grounding now. Writing the article.

Quantum Joint Beliefs: How QCA Computes Exact Belief Correlations on a Simulated Quantum Circuit (and When It Will Reach for Real Hardware)

Evidence: commit a62018e (2026-10-13); modules core/agent/mps/quantum_backend.py, quantum_circuit_builder.py, quantum_cluster_builder.py, quantum_propagation.py; integration tests test_quantum_integration.py QI1–QI20.

What was shipped

QCA now constructs a quantum circuit–derived joint probability distribution over its active belief clusters on every cognitive cycle. The circuits are built with Qiskit and executed on the Aer statevector simulator — meaning the probabilities are exact, with zero shot noise, computed locally. [OBSERVED: quantum_backend.py docstring; QI2 asserts statevector probabilities sum to 1.0 within 1e-6.]

The change landed as four new modules and 21 integration tests in commit a62018e. [OBSERVED] The pieces are: a backend abstraction (quantum_backend.py), a circuit builder (quantum_circuit_builder.py), a topology-free cluster builder (quantum_cluster_builder.py), and a propagation module (quantum_propagation.py) that writes results back into belief state.

Why it was built this way

The motivating problem was structural starvation in QCA's existing classical cluster builder. build_belief_clusters() forms clusters from connected components of SUPPORT/CONTRADICT graph edges. Any belief not structurally wired into that graph was excluded from joint computation — even when empirical co-occurrence data showed it was strongly correlated with other beliefs. [OBSERVED: quantum_cluster_builder.py docstring.]

The new builder sidesteps graph topology entirely. It forms cluster edges directly from co-occurrence evidence: any belief pair whose correlation magnitude |P(i=1,j=1) − P(i=1)·P(j=1)| meets MIN_PAIRWISE_CORRELATION (0.05) becomes an edge, and connected components of that empirical adjacency become quantum clusters. [OBSERVED] QI12 confirms a cluster forms with no graph edges present; QI13 confirms all eligible pairs are registered with the co-occurrence tracker.

Two design decisions keep this from becoming a parallel, bolt-on system:

1. Drop-in return type. The builder returns ClusterResult objects — the same type build_belief_clusters() returns — and QuantumJointDistribution exposes the same interface as the classical ExactJointDistribution (marginal, conditional_marginal, mutual_information, total_correlation, entropy, items). [OBSERVED: QI11.] Existing consumers see no new type.

2. No subsystem opts in. After circuit execution, propagate_quantum_posteriors() revises BeliefNode.confidence in place. Every downstream consumer — trading tick reasoning, gap investigation, business reasoning — inherits the revised belief state automatically. There is no routing decision anywhere in downstream code about whether to "use quantum." [OBSERVED: quantum_propagation.py docstring.]

Propagation is deliberately conservative. Posteriors blend into confidence with FRESH_ALPHA (0.25) for beliefs recently updated by direct evidence and STALE_ALPHA (0.6) for stale ones, so hard sensor/bridge evidence dominates over derived inference. Changes below MIN_DELTA (0.015) are not applied, and locked nodes are never revised. [OBSERVED: QI15 asserts locked nodes see zero revisions; QI16 asserts below-delta changes are skipped.]

What was learned (the validation result)

The headline measurable: the k=2 exact circuit matches the classical ExactJointDistribution oracle to KL < 0.001 nats across all three tested correlation scenarios. [OBSERVED: QI5 asserts kl_vs_oracle < 0.001; QI8 runs multiple scenarios with the same threshold.] Marginals and the joint P(1,1) are preserved to within 0.005 (QI6, QI7), and conditional marginals match the oracle to within 0.01 given either conditioning state (QI9, QI10).

In plain terms: at k=2 the quantum circuit is not an approximation of the classical joint — it reproduces it. For cluster sizes up to MAX_CLASSICAL_K (12), the builder constructs the classical oracle via from_pairwise_model() and records KL divergence in ClusterResult.kl_vs_oracle, so this equivalence is continuously self-checked rather than assumed. [OBSERVED: quantum_cluster_builder.py docstring.]

There is also a clean degradation story. All qiskit imports are lazy; when qiskit-aer is unavailable, get_default_backend() returns None and every quantum path falls back to classical ExactJointDistribution. [OBSERVED: QI18 verifies classical fallback when backend=None.] Insufficient evidence returns an empty cluster list rather than fabricating structure (QI19).

When it will reach for real hardware

Statevector simulation is the right environment now: exact, noiseless, immediate, and well-matched to the current belief-graph scale. [INFERRED from quantum_backend.py docstring, which states this explicitly as design rationale.] The architected escalation path is IBM Quantum Runtime (qiskit-ibm-runtime 0.43) via IBMRuntimeBackend, activated by setting QUANTUM_BACKEND=ibm plus IBM credentials.

The documented triggers for escalation are: average cluster k consistently exceeding IBM_ESCALATION_K_THRESHOLD (15); classical simulation becoming the throughput bottleneck; or a hypothesis that hardware noise could usefully regularize overfit correlations. [OBSERVED: quantum_backend.py docstring.] Crucially, escalation is a recommendation surfaced as a gap, not an enforced switch — the operator decides. [OBSERVED: comment at quantum_backend.py:32–34.] The hardware backend is real but currently a guardrail: IBMRuntimeBackend.run_statevector always raises (statevector is physically unavailable on shot-based hardware), and run_shots raises without a token (QI17).

What is still uncertain

  • Feedback-loop guard is not fully wired. [OBSERVED] The propagation module documents a _quantum_revised_at stamp intended to stop quantum-propagated confidences from contaminating co-occurrence statistics, but notes this guard is not yet implemented in cooccurrence.py's observe(). Today, contamination is avoided only because propagation runs after the tracker observes raw state each cycle; cross-cycle safety relies on bridge scans re-establishing ground truth within FRESH_EVIDENCE_SECONDS (1 hour). Wiring this guard is the stated next seam. [OBSERVED: quantum_propagation.py:34–47.]
  • Behavior above k=12 is unvalidated by oracle. Classical oracle comparison is bounded by MAX_CLASSICAL_K (12) and MAX_QUANTUM_CLUSTER_K (12). KL equivalence is demonstrated at k=2; the 2–12 range is checked against the oracle at runtime, but behavior at and beyond the escalation threshold (k>15) has no classical oracle to validate against. [INFERRED from module constants.]
  • No measured production impact. These observations cover correctness (KL equivalence, interface parity, propagation safety) — not any trading, profitability, or decision-quality outcome. [UNKNOWN] Whether richer joint beliefs change downstream decisions for the better has not been measured here.

Summary

QCA replaced a topology-gated joint-belief computation with an evidence-driven one, computed on an exact quantum statevector simulator, validated to KL < 0.001 against the classical oracle at k=2, and propagated into belief state with no opt-in required from any consumer. The simulator is the production backend today; real IBM hardware is wired as an operator-gated escalation for when clusters outgrow classical simulation. The known open edge is the feedback-loop guard, documented but not yet implemented.

QCA Products
Intelligence → Custom Build → Alpha Terminal →