- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
This module provides a deterministic, mathematically transparent interface between classical scalar models and quantum circuit parameters. It defines:
- Two temperature relaxation functions \(TA(\chi)\) and \(TB(\chi)\)
- A non‑zero scaling field \(\Phi(\chi)\)
- An equilibrium kernel
\[
Es(\chi) = \frac{TA(\chi) + T_B(\chi)}{2\,\Phi(\chi)}
\]
- A bounded phase mapping
\[
\theta(\chi) = (E_s(\chi) \bmod 1)\cdot 2\pi
\]
The module includes domain validation for \(\chi\), numerical safety checks for \(\Phi(\chi)\), and a normalization function ensuring all angles remain within \([0, 2\pi)\).
A Qiskit interface is provided to construct a 3‑qubit GHZ‑like circuit where the derived angle \(\theta(\chi)\) is applied to two RZ gates. This creates a reproducible classical‑to‑quantum parameterization pipeline suitable for hybrid modeling, benchmarking, or experimentation.
|
||
| .gitignore | ||
| Equilibrium Kernel + Quantum Circuit | ||
| LICENSE | ||
| README.md | ||
Equilibrium Kernel + Quantum Circuit
- Equilibrium Kernel
Temperature Models Both subsystems relax exponentially toward an environmental baseline:
[ T_A(\chi) = 300 + 20,e^{-\chi/10^4} ] [ T_B(\chi) = 300 - 15,e^{-\chi/8\cdot10^3} ]
Scaling Field A smooth, bounded, non‑zero field:
[ \Phi(\chi) = 1 + 0.1,\tanh(\chi/10^4) ]
Equilibrium Score [ Es(\chi) = \frac{TA(\chi) + T_B(\chi)}{2,\Phi(\chi)} ]
Includes:
- domain validation
- numerical guard for
\Phi(\chi)\approx 0
- Angle Mapping
The equilibrium score is converted into a phase angle:
- Extract fractional part:
[ f = E_s(\chi) \bmod 1 ] - Map to
[0, 2\pi):
[ \theta(\chi) = f \cdot 2\pi ]
This ensures:
- boundedness
- determinism
- compatibility with quantum rotation gates
- Quantum Circuit Construction
If Qiskit is installed, the module builds a 3‑qubit GHZ‑like circuit:
- H on qubit 2
- CX(2 → 0)
- CX(2 → 1)
- RZ(theta) on qubits 0 and 1
- barrier() for clarity
This circuit demonstrates how a classical scalar model can parameterize entangled quantum operations.
- Example Usage
`python from equilibriumkernel import equilibriumscore, anglefromequilibrium, buildequilibriumcircuit
chi = 60106.0 Es = equilibrium_score(chi) theta = anglefromequilibrium(chi)
qc, thetaused = buildequilibrium_circuit(chi) print(qc.draw(output="text")) `
- Dependencies
- Python 3.8+
- NumPy
- Qiskit (optional, required for circuit construction)
- Purpose This module is intended for:
- hybrid classical–quantum modeling
- parameterized circuit experiments
- reproducible scalar‑to‑phase mapping
- benchmarking and educational demonstrations
It is not a quantum simulator; it is a deterministic preprocessing and parameterization tool.