Skip to main content

Computational Implementation

A simulator implements a specified dynamical model [D]. It does not infer that model, reconstruct a physical state, or establish consciousness merely by producing a positive matrix. The mathematical kernel, evolution, and identifiability protocol specify these separate obligations.

State and configuration​

Use a Hermitian positive semidefinite matrix ρ\rho with Tr⁡ρ=1\operatorname{Tr}\rho=1. Store the frame, Hamiltonian, dissipator, feedback target, rates, physical time calibration, experiential extension, and measurement model alongside it. The seven-axis model has 48 real state coordinates; a joint state of nn such factors has dimension 7n7^n and 72n−17^{2n}-1 coordinates. Seven coordinates for an aggregate require an explicit reduction map and discard joint information.

A Cholesky parametrisation ρ=TT†/Tr⁡(TT†)\rho=TT^\dagger/\operatorname{Tr}(TT^\dagger) is useful for estimation when T≠0T\ne0. It does not make the measurement model identifiable. Confidence sets belong to the measurement likelihood, with subject and intervention structure retained.

A state-preserving step​

For the selected Fano dephasing family and a density-valued target BB consider

ρ˙=−i[H,ρ]+γ(Fρ−ρ)+a(ρ)(B(ρ)−ρ),γ≥0,a≥0,\dot\rho=-i[H,\rho]+\gamma(\mathcal F\rho-\rho)+a(\rho)(B(\rho)-\rho),\qquad \gamma\ge0,\quad a\ge0,

where Fρ=diag⁡ρ+13(ρ−diag⁡ρ)\mathcal F\rho=\operatorname{diag}\rho+\tfrac13(\rho-\operatorname{diag}\rho). The following first-order scheme freezes aa and BB at the initial state of each step. The array index of EE is explicitly set to 4 in the convention (A,S,D,L,E,O,U)(A,S,D,L,E,O,U).

import numpy as np
from scipy.linalg import expm

def diagnostics(rho, e=4):
p = float(np.trace(rho @ rho).real)
d = float(np.sum(np.real(np.diag(rho)) ** 2))
q_e = rho[e, e].real ** 2 + 2 * (
np.sum(np.abs(rho[e, :]) ** 2) - abs(rho[e, e]) ** 2)
return p, p / d - 1, float(q_e / p)

def step(rho, h, gamma, dt, rate, target):
# rate and target are frozen at the beginning of this step.
a = float(rate(rho))
sigma = np.asarray(target(rho), dtype=complex)
if dt < 0 or gamma < 0 or a < 0:
raise ValueError("Rates and dt must be nonnegative")
assert np.allclose(h, h.conj().T)
assert np.allclose(sigma, sigma.conj().T)
assert np.isclose(np.trace(sigma), 1)
assert np.linalg.eigvalsh(sigma).min() >= -1e-12
u = expm(-1j * h * dt)
x = u @ rho @ u.conj().T
diag = np.diag(np.diag(x))
x = diag + np.exp(-2 * gamma * dt / 3) * (x - diag)
w = np.exp(-a * dt)
return w * x + (1 - w) * sigma

Why positivity holds [T]. The first map is unitary conjugation. The second is the convex combination cx+(1−c)diag⁡xc x+(1-c)\operatorname{diag}x, c=e−2γΔt/3∈[0,1]c=e^{-2\gamma\Delta t/3}\in[0,1]. The third is a convex combination with a valid density matrix. Their composition preserves positivity and trace for every nonnegative step size in exact arithmetic. With frozen coefficients each map is CPTP. The full algorithm can be nonlinear because its coefficients depend on the initial state; calling it one CPTP map is incorrect.

Accuracy is a separate question. For bounded smooth coefficients on the region traversed, freezing and splitting give a local error O(Δt2)O(\Delta t^2) and a first-order global error over fixed finite time. A Lipschitz drift with constant LL and a local defect bound CΔt2C\Delta t^2 gives a global bound of the form C′Δt(eLT−1)/LC'\Delta t(e^{LT}-1)/L, interpreted continuously at L=0L=0. The constants depend on the model and region. Step doubling estimates error; a fixed rule such as Δt≤0.01\Delta t\le0.01 cannot guarantee accuracy across physical scales. Nonsmooth gates require the corresponding weaker error analysis or event handling.

