// ============================================================================
// threat_vqc.h — T1 Quantum Bayesian Threat Scorer (classically simulated VQC)
//
// C++ port of the classical-simulation subset of:
//   pdl-engine/pdl_platform/pdl_quantum/integrations/threat_network.py
//   (QuantumBayesianThreatNetwork — forward pass only, no QPU calls)
//
// Architecture (5-qubit VQC, 32-element statevector):
//   Layer 1 — Evidence encoding:  Ry(π * feat[i]) on qubit i  (5 rotations)
//   Layer 2 — Entangler:          CNOT(0→1), CNOT(1→2), CNOT(2→3), CNOT(3→4)
//   Layer 3 — Variational A:      Ry(θ[i])   on qubit i  (θ[0..4])
//   Layer 4 — Variational B:      Ry(θ[i+5]) on qubit i  (θ[5..9])
//
// Output: expectation value of Z_0 ⊗ Z_1 mapped to [0,1] threat probability.
//
// The pre-trained θ vector is hard-coded as a static constant; the integrator
// can swap it out by rebuilding after updating s_theta[] in threat_vqc.cpp.
//
// Memory: 32 × 8 bytes (complex<float>) = 256 bytes for the statevector.
//
// Static memory only.  No STL, no heap.  <cstdint> <cstring> <cmath> only.
//
// PDL Consulting LLC — Trade Secret.  See license header in threat_vqc.cpp.
// ============================================================================

#ifndef THREAT_VQC_H
#define THREAT_VQC_H

#include <cstdint>

// ---------------------------------------------------------------------------
// Public API
// ---------------------------------------------------------------------------

/**
 * threat_vqc_init — prepare the statevector workspace.
 * Must be called before threat_vqc_score().
 */
void threat_vqc_init(void);

/**
 * threat_vqc_score — run one VQC forward pass and return threat probability.
 *
 * @param feats  5-element feature vector, each ∈ [0, 1]:
 *                 feats[0] — Markov NLL (normalised, 0=benign, 1=max anomaly)
 *                 feats[1] — WFX channel occupancy  [0, 1]
 *                 feats[2] — FFPS corroborator count (normalised)
 *                 feats[3] — Channel RSSI (normalised, 0=weak, 1=strong)
 *                 feats[4] — Threat correlator active flag (0 or 1)
 *
 * @return threat probability in [0, 1].
 *         > 0.7 → high threat (integrator should set composite-threat bit).
 */
float threat_vqc_score(const float feats[5]);

#endif // THREAT_VQC_H
