Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/docbook-papers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: DocBook papers

# Builds the DocBook 5.2 scholarly papers (canonical XML -> HTML5 + LaTeX + PDF) and
# validates them. Runs on pull requests into main and on pushes to main. GitHub Pages
# itself is served from main/docs by the legacy Pages build; this workflow verifies the
# build and that the published HTML under docs/ is in sync, but does not deploy.

on:
push:
branches: [main]
paths:
- 'papers/ai_and_agents/paranormal-quantum-attention-networks/**'
- 'docs/ai_and_agents/**'
- '.github/workflows/docbook-papers.yml'
pull_request:
paths:
- 'papers/ai_and_agents/paranormal-quantum-attention-networks/**'
- 'docs/ai_and_agents/**'
- '.github/workflows/docbook-papers.yml'

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: papers/ai_and_agents/paranormal-quantum-attention-networks
steps:
- uses: actions/checkout@v4

- name: Install DocBook toolchain
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libxml2-utils xsltproc

# Deterministic, offline: well-formedness + XInclude + citation-link integrity + HTML + LaTeX.
# This is the real build signal (blocking).
- name: Build (wf + check-refs + HTML + LaTeX)
run: make all

# Structural validation against the official DocBook 5.2 grammar (network fetch; non-blocking).
- name: DocBook 5.2 RELAX NG validation
run: make fetch-schema && make validate
continue-on-error: true

# Compile the emitted LaTeX to PDF on the runner (the local dev host omits texlive).
# Blocking: surfaces LaTeX-escaping / tabularx / math-mode regressions.
- name: Install LaTeX (targeted subset)
run: sudo apt-get install -y --no-install-recommends texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended lmodern

- name: Compile PDF
run: make pdf

# Verify the committed GitHub Pages HTML matches a fresh build. Non-blocking:
# xsltproc whitespace can differ across environments.
- name: Check published docs HTML is in sync
run: |
make publish
if ! git diff --exit-code -- ../../../docs/ai_and_agents/ ; then
echo "::warning::docs/ai_and_agents HTML differs from a fresh build; run 'make publish' and commit the result"
fi
continue-on-error: true

- name: Upload rendered outputs
if: always()
uses: actions/upload-artifact@v4
with:
name: pqan-outputs
path: |
papers/ai_and_agents/paranormal-quantum-attention-networks/generated/01-pqan-report.html
papers/ai_and_agents/paranormal-quantum-attention-networks/generated/01-pqan-report.tex
papers/ai_and_agents/paranormal-quantum-attention-networks/generated/01-pqan-report.pdf
if-no-files-found: warn
389 changes: 389 additions & 0 deletions docs/ai_and_agents/paranormal-quantum-attention-networks.html

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@ <h3>Part II: Logic and Language</h3>
<!-- More links will be added as papers are converted -->
</ul>

<h3>Part III: AI and Agents</h3>
<ul>
<li><a href="ai_and_agents/paranormal-quantum-attention-networks.html">Paranormal Quantum Attention Networks: Discrete Graph Logics, Quantum Metalanguages, and Practical Architectures Beyond the Transformer</a></li>
</ul>

</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
generated/
*.pdf
*.aux
*.log
*.out
*.toc
# vendored third-party DocBook 5.2 RNG (fetched on demand via `make fetch-schema`)
schema/docbook.rng
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Build pipeline: DocBook 5.2 XML (canonical) -> HTML5 + LaTeX (derived).
#
# Requirements: xmllint (libxml2-utils), xsltproc (libxslt). Optional: jing,
# pdflatex. Run tools/install-docbook-toolchain.sh to install the core tools.
#
# Only ARTICLE files are transformed; 00-metadata.xml and 03-bibliography.xml
# are XInclude fragments pulled in by the article.

SHELL := /bin/bash

ARTICLES := src/01-pqan-report.xml
FRAGMENTS := src/00-metadata.xml src/03-bibliography.xml
HTML_OUTS := $(patsubst src/%.xml,generated/%.html,$(ARTICLES))
TEX_OUTS := $(patsubst src/%.xml,generated/%.tex,$(ARTICLES))
PDF_OUTS := $(patsubst src/%.xml,generated/%.pdf,$(ARTICLES))

# Prefer a vendored local copy (offline); fall back to the CDN if absent.
DOCBOOK_RNG_URL := https://cdn.docbook.org/schema/5.2/rng/docbook.rng
DOCBOOK_RNG_LOCAL := schema/docbook.rng
DOCBOOK_RNG := $(if $(wildcard $(DOCBOOK_RNG_LOCAL)),$(DOCBOOK_RNG_LOCAL),$(DOCBOOK_RNG_URL))

.PHONY: all wf check-refs validate fetch-schema html latex pdf publish clean

all: wf check-refs html latex

## publish — copy the rendered HTML into the repository's GitHub Pages tree (docs/).
## Legacy Pages serves main/docs, so a merge to main publishes this file.
DOCS_DIR ?= ../../../docs/ai_and_agents
publish: html
mkdir -p $(DOCS_DIR)
cp generated/01-pqan-report.html $(DOCS_DIR)/paranormal-quantum-attention-networks.html
@echo "published -> $(DOCS_DIR)/paranormal-quantum-attention-networks.html"

## fetch-schema — vendor the DocBook 5.2 RNG locally for offline `make validate`
fetch-schema:
curl -fsSL -o $(DOCBOOK_RNG_LOCAL) $(DOCBOOK_RNG_URL) && echo "vendored $(DOCBOOK_RNG_LOCAL)"

## wf — XML well-formedness + XInclude resolution (no network needed)
wf: $(ARTICLES)
@for f in $(ARTICLES); do \
echo "xmllint (well-formed + xinclude): $$f"; \
xmllint --noout --xinclude "$$f" || exit 1; \
done
@echo "OK: all articles are well-formed and XIncludes resolve."

## check-refs — every citation linkend must resolve to a defined bibliomixed
check-refs: $(ARTICLES) $(FRAGMENTS)
@used=$$(grep -ho 'linkend="[^"]*"' $(ARTICLES) | sed 's/linkend="//;s/"//' | sort -u); \
def=$$(grep -ho 'xml:id="bib-[^"]*"' $(FRAGMENTS) | sed 's/xml:id="//;s/"//' | sort -u); \
dangling=$$(comm -23 <(echo "$$used") <(echo "$$def")); \
if [ -n "$$dangling" ]; then \
echo "!! dangling citation linkend(s) with no bibliography entry:"; echo "$$dangling"; exit 1; \
else echo "OK: all citation linkends resolve to bibliography entries."; fi

## validate — structural validation against the official DocBook 5.2 grammar
## (requires network to fetch the RNG; falls back to wf if unavailable)
validate: $(ARTICLES)
@for f in $(ARTICLES); do \
echo "xmllint (RELAX NG DocBook 5.2): $$f"; \
xmllint --noout --xinclude --relaxng $(DOCBOOK_RNG) "$$f" \
|| { echo "!! DocBook RNG validation failed or network unavailable; run 'make wf' for offline well-formedness."; exit 1; }; \
done

html: $(HTML_OUTS)
generated/%.html: src/%.xml xsl/html5.xsl $(FRAGMENTS) | generated
xsltproc --xinclude xsl/html5.xsl $< > $@
@echo "wrote $@"

latex: $(TEX_OUTS)
generated/%.tex: src/%.xml xsl/latex.xsl $(FRAGMENTS) | generated
xsltproc --xinclude xsl/latex.xsl $< > $@
@echo "wrote $@"

pdf: $(PDF_OUTS)
generated/%.pdf: generated/%.tex | generated
cd generated && pdflatex -interaction=nonstopmode -halt-on-error $(notdir $<)
cd generated && pdflatex -interaction=nonstopmode -halt-on-error $(notdir $<)
@echo "wrote $@"

generated:
mkdir -p generated

