Metadata-Version: 2.4
Name: pyhqiv
Version: 0.3.0
Summary: Horizon-Quantized Informational Vacuum (HQIV) framework — discrete null lattice, phase-horizon Maxwell, octonion algebra, and protein-scale field simulation
Author: HQIV Team
License: MIT
Project-URL: Documentation, https://github.com/disregardfiat/hqiv
Project-URL: Repository, https://github.com/disregardfiat/hqiv
Keywords: HQIV,cosmology,quantum Maxwell,octonion,discrete lattice,phase-horizon
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.20
Requires-Dist: scipy>=1.7
Provides-Extra: ase
Requires-Dist: ase>=3.22; extra == "ase"
Provides-Extra: mda
Requires-Dist: MDAnalysis>=2.0; extra == "mda"
Provides-Extra: qutip
Requires-Dist: qutip>=4.7; extra == "qutip"
Provides-Extra: jax
Requires-Dist: jax>=0.4; extra == "jax"
Requires-Dist: jaxlib>=0.4; extra == "jax"
Provides-Extra: pyvista
Requires-Dist: pyvista>=0.38; extra == "pyvista"
Provides-Extra: all
Requires-Dist: pyhqiv[ase,jax,mda,pyvista,qutip]; extra == "all"

# pyhqiv — Horizon-Quantized Informational Vacuum (HQIV)