Numerical checks​

At every reported step check Hermiticity, trace, the smallest eigenvalue, and 1/7≤P≤11/7\le P\le1. A small tolerance is a statement about floating point error. A substantial violation indicates a defective input or algorithm; clipping a reported scalar does not repair the state. A projection onto the density cone changes the numerical trajectory and must be included in the error budget. Generic explicit Euler and Runge–Kutta methods do not guarantee positivity.

For a valid density matrix, the E mask can have zero weight. An implementation claiming a positive E floor must specify the source and rate conditions in its balance equation.

Meaningful verification includes an analytic diagonal example, a noncommuting Hamiltonian, a boundary state, finite-step positivity, convergence under step refinement, and an independently computed counterexample to any universal claim used by the model. The executable kernel checks cover these mathematical properties without certifying the entire theory.

Environmental coupling​

A nonnegative sum of GKSL generators gives an admissible generator. A signed difference requires a separate generator check. A proposed action additionally needs an observation law and a loss.

For joint systems use the tensor state and explicitly defined local channels or a joint Hamiltonian. A nonlinear single-state feedback has no automatic tensor extension: specify how its coefficients are evaluated from local marginals and use a linear local channel with those frozen coefficients. Feature-to-state reconstruction is an estimator, not an environmental quantum channel.

Bootstrap and closed gates​

The selected baseline κb=ω0/7\kappa_b=\omega_0/7 is a model convention [D]. A positive rate alone cannot generate coherence. If the feedback gate g(P)g(P) vanishes at P=1/7P=1/7, then a=κg(P)=0a=\kappa g(P)=0 at I/7I/7; unitary and unital dissipative terms leave I/7I/7 fixed. A start from this state requires a specified preparation, a nonunital input, or a revised gate, each with its own energetic and physical model. It cannot be proved by adding a positive scalar called bootstrap.

The bounded kinetic approximation for κ0\kappa_0 has stated timescale assumptions; it is not a norm of a categorical natural transformation. Use the regularised rate family in septicity when boundary continuity is needed.

Monitoring and control​

Report the four margins P−2/7P-2/7, R−1/3R-1/3, Φ−1\Phi-1, and Ddiff−2D_{\rm diff}-2. Only the first cut is strict; the other three include equality. The full verdict requires the specified experiential extension and readout. A scalar C=ΦRC=\Phi R, a stress score, or matrix purity alone is insufficient. With a reconstruction confidence set KK, certify a criterion only if it holds for every admissible record in KK; otherwise report it as unresolved. A proxy based on the E-row must be named as a proxy.

The cut 2/72/7 is an exact consequence of a chosen majority convention for Hilbert–Schmidt differentiation, not a universal survival or detection threshold. The self-observation and differentiation cuts are selected conventions; the operational interpretation requires calibration. Dynamic viability requires a specified domain, disturbances, admissible controls, and an invariant or viability-kernel argument.

For a finite action set, evaluate the specified loss for each action. For compact controls and a continuous loss a minimiser exists. Uniqueness, convexity, and efficient global optimisation each require additional assumptions. Do not infer any of them from compactness.

Cost and reproducibility​

Dense multiplication and diagonalisation cost O(N3)O(N^3) and memory O(N2)O(N^2); a fixed Hamiltonian permits precomputing its unitary step. A joint tensor state incurs the corresponding exponential growth in the number of factors. Sparse approximations and aggregate models require an error bound for the observables of interest.

Publish the chosen frame, model parameters, target and gate, step rule and tolerance, random seed, preparation, measurement likelihood, and uncertainty set. Distinguish a simulated mathematical example from a calibrated physical prediction. Numerical success verifies the implemented instance; physical identification and the phenomenal interpretation remain separate inputs.