News

日本語 · English · 中文

[Contribution] Simulating Silicon Quantum Computing at Home! Python “eoqrid” Optimization Capabilities

Introducing "eoqrid," a Python simulator specialized for exchange-only silicon quantum computers. It features transpilation functionality that converts logic circuits into physical pulses, enabling comparison of circuit depths across different optimization levels for random circuits. The depth is reduced from 821 at level 0 to 670 at level 3.

In recent years, following the "superconducting approach" to quantum computers led by Google and IBM, the "silicon quantum dot approach" is rapidly gaining attention as the next-generation frontrunner. It is said that its greatest strength lies in its ability to easily scale up to millions of bits in the future, as it can leverage existing semiconductor manufacturing technologies (such as cleanrooms).

Among such silicon quantum computers, did you know there is a Python library that allows you to easily simulate on your own PC the "Exchange-Only" method, which is being researched as a control technique particularly resistant to noise?

That is eoqrid, introduced here.

https://github.com/samn33/eoqrid

Japanese tutorial here

https://github.com/samn33/eoqrid/blob/main/docs/tutorial_jp.md

In this article, we will clearly explain the powerful features provided by eoqrid and how to use it, with actual source code!


1. What kind of library is eoqrid?

eoqrid is a simulator specialized for silicon quantum computers using the Exchange-Only (EO) approach. It takes abstract quantum algorithms that we usually see and maps them onto the physical behavior of actual silicon chips (pulse control and dot placement), allowing you to simulate the results.

It has two main powerful core functions:

  • Transpilation of logical quantum circuits ("Physical transformation & optimization") Automatically converts ideal quantum circuits (logical circuits) written in Qiskit etc. into an instruction set of "exchange interactions (voltage pulses)" and "measurements" that can be executed on silicon qubits.
  • Fast simulation execution of physical quantum circuits Pseudo-executes converted or manually assembled circuit groups at the physical pulse level, instantly calculating the final quantum state vector and sampling frequencies upon measurement.

2. Why do you need eoqrid? (Unique constraints of the EO approach)

You might wonder, "What's different from a regular quantum simulator?" In fact, silicon quantum computers using the Exchange-Only approach have numerous unique physical constraints that require significant effort from the software (compiler).

  • 3 Spins = 1 Logical Bit: In this approach, three physical quantum dots (electron spins) are combined to represent one logical quantum bit. This means the number of bits triples upon transpilation.
  • The inconvenience of only interacting with neighbors: Dots on the chip can generally only interact (communicate) with adjacent partners. If you want to perform calculations between distant bits, you must relay data via intermediate dots (SWAP operations).

On this "constrained map (topology)," eoqrid is a library that lets you experience the fun of solving the difficult route-finding puzzle of minimizing unnecessary data relays and shortening circuit length (depth).


3. Let's try running it! Sample Code

Seeing is believing. Here is code that maps a random circuit built with Qiskit to a random chip topology created with NetworkX, and visualizes the performance changes across different optimization levels.

Simply copy and paste this code and run it to see the full picture of the compiler puzzle being solved in the background pop up on your screen.

import matplotlib.pyplot as plt  # 👈 Essential for displaying the graph window!
import networkx as nx
from eoqrid import EoqSimulator
from eoqrid.util import plot_qc, plot_graph, random_quantum_circuit, random_connected_graph

# 1. Parameter settings
num_qubits = 3             # Number of logical qubits
num_dots = num_qubits * 3  # Physical dots need to be tripled (9 dots total)
depth = 100
seed = 1234

# 2. Create a random logical circuit first
qc = random_quantum_circuit(num_qubits, depth, seed)
plot_qc(qc)  # Prepare to draw the original clean logical circuit diagram

# 3. Next, create the connection topology for the physical chip
topo = random_connected_graph(num_dots, num_dots, seed)
plot_graph(topo)  # Prepare to draw the constrained chip connection graph

# 4. Pass the created topo to the simulator and verify optimization levels (0-3)
print("== optimization_level, depth ==")
eoq = EoqSimulator(topo)

for optimization_level in (0, 1, 2, 3):
    qc_native = eoq.transpile(qc, optimization_level=optimization_level, seed=seed)
    print(f"optimization_level = {optimization_level}, depth = {qc_native.depth()}")

# 5. Finally, pop up all drawing windows on the screen!
plt.show()  # 👈 By placing this at the end, graphs and circuits become visible!

Output Results (Terminal)

== optimization_level, depth ==
optimization_level = 0, depth = 821
optimization_level = 1, depth = 685
optimization_level = 2, depth = 670
optimization_level = 3, depth = 670

4. See it to believe it! The art of EO optimization

When you run the above code, not only numbers but also two visuals will appear.

① Map (Topology) Constraints: plot_graph(topo)

Looking at the NetworkX graph displayed on the screen, you can see that all dots are connected sparsely and insufficiently. At level 0 (no optimization), data is mapped blindly without considering this constrained map, causing unnecessary round-trip data relays (SWAPs) for every communication, resulting in a massive physical circuit length of "821".

② Layout and Routing Optimization: optimization_level = 3

When the optimization level is set to maximum, Qiskit's powerful compiler features kick in, performing advanced calculations such as "placing logically interacting qubits on adjacent dots from the start (layout)" and "transporting data along the shortest route with the fewest steps using graph theory (routing)." As a result, the circuit is successfully shortened to the limit value of "670".

Since qubits develop errors and degrade over time, this process of shrinking the circuit through software power is a lifeline for increasing hardware success rates.


5. Recommended for people like these:

  • Those interested in the hardware structure of quantum computers and low-level control
  • Those who want to research/study quantum compiler routing algorithms and layout optimization
  • Those who want to intuitively understand the mechanisms of silicon qubits, the next-generation frontrunner, not just through formulas

Summary: Run tomorrow's hardware on your PC right now

Actual silicon quantum chips are cutting-edge devices currently under development in laboratories worldwide. Before they become practical, the greatest value of eoqrid is that it allows you to "design the shape of future chips yourself and verify the limits of software optimization."

Would you like to take a step into the deep world of puzzles in low-level quantum software?

This article was translated from the Japanese original. 日本語で読む

← Latest articles