Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/black_hole.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from constants import CONSTANTS
from core.state import QuantumState
from physics.verification import UnifiedTheoryVerification
from physics.observables import compute_black_hole_entropy
from utils.io import QuantumGravityIO, MeasurementResult
from matplotlib.gridspec import GridSpec

Expand Down Expand Up @@ -665,7 +666,7 @@ def run_simulation(self, t_final: float) -> None:

# Calculate derived quantities
horizon_radius = 2 * CONSTANTS['G'] * self.qg.state.mass
entropy = np.pi * horizon_radius**2 / (4 * CONSTANTS['l_p']**2)
entropy = compute_black_hole_entropy(horizon_radius, include_log_correction=False)


# Calculate temperature
Expand Down
78 changes: 51 additions & 27 deletions physics/models/dark_matter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,33 @@
from constants import CONSTANTS, SI_UNITS
from physics.quantum_geometry import QuantumGeometry

# v7 Holographic Fisher Geometry parameters
# γ₀ = 0.274 (Immirzi parameter from LQG, Meissner 2004)
# Dark matter ratio M_DM/M_b = π/(2γ₀) ≈ 5.73
GAMMA_0 = CONSTANTS.get('gamma_0', 0.274)
DM_RATIO_V7 = CONSTANTS.get('dm_ratio_v7', np.pi / (2 * GAMMA_0))


