Quantum Operations Research

Zooming out from individual quantum gates reveals an architecture capable of operating at a much higher level of abstraction. When registers are left floating, interconnected operators act as non-local, passive filters over the joint configuration space. Applying a system of conditions transforms the circuit into a native Operations Research engine.
Mathematics
Operations Research
Optimization
Author

NicDeclic

Published

November 24, 2026

“Courage means weaving a rope out of one’s doubts… and slowly descending into the unknown.”
— Professor Alvin


Click to see library imports
import sys
if 'google.colab' in sys.modules:
    # 1. Download qmc.py from GitHub
    !wget -q https://raw.githubusercontent.com/nicdeclic/quantum-molecular-computing/main/qmc.py
    
    # 2. Download requirements.txt from GitHub
    !wget -q https://raw.githubusercontent.com/nicdeclic/quantum-molecular-computing/main/requirements.txt

    # 3. Install dependencies
    !pip install -q -r requirements.txt

sys.path.insert(0, "../../src") # Select root directory
from qmc import * # QMC library

%reload_ext autoreload
%autoreload 2

Zooming out from individual quantum gates reveals an architecture capable of operating at a much higher level of abstraction.

Multiple protobits can be grouped to form discrete registers. Any abstract data type in computer science—integers, fixed-point fractions, signed values, or categorical vectors—can be natively represented.

Across these registers, we can directly map the standard suite of mathematical operators:

Many molecular operators are natively reconfigurable simply by clamping an input or output terminal to a constant value. For example:

This organization mirrors the Arithmetic Logic Units (ALUs) of a conventional microprocessor, but with a fundamental architectural divergence. In a von Neumann CPU, a centralized ALU executes instructions sequentially over successive clock cycles. In the Conjugated Carbon Computing (CCC) paradigm, we trade execution time for physical area. Rather than cycling data through a single bottleneck, we replicate operators wherever mathematical relationships demand them.


Solving and Optimizing by Relaxation

When registers are left floating, these interconnected operators act as non-local, passive filters over the joint configuration space.

Applying a system of conditions transforms the circuit into a native Operations Research engine. Because the substrate is physical and continuous, the network can handle complex, non-linear, and discontinuous constraints without the computational penalties that plague digital numerical solvers.

Execution within this framework is startlingly direct. If a proposed set of constraints is mathematically impossible, the molecular network raises a Quantum Exception, signaling that no feasible solution exists. Conversely, if a valid ground-state manifold exists, the system settles into it naturally. A single physical readout of the registers samples directly from the pool of valid solutions.

This mechanism extends effortlessly to mathematical optimization. To find the global optimum of an objective function, one can iteratively tighten boundary thresholds through successive approximations. If a constraint is tightened too far, the molecule raises an exception, signaling that the boundary must be relaxed slightly. By narrowing this window, the optimal solution is captured in only a handful of physical tuning steps.


A Multi-Constraint Example

To observe this dynamic in practice, consider a system with three interdependent registers governed by the following constraints:

\[A > B \quad \land \quad A < C \quad \land \quad C = \text{NOT}(B)\]

Code
import schemdraw.dsp as dsp

def add_bus_label(drawing, l, pos1, pos2, dx=0.15, dy=0.15):
    """Draws a clean slash (/) bus mark on a wire."""
    pos=((pos1[0] + pos2[0])/2, (pos1[1] + pos2[1])/2)

    drawing.add(elm.Line().at((pos[0] - dx, pos[1] - dy)).to((pos[0] + dx, pos[1] + dy)).linewidth(1.2))

    drawing.add(elm.Label().label(l, fontsize=9, loc='top').at((pos[0] + dx + 0.05, pos[1] + 0.05)))

