Skip to main content

Temporal Quantum Causal Engine — A computational paradigm based on causal loop mechanics

Project description

TQCE — Temporal Quantum Causal Engine

A novel computational paradigm based on causal loop mechanics.

Paradox resolution in closed timelike curves is computationally equivalent to optimization under self-referential constraint systems. TQCE exploits this equivalence to build a new class of algorithms that solve problems standard approaches cannot handle — circular dependencies, self-referential optimization, and causal reasoning with feedback loops.

Installation

git clone <repo-url>
cd tqce
pip install -e ".[dev]"

Requirements: Python 3.11+, numpy, networkx, scipy, matplotlib.

Quick Start

import numpy as np
from tqce import CausalNode, TQCEOrchestrator
from tqce.viz import plot_convergence, plot_ctn_graph

np.random.seed(42)

# Build a causal loop: A -> B -> C with retrocausal C -> A
engine = TQCEOrchestrator("My Problem")
net = engine.build_network()

net.add_node(CausalNode("A", time_coordinate=0.0, state_dim=4))
net.add_node(CausalNode("B", time_coordinate=1.0, state_dim=4))
net.add_node(CausalNode("C", time_coordinate=2.0, state_dim=4))

net.add_causal_edge("A", "B", weight=0.8)
net.add_causal_edge("B", "C", weight=0.6)
net.add_retrocausal_edge("C", "A", weight=0.4)  # backward in time

# Solve for a self-consistent timeline
results = engine.solve(verbose=True)

# Visualize
plot_ctn_graph(net)
plot_convergence(results["fixed_point"]["iteration_history"])

Five Core Components

1. Causal Tensor Networks (CTN)

Standard tensor networks are directed acyclic graphs. CTNs extend this by adding retrocausal edges — connections pointing backward in time — creating Closed Causal Loops (CCLs). The network state is computed not by forward propagation but by fixed-point iteration: repeatedly updating all nodes until the global state converges to a self-consistent solution. This is the computational analog of finding a valid timeline in a system with closed timelike curves.

Class: CausalTensorNetwork

2. Paradox Pressure Gradient Descent (PPGD)

PPGD is a gradient-based optimizer where the loss function is causal inconsistency itself. The "paradox pressure" at each node measures how far its current state is from what its causal parents demand. By treating this pressure as a differentiable loss surface, PPGD descends toward self-consistent basins using momentum and adaptive learning rates scaled by local paradox pressure.

Class: ParadoxPressureGradientDescent

3. Temporal Eigenstate Collapse (TEC)

Multiple candidate timelines are superposed as a "temporal wavefunction" with complex amplitudes. Causal interference between timelines amplifies consistent resolutions (constructive interference) and cancels paradoxical ones (destructive interference). After several rounds of interference, the system collapses to the timeline with the highest probability — the most self-consistent solution.

Class: TemporalWavefunction

4. Chrono-Entropic Regularization (CER)

Inspired by the second law of thermodynamics: entropy must be non-decreasing, even in causal loops. CER penalizes states where a past node has higher approximate entropy than its future retrocausal parents. This prevents information from growing unboundedly as it circulates through the loop, acting as a principled regularizer derived from physical constraints.

Class: ChronoEntropicRegularizer

5. Bootstrap Amplification (BA)

In a bootstrap paradox, information exists with no origin. BA exploits this computationally: a weak signal is injected into a causal loop where it influences itself at each pass. With the right resonance conditions (spectral radius of the loop kernel below 1), the signal amplifies to a stable fixed point that is larger than the input. Chrono-entropic damping prevents unbounded growth.

Class: BootstrapAmplifier

Visualization

TQCE includes a dark-themed visualization module:

Function Description
plot_convergence() Fixed-point inconsistency over iterations, with optional PPGD loss overlay
plot_paradox_pressure_landscape() Bar chart of paradox pressure per node
plot_ctn_graph() Network graph with blue causal and red retrocausal edges
plot_tec_probabilities() Timeline probability distribution after interference
plot_amplification_trace() Amplification factor over loop iterations
animate_convergence() Animated convergence showing per-node traces

All functions are importable from tqce.viz.

Examples

Three demo scripts are provided in examples/:

  • circular_constraints.py — Solve a circular dependency problem (A depends on C, B on A, C on B) using the full TQCE pipeline.
  • signal_amplification.py — Recover a weak signal buried below the noise floor using Bootstrap Amplification.
  • anomaly_detection.py — Detect time series anomalies by measuring paradox pressure when data points are inserted into causal loops.

Run any example:

python examples/circular_constraints.py

See docs/examples.md for detailed walkthroughs.

Architecture

tqce/
├── network/          # CausalNode, CausalTensorNetwork
├── optimization/     # ChronoEntropicRegularizer, ParadoxPressureGradientDescent
├── quantum/          # TemporalWavefunction
├── amplification/    # BootstrapAmplifier
├── engine/           # TQCEOrchestrator
└── viz/              # Plotting and animation

References

  • Deutsch, D. (1991). Quantum mechanics near closed timelike lines. Physical Review D, 44(10), 3197.
  • Novikov, I. D. (1989). An analysis of the operation of a time machine. Soviet Physics JETP, 68(3), 439.
  • Lloyd, S., Maccone, L., Garcia-Patron, R., Giovannetti, V., & Shikano, Y. (2011). Quantum mechanics of time travel through post-selected teleportation. Physical Review D, 84(2), 025007.

License

MIT License. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tqce-1.0.0.tar.gz (24.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tqce-1.0.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file tqce-1.0.0.tar.gz.

File metadata

  • Download URL: tqce-1.0.0.tar.gz
  • Upload date:
  • Size: 24.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for tqce-1.0.0.tar.gz
Algorithm Hash digest
SHA256 40b5997aad46bad6b9fe226529a28e43fa05145f5d26929be323bd7c6d63b291
MD5 db5f10b3d199b2ca99be7b2d3ea6218f
BLAKE2b-256 789807a7e0631b78460f8edca2aaaa7354a8710b16a12046959eddd1f7bf3e7d

See more details on using hashes here.

File details

Details for the file tqce-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: tqce-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for tqce-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0462a57f47ddb80a183e81c566a65e0eb3571fde4b1c24a0383270536b4fc4c1
MD5 9b76542ba9bfda3c3abcf2ef2319c0fb
BLAKE2b-256 21309224fe6d8fdf53b1253115d9e22483dc3586b9820ef6993842d2a1386c1a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page