Quantum Mind GitHub
quantum-mind banner

Quantum robotics: computing, sensing and cognition, each against its classical baseline.

Quantum robotics has three threads, and Quantum Mind is an open-source Python library that covers all of them: quantum computing for robot algorithms (robot problems as optimisation, classical baselines and a Qiskit QAOA adapter), quantum sensing (quantum-limited sensor models fused with classical sensors) and quantum-probability cognition (how people judge, decide and trust, and how a robot should read them, ending in a cost-aware decision: hand over, wait, or ask). It runs on ordinary computers, makes no claim of quantum computational advantage, and reports where the quantum version does no better.

PyPI version PyPI downloads per month Total PyPI downloads Tests Apache-2.0 licence Documentation

pip install quantum-mind          # or "quantum-mind[all]" for Qiskit, plots and RL

1 · Quantum computing for robots

Allocation, grasp selection and scheduling as QUBOs; classical baselines, random sampling as the null, and a Qiskit QAOA adapter.

2 · Quantum sensing for robots

Quantum limits, atom-interferometer and MEMS accelerometer models, and a Kalman filter that fuses them in simulation.

3 · Quantum-probability cognition

COBRA, a context-rotated belief filter, quantum-like models of people and the ask-or-act decision layer, with a ROS 2 node.

Version 3.0.0 · Apache-2.0 · Python 3.10–3.12 · 135 tests in CI · Qiskit, IBM Quantum, Amazon Braket

Author's view

Yeshwanth Guru, author and maintainer.

I started Quantum Mind from one belief: a robot that works with people needs a different kind of probability than the one inside most of its filters. People are not neutral sensors. A look changes what a hand movement means, a question changes the answer to the next question, and asking someone whether they trust a robot changes their trust. Classical filters assume the evidence arrives in independent pieces; quantum probability was built for the case where the order and the context of a measurement matter.

Quantum robotics is a young field with at least three threads, and I think it helps to keep them apart: (1) quantum computing for robot algorithms (planning, optimisation, learning), promising on paper but with no practical advantage shown on real robot problems with today's noisy devices; (2) quantum sensing for robots (atomic and solid-state sensors for navigation, magnetometry, gravimetry), which is physical hardware; and (3) quantum-probability models of the beliefs a robot holds about people (context, order and trust), which run on ordinary computers and can be tested today.

Quantum Mind covers all three, because I want to work on the whole umbrella, and it holds each thread to the same standard: a classical baseline, an ablation, and results that are allowed to say no. Thread 1 poses robot problems as binary optimisation, supplies the classical baselines and a thin adapter to Qiskit's QAOA, and does not re-implement what Qiskit and PennyLane do better. Thread 2 models quantum-limited sensors and fuses a slow, stable quantum accelerometer with a fast, drifting classical one in simulation, and does not claim to build a sensor. Thread 3 is the quantum-probability model of the beliefs a robot holds about people, the part I have developed furthest. The circuits of the thread-3 models also run on quantum hardware, which is the bridge between the threads. I claim no speed-up anywhere.

In every thread I ask the same question: does the quantum version beat the classical one, and does the robot decide or move better with it? For beliefs about people that becomes: does quantum probability describe human context better than the classical alternative? Every model sits next to the classical model it has to beat.

I did not re-implement general-purpose quantum algorithms or optimisers, because Qiskit, PennyLane and optimisation libraries do them better, and I limited the scope to AI, machine learning, vision, robotics and embodied AI. Models from the literature are implemented from their papers and cited in the model atlas, which labels each as published, extended or unique; the unique ones are my own designs.

I do not claim a quantum computational advantage (QAOA does no better than random sampling on the problems I tested), quantum sensing hardware, or results with real people and robots, and COBRA's gain is modest and shown only on synthetic data. Next: a pilot study with a real robot, more reliable training, runs on hardware and measured sensor data for threads 1 and 2, and independent replication. If a claim does not hold, please open an issue.

New in 3.0

