Raspberry Tie

Run quantum circuits on IBM Quantum processors or simulators and visualize the results on the RasQberry LED array! The Raspberry Tie displays quantum measurement results as colored pixels on the 8×8 LED matrix, with patterns corresponding to IBM quantum processor topologies.
Overview
Raspberry Tie brings quantum computing to life through physical LED visualization. Submit quantum circuits to IBM Quantum backends (real or simulated) and watch the measurement results light up on your RasQberry's LED array in real-time.
Features
- LED Visualization: Results displayed as red (0) and blue (1) pixels on the 8×8 LED matrix
- Multiple Display Modes: Supports 5-qubit (bowtie/tee), 12-qubit (hex), and 16-qubit layouts
- Backend Options: Local Aer simulator, IBM Quantum simulators, or real quantum hardware
- Interactive Mode: Menu-driven setup for easy demo configuration
- Accelerometer Support: Auto-rotates display based on Pi orientation
- SVG Alternative: Browser-based display option when LEDs aren't available
What You'll Learn
- Quantum Measurement: See how quantum states collapse to classical bits
- Processor Topologies: Understand how qubits are arranged on real quantum computers
- Backend Comparison: Experience differences between simulators and real hardware
- IBM Quantum Platform: Work with IBM's quantum computing infrastructure
Running the Demo
From RasQberry Configuration Menu
- Open a terminal on your RasQberry
- Run:
sudo raspi-config - Navigate to: 0 RasQberry → Quantum Computing Demos → Raspberry Tie
- Follow the interactive prompts to configure the demo
Desktop Icon
- Look for the "Raspberry Tie" icon on your RasQberry desktop
- Double-click to launch the demo with interactive configuration
Desktop Menu
- Click on the desktop menu
- Navigate to: Applications → RasQberry → Raspberry Tie
Command Line (Advanced)
cd ~/RasQberry-Two
source venv/RQB2/bin/activate
python3 RQB2-bin/quantum-raspberry-tie.py
Command-line options:
# Interactive mode (recommended)
python3 quantum-raspberry-tie.py -int
# Specify display mode
python3 quantum-raspberry-tie.py -bowtie # 5-qubit bowtie
python3 quantum-raspberry-tie.py -tee # 5-qubit tee
python3 quantum-raspberry-tie.py -hex # 12-qubit hex
python3 quantum-raspberry-tie.py -16 # 16-qubit
# Use specific backend
python3 quantum-raspberry-tie.py -aer # Local Aer simulator
python3 quantum-raspberry-tie.py -real # Real quantum hardware
Display Modes
5-Qubit Displays
Bowtie
The classic 5-qubit "bowtie" layout matching IBM's early quantum processors. Each colored pixel represents one qubit's measurement result.
Tee
A 5-qubit layout based on the "tee" connectivity of later IBM processors, offering lower noise characteristics.
12-Qubit Display (Hex)
The "heavy hex" topology used in modern IBM quantum processors. This diamond-shaped layout is topologically equivalent to a hexagon with qubits at vertices and edge midpoints.
16-Qubit Display
Layout corresponding to IBM's experimental 16-qubit processors, arranged in four rows.
Understanding the Display
- Blue pixels: Qubit measured as |1⟩
- Red pixels: Qubit measured as |0⟩
- Purple/lavender pixels: Unmeasured qubits (when using fewer than max qubits)
The pixel patterns correspond to qubit connectivity on IBM quantum processors, helping visualize the physical hardware topology.
Hardware Requirements
- Raspberry Pi (Pi 5 recommended, Pi 4 supported)
- 4× WS2812 LED panels (4×12 pixels each) - Required for LED display
- Connected to GPIO pin 21
- Display (monitor or VNC) for configuration
- Internet connection (for IBM Quantum backends)
Alternative: If no LEDs are connected, an SVG browser display is available.
See the Bill of Materials and Hardware Assembly Guide for LED panel details and assembly instructions.
Backend Options
Local Aer Simulator (Default)
- Type: Fast local simulation
- Requirements: No IBM account needed
- Behavior: Ideal quantum behavior, no noise
IBM Quantum Simulators
- Type: Cloud-based simulation
- Requirements: IBM Quantum account
- Behavior: Can model noise from real devices
Real Quantum Hardware
- Type: Actual quantum computer
- Requirements: IBM Quantum account
- Behavior: Real quantum effects including noise and errors
- Note: Jobs may queue; results take longer
Configuration
Interactive Mode
The -int flag launches an interactive menu to configure:
- Number of qubits (5, 12, or 16)
- Display mode (bowtie, tee, hex, or 16-qubit rows)
- Simulator vs. real backend
- Specific backend selection
IBM Quantum Setup
To use IBM Quantum backends:
- Create account at IBM Quantum
- Get your API token from account settings
- Save credentials:
python3 >>> from qiskit_ibm_runtime import QiskitRuntimeService >>> QiskitRuntimeService.save_account(channel="ibm_quantum", token="YOUR_TOKEN")
The demo will prompt for credentials if needed.
SVG Display Mode
When LEDs aren't available, the demo creates browser-viewable output:
The demo generates:
svg/qubits.html- Auto-refreshing wrapper (every 2 seconds)svg/pixels.html- SVG rendering of current LED state
Open svg/qubits.html in a browser to watch the demo without physical LEDs.
Performance Tips
- Start with Local: Use Aer simulator for fastest results
- Monitor Queue Times: Real hardware jobs may take minutes to hours
- Check Connectivity: Ensure stable internet for IBM Quantum backends
- Use Interactive Mode: Easier than command-line flags for demos
Educational Context
Perfect for teaching:
- Quantum Measurement: Physical representation of state collapse
- IBM Quantum Platform: Hands-on experience with real quantum systems
- Processor Architecture: Understanding qubit connectivity and topology
- Backend Comparison: Simulator vs. real hardware differences
Credits
Developed by Kevin Roche
- GitHub: KPRoche/quantum-raspberry-tie
- Requirements: Qiskit 1.x, Python 3, SenseHat libraries
Learn More
IBM Quantum
Hardware
- Bill of Materials - Component list including LED panels
- Hardware Assembly Guide - Assembly instructions
Source Code
Related Demos
- Bloch Sphere - Understand single-qubit states
- Quantum Lights Out - Another LED-based demo
- Qoffee Maker - Quantum circuit design
- Demo List - All available demos
IBM Quantum and Qiskit are trademarks of IBM Corporation. This demo uses open-source Qiskit software.