Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
projects:quantum:hawking-projector [2025/03/31 09:06] – created kymki | projects:quantum:hawking-projector [2025/04/30 09:28] (current) – kymki | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | # Black Hole Mechanics in Quantum Image Compression | + | < |
+ | < | ||
+ | <meta charset=" | ||
+ | <meta name=" | ||
+ | < | ||
+ | < | ||
+ | /* Container for the entire Ramble Meter */ | ||
+ | .ramble-meter-container { | ||
+ | display: flex; | ||
+ | align-items: | ||
+ | justify-content: | ||
+ | margin: 20px 0; | ||
+ | } | ||
- | ## Hawking Radiation and Information Theory | + | /* Ramble Meter */ |
- | The `HawkingProjector` class uses black hole physics as inspiration for quantum data compression. The fundamental concept relates to how information behaves near a black hole's event horizon, particularly drawing from Hawking radiation theory. | + | .ramble-meter { |
+ | position: relative; | ||
+ | width: 200px; /* Scaled down */ | ||
+ | height: 40px; /* Scaled down */ | ||
+ | background: linear-gradient(to right, green, yellow, orange, red); | ||
+ | border-radius: | ||
+ | overflow: hidden; | ||
+ | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); | ||
+ | } | ||
+ | |||
+ | /* Needle */ | ||
+ | .needle { | ||
+ | position: absolute; | ||
+ | top: 5px; /* Adjust for centering */ | ||
+ | left: 50%; /* Default position */ | ||
+ | width: 4px; /* Visible width */ | ||
+ | height: 30px; | ||
+ | background: black; | ||
+ | border-radius: | ||
+ | z-index: 2; | ||
+ | box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Glow effect */ | ||
+ | } | ||
+ | |||
+ | /* Label in the middle of the meter */ | ||
+ | .meter-label { | ||
+ | position: absolute; | ||
+ | top: 50%; | ||
+ | left: 50%; | ||
+ | transform: translate(-50%, | ||
+ | font-family: | ||
+ | font-size: 12px; /* Adjusted for smaller size */ | ||
+ | font-weight: | ||
+ | color: | ||
+ | text-shadow: | ||
+ | z-index: 3; | ||
+ | } | ||
+ | |||
+ | /* Tooltip styling */ | ||
+ | .tooltip { | ||
+ | visibility: hidden; | ||
+ | width: 250px; | ||
+ | background-color: | ||
+ | color: #fff; | ||
+ | text-align: center; | ||
+ | padding: 10px; | ||
+ | border-radius: | ||
+ | position: absolute; | ||
+ | top: 50%; /* Vertically aligned */ | ||
+ | left: 110%; /* Position to the right of the meter */ | ||
+ | transform: translateY(-50%); | ||
+ | font-size: 12px; | ||
+ | z-index: 10; | ||
+ | box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); | ||
+ | } | ||
+ | |||
+ | /* Show tooltip on hover */ | ||
+ | .ramble-meter: | ||
+ | visibility: visible; | ||
+ | } | ||
+ | |||
+ | /* Wrapper for positioning the tooltip and meter */ | ||
+ | .ramble-wrapper { | ||
+ | position: relative; | ||
+ | display: flex; | ||
+ | align-items: | ||
+ | } | ||
+ | </ | ||
+ | < | ||
+ | document.addEventListener(" | ||
+ | const needle = document.querySelector(" | ||
+ | const rambleMeter = document.querySelector(" | ||
+ | const level = rambleMeter.getAttribute(" | ||
+ | needle.style.left = `${Math.min(Math.max(level, | ||
+ | }); | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <!-- Ramble Meter --> | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | </ | ||
+ | <div class=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ==== Black Hole Mechanics in Quantum Image Compression ==== | ||
+ | |||
+ | === Hawking Radiation and Information Theory | ||
+ | The Hawking Projector | ||
$$ | $$ | ||
Line 10: | Line 117: | ||
Where $\mathcal{H}(\rho)$ represents the von Neumann entropy of a quantum state $\rho$, analogous to the entropy of a black hole. | Where $\mathcal{H}(\rho)$ represents the von Neumann entropy of a quantum state $\rho$, analogous to the entropy of a black hole. | ||
- | ## Black Hole Information Paradox | + | === Black Hole Information Paradox |
- | The compression algorithm | + | The compression algorithm |
- | $$ | + | Stephen Hawking proposed that information is preserved through quantum entanglement between the radiation emitted from black holes and the interior matter. This quantum information scrambling transforms but conserves the information in a highly complex encoded form rather than destroying it. |
- | \text{entropy} = -\sum_{i} p_i \log_2(p_i) | + | |
- | $$ | + | |
- | This is calculated in the `analyze_entropy` method, which computes the Shannon | + | The algorithm implements this principle by computing quantum state entropy: |
- | ## Quantum Circuit Encoding | + | $ |
+ | S = -\sum_{i} p_i \log_2(p_i) | ||
+ | $ | ||
+ | |||
+ | Where $p_i$ represents the probability of measuring the quantum system in state $i$. | ||
+ | |||
+ | The Shannon entropy is then calculated as a mathematical approximation of the von Neumann entropy ($S(\rho) = -\text{Tr}(\rho\log\rho)$), | ||
+ | |||
+ | === Quantum Circuit Encoding | ||
The encoding process uses quantum circuits that preserve structural information, | The encoding process uses quantum circuits that preserve structural information, | ||
Line 28: | Line 141: | ||
Where $|\psi\rangle$ is the quantum state representing encoded image data, and $\alpha_i$ are complex amplitudes. | Where $|\psi\rangle$ is the quantum state representing encoded image data, and $\alpha_i$ are complex amplitudes. | ||
- | ## Holographic Principle | + | === Holographic Principle |
- | The `create_quantum_circuit` method implements a form of the holographic principle, where the information content of a region is encoded on its boundary: | + | A form of the holographic principle |
$$ | $$ | ||
Line 35: | Line 148: | ||
$$ | $$ | ||
- | This equation from black hole thermodynamics relates entropy ($S$) to the area ($A$) of the event horizon. In the code, this manifests | + | This equation from black hole thermodynamics relates entropy ($S$) to the area ($A$) of the event horizon. In the code, this is implemented |
- | ``` | + | '' |
- | # Custom entanglement pattern that preserves locality | + | |
- | sqrt_n = int(np.sqrt(self.num_qubits)) | + | |
- | ``` | + | |
- | ## Information Scrambling with Controlled Rotation | + | === Information Scrambling with Controlled Rotation |
The quantum circuits use controlled rotation gates to simulate the scrambling of information that occurs near a black hole: | The quantum circuits use controlled rotation gates to simulate the scrambling of information that occurs near a black hole: | ||
Line 57: | Line 167: | ||
``` | ``` | ||
- | ## Weighted Reconstruction Model | + | === Weighted Reconstruction Model === |
The reconstruction algorithm uses a weighted combination of quantum states, inspired by how information might be retrieved from Hawking radiation: | The reconstruction algorithm uses a weighted combination of quantum states, inspired by how information might be retrieved from Hawking radiation: | ||
$$ | $$ | ||
- | \text{reconstructed\_bit}_i = \begin{cases} | + | \text{reconstructed\_bit}_i = \begin{cases} |
1 & \text{if } \sum_{j} p_j \cdot \text{bit}_j^i \geq \text{threshold} \\ | 1 & \text{if } \sum_{j} p_j \cdot \text{bit}_j^i \geq \text{threshold} \\ | ||
0 & \text{otherwise} | 0 & \text{otherwise} | ||
Line 69: | Line 179: | ||
Where $p_j$ are the probabilities of different quantum states, and $\text{bit}_j^i$ is the $i$-th bit of the $j$-th state. | Where $p_j$ are the probabilities of different quantum states, and $\text{bit}_j^i$ is the $i$-th bit of the $j$-th state. | ||
- | ## Entropy Ratio Analysis | + | === Entropy Ratio Analysis |
The code calculates an entropy ratio that measures how close the system is to maximum entropy: | The code calculates an entropy ratio that measures how close the system is to maximum entropy: | ||
Line 78: | Line 188: | ||
Where $n$ is the number of qubits. This relates to the idea that black holes represent maximum entropy configurations. | Where $n$ is the number of qubits. This relates to the idea that black holes represent maximum entropy configurations. | ||
- | ## Context-Aware Reconstruction | + | === Context-Aware Reconstruction |
The spatial relationships in the image are preserved using a context-aware reconstruction method that treats adjacent blocks as entangled systems: | The spatial relationships in the image are preserved using a context-aware reconstruction method that treats adjacent blocks as entangled systems: | ||
Line 87: | Line 197: | ||
This is implemented in the `reconstruct_with_context` method. | This is implemented in the `reconstruct_with_context` method. | ||
- | ## Performance Metrics Inspired by Black Hole Physics | + | === Performance Metrics Inspired by Black Hole Physics |
The reinforcement learning environment uses a reward function that incorporates metrics inspired by black hole information theory: | The reinforcement learning environment uses a reward function that incorporates metrics inspired by black hole information theory: | ||
Line 95: | Line 205: | ||
These metrics measure how well the information is preserved through the compression and reconstruction process, similar to how information might theoretically be preserved despite passing through a black hole. | These metrics measure how well the information is preserved through the compression and reconstruction process, similar to how information might theoretically be preserved despite passing through a black hole. | ||
+ |