with schemdraw.Drawing() as d:
    d.config(fontsize=12, unit=2.5)

    # ==========================================
    # 1. Coordinates: Triangle Configuration
    # ==========================================
    pos_A   = (5.0, 4.3)
    pos_B   = (1.0, 1.0)
    pos_C   = (9.0, 1.0)
    pos_gt  = (1.2, 4.3)
    pos_lt  = (9.2, 4.3)
    pos_not = (5.0, 1.0)

    bw, bh = 1.4, 1.0

    # ==========================================
    # 2. Draw Register Boxes (dsp.Box)
    # ==========================================
    reg_A = d.add(dsp.Box(w=bw, h=bh).at((pos_A[0], pos_A[1])).label("$A$"))
    reg_B = d.add(dsp.Box(w=bw, h=bh).at((pos_B[0], pos_B[1])).label("$B$"))
    reg_C = d.add(dsp.Box(w=bw, h=bh).at((pos_C[0], pos_C[1])).label("$C$"))

    # ==========================================
    # 3. Draw Operator Boxes (dsp.Box)
    # ==========================================
    op_gt  = d.add(dsp.Box(w=1.0, h=1.0).at((pos_gt[0], pos_gt[1])).label("$>$", fontsize=15))
    op_lt  = d.add(dsp.Box(w=1.0, h=1.0).at((pos_lt[0], pos_lt[1])).label("$<$", fontsize=15))
    op_not = d.add(dsp.Box(w=1.0, h=1.0).at((pos_not[0], pos_not[1])).label("NOT", fontsize=12))

    # ==========================================
    # 4. Wiring: Left Edge (A > B)
    # ==========================================
    d.add(elm.Wire('-').at(reg_A.W).to(op_gt.E))
    add_bus_label(d, '2', reg_A.W, op_gt.E)

    d.add(elm.Wire('-').at(reg_B.N).to(op_gt.S))
    add_bus_label(d, '2', reg_B.N, op_gt.S)

    # ==========================================
    # 5. Wiring: Right Edge (A < C)
    # ==========================================
    d.add(elm.Wire('-').at(reg_A.E).to(op_lt.W))
    add_bus_label(d, '2', reg_A.E, op_lt.W)

    d.add(elm.Wire('-').at(reg_C.N).to(op_lt.S))
    add_bus_label(d, '2', reg_C.N, op_lt.S)

    # ==========================================
    # 6. Wiring: Bottom Edge (C = NOT B)
    # ==========================================
    d.add(elm.Line().at(reg_B.E).to(op_not.W))
    add_bus_label(d, '2', reg_B.E, op_not.W)

    d.add(elm.Line().at(op_not.E).to(reg_C.W))
    add_bus_label(d, '2', op_not.E, reg_C.W)

In this demonstration, each register is allocated 2 protobits (denoted on circuit lines in the schematic by a slash-2 notation: \(/2\)).

Restricting the registers to 2 bits is strictly a limitation of a classical computer simulation, where matrix dimensions scale exponentially (\(2^N\)). An actual physical CCC processor scales linearly in physical space and suffers no such software bottleneck.

Also, to evaluate this molecular network mathematically on a classical machine, we must artificially serialize the parallel molecular graph into an ordered sequence of matrix products. On an actual physical molecule, this serialization is completely unnecessary: the conjugated carbon network resonates collectively across all paths simultaneously.