Version 3.0 covers all three threads of quantum robotics. General-purpose quantum algorithms (VQE, Grover, quantum kernels) and quantum-inspired optimisers are left to Qiskit, PennyLane and dedicated optimisation libraries; thread 1 connects to Qiskit's QAOA instead of re-implementing it. New: quantum_mind.computing, quantum_mind.sensing and COBRA.

COBRA: context-rotated belief

The same hand cue means hand over after a look at the robot and retrieve after a look away. A Bayes filter adds the same evidence either way. COBRA keeps the belief as a density matrix and lets the previous frame rotate the basis in which the next reading is measured.

from quantum_mind.belief import COBRA, min_cost_action

model = COBRA(n_hyp=3, n_features=3).fit(frames, intent)
belief = model.start()                 # online, one frame at a time
for frame in sensor_stream:
    p = belief.update(frame)           # P(handover, retrieve, withdraw)
action = min_cost_action(p, cost)      # hand over, wait or ask

What the benchmark says

On a synthetic task built to contain this kind of context effect, COBRA lowers decision cost by about 0.02 against a Bayes filter with enough training data (significant in 2 of 5 seeds) and is the best calibrated model under noise. With little data it is worse, on a control task with no context effect it is slightly worse than the Bayes filter, and training sometimes misses the mechanism. Full results and figures.

Two-qubit playground

An exact two-qubit simulation running in this page. Apply gates and watch both Bloch vectors move. After a CNOT on a superposition the qubits become entangled: each vector shrinks into the ball and the concurrence rises. Drag a sphere to rotate it.

● qubit 0

● qubit 1

Entanglement (concurrence): 0.000

qubit 0
qubit 1

Tip: H on qubit 0, then CNOT q0 → q1, entangles the pair; a second CNOT undoes it.

The same views in Python, for any Qiskit circuit: circuit_trajectory(qc), animate_bloch, LiveBloch, plot_entanglement. Checked against Qiskit in the test suite.

Three threads, each tested against its classical limit

Every thread reports a classical baseline and says where the classical method wins. Read the concepts page.

1 · Quantum computing for robots

Robot problems as binary optimisation, with the baselines a quantum result must beat.

  • multi-robot allocation, grasp selection, slot scheduling
  • QUBO encodings, true objectives, decoders
  • greedy, annealing and random-sampling baselines
  • Qiskit QAOA adapter (exact simulation)
  • solver comparison in robot terms

quantum_mind.computing

2 · Quantum sensing for robots

Quantum-limited sensors and their fusion with classical sensors, in simulation.

  • standard quantum limit, Heisenberg limit
  • atom-interferometer sensitivity
  • MEMS and quantum accelerometer models
  • multi-rate Kalman dead reckoning
  • where the quantum sensor stops helping

quantum_mind.sensing

Interactive animations

Generated by the package itself (animate_bloch). Press play, drag the slider, rotate with the mouse.

Bloch-vector lengths and concurrence along the entangling circuit
The entangling circuit as a timeline: each qubit's Bloch-vector length and the pair's concurrence (plot_entanglement).

For robots that ask people questions

A robot's questions can change people's answers, and asking about trust can change trust. The robotics layer gives a robot a predicted answer, its uncertainty, and a rule for when to ask instead of act.

from quantum_mind.applications.robotics import HumanModelService

svc = HumanModelService()
svc.add_answer({'order': 'AB', 'answers': [1, 0]})
svc.query({'order': 'AB', 'ask_cost': 1.0, 'error_cost': 3.0})
# prediction, uncertainty (bits), model weights,
# {'action': 'ask' | 'act', 'reason': ...}

ROS 2 node

The same service as a ROS 2 package with standard std_msgs/String JSON topics: answers in, decisions out. integrations/ros2

Its callbacks are tested with stand-in ROS modules; it has not yet been run inside a ROS 2 installation.

Results, reported as measured

Simulated data, small problems; they illustrate the methods and are not a benchmark. Where a classical model wins, the table says so.