clean:
rm -f generated/*.html generated/*.tex generated/*.pdf
rm -f generated/*.aux generated/*.log generated/*.out generated/*.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Paranormal Quantum Attention Networks (PQAN)

A scholarly white paper codifying a research report on **Paranormal Quantum Attention
Networks**: neural architectures whose *object language* is a discrete propositional
graph and whose *metalanguage* is a continuous, quantum-inspired system of
amplitude-valued assertion degrees.

The report situates PQAN against contemporary work on quantum transformers,
density-matrix quantum NLP, tensor-network machine learning, hybrid quantum–classical
(NISQ) computing, and paraconsistent / paracomplete / substructural / non-reflexive
logics for quantum theory, and argues a near-term implementation strategy:
**prioritise tensor-network approximation, add parameterized-quantum-circuit (PQC)
attention modules where quantum hardware allows, and use natural language as the first
testbed.**

## Canonical source & derived outputs

DocBook 5.2 XML is the **single canonical source**; HTML5 and LaTeX are derived by XSLT
and are never edited directly.

```
src/00-metadata.xml DocBook <info> (native elements; DC + Schema.org derived from these)
src/01-pqan-report.xml the article (primary content) — XIncludes 00 and 03
src/03-bibliography.xml the reference list (<bibliomixed> entries)
xsl/html5.xsl DocBook -> HTML5 (DC <meta> + Schema.org JSON-LD + MathJax)
xsl/latex.xsl DocBook -> LaTeX (article class)
schema/custom.rnc RELAX NG Compact: project conventions (math + finding + provisional)
scratch/formulas.md math & correspondence quick-reference
scratch/notes.md provenance, citation-verification tracking, open questions
tools/install-docbook-toolchain.sh installs xmllint + xsltproc
Makefile build pipeline
```

## Building

Install the toolchain (small; ~a few MB — NOT texlive):

```bash
./tools/install-docbook-toolchain.sh # libxml2-utils (xmllint) + xsltproc
```

Then:

```bash
make wf # XML well-formedness + XInclude resolution (offline)
make check-refs # every citation linkend resolves to a bibliography entry
make html # -> generated/01-pqan-report.html
make latex # -> generated/01-pqan-report.tex
make all # wf + check-refs + html + latex

make fetch-schema && make validate # full DocBook 5.2 RNG validation (needs network once)
make pdf # -> generated/01-pqan-report.pdf (requires a LaTeX install)
```

The document **validates against the stock DocBook 5.2 RELAX NG grammar** (`make validate`).
Math is authored once as raw LaTeX in `<mathphrase role="tex">` and rendered via MathJax
(HTML) or native math mode (LaTeX). Citations are numbered sequentially and hyperlinked
to the bibliography; a `check-refs` guard fails the build on any dangling `linkend`.

## Status of the references (IMPORTANT)

The source report cited markers **[1]–[17] but shipped no reference list** (and marker
**[7] was cited nowhere** — a dangling marker). Rather than reverse-engineer confabulated
pointers, the citations were **independently re-researched** by a deep-research pass
(fan-out web search → fetch → 3-vote adversarial verification → synthesis; 104 agents).
For each claim a real supporting source was sought; contradicted or unsupported claims
were **eliminated**. The full per-claim verdict table is in `scratch/notes.md`.

Outcome (16 sources; every entry carries a verification note):

- **Confirmed by unanimous 3-vote adversarial check** — quantum-transformer survey
(arXiv:2504.03192), quantum self-attention / PQC attention (QSANN arXiv:2205.05625;
QASA arXiv:2504.05336), density-matrix NLP (Meyer & Lewis, CoNLL 2020), tensor-network
ML (Stoudenmire & Schwab 2016; Han et al. PRX 2018; Glasser et al. NeurIPS 2019; Tang
et al. 2025), quantum metalanguage / Basic logic (Zizzi), Schrödinger/non-reflexive
logic (da Costa & Krause 1994).
- **Located in search (real primary/canonical) but not adversarially re-verified** —
qPCA (Lloyd–Mohseni–Rebentrost 2014), NISQ (Preskill 2018), barren plateaus (McClean
et al. 2018), Tarski object/metalanguage (SEP), tensor-network gene-regulatory
inference (arXiv:2509.06891), French & Krause (2006).

**Claims eliminated** (per the owner's "eliminate contradicted claims" policy): the
report's Bitcoin/ECC quantum-threat figures ("<500,000 qubits / minutes" — unsubstantiated);
the "quantum computing in genomics / human health" claim (no source located); and the
specifics that density-matrix embeddings are learned "via variational quantum circuits"
(the anchor work uses classical **neural** models — corrected in-text).

## License

AGPL-3.0-or-later. See the repository `LICENSE`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# RELAX NG Compact schema — custom constraints layered over DocBook 5.2.
#
# This schema does NOT re-specify all of DocBook; it pins down the two
# project-specific conventions this white paper relies on, so they can be
# checked with `jing -c schema/custom.rnc <file>`:
#
# 1. The math convention: <mathphrase role="tex"> carries raw LaTeX, used
# inside <inlineequation>/<informalequation>/<equation>.
# 2. The critical-review convention: <section role="finding" condition="..."></section>
# (reserved for review documents; unused in this report but validated if present).
#
# For full structural validation, validate against the official DocBook 5.2
# RELAX NG grammar (see Makefile `validate` target).

namespace db = "http://docbook.org/ns/docbook"
namespace xml = "http://www.w3.org/XML/1998/namespace"

# ---- math convention -------------------------------------------------------
tex-mathphrase =
element db:mathphrase {
attribute role { "tex" },
text
}

# A tex-bearing equation wrapper: inline or block.
tex-equation =
element db:inlineequation { tex-mathphrase }
| element db:informalequation { tex-mathphrase }
| element db:equation { element db:title { text }?, tex-mathphrase }

# ---- critical-review finding convention ------------------------------------
finding-condition = "confirmed" | "confirmed-with-caveats" | "split"

finding-section =
element db:section {
attribute xml:id { xsd:NCName },
attribute role { "finding" },
attribute condition { finding-condition },
element db:title { text },
element db:para { mixed { any* } }+
}

# ---- provisional-bibliography convention -----------------------------------
# bibliomixed entries may carry role="provisional" while their source is
# still being verified by the research pass.
provisional-bibentry =
element db:bibliomixed {
attribute xml:id { xsd:NCName },
attribute role { "provisional" }?,
any*
}

# Permissive wildcard used above so this compact schema composes with, rather
# than replaces, the full DocBook grammar.
any =
element * { attribute * { text }*, ( any | text )* }
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# PQAN — Formula & Correspondence Reference

GitHub-Markdown quick reference for the mathematics in `src/01-pqan-report.xml`.
The canonical rendering lives in the DocBook `<mathphrase role="tex">` nodes; this
file is the human-readable scratch companion.

## Assertion degrees (quantum metalanguage)

An assertion about proposition $A$ carries amplitude $\alpha$; its orthogonal
counterpart $A^\perp$ carries amplitude $\beta$, with measurement probabilities

$$P(A) = |\alpha|^2, \qquad P(A^\perp) = |\beta|^2, \qquad |\alpha|^2 + |\beta|^2 = 1.$$

A **glut** node holds $A \wedge A^\perp$ with both amplitudes non-zero (paraconsistent,
no explosion). A **gap** node leaves the assertion undefined (paracomplete).

## Identity / para-identity

Classical (Leibniz's Law):

$$x = y \iff \forall F.\, \big(F(x) \leftrightarrow F(y)\big).$$

Non-reflexive relaxation: entities may share all *contextual* properties yet not be
strictly identical; the para-identity operator $\mathcal{I}_{\text{para}}$ encodes
"indistinguishable up to contextual properties, not necessarily identical."

## Quantum fidelity (para-identical similarity core)

$$F(\rho, \sigma) = \left( \operatorname{Tr} \sqrt{ \sqrt{\rho}\, \sigma\, \sqrt{\rho} } \right)^2.$$

## PQAN attention (replaces $QK^\top$ + softmax)

Similarity between query state $\rho_{Q_i}$ and key state $\rho_{K_j}$:

$$\mathcal{S}_{i,j} = f\!\left( \operatorname{Tr} \sqrt{ \sqrt{\rho_{Q_i}}\, \rho_{K_j}\, \sqrt{\rho_{Q_i}} } \right) \mathcal{I}_{\text{para}},$$

where $f$ is a scaling function and $\mathcal{I}_{\text{para}}$ carries the non-reflexive
identity conditions. Value update via a completely positive trace-preserving (CPTP)
channel $\mathcal{E}$ (instead of a softmax-weighted linear sum):

$$\rho_{\text{out}_i} = \mathcal{E}\!\left( \sum_j \mathcal{S}_{i,j}\, \rho_{V_j} \right).$$

## Complexity / the exponential wall

| Object | Classical cost | Notes |
| --- | --- | --- |
| Pure state of $n$ qubits | $2^n$ complex amplitudes | state vector |
| Density matrix of $n$ qubits | $2^n \times 2^n$ ($\sim 4^n$ params) | mixed states + operations |
| Matrix product state (MPS), bond dim $D$ | $\mathcal{O}(n\,d\,D^2)$ | $d$ = local (physical) dimension |

MPS makes cost **polynomial** in $n$ and $D$ rather than exponential — the core "cheat,"
valid when effective entanglement stays below the bond dimension $D$.

## Object-language / metalanguage correspondence

| Layer | Classical Transformer | PQAN |
| --- | --- | --- |
| Object language (discrete) | tokens, positions | graph nodes/labels/formulas, layers |
| Metalanguage (continuous) | weights, dot products, softmax | assertion degrees, fidelity/para-identity metrics, CPTP maps, tensor-network contractions |
| Representation | $\mathbb{R}^d$ vectors | density matrices / tensor-network states |
| Context mixing | weighted linear sum | entanglement-based (tensor products + contraction) |
| Ambiguity | averaged into one vector | explicit gluts (superposed mixed states) |
| Unknowns | forced guess | genuine paracomplete gaps until measurement |

## Substructural ↔ quantum correspondence

| Dropped structural rule | Classical reading | Quantum analogue |
| --- | --- | --- |
| Contraction | copy an assumption freely | **no-cloning** |
| Weakening | discard an assumption freely | **no-deleting** |
Loading
Loading