# Bosonic Monte Carlo Pipeline — Actionable Review

Source: `/home/allaun/Documents/chatgpt output6222026.md`

## Pipeline Summary

### Critical Boundary (Bosonic ↔ Classical Collapse)
- **Physics boundary**: N/p² < ϵ → classical regime
- **For N=2000**: p < √(2000/ϵ) ≈ 4-6 is still physically bosonic
- **Current implementation**: Switches at p≥5 (algorithmic, not physical)

### Variational Inference Formulation
Current system implements:
```
Q*(p,N) = { Q_bos, p≤4; Q_fact, p≥5 }  // Hard mixture
```
This produces:
- Entropy plateau (~10.8 bits)
- Runtime collapse at p≥5
- Loss of correlation structure

### Proposed Fix
Replace hard switch with continuous interpolation:
```
Q(p) = λ(p)Q_bos + (1-λ(p))Q_fact
λ(p) ~ exp(-p²/N)
```

## Actionable Reviews

| Issue | Current State | Action Required | Owner |
|-------|--------------|-----------------|-------|
| **Regime switching** | Hard threshold p≥5 | Remove if-bloc, unify estimator | Core |
| **Entropy plateau** | Artificial from mixture collapse | Continuous λ(p) interpolation | Core |
| **Runtime discontinuity** | O(p) vs O(p!) jump | Single Ryser-based estimator | Core |
| **No variational continuity** | Discontinuous model change | λ(p) smooth transition | Core |
| **GPU kernel** | Regime-split kernels | Unified 4-kernel pipeline | Infra |
| **Category model** | Implicit Sym^p(U) contraction | Extract functor formalism | Formal |

## Implementation Path

### Kernel Pipeline (GPU/Cluster)
1. **Mode sampler**: O(Np), categorical sampling
2. **Gather**: M = U[S,:], memory coalescing
3. **Ryser permanent**: 2^p threads, subset evaluation
4. **Reduction**: Atomic histogram or segmented buffers

### Complexity
```
T(N,p,S) = O(S ⋅ (Np + p²2^p))
```
- p ≤ 6: fully tractable (≤2304 samples)
- No dependence on (p N+p-1)