Fluid Quantum Logic
I built Fluid Quantum Logic around a narrow question: if an operation is already present in a circuit’s structure, can a separate quantum state select it without training the circuit?
The implementation uses six qubits. Two hold the inputs, one holds the output, and three act as controls. Each control sits in front of an operation I put there deliberately:
- AND is a Toffoli gate.
- XOR is two CNOT gates computing parity.
- OR uses a Toffoli gate with the input and output inversions required by De Morgan’s law.
Setting one control rotation to π activates its block. Setting the others to zero leaves them inactive. The same circuit then returns the complete truth tables for AND, OR, and XOR.
No optimizer is involved in that test. That is what zero-shot means here. It does not mean the circuit discovered Boolean logic from data. The operations are explicitly built into it, so 100 percent on four binary inputs is a check that the construction works, not a machine-learning result.
Stated that way, the experiment is less grand and more useful. It separates the program from the data. The gate blocks stay fixed while the control register selects which block acts on the input.
What I was testing
Programmable quantum circuits are not new. Nielsen and Chuang were writing about programmable quantum gate arrays in 1997. This is a small, specialized version of that general idea, built while I was exploring whether circuit structure could take the place of trained parameters in some quantum-machine-learning experiments.
The six-qubit circuit exposes three named operations and an inactive state. I also treated the three control angles as a tiny search space and asked which of the sixteen possible two-input Boolean functions the fixed construction could express. The search found AND, OR, XOR, and FALSE. The other twelve would require another operation or a change to the circuit.
That result describes this circuit. It does not establish a general law that quantum computation is limited to four geometric primitives. I chose the gate blocks, their controls, and the allowed parameterization. The search maps the resulting design space.
The control qubits can also be placed in superposition instead of being set to zero or π. The simulator then evolves the controlled branches coherently. In one test, the measured output differed by 43 percent from a baseline made by averaging the two separately selected operations.
That confirms that this circuit is not equivalent to that particular classical mixture. It is not evidence of a computational advantage. A state-vector simulator tracks amplitudes and interference by construction, and the experiment remains small enough to simulate easily on an ordinary computer.
What the other demonstrations show
The audio example applies XOR to adjacent binary samples. A change from silence to sound, or sound to silence, returns one; no change returns zero. The same XOR circuit works because XOR does not care whether its inputs are called pixels, audio samples, or anything else. That is reuse across representations, not learned generalization to a new domain.
The noise experiment adds depolarizing channels in simulation and checks whether each of the four XOR outputs stays on the correct side of a 0.5 threshold. It does through the tested value of p = 0.1. This does not mean every simulated shot is correct, and it does not show that the circuit will survive real device noise. Hardware has gate, readout, timing, connectivity, and calibration behavior that this small model does not capture.
Running the logic gates in PennyLane and Qiskit Aer gives the same truth tables. That is a useful implementation check across two software stacks. Both runs are still simulations.
The longer paper also explores a fourteen-qubit circuit inspired by attention, binding, and perceptual bistability. Sampling produces discrete detector outputs where an expectation value only shows an average. That is the right way to inspect the measurement distribution. It does not turn the circuit into a model of perception or demonstrate anything about consciousness. The words are analogies for the architecture.
The repository’s current bistability demonstration exercises that sampling method on an untrained baseline. It does not reproduce the complete trained result reported in the paper.
The boundary of the result
This work does not show quantum advantage, execution on quantum hardware, useful scaling, or a new way to keep AI from hallucinating. It also does not show that the circuit learned without data. The logic was already there.
What it does show is a concrete way to hold a small program in a quantum control state and use it to select among operations in a fixed circuit. It also forced a useful distinction between three things that are easy to blur together: an operation encoded in the architecture, a parameter selected at runtime, and a parameter learned from examples.
That distinction is why I kept the project. The experiment is easier to understand once every observation does not have to become a breakthrough. It is a small, reproducible circuit study with a few directions left open.
The source code is on GitHub, and the archived paper is available through Zenodo. I filed U.S. Provisional Patent Application 63/921,961 covering the work on November 20, 2025.