Code
# Initialize schematic drawing for the serialized Operations Research circuit
with schemdraw.Drawing() as d:
    d.config(fontsize=11, unit=2.0)

    # Coordinates for the 3 horizontal register buses (Top)
    y_a = 6.0
    y_b = 5.0
    y_c = 4.0
    x_start = 0.0
    x_end = 13.5

    # ==========================================
    # 1. Main Register Buses (A, B, C)
    # ==========================================
    # Register A bus (with 2-bit slash notation)
    d.add(elm.Line().at((x_start, y_a)).to((x_end, y_a)).label("$A$", loc="left"))
    d.add(elm.Label(r"$/^2$", fontsize=16).at((1.0, y_a - 0.05)))

    # Register B bus
    d.add(elm.Line().at((x_start, y_b)).to((x_end, y_b)).label("$B$", loc="left"))
    d.add(elm.Label(r"$/^2$", fontsize=16).at((1.0, y_b - 0.05)))

    # Register C bus
    d.add(elm.Line().at((x_start, y_c)).to((x_end, y_c)).label("$C$", loc="left"))
    d.add(elm.Label(r"$/^2$", fontsize=16).at((1.0, y_c - 0.05)))

    # ==========================================
    # 2. Operator Blocks (Bottom)
    # ==========================================
    y_ops = 2.0
    box_w, box_h = 1.6, 1.2

    # Operator 1: Greater-Than (A > B)
    x_op1 = 4.0
    d.add(elm.Rect(w=box_w, h=box_h).at((x_op1 - box_w/2, y_ops - box_h/2)))
    d.add(elm.Label("$>$", fontsize=14).at((x_op1 - 0.4, y_ops - 0.25)))

    # Operator 2: Less-Than (A < C)
    x_op2 = 7.0
    d.add(elm.Rect(w=box_w, h=box_h).at((x_op2 - box_w/2, y_ops - box_h/2)))
    d.add(elm.Label("$<$", fontsize=14).at((x_op2 - 0.4, y_ops - 0.25)))

    # Operator 3: Bitwise NOT (NOT B)
    x_op3 = 10.0
    d.add(elm.Rect(w=box_w, h=box_h).at((x_op3 - box_w/2, y_ops - box_h/2)))
    d.add(elm.Label("NOT", fontsize=11).at((x_op3 - 0.4, y_ops - 0.25)))

    # Operator 4: Equality Check (C == NOT B)
    x_op4 = 13.0
    d.add(elm.Rect(w=box_w, h=box_h).at((x_op4 - box_w/2, y_ops - box_h/2)))
    d.add(elm.Label("$=$", fontsize=14).at((x_op4 - 0.4, y_ops - 0.25)))

    # ==========================================
    # 3. Connections to Operator 1 (A > B)
    # ==========================================
    # Tap from Bus A into Left Input of (>)
    d.add(elm.Dot().at((x_op1 - 1.8, y_a)))
    d.add(elm.Wire("|-").at((x_op1 - 1.8, y_a)).to((x_op1 - 0.8, y_ops - 0.25)))

    # Tap from Bus B into Right Input of (>)
    d.add(elm.Dot().at((x_op1 - 1.2, y_b)))
    d.add(elm.Wire("|-").at((x_op1 - 1.2, y_b)).to((x_op1 - 0.8, y_ops + 0.0)))

    # ==========================================
    # 4. Connections to Operator 2 (A < C)
    # ==========================================
    # Tap from Bus A into Left Input of (<)
    d.add(elm.Dot().at((x_op2 - 1.8, y_a)))
    d.add(elm.Wire("|-").at((x_op2 - 1.8, y_a)).to((x_op2 - 0.8, y_ops - 0.25)))

    # Tap from Bus C into Right Input of (<)
    d.add(elm.Dot().at((x_op2 - 1.2, y_c)))
    d.add(elm.Wire("|-").at((x_op2 - 1.2, y_c)).to((x_op2 - 0.8, y_ops + 0.0)))

    # ==========================================
    # 5. Connections to Operator 3 (NOT B)
    # ==========================================
    # Tap from Bus B into Input of NOT
    d.add(elm.Dot().at((x_op3 - 1.8, y_b)))
    d.add(elm.Wire("|-").at((x_op3 - 1.8, y_b)).to((x_op3 - 0.8, y_ops - 0.0)))

    # ==========================================
    # 6. Connections to Operator 4 (C == NOT B)
    # ==========================================
    # Tap from Bus C into Left Input of (=)
    d.add(elm.Dot().at((x_op4 - 1.8, y_c)))
    d.add(elm.Wire("|-").at((x_op4 - 1.8, y_c)).to((x_op4 - 0.8, y_ops + 0.15)))

    # Route Output from NOT to Right Input of (=)
    d.add(elm.Line().at((x_op3 + 0.2, y_ops - 0.35)).to((x_op4 - 0.8, y_ops - 0.35)))

Solving this system reveals that only two states survive out of the sixty-four theoretical combinations:

\[\text{Solution 1:} \quad (A = 1, \, B = 0, \, C = 3)\]

\[\text{Solution 2:} \quad (A = 2, \, B = 0, \, C = 3)\]

Every other permutation violates at least one constraint, triggering destructive interference that eliminates it from the ground state.

Let’s see which one we get:

# ==============================================================================
# 1. High-Level 2-protobit Relational and Arithmetic Operators
# ==============================================================================
# Each 2-protobit register has 4 states (0, 1, 2, 3).
# Pairing two 2-protobit registers yields 4 protobits (16 input states from 0000 to 1111).
# Relational operators evaluate as 16x1 constraint filter matrices.

# Operator: Greater-Than (A > B)
# Yields 1 only when 2-bit value A strictly exceeds 2-bit value B.
greater_than = TransitionMatrix([
    [0], [0], [0], [0],  # A = 0: 0>0, 0>1, 0>2, 0>3 (all False)
    [1], [0], [0], [0],  # A = 1: 1>0 (True), 1>1, 1>2, 1>3 (False)
    [1], [1], [0], [0],  # A = 2: 2>0, 2>1 (True), 2>2, 2>3 (False)
    [1], [1], [1], [0]   # A = 3: 3>0, 3>1, 3>2 (True), 3>3 (False)
])