TaskResult
Robot allocation, grasp selection and scheduling, QAOA against classical solvers (simulated, 10 instances each)instances solved to the optimum, out of 30: greedy descent 29 · QAOA depth 2 and 3: 26 · QAOA depth 1: 24 · random sampling with the same 1000 shots 24 · simulated annealing 16 (QAOA is within noise of random sampling; exact simulation, no hardware)
Quantum accelerometer fused with a MEMS accelerometer, position RMSE over 300 s (simulated, illustrative sensor values)no position fixes: fused 10.0 m · MEMS only 339.7 m · quantum only 229.1 m; with a fix every 10 s: fused 0.144 m · MEMS only 0.173 m; the benefit vanishes when the quantum sensor is as unstable as the MEMS sensor (297 m)
COBRA vs Bayes filter on a context-dependent intent task (simulated, 5 seeds)context: cost 0.221 (COBRA) · 0.239 (Bayes filter) · 0.233 (MLP) · oracle 0.147 at 1000 training sequences; paired test significant in 2 of 5 seeds; with 60 sequences COBRA 0.347 against Bayes 0.280; under 1.5x test noise COBRA is best calibrated (cost 0.481 against 0.608)
Control task with no context effect (simulated)expected cost 0.204 (COBRA) · 0.189 (Bayes filter) at 1000 training sequences: COBRA is slightly worse where context does not matter
Individual differences (example 11)a pooled fit selects the quantum-like model for a population that is half anchoring; per-person fits recover all 12 people at about 3,000 answers each
Trust as a qubitP(trust) read from the Bloch vector equals the model's prediction (0.7247)
Trust-aware hand-over, 40 simulated sessions of 20 hand-overs (example 16)mean session cost: order-aware 42.1 · Markov-based 60.9 · always hand over 96.2 (the simulated people follow the open-system model, which favours the order-aware policy by construction)
Detector calibration, 5 classes (simulated, example 13)ECE raw 0.192 · Platt 0.020 · temperature 0.017 · isotonic 0.009; conformal sets reach 0.911 coverage at a 0.90 target
Multimodal fusion, held-out log loss (simulated, example 14)quantum-like 0.759 · Bayes 0.793 · Dempster-Shafer 0.818 (the simulated people follow the quantum-like rule)
Bistable perception, dwell times at two check intervals (simulated, example 15)BIC: quantum Zeno 2796.6 · gamma renewal 3031.8 · Markov switching 3073.8

What is and is not claimed

  • No quantum advantage is claimed. COBRA is a classical simulation of the quantum-probability formalism; its gain over classical filters is shown only on synthetic data built to contain a context effect.
  • No hardware results are included yet. IBM and Braket submission code is tested against local stand-ins (a fake IBM device, the Braket local simulator).
  • All data in the examples are simulated or published aggregates, and labelled as such. No study with real people and a robot has been run yet; the validation page lists what is checked and gives a protocol for a pilot.
  • In several robotics comparisons the simulated people follow the same model the robot uses, which favours the order-aware method by construction; the tutorials say where.

Get started

pip install "quantum-mind[all]"

# quantum-like: is there an order effect?
from quantum_mind.core import compare
from quantum_mind.families.order_effects import (
    QuantumOrderModel4D, BayesOrderModel, AnchoringOrderModel, qq_test)
print(qq_test(counts))
compare([QuantumOrderModel4D, BayesOrderModel,
         AnchoringOrderModel], counts)
# a robot's belief about what a person wants
import numpy as np
from quantum_mind.belief import COBRA, GaussianBayesFilter

model = COBRA(3, 3).fit(frames, intent)          # frames: (N, T, 3)
classical = GaussianBayesFilter(3).fit(frames, intent)
model.predict_proba(new)    # context-aware belief
classical.predict_proba(new)

# watch a circuit on Bloch spheres
from quantum_mind.viz import circuit_trajectory, animate_bloch
animate_bloch(circuit_trajectory(qc))