Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Fractal-Weighted Holographic Reconstruction</title>
- <style>
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- body {
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
- background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
- min-height: 100vh;
- padding: 20px;
- color: #fff;
- }
- .container {
- max-width: 1400px;
- margin: 0 auto;
- background: white;
- border-radius: 16px;
- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
- padding: 30px;
- }
- .header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 20px;
- padding-bottom: 20px;
- border-bottom: 2px solid #e2e8f0;
- }
- h1 {
- font-size: 2em;
- color: #1e293b;
- margin: 0;
- }
- .subtitle {
- color: #64748b;
- font-size: 0.9em;
- margin-top: 5px;
- }
- .info-toggle {
- background: #3b82f6;
- color: white;
- border: none;
- padding: 10px 20px;
- border-radius: 8px;
- cursor: pointer;
- font-weight: 600;
- transition: background 0.2s;
- }
- .info-toggle:hover {
- background: #2563eb;
- }
- .info-box {
- background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
- padding: 20px;
- border-radius: 12px;
- margin-bottom: 20px;
- border-left: 4px solid #3b82f6;
- color: #1e40af;
- line-height: 1.6;
- }
- .info-box.hidden {
- display: none;
- }
- .main-grid {
- display: grid;
- grid-template-columns: 1fr 350px;
- gap: 30px;
- margin-bottom: 20px;
- }
- @media (max-width: 1024px) {
- .main-grid {
- grid-template-columns: 1fr;
- }
- }
- .canvas-container {
- position: relative;
- }
- canvas {
- width: 100%;
- max-width: 700px;
- height: auto;
- border: 3px solid #cbd5e1;
- border-radius: 12px;
- cursor: crosshair;
- background: #f8fafc;
- display: block;
- margin: 0 auto;
- }
- .sidebar {
- display: flex;
- flex-direction: column;
- gap: 20px;
- }
- .panel {
- background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
- padding: 20px;
- border-radius: 12px;
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
- }
- .panel h2 {
- color: #1e293b;
- font-size: 1.2em;
- margin-bottom: 15px;
- display: flex;
- align-items: center;
- gap: 8px;
- }
- .slider-group {
- margin-bottom: 20px;
- }
- .slider-group:last-child {
- margin-bottom: 0;
- }
- .slider-label {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 8px;
- color: #334155;
- font-weight: 600;
- font-size: 0.95em;
- }
- .slider-value {
- background: #3b82f6;
- color: white;
- padding: 4px 12px;
- border-radius: 6px;
- font-family: 'Courier New', monospace;
- font-size: 0.9em;
- }
- input[type="range"] {
- width: 100%;
- height: 8px;
- border-radius: 4px;
- background: #cbd5e1;
- outline: none;
- -webkit-appearance: none;
- }
- input[type="range"]::-webkit-slider-thumb {
- -webkit-appearance: none;
- appearance: none;
- width: 20px;
- height: 20px;
- border-radius: 50%;
- background: #3b82f6;
- cursor: pointer;
- box-shadow: 0 2px 4px rgba(0,0,0,0.2);
- }
- input[type="range"]::-moz-range-thumb {
- width: 20px;
- height: 20px;
- border-radius: 50%;
- background: #3b82f6;
- cursor: pointer;
- border: none;
- box-shadow: 0 2px 4px rgba(0,0,0,0.2);
- }
- .slider-hint {
- color: #64748b;
- font-size: 0.8em;
- margin-top: 5px;
- }
- .button-grid {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: 10px;
- }
- button {
- padding: 14px;
- border: none;
- border-radius: 8px;
- font-weight: 600;
- font-size: 0.95em;
- cursor: pointer;
- transition: all 0.2s;
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 8px;
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
- }
- button:active {
- transform: translateY(1px);
- }
- .btn-primary {
- background: #3b82f6;
- color: white;
- grid-column: span 2;
- }
- .btn-primary:hover {
- background: #2563eb;
- }
- .btn-success {
- background: #10b981;
- color: white;
- }
- .btn-success:hover {
- background: #059669;
- }
- .btn-danger {
- background: #ef4444;
- color: white;
- }
- .btn-danger:hover {
- background: #dc2626;
- }
- .btn-secondary {
- background: #64748b;
- color: white;
- grid-column: span 2;
- }
- .btn-secondary:hover {
- background: #475569;
- }
- .stats-grid {
- display: grid;
- gap: 10px;
- }
- .stat-item {
- display: flex;
- justify-content: space-between;
- padding: 10px;
- background: white;
- border-radius: 6px;
- font-size: 0.9em;
- }
- .stat-label {
- color: #64748b;
- font-weight: 600;
- }
- .stat-value {
- color: #1e293b;
- font-weight: 700;
- font-family: 'Courier New', monospace;
- }
- .theory-box {
- background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
- padding: 20px;
- border-radius: 12px;
- border: 2px solid #cbd5e1;
- }
- .theory-box h3 {
- color: #1e293b;
- margin-bottom: 15px;
- font-size: 1.1em;
- }
- .equation {
- font-family: 'Courier New', monospace;
- background: white;
- padding: 10px;
- border-radius: 6px;
- margin: 8px 0;
- font-size: 0.85em;
- color: #334155;
- overflow-x: auto;
- }
- .prediction {
- background: #dbeafe;
- padding: 12px;
- border-radius: 6px;
- margin-top: 10px;
- color: #1e40af;
- font-size: 0.9em;
- border-left: 3px solid #3b82f6;
- }
- .icon {
- display: inline-block;
- width: 16px;
- height: 16px;
- }
- </style>
- </head>
- <body>
- <div class="container">
- <div class="header">
- <div>
- <h1>Fractal-Weighted Holographic Reconstruction</h1>
- <div class="subtitle">Observer-dependent boundary-to-bulk mapping in AdS/CFT</div>
- </div>
- <button class="info-toggle" onclick="toggleInfo()">ℹ️ Info</button>
- </div>
- <div id="infoBox" class="info-box">
- <p style="margin-bottom: 10px;">
- <strong>Interactive Demo:</strong> Click anywhere on the boundary circle to add decoherence events (red dots).
- The green field shows the reconstructed bulk scalar field Φ(z,φ) with fractal weighting.
- </p>
- <p>
- <strong>Key Features:</strong> Sharp peaks near measurements (~5° resolution cones),
- nearly flat elsewhere. Each observer creates high-resolution "spotlights" on the holographic screen.
- The effective vacuum energy suppression emerges naturally: ρ_vac ~ 10^(-60) × Planck^4.
- </p>
- </div>
- <div class="main-grid">
- <div class="canvas-container">
- <canvas id="canvas" width="700" height="700"></canvas>
- </div>
- <div class="sidebar">
- <div class="panel">
- <h2>⚙️ Parameters</h2>
- <div class="slider-group">
- <div class="slider-label">
- <span>Fractal exponent α</span>
- <span class="slider-value" id="alphaValue">2.6</span>
- </div>
- <input type="range" id="alphaSlider" min="2.0" max="3.2" step="0.1" value="2.6">
- <div class="slider-hint">Controls resolution cone width</div>
- </div>
- <div class="slider-group">
- <div class="slider-label">
- <span>Bulk depth z</span>
- <span class="slider-value" id="zValue">0.500</span>
- </div>
- <input type="range" id="zSlider" min="0" max="0.95" step="0.01" value="0.50">
- <div class="slider-hint">0 = boundary (∂), 1 = bulk center</div>
- </div>
- </div>
- <div class="panel">
- <h2>🎮 Controls</h2>
- <div class="button-grid">
- <button id="animateBtn" class="btn-primary">
- <span id="animateIcon">▶</span> Animate z-scan
- </button>
- <button onclick="addRandomEvent()" class="btn-success">
- + Event
- </button>
- <button onclick="clearEvents()" class="btn-danger">
- ✕ Clear
- </button>
- <button onclick="resetParameters()" class="btn-secondary">
- ↻ Reset Parameters
- </button>
- </div>
- </div>
- <div class="panel">
- <h2>📊 Statistics</h2>
- <div class="stats-grid">
- <div class="stat-item">
- <span class="stat-label">Decoherence Events</span>
- <span class="stat-value" id="eventCount">0</span>
- </div>
- <div class="stat-item">
- <span class="stat-label">Current Depth</span>
- <span class="stat-value" id="currentZ">z = 0.500</span>
- </div>
- <div class="stat-item">
- <span class="stat-label">Resolution Cone</span>
- <span class="stat-value" id="coneWidth">~5.0°</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="theory-box">
- <h3>🔬 Theory Summary</h3>
- <div class="equation">
- <strong>Weighting function:</strong> W(θ) = Σ<sub>k</sub> 1 / (1 + 100|θ − θ<sub>k</sub>|<sup>α</sup>)
- </div>
- <div class="equation">
- <strong>Reconstruction:</strong> Φ(z,φ) = ∫ W(θ) · exp(−z|φ−θ|) · C(θ,φ) dθ
- </div>
- <div class="prediction">
- <strong>Key Prediction:</strong> Each observer creates a ~5° high-resolution cone.
- Effective degrees of freedom: N<sub>eff</sub> ~ 10<sup>60</sup> (not 10<sup>120</sup>),
- naturally explaining the cosmological constant without fine-tuning.
- </div>
- </div>
- </div>
- <script>
- const canvas = document.getElementById('canvas');
- const ctx = canvas.getContext('2d');
- const alphaSlider = document.getElementById('alphaSlider');
- const zSlider = document.getElementById('zSlider');
- const alphaValue = document.getElementById('alphaValue');
- const zValue = document.getElementById('zValue');
- const currentZ = document.getElementById('currentZ');
- const eventCount = document.getElementById('eventCount');
- const coneWidth = document.getElementById('coneWidth');
- const animateBtn = document.getElementById('animateBtn');
- const animateIcon = document.getElementById('animateIcon');
- let events = [];
- let alpha = 2.6;
- let z = 0.5;
- let isAnimating = false;
- let animationFrame = null;
- function calculateW(theta, eventList) {
- let sum = 0;
- for (const event of eventList) {
- const diff = Math.abs(theta - event.theta);
- const minDiff = Math.min(diff, 2 * Math.PI - diff);
- sum += 1 / (1 + 100 * Math.pow(minDiff, alpha));
- }
- return sum;
- }
- function reconstructField(zVal, phi, eventList) {
- const samples = 50;
- let integral = 0;
- const dtheta = 2 * Math.PI / samples;
- for (let i = 0; i < samples; i++) {
- const theta = i * dtheta;
- const W = calculateW(theta, eventList);
- const diff = Math.abs(phi - theta);
- const minDiff = Math.min(diff, 2 * Math.PI - diff);
- const kernel = Math.exp(-zVal * minDiff * 10);
- integral += W * kernel * dtheta;
- }
- return integral;
- }
- function addRandomEvent() {
- events.push({
- theta: Math.random() * 2 * Math.PI,
- id: Date.now()
- });
- updateStats();
- draw();
- }
- function clearEvents() {
- events = [];
- updateStats();
- draw();
- }
- function resetParameters() {
- z = 0.5;
- alpha = 2.6;
- alphaSlider.value = 2.6;
- zSlider.value = 0.5;
- alphaValue.textContent = '2.6';
- zValue.textContent = '0.500';
- currentZ.textContent = 'z = 0.500';
- isAnimating = false;
- animateBtn.className = 'btn-primary';
- animateIcon.textContent = '▶';
- updateStats();
- draw();
- }
- function handleCanvasClick(e) {
- const rect = canvas.getBoundingClientRect();
- const scaleX = canvas.width / rect.width;
- const scaleY = canvas.height / rect.height;
- const x = (e.clientX - rect.left) * scaleX - canvas.width / 2;
- const y = (e.clientY - rect.top) * scaleY - canvas.height / 2;
- const theta = Math.atan2(y, x);
- const normalizedTheta = theta < 0 ? theta + 2 * Math.PI : theta;
- events.push({
- theta: normalizedTheta,
- id: Date.now()
- });
- updateStats();
- draw();
- }
- function updateStats() {
- eventCount.textContent = events.length;
- currentZ.textContent = `z = ${z.toFixed(3)}`;
- const cone = 5 * Math.pow(2.6 / alpha, 0.8);
- coneWidth.textContent = `~${cone.toFixed(1)}°`;
- }
- function toggleInfo() {
- const infoBox = document.getElementById('infoBox');
- infoBox.classList.toggle('hidden');
- }
- function draw() {
- const width = canvas.width;
- const height = canvas.height;
- const centerX = width / 2;
- const centerY = height / 2;
- const maxRadius = Math.min(width, height) / 2 - 50;
- ctx.clearRect(0, 0, width, height);
- ctx.fillStyle = '#f8fafc';
- ctx.fillRect(0, 0, width, height);
- // Radial grid
- ctx.strokeStyle = '#e2e8f0';
- ctx.lineWidth = 1.5;
- for (let r = 0.2; r <= 1; r += 0.2) {
- ctx.beginPath();
- ctx.arc(centerX, centerY, maxRadius * r, 0, 2 * Math.PI);
- ctx.stroke();
- }
- // Angular grid
- for (let angle = 0; angle < 2 * Math.PI; angle += Math.PI / 6) {
- ctx.beginPath();
- ctx.moveTo(centerX, centerY);
- ctx.lineTo(
- centerX + maxRadius * Math.cos(angle),
- centerY + maxRadius * Math.sin(angle)
- );
- ctx.stroke();
- }
- // Draw influence cones
- events.forEach((event) => {
- const coneAngle = 0.1;
- ctx.fillStyle = 'rgba(239, 68, 68, 0.06)';
- ctx.beginPath();
- ctx.moveTo(centerX, centerY);
- ctx.arc(centerX, centerY, maxRadius, event.theta - coneAngle, event.theta + coneAngle);
- ctx.closePath();
- ctx.fill();
- });
- // Draw reconstructed field
- if (events.length > 0) {
- const samples = 180;
- const fieldRadius = maxRadius * (1 - z);
- let maxField = 0;
- const fieldValues = [];
- for (let i = 0; i <= samples; i++) {
- const phi = (i / samples) * 2 * Math.PI;
- const fieldValue = reconstructField(z, phi, events);
- fieldValues.push(fieldValue);
- maxField = Math.max(maxField, fieldValue);
- }
- // Draw filled shape
- ctx.fillStyle = 'rgba(16, 185, 129, 0.2)';
- ctx.beginPath();
- for (let i = 0; i <= samples; i++) {
- const phi = (i / samples) * 2 * Math.PI;
- const normalizedValue = maxField > 0 ? fieldValues[i] / maxField : 0;
- const r = fieldRadius + normalizedValue * 50;
- const x = centerX + r * Math.cos(phi);
- const y = centerY + r * Math.sin(phi);
- if (i === 0) {
- ctx.moveTo(x, y);
- } else {
- ctx.lineTo(x, y);
- }
- }
- ctx.closePath();
- ctx.fill();
- // Draw outline
- ctx.strokeStyle = '#10b981';
- ctx.lineWidth = 3;
- ctx.beginPath();
- for (let i = 0; i <= samples; i++) {
- const phi = (i / samples) * 2 * Math.PI;
- const normalizedValue = maxField > 0 ? fieldValues[i] / maxField : 0;
- const r = fieldRadius + normalizedValue * 50;
- const x = centerX + r * Math.cos(phi);
- const y = centerY + r * Math.sin(phi);
- if (i === 0) {
- ctx.moveTo(x, y);
- } else {
- ctx.lineTo(x, y);
- }
- }
- ctx.stroke();
- }
- // Draw boundary circle
- ctx.strokeStyle = '#3b82f6';
- ctx.lineWidth = 4;
- ctx.beginPath();
- ctx.arc(centerX, centerY, maxRadius, 0, 2 * Math.PI);
- ctx.stroke();
- // Draw current z-level
- if (z > 0.05) {
- ctx.strokeStyle = '#94a3b8';
- ctx.lineWidth = 2;
- ctx.setLineDash([8, 8]);
- ctx.beginPath();
- ctx.arc(centerX, centerY, maxRadius * (1 - z), 0, 2 * Math.PI);
- ctx.stroke();
- ctx.setLineDash([]);
- }
- // Draw events
- events.forEach((event) => {
- const x = centerX + maxRadius * Math.cos(event.theta);
- const y = centerY + maxRadius * Math.sin(event.theta);
- // Glow
- const gradient = ctx.createRadialGradient(x, y, 0, x, y, 15);
- gradient.addColorStop(0, 'rgba(239, 68, 68, 0.6)');
- gradient.addColorStop(1, 'rgba(239, 68, 68, 0)');
- ctx.fillStyle = gradient;
- ctx.beginPath();
- ctx.arc(x, y, 15, 0, 2 * Math.PI);
- ctx.fill();
- // Solid dot
- ctx.fillStyle = '#ef4444';
- ctx.beginPath();
- ctx.arc(x, y, 6, 0, 2 * Math.PI);
- ctx.fill();
- // White center
- ctx.fillStyle = '#fff';
- ctx.beginPath();
- ctx.arc(x, y, 2.5, 0, 2 * Math.PI);
- ctx.fill();
- });
- // Labels
- ctx.fillStyle = '#1e293b';
- ctx.font = 'bold 14px sans-serif';
- ctx.fillText('Boundary (∂)', centerX + maxRadius + 15, centerY + 5);
- ctx.fillText('Bulk center', centerX - 45, centerY - 15);
- }
- function animate() {
- if (!isAnimating) return;
- z = (z + 0.015) % 0.95;
- zSlider.value = z;
- zValue.textContent = z.toFixed(3);
- updateStats();
- draw();
- animationFrame = requestAnimationFrame(animate);
- }
- canvas.addEventListener('click', handleCanvasClick);
- alphaSlider.addEventListener('input', (e) => {
- alpha = parseFloat(e.target.value);
- alphaValue.textContent = alpha.toFixed(1);
- updateStats();
- draw();
- });
- zSlider.addEventListener('input', (e) => {
- z = parseFloat(e.target.value);
- zValue.textContent = z.toFixed(3);
- updateStats();
- draw();
- });
- animateBtn.addEventListener('click', () => {
- isAnimating = !isAnimating;
- if (isAnimating) {
- animateBtn.className = 'btn-primary';
- animateIcon.textContent = '⏸';
- animate();
- } else {
- animateBtn.className = 'btn-primary';
- animateIcon.textContent = '▶';
- if (animationFrame) {
- cancelAnimationFrame(animationFrame);
- }
- }
- });
- // Initial draw
- updateStats();
- draw();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment