Photonica: A Structured Arithmetic Framework Inspired by Photonic Encoding

Kevin Dill · BridgeTech Media
Proposed revision v0.2 · September 9, 2026
Status: Conceptual mathematical framework; not peer-reviewed. Physical realization and computational advantage have not been demonstrated.

A numerical representation can carry both a scalar value and an addressable internal configuration.

1. Executive summary

Photonica explores numerical representations whose coordinates have proposed interpretations in structured light. A formal state is a seven-coordinate record, written ⊛ = ⟨E, p, ℓ, t, f, μ, κ⟩. A designated coordinate supplies a scalar value; the complete record identifies the configuration.

The central design question is useful and concrete: how should arithmetic act on a structured record while retaining a predictable scalar projection?

This revision supplies two consistent answers. Coordinate arithmetic treats each coordinate independently and gives a direct product of finite residue rings. Carry arithmetic treats the same record as mixed-radix digits and gives a single finite residue ring. Each has its own addition, multiplication, and additive inverse. Their operations must not be mixed without separately proving the required algebraic laws.

Both constructions use established mathematics. Photonica's proposed contribution is the organization, interpretation, and eventual implementation of these structures for photonic encoding. The present definitions do not establish a new branch of number theory, quantum advantage, or a physical arithmetic device.

The revision also distinguishes the size of a state alphabet from a support score and from information recovered in a measurement. It preserves the original support-product formula as an explicitly defined statistic, while correcting its previous interpretation as the storage capacity of an individual number.

2. Motivation and scope

The scalar integer 7 and a structured record whose designated value is 7 are different mathematical objects. Ordinary mathematics already supports tuples, vectors, rings, annotated values, and encodings with internal organization. Nothing in Peano arithmetic prevents a representation of a number from carrying additional information. Peano arithmetic concerns the natural numbers; the integers ℤ additionally include negative values.

Photonica therefore augments a representation rather than repairing a limitation of classical integers. Two records can share the same time-bin label while differing in their other coordinates. Whether those coordinates can be prepared, transformed, and distinguished optically is a separate engineering question.

The report separates three levels:

  1. Formal records: finite coordinate labels and exact arithmetic rules.
  2. Encoding proposals: possible associations between labels and optical modes.
  3. Physical devices: sources, transformations, measurements, losses, and experimental validation.

Results at the first level do not, on their own, establish results at the other two.

3. Formal state space

Choose positive integer radices d = (d_E, d_p, d_ℓ, d_t, d_f, d_μ, d_κ). Define

X(d) = ∏ᵢ {0, 1, …, dᵢ − 1}.

x = ⟨x_E, x_p, x_ℓ, x_t, x_f, x_μ, x_κ⟩ ∈ X(d).

The indices are formal labels. An encoding dictionary may associate each index with an optical configuration. Adding indices does not mean adding physical energies, polarization vectors, or topological charges.

The all-zero record is the reference configuration and the additive identity in both models below. Zero is a label: it does not mean the electromagnetic vacuum. In particular, a single photon in a Gaussian spatial mode is not a vacuum state.

3.1 Coordinates and possible interpretations

Coordinate Formal interpretation Physical qualification
E Coarse spectral label Photon energy and frequency obey E = hν. Coarse band and fine frequency labels must partition a spectrum consistently; they are not automatically independent resources.
p Polarization-basis index H/V and L/R are alternative bases for a two-dimensional polarization space under the usual fixed propagation-mode approximation. They are not four mutually orthogonal states.
Index into a selected OAM mode list Choose the list explicitly. A symmetric list −L,…,+L has 2L+1 entries: L = 23 gives 47, not 48. A 48-entry list need not be symmetric.
t Temporal-mode index Distinguishable time slots require specified pulse shapes, spacing, and detection resolution. Modular wrap is an arithmetic convention.
f Spectral-mode index Time and frequency are related descriptions of the optical field. A product of time and frequency alphabet sizes requires an explicit orthogonal mode construction.
μ Spatial-profile index Different visual shapes need not be orthogonal or independently distinguishable. OAM and morphology may describe overlapping mode structure.
κ Index into a chosen topology-label list A topological invariant may be derived from other coordinates or an entire field/correlation texture. It is not automatically an independent quantum degree of freedom.

No physical minimum radix is asserted for these axes. A radix of one disables an axis. The label assigned to a reference state and the selection of a basis are modeling choices.

3.2 One consistent illustrative configuration

All numerical examples in this revision use:

Display order: (E, p, ℓ, t, f, μ, κ)
Radices:       (1, 2, 48, 37, 12, 6, 3)
Total labels:  N = 1 × 2 × 48 × 37 × 12 × 6 × 3 = 767,232.

Energy is fixed in this example. The values 48 and 37 are illustrative choices, not experimental lower bounds for Photonica. Their product does not imply that a laboratory system supplies the corresponding joint alphabet.

4. Value, support, and information

4.1 Scalar projection

Define the value map

πₜ : X(d) → ℤ/dₜℤ,       πₜ(x) = x_t mod dₜ.

Its displayed representative lies between 0 and d_t−1. For the examples, the value lies between 0 and 36. This is a formal coordinate projection, not quantum measurement collapse.

Other functions of the coordinates can be defined, but they do not automatically preserve arithmetic. For example, changing the designated axis in the carry model may destroy the projection identities proved in Section 7.

4.2 Global alphabet size

The unrestricted formal product contains

N = |X(d)| = ∏ᵢ dᵢ

records. If physical compatibility restricts the available records to A ⊆ X(d), the available label count is |A|, not necessarily N. Distinguishability can impose further restrictions.

A single known record is one record. It is not an ensemble of N simultaneously readable messages. Nevertheless, a choice among N distinguishable records can encode information.

4.3 Support score: a precise replacement for “local storage”

Define the support relative to the all-zero reference:

supp(x) = {i : xᵢ ≠ 0}.
W(x) = ∏ over i in supp(x) of dᵢ, with W(0) = 1.

W retains the old local-depth formula. It counts the coordinate box obtained by freeing the supported coordinates, including their zero values, while holding all other coordinates at zero. It is a support score, not the number of configurations inside x, an entropy, or a physical Hilbert-space dimension.

The number of records with exactly a specified support S is instead

Q(S) = ∏ over i in S of (dᵢ − 1).

For example, W = 37 for a time-only nonzero record, but there are only 36 records with exactly that support. The box includes the zero record; the exact-support set excludes it.

Both support and W depend on the reference labels. Relabeling an axis can change W without changing any physical capacity. “Support-dependent” is therefore more precise than “value-sensitive”: the scalar time-bin value alone does not determine the score.

4.4 Information and binary representation

Quantity Meaning For N = 767,232
log₂ N Entropy of a uniform choice among all N labels Approximately 19.5493 bits
⌈log₂ N⌉ Minimum fixed-width binary record length to label every state 20 bits
⌊log₂ N⌋ Largest fixed-length binary message embeddable in one selection from N labels 19 bits

For a nonuniform classical ensemble, H(X) = −Σ_x p(x) log₂ p(x) ≤ log₂ N. Neither H(X) nor N changes merely because one selected record has more nonzero coordinates.

In a quantum encoding using a D-dimensional transmitted system, without preshared entanglement or extra communication resources, accessible classical information is bounded by the Holevo quantity, which is at most log₂ D. Real preparation and readout errors can reduce the useful information. This bound concerns an ensemble and a communication model, not the score W of a record. See Preskill, Quantum Shannon Theory.

5. Model A: coordinate arithmetic

Define separate operations on each coordinate:

(a ⊕coord b)ᵢ = (aᵢ + bᵢ) mod dᵢ
(a ⊗coord b)ᵢ = (aᵢ bᵢ) mod dᵢ
(−coord a)ᵢ   = (−aᵢ) mod dᵢ.

The additive identity is the all-zero record. The multiplicative identity has coordinate 1 mod d_i on each axis, including 0 on any radix-one axis.

This is the commutative ring ∏ᵢ ℤ/dᵢℤ. Addition and multiplication are associative and commutative; multiplication distributes over addition; every record has an additive inverse. There is no carry between coordinates.

These statements follow coordinate by coordinate from the laws of modular arithmetic. A product of two or more nontrivial rings has zero divisors. This model does not provide a new unique-factorization theory.

6. Model B: mixed-radix carry arithmetic

To preserve the original carry idea, introduce a second, explicitly different arithmetic. Use the order

(t, ℓ, κ, μ, f, E, p)

from least to most significant. Write y_j for the coordinates in this order, r_j for their radices, and define weights and a packing map:

w₀ = 1;    wⱼ = ∏ over h < j of r_h
J(x) = Σⱼ yⱼ wⱼ,        0 ≤ J(x) < N.

Every record has a unique packed label. Let unpack be the inverse map. Define

a ⊕carry b = unpack((J(a) + J(b)) mod N)
a ⊗carry b = unpack((J(a) × J(b)) mod N)
−carry a   = unpack((−J(a)) mod N).

This supplies a complete boundary rule: discard only overflow beyond the final coordinate. All coordinates use modular digit arithmetic. There is no energy saturation, morphology lattice join, or separate signed-charge rule inside this model.

For a digitwise implementation of addition:

c₀ = 0
sⱼ = aⱼ + bⱼ + cⱼ
zⱼ = sⱼ mod rⱼ
cⱼ₊₁ = floor(sⱼ / rⱼ)
Discard c₇.

Incoming carry must be included before taking the remainder. A radix-one axis passes incoming carry onward while its own digit remains zero.

The packing map makes this ring isomorphic to ℤ/Nℤ. Consequently, both operations are associative and commutative, multiplication distributes, and the packed inverse is a genuine additive inverse. The multiplicative identity is unpack(1); for the example, only t equals 1.

The coordinate product from Model A is not the multiplication of Model B. Combining coordinate multiplication with carry addition generally breaks distributivity. For example, with two radix-two digits ordered low-to-high, let a = b = c = (1,0). Then b ⊕carry c = (0,1), so a ⊗coord (b ⊕carry c) = (0,0), whereas (a ⊗coord b) ⊕carry (a ⊗coord c) = (0,1).

Mixed-radix carry is established mathematics. Associating different digits with optical labels is a proposed interpretation. Carry does not by itself turn time into angular momentum or provide the physical transformation needed to change a mode.

7. Results established by the definitions

7.1 Modular projection

For either model, with its own matched addition and multiplication:

πₜ(a ⊕ b) = πₜ(a) + πₜ(b) mod dₜ
πₜ(a ⊗ b) = πₜ(a) × πₜ(b) mod dₜ.

For coordinate arithmetic this is immediate. For carry arithmetic, t is the least significant digit, so J(x) ≡ x_t mod d_t. Since d_t divides N, reduction modulo N followed by reduction modulo d_t yields the stated identities.

This proves reduction to a finite residue ring. It does not prove reduction to Peano arithmetic or recover all of ℤ. An unbounded integer representation requires a separate construction, such as arbitrarily many mixed-radix digits for nonnegative values plus a consistent signed extension. Merely taking an unspecified union of finite residue rings is insufficient.

Time-only records are not closed under carry addition: 30 + 15 creates a nonzero next digit. Projection is still valid; closure of the time-only subset is a different claim.

7.2 Many configurations can share one value

For unrestricted X(d), each scalar time-bin value has exactly N/d_t preimages. In the example, that number is 20,736. This count is the same for every scalar value, including zero. It is distinct from the support score.

7.3 Support is not monotone under addition

W(a ⊕ b) may rise, fall, or remain unchanged. This is ordinary support behavior under arithmetic, not evidence of optical interference. It also shows that the support score alone does not measure preserved information.

7.4 Repeated addition is periodic

For Model A, the additive order of x is

Tcoord = lcmᵢ(dᵢ / gcd(dᵢ, xᵢ)).

For Model B, it is

Tcarry = N / gcd(N, J(x)).

The zero record has order one under these formulas. Repeated addition of x cycles with this order. Any support-score sequence sampled along that cycle is periodic, with a period dividing the state period. Periodicity is therefore solved for these finite models, rather than an open conjecture.

7.5 The two rings are not generally equivalent

The Chinese remainder theorem identifies ∏ᵢ ℤ/dᵢℤ with ℤ/Nℤ when the nontrivial radices are pairwise coprime. The illustrative radices are not: 2, 48, 12, 6, and 3 share factors. The two models therefore have different algebraic structure. Even where such an isomorphism exists, it need not be the ordinary mixed-radix packing map.

8. Worked examples

Every tuple uses display order (E, p, ℓ, t, f, μ, κ).

8.1 Same scalar value, different support

a = ⟨0, 0, 0, 7, 0, 0, 0⟩
b = ⟨0, 1, 3, 7, 4, 1, 1⟩

πₜ(a) = πₜ(b) = 7
W(a) = 37
W(b) = 767,232.

These are two distinct records with the same designated value. The score does not assert that b physically stores more information than a within a fixed encoding alphabet.

8.2 Addition with carry

a = ⟨0, 0, 12, 30, 2, 1, 1⟩
b = ⟨0, 1,  5, 15, 3, 2, 2⟩
Axis Radix a b Carry in Total Output Carry out
t 37 30 15 0 45 8 1
48 12 5 1 18 18 0
κ 3 1 2 0 3 0 1
μ 6 1 2 1 4 4 0
f 12 2 3 0 5 5 0
E 1 0 0 0 0 0 0
p 2 0 1 0 1 1 0
a ⊕carry b = ⟨0, 1, 18, 8, 5, 4, 0⟩.

Both the temporal digit and topology-label digit overflow. The topology label is 0, not 3. With coordinate addition instead, the result is ⟨0, 1, 17, 8, 5, 3, 0⟩.

8.3 Cancellation depends on the arithmetic

a = ⟨0, 0,  3, 5, 0, 0, 0⟩
b = ⟨0, 0, 45, 5, 0, 0, 0⟩

a ⊕coord b = ⟨0, 0, 0, 10, 0, 0, 0⟩; W = 37
a ⊕carry b = ⟨0, 0, 0, 10, 0, 0, 1⟩; W = 111.

Each input has W = 48 × 37 = 1,776. In Model A, 45 is the residue −3 modulo 48. In Model B, adding the digit labels 3 and 45 also emits a carry. These are formal labels, not an asserted mapping from 45 to a particular physical OAM mode. No optical destructive interference is implied.

8.4 A valid carry inverse

Let a have t = 1 and every other digit zero. Then J(a) = 1 and

−carry a = unpack(N − 1) = ⟨0, 1, 47, 36, 11, 5, 2⟩.

Adding these records propagates carry across the register and produces zero after terminal overflow is discarded. Negating only the time digit would produce t = 36 and leave an unwanted carry in ℓ.

8.5 Multiplication has two different meanings

Let a have t = 4 only, and b have t = 10 only.

a ⊗coord b = ⟨0, 0, 0, 3, 0, 0, 0⟩
a ⊗carry b = ⟨0, 0, 1, 3, 0, 0, 0⟩.

Both project to 4 × 10 ≡ 3 mod 37. The carry model also retains the next digit of the packed product 40. Neither operation creates quantum entanglement by definition.

9. Relationship to quantum optics

9.1 A record is not a complete quantum state

If an implementation establishes an orthonormal basis indexed by admissible records, an individual record may label a basis state |x⟩. A general pure state additionally requires complex amplitudes:

|ψ⟩ = Σ_x α_x |x⟩,       Σ_x |α_x|² = 1.

A mixed state requires a density operator. A seven-index record contains neither these amplitudes nor a density operator. A physical factorization into seven independent subsystems is an additional assumption requiring justification.

The polarization index p is not a substitute for an arbitrary continuous phase angle. The proposed mapping from continuous Helvin parameters into a fixed finite X(d) cannot be injective over the full continuous domain. A finite discretization could define an encoding, with explicitly stated rounding and information loss; no general Helvin embedding theorem is claimed here.

9.2 Interference and entanglement need their own models

For two coherent scalar field contributions in the same detected mode,

I = |A + B|² = |A|² + |B|² + 2 Re(A* B).

Relative phase, amplitudes, mode overlap, and the measurement determine the interference term. The earlier “destructive if any axis exceeds π/2” rule is not a general optical law and is removed.

A tensor product of two pure states is a product state, not an entangled state. Nonzero covariance alone also does not prove entanglement: classical mixtures can be correlated. Claims of entanglement require a specified subsystem division and suitable state analysis or an experimentally justified witness.

9.3 What the cited experiments support

Source Relevant result Limit on its use here
Yuen and Demetriadou, 2024 A quantum-electrodynamic description of emitters interacting with radiative photonic environments using pseudomodes. Does not establish a separate finite morphology register or Photonica arithmetic. Paper
Liu et al., 2025 A 37-dimensional time-domain optical demonstration of a GHZ-type contextuality construction, using time-multiplexed pulsed coherent light. Does not establish a 37-dimensional single-photon minimum or a multipartite GHZ state in every photon. Paper
de Mello Koch et al., 2025 Topological structure of entangled OAM light, including reported 48-dimensional manifolds and more than 17,000 topological numbers. Those invariants are not automatically 17,000 independent, orthogonal storage states to multiply by another OAM radix. Paper
Kam et al., 2025 Near-field photon entanglement involving total angular momentum. Does not establish the seven-coordinate register or arithmetic carry transitions. Paper
Wang et al., 2025 Sequence-dependent transformations using noncommutative metasurfaces and structured entangled photons. Noncommuting device composition does not make the additions in Sections 5–6 noncommutative. Paper

These papers motivate possible encodings and experiments. None is a validation of the complete Photonica construction.

10. Implementation and validation plan

10.1 Establish a software baseline

Implement the two models with distinct function names. Validate label ranges, packing and unpacking, identity and inverse laws, distributivity, projection identities, and the worked examples. The executable appendix supplies a minimal version.

The previously linked photonica.py implements a different hybrid rule, including energy saturation and coordinate multiplication. It should not be described as an implementation of this revision. The replacement visualizer includes a model selector, consistent carry and coordinate addition, full-seed ring classification, exact additive periods, and explicitly labeled support-score statistics. Its script is photonica.js. The replacement Python module is photonica.py. These prepared files are not a certification of the public deployment.

10.2 Start with a small optical alphabet

A proposed first experiment should select a limited, explicitly characterized mode set, for example two polarization labels and a small set of path or temporal modes. Specify the state preparation, intended basis, decoder, and complete input-to-output mapping before increasing the alphabet.

The acceptance criteria should include preparation and detection error, mode cross-talk, loss, transformation success probability, throughput, energy use, and repeatability. Compare results with a conventional digital implementation and, where relevant, a classical optical implementation using the same task definition.

10.3 Specify realizable operations

A fixed modular shift |a⟩ → |a+k mod N⟩ is a permutation and therefore has an abstract unitary implementation. This observation does not supply an optical circuit.

A coherent two-register addition can preserve the first register:

|a⟩|b⟩ → |a⟩|a+b mod N⟩.

For multiplication, overwriting both inputs with their product loses information. A reversible formulation instead retains them and uses an accumulator:

|a⟩|b⟩|c⟩ → |a⟩|b⟩|c+ab mod N⟩.

Fixed multiplication |a⟩ → |ka mod N⟩ is a permutation only when gcd(k,N) = 1. Nonlinear optical sources, beam splitters, or entanglement swapping do not automatically implement these truth tables. Each proposed device needs a circuit and a success/fidelity model.

10.4 Model noise and measurement operationally

Use a classical transition model for noisy labels, or a quantum channel for density operators, as appropriate. Track fidelity, loss, coherence, and decoding error. Decoherence need not reduce Hilbert-space dimension, and the integer-valued support score does not generally obey an exponential decay law.

The earlier millisecond/second “depth lifetime” estimates lack specified hardware and supporting measurements and are removed. Ordinary photodetection consumes the detected photon. Tomography of an unknown quantum state requires repeated preparations and measurements; it does not recover an arbitrary unknown state from one photon.

11. Research questions that remain open

  1. Physical alphabet: Which joint labels can be prepared and reliably distinguished without double-counting related descriptions of the same optical modes?
  2. Operation design: What circuits implement a chosen arithmetic, at what loss, fidelity, latency, and resource cost?
  3. Useful structure: Can a geometry-aware operation or task exploit these labels more efficiently than a conventional representation?
  4. Error correction: What restricted code space, error model, and recovery map provide protection? Multiple coordinates alone do not constitute an error-correcting code.
  5. Topology: Which invariants are measurable and robust under the particular disturbances of an implementation, and does that robustness help the task?
  6. Beyond the finite models: What additional operations or unbounded constructions yield results not already accounted for by the two rings defined here?

No cryptographic security claim follows from either construction. A future cryptographic proposal would need a threat model, hardness assumption, protocol, and independent analysis. Noncommutativity by itself would not establish security.

12. Conclusion

Photonica provides a vocabulary for structured numerical records inspired by optical encoding. This revision gives that vocabulary a consistent mathematical basis: two separately defined finite arithmetic models, an exact modular projection, a clearly interpreted support score, and reproducible examples.

The useful next step is to connect a small, well-defined encoding to a measured task. The prospect of physical benefit depends on that implementation and comparison, rather than on the coordinate count alone.

Appendix A. Principal changes from the linked report

Original issue Correction in this revision
Classical integers described as having no mathematical structure or information-bearing representations Distinguishes abstract scalar values from structured representations.
Coordinate-ring claims mixed with carry addition, saturation, joins, and coordinate multiplication Defines two complete arithmetic systems with separate operation names.
Undefined terminal carry and invalid componentwise carry inverse Specifies modulo-N overflow and a packed additive inverse.
“Peano reduction” to ℤ Proves the actual projection to ℤ/d_tℤ.
Local depth treated as internal state count or storage Reinterprets the formula as a reference-dependent support-box score; supplies the exact-support count.
20-bit storage capacity inferred from rounding upward Separates entropy, binary label width, and fixed-length message capacity.
Unjustified multiplication of optical axes Requires an admissible, distinguishable joint alphabet.
Symmetric OAM range claimed to supply 48 states at L ≥ 23 Corrects 2L+1; uses indices into an explicit mode list.
κ = 3 retained at radix 3 in carry example Wraps κ to 0 and propagates carry to μ.
Cancellation described as optical interference Distinguishes coordinate cancellation, carry behavior, and optical interference.
Continuous Helvin parameters claimed to embed injectively into finite labels Withdraws the impossible unrestricted finite encoding claim.
Entanglement and hardware operations asserted by naming components Requires a quantum state/circuit model and validation.
Unsupported depth decay and lifetime estimates Replaces them with measurable noise and performance criteria.
Repeated-addition periodicity listed as open Gives explicit additive-order formulas for both finite models.
Incorrect paper names, author attributions, and years Provides the bibliography below.

The prior rigor notes correctly identified important inconsistencies, but their closing claim of a correct “collapse to Peano arithmetic” still overstates the result. Also, dropping terminal carry alone does not make componentwise negation a carry inverse; the inverse must account for the complete packed number. Neither the old report nor its code should be treated as authoritative for the definitions introduced here.

Appendix B. References

  1. Ben Yuen and Angela Demetriadou. “Exact Quantum Electrodynamics of Radiative Photonic Environments.” Physical Review Letters 133, 203604 (2024). Publisher.
  2. Zheng-Hao Liu et al. “Exploring the boundary of quantum correlations with a time-domain optical processor.” Science Advances 11, eabd8080 (2025). Publisher; author manuscript.
  3. Robert de Mello Koch, Pedro Ornelas, Neelan Gounden, Bo-Qiang Lu, Isaac Nape, and Andrew Forbes. “Revealing the topological nature of entangled orbital angular momentum states of light.” Nature Communications 16, 11095 (2025). Publisher. Publication was in December 2025, not March 2026.
  4. Amit Kam et al. “Near-field photon entanglement in total angular momentum.” Nature 640, 634–640 (2025). Publisher.
  5. Yan Wang et al. “Noncommutative metasurfaces enabled diverse quantum path entanglement of structured photons.” Opto-Electronic Science 4, 250006 (2025). Publisher; author manuscript.
  6. Manuel Erhard, Mario Krenn, and Anton Zeilinger. “Advances in high-dimensional quantum entanglement.” Nature Reviews Physics 2, 365–381 (2020). Publisher. This is background literature, not experimental validation of Photonica; the original report's 2023 date was incorrect.
  7. John Preskill. “Quantum Shannon Theory” (2016). Author manuscript. Background for the information-theoretic distinction in Section 4.
  8. Kevin Dill. Original Photonica application report, its linked reference implementation, and Helen & Kevin Dill's rigor notes, reviewed September 9, 2026. These are project materials, not independent corroboration. Helvin is retained as the project's stated conceptual antecedent; this revision does not independently assess its separate report.

Appendix C. Executable definitions and checks

Copy the following block into a Python file and run it with Python 3. It uses the standard library only. It implements this revision, not the old hybrid rules. The small-register exhaustive checks and illustrative randomized checks verify implementation consistency; the algebraic proofs are given in Sections 5–7.

from itertools import product
from math import prod
from random import Random

AXES = ('E', 'p', 'l', 't', 'f', 'm', 'k')
ORDER = (3, 2, 6, 5, 4, 0, 1)  # t,l,k,m,f,E,p
RADICES = (1, 2, 48, 37, 12, 6, 3)


class Model:
    def __init__(self, radices=RADICES):
        self.d = tuple(radices)
        if len(self.d) != 7 or any(type(d) is not int or d < 1 for d in self.d):
            raise ValueError('Expected seven positive integer radices')
        self.N = prod(self.d)
        self.zero = (0,) * 7

    def checked(self, x):
        x = tuple(x)
        if len(x) != 7 or any(type(v) is not int or not 0 <= v < d
                              for v, d in zip(x, self.d)):
            raise ValueError('Coordinate outside its label range')
        return x

    def pack(self, x):
        x = self.checked(x)
        n, weight = 0, 1
        for i in ORDER:
            n += weight * x[i]
            weight *= self.d[i]
        return n

    def unpack(self, n):
        if type(n) is not int or not 0 <= n < self.N:
            raise ValueError('Packed label outside register range')
        x = [0] * 7
        for i in ORDER:
            n, x[i] = divmod(n, self.d[i])
        return tuple(x)

    def coord_add(self, a, b):
        a, b = self.checked(a), self.checked(b)
        return tuple((x + y) % d for x, y, d in zip(a, b, self.d))

    def coord_mul(self, a, b):
        a, b = self.checked(a), self.checked(b)
        return tuple((x * y) % d for x, y, d in zip(a, b, self.d))

    def coord_neg(self, a):
        return tuple((-x) % d for x, d in zip(self.checked(a), self.d))

    def carry_add(self, a, b):
        a, b = self.checked(a), self.checked(b)
        out, carry = [0] * 7, 0
        for i in ORDER:
            carry, out[i] = divmod(a[i] + b[i] + carry, self.d[i])
        return tuple(out)  # discard terminal carry

    def carry_mul(self, a, b):
        return self.unpack((self.pack(a) * self.pack(b)) % self.N)

    def carry_neg(self, a):
        return self.unpack((-self.pack(a)) % self.N)

    def score(self, x):
        return prod(d for v, d in zip(self.checked(x), self.d) if v != 0)


def verify_case(m, a, b, c):
    assert m.unpack(m.pack(a)) == a
    assert m.pack(m.carry_add(a, b)) == (m.pack(a) + m.pack(b)) % m.N
    for add, mul, neg, one in (
        (m.coord_add, m.coord_mul, m.coord_neg, tuple(1 % d for d in m.d)),
        (m.carry_add, m.carry_mul, m.carry_neg, m.unpack(1 % m.N)),
    ):
        assert add(a, m.zero) == a
        assert add(a, neg(a)) == m.zero
        assert mul(a, one) == a
        assert add(a, b) == add(b, a)
        assert mul(a, b) == mul(b, a)
        assert add(add(a, b), c) == add(a, add(b, c))
        assert mul(mul(a, b), c) == mul(a, mul(b, c))
        assert mul(a, add(b, c)) == add(mul(a, b), mul(a, c))
        assert add(a, b)[3] == (a[3] + b[3]) % m.d[3]
        assert mul(a, b)[3] == (a[3] * b[3]) % m.d[3]


def verify():
    small = Model((1, 2, 2, 3, 1, 1, 1))
    states = [small.unpack(n) for n in range(small.N)]
    for a, b, c in product(states, repeat=3):
        verify_case(small, a, b, c)

    m, rng = Model(), Random(20260909)
    for _ in range(1000):
        a, b, c = [m.unpack(rng.randrange(m.N)) for _ in range(3)]
        verify_case(m, a, b, c)

    a, b = (0, 0, 12, 30, 2, 1, 1), (0, 1, 5, 15, 3, 2, 2)
    assert m.carry_add(a, b) == (0, 1, 18, 8, 5, 4, 0)
    assert m.coord_add(a, b) == (0, 1, 17, 8, 5, 3, 0)
    a, b = (0, 0, 3, 5, 0, 0, 0), (0, 0, 45, 5, 0, 0, 0)
    assert m.score(m.coord_add(a, b)) == 37
    assert m.score(m.carry_add(a, b)) == 111
    assert m.carry_neg((0, 0, 0, 1, 0, 0, 0)) == (0, 1, 47, 36, 11, 5, 2)
    a, b = (0, 0, 0, 4, 0, 0, 0), (0, 0, 0, 10, 0, 0, 0)
    assert m.coord_mul(a, b) == (0, 0, 0, 3, 0, 0, 0)
    assert m.carry_mul(a, b) == (0, 0, 1, 3, 0, 0, 0)
    assert m.N == 767232
    print('PASS: 1,728 exhaustive small-register triples, 1,000 sampled')
    print('illustrative triples, and the specified arithmetic examples.')


if __name__ == '__main__':
    verify()

© 2026 Kevin Dill. BridgeTech Media research draft.

Appendix D. Interactive implementation update

The replacement visualizer uses radix vector (1,2,48,d_t,12,6,3), with d_t selectable as 37, 39, or 48. The initial setting is 37. It adds the fixed seed to an initially zero accumulator; it does not repeatedly double the accumulator. Run/Pause controls animation, Step advances the existing run by the selected number of additions, and Reset begins a fresh run. Invalid, empty, fractional, and out-of-range input is rejected; zero is valid.

The distinct-score plot shows cumulative distinct W values against additions, both on linear axes. The histogram and entropy use every step from 1 through n, not the initial accumulator. Frequency counters avoid keeping an unbounded sample history. One full additive cycle ends the run automatically. Carries are visualized only in carry mode, including passage through the radix-one E digit.

Seed classification is computed in the selected full ring. A seed that is a unit modulo d_t need not be a unit in the full ring. Zero is labeled separately from nonzero zero divisors. The tool presents exact additive periods; it makes no claim of unbounded drift, novel entropy growth, or physical information capacity.

Deployment must update the report, photonica.js, photonica.py, and both visualizer URLs together. Keep the old assets in a rollback copy. The historical rigor notes should point to this revision so readers do not mistake their older hybrid definitions for the current model.