# Operator: Less-Than (A < C)
# Yields 1 only when 2-protobit value A is strictly less than 2-protobit value C.
less_than = TransitionMatrix([
    [0], [1], [1], [1],  # A = 0: 0<0 (False), 0<1, 0<2, 0<3 (True)
    [0], [0], [1], [1],  # A = 1: 1<0, 1<1 (False), 1<2, 1<3 (True)
    [0], [0], [0], [1],  # A = 2: 2<0, 2<1, 2<2 (False), 2<3 (True)
    [0], [0], [0], [0]   # A = 3: 3<0, 3<1, 3<2, 3<3 (all False)
])

# Operator: Equality (X == Y)
# Yields 1 only when two 2-protobit values are identical.
equal = TransitionMatrix([
    [1], [0], [0], [0],  # 0 == 0
    [0], [1], [0], [0],  # 1 == 1
    [0], [0], [1], [0],  # 2 == 2
    [0], [0], [0], [1]   # 3 == 3
])

# Operator: Bitwise Invert (2-protobit NOT)
# Inverts both protobits of a 2-protobit bus (e.g., 00 -> 11 (0 -> 3), 01 -> 10 (1 -> 2))
invert = (negate**2)

# Operator: 2-protobit Adder (Modulo 4 addition)
# Maps 4 input protobits (A, B) to a 2-protobit sum (4 output states).
# Note: Only shown here if someone wants to experiment with it.
add = TransitionMatrix([
    [1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1],  # 0 + {0,1,2,3}
    [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1], [1, 0, 0, 0],  # 1 + {0,1,2,3}
    [0, 0, 1, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 1, 0, 0],  # 2 + {0,1,2,3}
    [0, 0, 0, 1], [1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0]   # 3 + {0,1,2,3}
])

# ==============================================================================
# 2. Sequential Constraint Pipeline Compilation
# ==============================================================================
# System state: 6 protobits representing three 2-bit registers (A, B, C).
# Initial state: Full superposition across all 64 possible register combinations.

# --- Apply Constraint 1: A > B ---
# 1. Tap registers A and B using split operators.
# 2. Permute tapped lines to feed into the 4-bit greater_than comparator.
# 3. Contract and normalize to filter out violating configurations.
constraints = (
    (random**6) 
    @ (split**4 ^ identity**2) 
    @ permute([0, 2, 4, 6, 8, 9, 1, 3, 5, 7]) 
    @ (identity**6 ^ greater_than)
).normalize()

# --- Apply Constraint 2: A < C ---
# 1. Tap registers A and C.
# 2. Route tapped channels into the less_than comparator.
# 3. Contract and normalize the joint state.
constraints = (
    constraints 
    @ (split**2 ^ identity**2 ^ split**2) 
    @ permute([0, 2, 4, 5, 6, 8, 1, 3, 7, 9]) 
    @ (identity**6 ^ less_than)
).normalize()

# --- Apply Constraint 3: C == NOT(B) ---
# 1. Tap register B, pass through 2-bit invert, and compare with register C via equal.
# 2. Final contraction filters down to the mutually consistent ground-state manifold.
constraints = (
    constraints 
    @ (identity**2 ^ split**2 ^ identity**2) 
    @ permute([0, 1, 2, 4, 6, 7, 3, 5]) 
    @ (identity**6 ^ invert) 
    @ (identity**4 ^ split**2 ^ identity**2) 
    @ permute([0, 1, 2, 3, 4, 6, 8, 9, 5, 7]) 
    @ (identity**6 ^ equal)
).normalize()

# ==============================================================================
# 3. Physical State Readout (Sampling the Feasible Manifold)
# ==============================================================================
# Collapse the 6-protobit state vector into a single measured bitstring.
measured_bitstring = constraints.measure()

# Slice bitstring into the three 2-protobit registers (A, B, C)
bin_a = measured_bitstring[0:2] 
bin_b = measured_bitstring[2:4] 
bin_c = measured_bitstring[4:6] 

# Convert binary strings to integers (0 to 3)
val_a = int(bin_a, 2)
val_b = int(bin_b, 2)
val_c = int(bin_c, 2)

# Display the sampled solution in LaTeX format
display_inline(
    r"\text{Measured State: }",
    r"\mathbf{A} =", str(val_a),
    r",\quad \mathbf{B} =", str(val_b),
    r",\quad \mathbf{C} =", str(val_c)
)

\[ \text{Measured State: } \mathbf{A} = 2 ,\quad \mathbf{B} = 0 ,\quad \mathbf{C} = 3 \]

Measuring the registers yields one of the two valid configurations at random, demonstrating how a complex constraint satisfaction problem is solved entirely through the passive wave mechanics of carbon bonds.


👉 Next chapter :
“Quantum Set Theory”