Metadata-Version: 2.4
Name: quantum-progress-bar
Version: 0.1.1
Summary: The Ultimate Quantum Progress Bar
Project-URL: Repository, https://github.com/FlatBone/quantum-progress-bar.git
License-File: LICENSE
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Quantum-Progress-Bar
[日本語版READMEはこちら](README_ja.md)

*Designed by Schrödinger’s cat and debugged by Heisenberg—the ultimate quantum progress bar*  
**Note: This is a joke library.**

`Quantum-Progress-Bar` is a Python library that embodies the abyssal paradoxes of quantum mechanics. Unlike mundane, classical progress bars, this tool **collapses its wavefunction upon observation, spewing forth random progress from the fog of superposition**. The time to completion is pure chaos, governed by Heisenberg’s uncertainty principle. Let your code tunnel through quantum barriers and surrender to the embrace of quantum entanglement.

![gif](https://github.com/user-attachments/assets/0e416bbd-2278-4a31-81ee-c89b75ca3b01)


## Features

- **Observation-Dependent Quantum Collapse**: Each call to `quantum_progress` unshackles the progress bar’s state from the confines of the Schrödinger equation, potentially advancing, retreating, or wandering into multidimensional spacetime.  
- **Heisenberg Uncertainty**: `uncertainty_estimate` reflects the trade-off between conjugate variables of time and progress, thrusting unpredictable fluctuations upon you.  
- **Curse of Entanglement**: Link two progress bars quantumly, and nonlocal spin correlations will drag one into inexplicable chaos with the manipulation of the other.  
- **Superposition Visuals**: The progress bar’s display is composed of characters (`█▓▒░▄▌`) mimicking probability amplitude fluctuations, subtly embedding quantum noise into the observer’s mind.  
- **Customizable**: Freely tweak total steps, collapse coefficient (scaled to Planck’s constant), uncertainty level, and Dirac notation-inspired display width.  
- **Superposition with tqdm**: Calling the `qqdm` function wraps an iterator in a tqdm-like shell while simultaneously dragging it into a quantum superposition state. Cast aside the dull shackles of classical reliability and observe a progress wavefunction dominated by Heisenberg uncertainty.



## Installation

No profound understanding of quantum mechanics is required, but basic Python skills are a must. To inject this library into your classical system, follow these steps:

1. **Observation of Dependencies**:  
   Verified with Python 3.10 or higher. External libraries are rendered unnecessary via quantum tunneling effects (i.e., there are no dependencies).  
   ```bash
   python --version  # Confirm Python >= 3.10
   ```

2. **Localization of the Wavefunction**:  
   Use `pip` to observe (install) the library into your local spacetime.  
   ```bash
   pip install quantum-progress-bar
   ```



## Usage

### Basic Quantum Experiment
Let’s observe a simple quantum progress bar—though the act of observation itself distorts the outcome.  
```python
from quantum_progress_bar import quantum_progress

# Initialize the progress bar in a superposition state
quantum_progress(total=100, width=50, delay=0.2)
```

Sample output (collapsing with each observation):  
```
[▓▒░█▄▌        ] 42%  # First observation: Steady progress
[█▄▌▓▒         ] 38%  # Second: Time reversal
[▓█▄▌▒░▓█      ] 67%  # Third: Sudden leap via tunneling
...
[█▓▒░█▄▌▓█....█] 100%  # Miraculous convergence
```

### Advanced Manipulation with Dirac Notation
Use the `Quantum-Progress-Bar` class to (attempt to) precisely control quantum states.  
```python
from quantum_progress_bar import QuantumProgressBar
import time

# Initialize the progress bar in the |ψ⟩ state
pb = QuantumProgressBar(total_steps=100, collapse_factor=0.3, uncertainty_level=0.9)

# Conduct 10 observation experiments
for _ in range(10):
    progress = pb.quantum_progress(width=50)
    print(f" Remaining time ⟨t|ψ⟩: {pb.uncertainty_estimate()}")  # ⟨t|ψ⟩ is unpredictable
    time.sleep(0.2)

# Entangle with another progress bar
pb2 = QuantumProgressBar(total_steps=100)
pb.entangle(pb2)
pb.update(steps=10)  # pb2 is nonlocally affected
```

### Quantum Loading Fiction
Display a loading animation brimming with infinite possibilities.  
```python
from quantum_progress_bar import quantum_loading

quantum_loading(message="Converging quantum states within a black hole", duration=3, width=50)
```

### Wave-Like Iteration à la tqdm
With the `qqdm` function, wrap an iterator like `tqdm` while elevating its existence into a quantum phase space.

```python
from quantum_progress_bar import qqdm
import time

# Quantum field interference pattern generator in tqdm style
for i in qqdm(range(100)):
    # Some operator transitions the state
    time.sleep(0.01)

# Wave packet collapse in list comprehension
process = lambda x: x * (x + 1)  # Projection of angular momentum energy levels
results = [process(i) for i in qqdm(range(100))]

# Entanglement as a context manager
with qqdm(total_steps=100) as qbar:
    for i in range(100):
        # Some interaction evolves the field’s state
        time.sleep(0.01)
        qbar.update(1)
```



## How It Works (Quantum Mechanical Interpretation)

- **Wavefunction Collapse**: When `quantum_progress` is called, the progress state |ψ⟩ is projected into an eigenstate by the observation operator, materializing possibilities of advancement, retreat, or drift into imaginary time.  
- **Manifestation of the Uncertainty Principle**: `uncertainty_estimate` mimics the relation Δt·Δp ≥ ħ/2, with the precision of remaining time estimates collapsing inversely to observation frequency.  
- **Chaos of Quantum Entanglement**: Entangling two progress bars generates a Bell state |Ψ⁻⟩ = (|01⟩ - |10⟩)/√2, where updating one exerts a seemingly superluminal influence on the other.  
- **Quantum Interpretation of tqdm Compatibility**: The `qqdm` function realizes a superposition of classical tqdm interfaces and quantum uncertainty. Like Schrödinger’s cat, it simultaneously expresses deterministic and indeterminate progress.


## Practicality
By viewing progress through a quantum lens and embracing uncertainty, `Quantum-Progress-Bar` offers a fresh perspective on your projects. It’s a tool to savor the absurdity of quantum mechanics while adding philosophical depth to your code. There’s no guarantee progress will reach 100%, but isn’t that a metaphor for life itself?



## Contribution

We welcome brave contributors who can withstand quantum chaos. We await bug reports (blame them on observation-induced state changes), feature suggestions (e.g., spin-polarized progress bars), code optimizations (aiming for quantum supremacy), and documentation additions (like explanations of black hole evaporation).


## License

This project is released under the MIT License. See [LICENSE](LICENSE) for details.

## References
- [Über das Gesetz der Energieverteilung im Normalspektrum](https://onlinelibrary.wiley.com/doi/10.1002/andp.19013090310)
- [Über einen die Erzeugung und Verwandlung des Lichtes betreffenden heuristischen Gesichtspunkt](https://onlinelibrary.wiley.com/doi/10.1002/andp.19053220607)
- [Quantisierung als Eigenwertproblem](https://onlinelibrary.wiley.com/doi/10.1002/andp.19263840404)
