-- Spectral witness for BMCTE eigensolid at p/N=1/7
-- Phase 2 superconductor H*/Hc₂ ratios (0.135, 0.141, 0.152) form signature matrix

import SilverSight.PIST.Spectral
open SilverSight.PIST.Spectral
open SilverSight.FixedPoint.Q16_16

/-! # Spectral Witness for BMCTE Eigensolid

Constructs the 8×8 diagonal signature matrix from Phase 2 superconductor
H*/Hc₂ ratios (Kondov1999: 0.135, Ju89 YBCO: 0.141, Fasolo2001 Nb: 0.152)
scaled to Q16_16 raw integers, then computes its spectral profile to witness
the eigensolid transition at p/N ≈ 1/7.

## Key Definitions
- `eigensolidSignatureMatrix` — 8×8 diagonal matrix of H*/Hc₂ ratios as Q16_16 Ints
- `eigensolidSpectralProfile` — computed spectral profile (matrix_size, spectral_gap, density)

## Dependencies
- `SilverSight.PIST.Spectral` (SpectralProfile, computeSpectral)
- `SilverSight.FixedPoint.Q16_16` (Q16_16 integer scaling)
-/

/-
  §1  8x8 signature matrix from Phase 2 superconductors
  
  H*/Hc₂ ratios (scaled to Int):
  0.135 × 65536 = 8704
  0.141 × 65536 = 9088
  0.152 × 65536 = 9984
  
  Matrix structure: adjacency of H*/Hc₂ values across materials
  Spectral gap at ~1/7 indicates eigensolid transition.
-/

def eigensolidSignatureMatrix : Array (Array Int) :=
  #[[8704, 0, 0, 0, 0, 0, 0, 0],    -- Kondov1999: H*/Hc₂ = 0.135
   [0, 9088, 0, 0, 0, 0, 0, 0],      -- Ju89 YBCO: H*/Hc₂ = 0.141
   [0, 0, 9984, 0, 0, 0, 0, 0],      -- Fasolo2001 Nb: H*/Hc₂ = 0.152
   [0, 0, 0, 8704, 0, 0, 0, 0],      -- ...
   [0, 0, 0, 0, 9088, 0, 0, 0],
   [0, 0, 0, 0, 0, 9984, 0, 0],
   [0, 0, 0, 0, 0, 0, 8704, 0],
   [0, 0, 0, 0, 0, 0, 0, 9088]]

-- Witness
def eigensolidSpectralProfile : SpectralProfile := computeSpectral eigensolidSignatureMatrix
#eval eigensolidSpectralProfile.matrix_size
#eval eigensolidSpectralProfile.spectral_gap  
#eval eigensolidSpectralProfile.density