class DarkMatterAnalysis:
def __init__(self,
def __init__(self,
observed_mass: float,
total_mass: float,
total_mass: float,
radius: float,
velocity_dispersion: float,
dark_mass: float = None,
visible_mass: float = None):
self.observed_mass = observed_mass # Solar masses
self.total_mass = total_mass # Solar masses
self.total_mass = total_mass # Solar masses
self.radius = radius # Light years
self.visible_mass = visible_mass # Solar masses
self.velocity_dispersion = velocity_dispersion # km/s
self.mass = total_mass
# Initialize quantum geometry
self.qg = QuantumGeometry()

# v7 Immirzi parameter
self.gamma_0 = GAMMA_0

# Compute quantum parameters from cluster properties
self.beta = self._compute_beta()
self.gamma_eff = self._compute_gamma()
Expand All @@ -37,29 +47,33 @@ def _compute_beta(self):
return (1/M_scale) * np.exp(-r_scale/self.qg.phi)

def _compute_gamma_parameter(self):
"""Compute quantum geometric coupling gamma"""
qg = QuantumGeometry()
"""Compute quantum geometric coupling gamma using v7 formulation."""
beta = self.compute_beta_parameter()

# γ = φ⁻¹β√(Λ/24)
gamma = (1/qg.phi) * beta * np.sqrt(qg.Lambda/24)


# v7 formulation: γ_eff = γ₀ × (1 + β²)
# where γ₀ = 0.274 is the Immirzi parameter
gamma = self.gamma_0 * (1 + beta**2)

return gamma

def _compute_gamma(self):
"""Compute quantum geometric coupling gamma"""
qg = QuantumGeometry()
"""Compute quantum geometric coupling gamma using v7 formulation."""
beta = self.compute_beta_parameter()
# γ = φ⁻¹β√(Λ/24)
gamma = (1/qg.phi) * beta * np.sqrt(qg.Lambda/24)

# v7 formulation: γ_eff = γ₀ × (1 + β²)
gamma = self.gamma_0 * (1 + beta**2)

return gamma

def compute_geometric_enhancement(self):
leech_factor = np.sqrt(196560/24)
# Apply precise normalization
return leech_factor * (1 - 5e-3) # Within 0.5% of expected value
"""
Compute geometric enhancement factor for dark matter.

v7 formulation: M_DM/M_b = π/(2γ₀) ≈ 5.73
This replaces the deprecated Leech lattice formula √(196560/24).
"""
# v7 dark matter ratio from Immirzi parameter
return DM_RATIO_V7


def compare_with_observations(self):
Expand All @@ -78,21 +92,31 @@ def compute_dark_matter_ratio(self):
return (self.total_mass - self.visible_mass) / self.visible_mass

def quantum_nfw_profile(self, r):
"""Q(r) = 1 + c(M)exp(-r/(rs×φ))√(Λ/(24×φ))"""
"""
Quantum-corrected NFW profile using v7 formulation.

Q(r) = 1 + c(M) × exp(-r/(rs×φ)) × γ₀
where γ₀ = 0.274 is the Immirzi parameter.
"""
rs = self.scale_radius
mass_coupling = self.compute_mass_coupling()

quantum_term = mass_coupling * np.exp(-r/(rs*self.phi))
geometric_factor = np.sqrt(self.Lambda/(24*self.phi))

phi = (1 + np.sqrt(5)) / 2

quantum_term = mass_coupling * np.exp(-r / (rs * phi))
# v7: use γ₀ instead of √(Λ/(24×φ))
geometric_factor = self.gamma_0

return 1 + quantum_term * geometric_factor

def _compute_geometric_entanglement(self):
"""Scale geometric entanglement to match 0.4 threshold"""
qg = QuantumGeometry()
"""
Compute geometric entanglement using v7 formulation.

v7: E = β × γ₀ (replaces β × √(Λ/24))
"""
beta = self._compute_beta()
lattice_factor = np.sqrt(qg.Lambda/24)
return beta * lattice_factor * 0.4
# v7 formulation: use γ₀ instead of Leech lattice factor
return beta * self.gamma_0 * 0.4

def quantum_correction_factor(self):
"""Calculate quantum correction factor for geometric enhancement"""
Expand Down
49 changes: 46 additions & 3 deletions physics/observables.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,46 @@
from utils.io import MeasurementResult
import cProfile


def compute_black_hole_entropy(horizon_radius: float, include_log_correction: bool = False) -> float:
"""
Compute black hole entropy using Bekenstein-Hawking formula with optional LQG correction.

Leading order (Bekenstein-Hawking):
S = A/(4*l_p²) = 4πr_h²/(4*l_p²) = πr_h²/l_p²

With LQG logarithmic correction (Meissner 2004, Kaul-Majumdar 2000):
S = A/(4*l_p²) - (1/2)*ln(A/l_p²)

The logarithmic correction arises from quantum corrections to the area spectrum
in Loop Quantum Gravity and becomes significant for Planck-scale black holes.

Args:
horizon_radius: Schwarzschild radius r_h = 2GM/c²
include_log_correction: If True, include the LQG logarithmic correction

Returns:
Black hole entropy in units of k_B (Boltzmann constant)
"""
l_p_sq = CONSTANTS['l_p']**2

# Horizon area A = 4π*r_h²
area = 4 * np.pi * horizon_radius**2

# Leading order Bekenstein-Hawking entropy: S = A/(4*l_p²) = πr_h²/l_p²
entropy = area / (4 * l_p_sq)

if include_log_correction:
# LQG logarithmic correction: -½ ln(A/l_p²)
# This correction is derived from microstate counting in LQG
area_ratio = area / l_p_sq
if area_ratio > 1.0: # Only apply for macroscopic black holes
log_correction = -0.5 * np.log(area_ratio)
entropy += log_correction

return entropy


class Observable(ABC):
"""Base class for quantum gravity observables."""

Expand Down Expand Up @@ -1915,17 +1955,20 @@ class RadiationEntropyObservable(Observable):
- G_μν^Fisher of radiation encodes recovered information
"""

def __init__(self, grid, initial_entropy: float = None):
def __init__(self, grid, initial_entropy: float = None, include_log_correction: bool = False):
"""
Initialize radiation entropy observable.

Args:
grid: Computational grid
initial_entropy: Initial black hole entropy S_BH(0).
If None, will be set on first measurement.
include_log_correction: If True, use LQG logarithmic correction to entropy.
Default False for backward compatibility.
"""
super().__init__(grid)
self.initial_entropy = initial_entropy
self.include_log_correction = include_log_correction
self.page_time = None
self._max_radiation_entropy = 0.0
self._max_entropy_time = None
Expand All @@ -1945,9 +1988,9 @@ def measure(self, state) -> 'MeasurementResult':
Returns:
MeasurementResult with radiation entropy value
"""
# Get current black hole entropy
# Get current black hole entropy using utility function
horizon_radius = 2 * CONSTANTS['G'] * state.mass
current_entropy = np.pi * horizon_radius**2 / (4 * CONSTANTS['l_p']**2)
current_entropy = compute_black_hole_entropy(horizon_radius, self.include_log_correction)

# Set initial entropy on first call
if self.initial_entropy is None:
Expand Down
12 changes: 6 additions & 6 deletions tests/test_black_hole_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ def test_information_conservation(self):
self.default_sim.run_simulation(t_final=10.0)
initial_entropy = self.default_sim.entropy_history[0]
final_entropy = self.default_sim.entropy_history[-1]

# As black hole evaporates, entropy decreases due to mass loss
self.assertLess(final_entropy, initial_entropy)
# Verify entropy scales with area using correct factor
expected_entropy = np.pi * self.default_mass**2
# Verify entropy scales with area: S = A/(4l_p²) = 4*pi*M² in Planck units
expected_entropy = 4 * np.pi * self.default_mass**2
self.assertAlmostEqual(initial_entropy, expected_entropy, delta=0.1*initial_entropy)


Expand Down Expand Up @@ -198,9 +198,9 @@ def test_mass_scaling(self):
for mass in test_masses:
bh = BlackHoleSimulation(mass=mass)
bh.run_simulation(t_final=1.0)
# Test entropy scaling
expected_S = np.pi * mass**2

# Test entropy scaling: S = A/(4l_p²) = 4*pi*M² in Planck units
expected_S = 4 * np.pi * mass**2
initial_entropy = bh.entropy_history[0]
self.assertAlmostEqual(initial_entropy/expected_S, 1.0, delta=0.1)

Expand Down
16 changes: 9 additions & 7 deletions tests/test_page_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ def compute_black_hole_entropy(mass: float) -> float:
"""
Compute Bekenstein-Hawking entropy for a Schwarzschild black hole.

S_BH = pi * r_h^2 / (4 * l_p^2)
S_BH = A / (4 * l_p^2) = 4*pi*r_h^2 / (4*l_p^2) = pi * r_h^2 / l_p^2

where r_h = 2GM is the horizon radius.

In Planck units (G = l_p = 1): S_BH = pi * (2M)^2 / 4 = pi * M^2
In Planck units (G = l_p = 1): S_BH = pi * (2M)^2 = 4 * pi * M^2

Args:
mass: Black hole mass in Planck units
Expand All @@ -64,7 +64,7 @@ def compute_black_hole_entropy(mass: float) -> float:
Black hole entropy in Planck units
"""
horizon_radius = 2 * CONSTANTS['G'] * mass
return np.pi * horizon_radius**2 / (4 * CONSTANTS['l_p']**2)
return np.pi * horizon_radius**2 / CONSTANTS['l_p']**2


def compute_evaporation_time(mass: float) -> float:
Expand Down Expand Up @@ -329,16 +329,18 @@ def test_entropy_scaling_with_mass(self):
)

