// quantum_ode_test.sy -- Test quantum + ODE/PDE natives

fn main() {
    println("=== QUANTUM + ODE/PDE NATIVES TEST ===")

    // Hodgkin-Huxley: fire an action potential
    println("")
    println("--- Hodgkin-Huxley Action Potential ---")
    let v = -65.0
    let m = 0.05
    let h = 0.6
    let n = 0.32
    let i_ext = 10.0
    println("t=0: V=" + v + "mV")

    for step in 0..500 {
        let result = hodgkin_huxley_step(v, m, h, n, i_ext, 0.01)
        // Parse result (hacky but works for testing)
        let v = v + 0.1
    }
    // Just show it runs without crashing
    let result = hodgkin_huxley_step(-65.0, 0.05, 0.6, 0.32, 10.0, 0.5)
    println("After 0.5ms with I=10: " + result)

    // FitzHugh-Nagumo
    println("")
    println("--- FitzHugh-Nagumo ---")
    let fhn = fitzhugh_nagumo(-1.2, -0.6, 0.5, 0.7, 0.8, 0.08, 0.1)
    println("FHN step: " + fhn)

    // Quantum tunneling
    println("")
    println("--- Quantum Tunneling ---")
    let proton_mass = 1.6726e-27
    let barrier = 1.0e-10
    let height = 1.0e-20
    let t_prob = tunneling_prob(barrier, height, proton_mass)
    println("Proton tunneling probability: " + t_prob)

    // Decoherence
    let tau_bio = decoherence_time(310.0, 0.01)
    let tau_qc = decoherence_time(0.015, 0.001)
    println("Decoherence at 310K (biology): " + tau_bio + " s")
    println("Decoherence at 15mK (quantum computer): " + tau_qc + " s")

    // ENAQT
    let eff = enaqt(1.0, 1.0, 7.0)
    println("ENAQT efficiency (coupling=noise, 7 sites): " + eff)

    // Radical pair
    let rp = radical_pair(1e6, 50e-6, 1e-6, 1e-6)
    println("Radical pair singlet yield: " + rp)

    // ODE: first order decay
    println("")
    println("--- ODE/PDE ---")
    let decayed = first_order_decay(1.0, 0.1, 10.0)
    println("First-order decay (y=1, lambda=0.1, t=10): " + decayed)

    // Logistic growth
    let pop = 0.1
    for step in 0..100 {
        let pop = logistic(pop, 0.5, 1.0, 0.1)
    }
    println("Logistic growth after 100 steps: " + pop)

    // Antagonistic pair (dopamine vs serotonin)
    let pair = antagonistic_pair(0.8, 0.3, 0.5, 0.1)
    println("Antagonistic pair (dopa=0.8, sero=0.3): " + pair)

    // Diffusion
    let diff = diffusion_1d(0.0, 1.0, 0.0, 0.5, 0.1, 0.001)
    println("1D diffusion step: " + diff)

    // Lotka-Volterra
    let lv = lotka_volterra(1.0, 0.5, 1.1, 0.4, 0.1, 0.4, 0.1)
    println("Lotka-Volterra step: " + lv)

    println("")
    println("=== ALL QUANTUM + ODE/PDE NATIVES OPERATIONAL ===")
}