[![PyPI version](https://badge.fury.io/py/pyhqiv.svg)](https://badge.fury.io/py/pyhqiv)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18794889.svg)](https://doi.org/10.5281/zenodo.18794889)

Production-ready, pip-installable Python package implementing the **Horizon-Quantized Informational Vacuum (HQIV)** framework exactly as defined in the paper:

> **Ettinger, Steven Jr**, *Horizon-Quantized Informational Vacuum (HQIV): A Unified Framework from Causal Horizon Monogamy and Discrete Null-Lattice Combinatorics*. Zenodo, 2026. [https://doi.org/10.5281/zenodo.18794889](https://doi.org/10.5281/zenodo.18794889)

## Citation

If you use this package in research, please cite the paper:

```bibtex
@misc{ettinger2026hqiv,
  author       = {Ettinger, Steven Jr},
  title        = {Horizon-Quantized Informational Vacuum (HQIV): A Unified Framework from Causal Horizon Monogamy and Discrete Null-Lattice Combinatorics},
  year         = {2026},
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.18794889},
  url          = {https://doi.org/10.5281/zenodo.18794889}
}
```

## Installation

```bash
pip install pyhqiv
```

From source:

```bash
git clone https://github.com/disregardfiat/pyhqiv.git && cd pyhqiv
pip install -e .
```

Also on [TestPyPI](https://test.pypi.org/project/pyhqiv/) for pre-release testing:  
`pip install --index-url https://test.pypi.org/simple/ pyhqiv`

Optional extras (PDB loading, JAX, QuTiP, visualization):

```bash
pip install pyhqiv[ase,mda,qutip,jax,pyvista]
# or
pip install pyhqiv[all]
```

## Quick start

```python
from pyhqiv import DiscreteNullLattice, HQIVSystem
import numpy as np

lattice = DiscreteNullLattice(m_trans=500, gamma=0.40)
result = lattice.evolve_to_cmb(T0_K=2.725)  # Omega_true_k ≈ 0.0098

sys = HQIVSystem.from_atoms([(0, 0, 0), (1.5, 0, 0)], charges=[1, -1], gamma=0.40)
grid = np.mgrid[-2:2:11j, -2:2:11j, -2:2:11j].reshape(3, -1).T
E, B = sys.compute_fields(grid, t=0.0)
```

## API examples (every module)

```python
import numpy as np
from pyhqiv import (
    # Constants (paper values)
    GAMMA, ALPHA, T_PL_GEV, T_LOCK_GEV, T_CMB_K, M_TRANS,
    COMBINATORIAL_INVARIANT, OMEGA_TRUE_K_PAPER, LAPSE_COMPRESSION_PAPER,
    HBAR_C_EV_ANG, A_LOC_ANG,
    # Lattice
    DiscreteNullLattice,
    # Phase lift
    HQIVPhaseLift,
    # Algebra (so(8), hypercharge)
    OctonionHQIVAlgebra,
    # Atom & system
    HQIVAtom, HQIVSystem,
    # Fluid (modified NS)
    f_inertia, g_vac_vector, eddy_viscosity, modified_momentum_rhs,
    # Molecular (PROtien)
    molecular,
    # Waveguide
    waveguide,
    # Fields
    PhaseHorizonFDTD,
    # Crystal & response
    HQIVCrystal, hqiv_potential_shift, compute_conductivity, response_tensor_diagonal,
)

# --- constants ---
print(GAMMA, COMBINATORIAL_INVARIANT, HBAR_C_EV_ANG)

# --- algebra: so(8) closure, hypercharge 4×4 block ---
alg = OctonionHQIVAlgebra(verbose=False)
dim, _ = alg.lie_closure_dimension()  # 28
data = alg.hypercharge_paper_data()

# --- lattice: δE(m), evolve_to_cmb ---
lattice = DiscreteNullLattice(m_trans=500, gamma=0.40)
result = lattice.evolve_to_cmb(T0_K=2.725)
delta_E = lattice.get_delta_E_grid()

# --- phase: δθ′(E′), ˙δθ′, lapse ---
phase = HQIVPhaseLift(gamma=0.40)
dtheta = phase.delta_theta_prime(0.5)
dot_dtheta = phase.delta_theta_prime_dot(H_homogeneous=1e-18)

# --- atom: local Θ, φ = 2c²/Θ ---
atom = HQIVAtom(position=(0, 0, 0), charge=1)
phi = atom.phi_local(np.array([[1.0, 0, 0]]))

# --- system: multi-atom, E/B on grid ---
sys = HQIVSystem.from_atoms([(0, 0, 0), (1, 0, 0)], charges=[1, -1])
E, B = sys.compute_fields(np.array([[0.5, 0, 0]]), t=0.0)

# --- fluid: f(a,φ), g_vac, ν_eddy ---
f = f_inertia(0.1, 1.0)
g_vac = g_vac_vector(1.0, 0.5, np.ones(3), np.zeros(3))
nu = eddy_viscosity(Theta_local=1.0, dot_delta_theta=1e-18, l_coh=1e-3, coherence_factor=0.5)

# --- molecular: Θ(Z,coord), bond length, damping ---
theta_C = molecular.theta_local(6, 2)  # ≈ 1.53 Å
r_eq = molecular.bond_length_from_theta(1.53, 1.33)
mag = molecular.damping_force_magnitude(1.0, 0.5, a_loc=1.0)

# --- waveguide: k_c², radius, taper, mode solver ---
from pyhqiv.waveguide import kc_squared_hqiv, waveguide_radius_constant_phi, hqiv_waveguide_mode_solver
kc2 = kc_squared_hqiv(omega=2*np.pi*1e9, beta=10.0, m_phase=1, dot_delta_theta=1e-18)
a = waveguide_radius_constant_phi(phi_target=1e10)
gx, gy = np.mgrid[0:1:5j, 0:1:5j]
evals, evecs, mask = hqiv_waveguide_mode_solver(gx, gy, 2*np.pi*1e9, 0.0, n_modes=2)

# --- fields: FDTD ---
fdtd = PhaseHorizonFDTD(shape=(10, 10, 10), dx=0.1, dt=0.05)
fdtd.step()

# --- crystal: PBC, Bloch sum ---
from pyhqiv.atom import HQIVAtom
atoms = [HQIVAtom([0, 0, 0], 0), HQIVAtom([0.5, 0, 0], 0)]
crystal = HQIVCrystal(atoms, lattice_vectors=np.eye(3), supercell_shape=(2, 1, 1))
bloch = crystal.bloch_sum(k_point=[0, 0, 0])
pos_sc = crystal.supercell_positions()

# --- response: conductivity ---
sigma = compute_conductivity(omega=1e10, sigma_0=1.0, phi_avg=1e5)
tensor = response_tensor_diagonal(omega=1e10, dim=3, sigma_0=1.0)

# --- band-gap: potential shift for PySCF ---
V_shift = hqiv_potential_shift(phi_avg=1e-10, dot_delta_theta_avg=1e-18)
# Use V_shift in pyscf.pbc as effective potential shift
```

## Package layout

| Path | Description |
|------|-------------|
| `src/pyhqiv/algebra.py` | Octonion HQIV algebra (so(8) closure, hypercharge 4×4 block) |
| `src/pyhqiv/lattice.py` | Discrete null lattice, δE(m), T(m), evolve_to_cmb |
| `src/pyhqiv/phase.py` | HQIVPhaseLift: δθ′(E′), ˙δθ′, ADM lapse compression |
| `src/pyhqiv/atom.py` | HQIVAtom (position, charge, species, local Θ, φ) |
| `src/pyhqiv/system.py` | HQIVSystem (multi-atom, monogamy γ, E/B on grid) |
| `src/pyhqiv/fields.py` | Phase-horizon FDTD / spectral Maxwell (γ(φ/c²)(˙δθ′/c) terms) |
| `src/pyhqiv/fluid.py` | Modified Navier–Stokes: f_inertia, g_vac, ν_eddy (laminar → standard NS) |
| `src/pyhqiv/waveguide.py` | HQIV waveguide: k_c²(ω,β,m), constant-φ circle, taper, hyperbolic, mode solver |
| `src/pyhqiv/molecular.py` | PROtien: Θ(Z, coord), bond_length_from_theta, damping_force_magnitude |
| `src/pyhqiv/crystal.py` | HQIVCrystal: PBC, supercell, bloch_sum; hqiv_potential_shift (band-gap / PySCF) |
| `src/pyhqiv/response.py` | compute_conductivity, response_tensor_diagonal (phase-horizon corrected) |
| `src/pyhqiv/constants.py` | Paper constants (γ, α, T_Pl, 6^7√3, HBAR_C_EV_ANG, A_LOC_ANG, etc.) |

## Paper numbers (reproduced)

| Quantity | Value | Source |
|----------|--------|--------|
| Ω_k^true | +0.0098 | Shell integral m = 0 … 500 |
| m_trans | 500 | Discrete–continuous transition |
| γ | 0.40 | Entanglement monogamy |
| α | 0.60 | G_eff exponent |
| T_lock | 1.8 GeV | QCD lock-in |
| 6^7√3 | ≈ 4.849×10^5 | Combinatorial invariant |
| Wall-clock age | 51.2 Gyr | Lattice → CMB |
| Apparent age | 13.8 Gyr | ADM lapse compression ≈ 3.96× |

## Tests

```bash
pip install -e ".[all]"
pytest tests/ -v
```

The test `tests/test_paper_numbers.py` checks Ω_true_k, γ, combinatorial invariant, lapse factor, and lattice δE(m) / mode counts to 6 decimal places.

## License

MIT.