def test_entropy_formula_explicit(self):
"""Test the explicit entropy formula S = pi * M^2."""
"""Test the explicit entropy formula S = 4 * pi * M^2."""
mass = 100.0
S_BH = compute_black_hole_entropy(mass)

# In Planck units with G = l_p = 1:
# S = pi * (2GM)^2 / (4 * l_p^2) = pi * M^2
expected = np.pi * mass**2
# r_h = 2GM = 2M
# A = 4*pi*r_h^2 = 16*pi*M^2
# S = A/(4*l_p^2) = 4*pi*M^2
expected = 4 * np.pi * mass**2

assert np.isclose(S_BH, expected, rtol=0.01), (
f"S_BH = {S_BH}, expected pi * M^2 = {expected}"
f"S_BH = {S_BH}, expected 4*pi*M^2 = {expected}"
)


Expand Down
12 changes: 8 additions & 4 deletions tests/test_quantum_effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ def test_quantum_corrections(self):
# assert abs(enhancement - expected)/expected < 0.01

def test_leech_lattice_contribution(self):
"""Verify Leech lattice enhancement factor"""
enhancement = self.dm_analysis.compute_geometric_enhancement() # Use correct method name
expected = np.sqrt(196560/24)
assert abs(enhancement - expected)/expected < 0.01
"""Verify v7 dark matter enhancement factor (replaces Leech lattice)"""
enhancement = self.dm_analysis.compute_geometric_enhancement()

# v7 formulation: M_DM/M_b = π/(2γ₀) ≈ 5.73
# where γ₀ = 0.274 is the Immirzi parameter
# This replaces the deprecated Leech lattice formula √(196560/24) ≈ 90.5
expected = np.pi / (2 * 0.274) # ≈ 5.73
assert abs(enhancement - expected) / expected < 0.01
Loading
Loading