2026年5月26日火曜日

Standalone Quantum Circuit Simulators Running on Mobile Phones

Abstract
Full-featured quantum circuit simulators such as Qiskit and Cirq are widely used in the quantum computing community. However, I wanted a quantum circuit simulator that could be used like a pocket calculator—something I could quickly pull out anytime and anywhere, without requiring an internet connection. Several years ago, I developed the app described in [2] for this purpose. Using it, I was able to experiment with many of the basic examples commonly found in introductory quantum computing textbooks, and I still find it extremely useful today.

Recently, I discovered that a similar simulator is also available: the product developed by Codexus Technologies [1]. In this article, I briefly compare the two simulators through several example problems, focusing on usability and design philosophy. Exploring the ideas behind each simulator is both interesting and enjoyable.

🟢 Standalone Quantum Circuit Simulators
Both simulators run entirely on an Android smartphone without requiring any user configuration or internet connection. Like using a calculator, users can immediately experiment with basic quantum circuits whenever they wish. Their main features are summarized below.

• Codexus Technologies App [1]
The app features an attractive and polished user interface. A wide range of fundamental quantum gates is available, and circuits of up to five qubits can be simulated. Users build circuits graphically by placing gates through the GUI, so no text-based programming is required. 

Simulation results are obtained from 1,024 measurement shots and displayed both as a histogram and as a textual state vector (probability amplitudes). The development environment used to create the application is not publicly known.

• Fujio Yamamoto's App [2]
This simulator consists of two versions: a single-qubit simulator and an n-qubit simulator. In the single-qubit version, users can apply quantum gates interactively through a graphical interface, and the state vector is visualized on a three-dimensional Bloch sphere. The n-qubit version accepts circuits in a text-based format similar to IBM's QASM language. 

Simulation results are displayed both graphically (using a disk representation) and in textual form as state vectors. Created circuits can be saved with a button press and later reloaded for further editing. The application was developed efficiently using MIT App Inventor, although much of the complex-number arithmetic is implemented in embedded JavaScript code.

🟢 Comparing Usability Through Example Problems
The purpose of this comparison is not to determine which simulator is superior. Rather, it is to explore the design philosophy behind each application and understand how their creators approached the challenge of building a quantum circuit simulator. Examining these differences is both informative and enjoyable. Let us try the following three examples on each simulator.

(1) Applying X and H Gates Sequentially to a Single Qubit
In the Codexus app, as shown below, the interface is highly polished and intuitive. Users simply place quantum gates one after another. Pressing the "Simulate" button automatically performs 1,024 measurement shots and displays both the state vector and histogram, making the results easy to understand.

The Fujio app also applies quantum gates through a graphical user interface. Its most distinctive feature is the visualization of the state vector on a 3D Bloch sphere. The probability amplitudes are additionally displayed as complex numbers in the lower section of the screen.

(2) Creating a GHZ State with Three Qubits
In the Codexus app, the configuration of CNOT gates is particularly well designed. First, the user selects the control qubit. The simulator then highlights the candidate qubits where the target NOT gate can be placed, allowing the user to complete the operation simply by tapping the desired qubit. The simulation output correctly shows that only the states 000 and 111 occur, confirming the presence of quantum entanglement.

In the Fujio app, quantum gates are specified using a text-based description. Because the circuit can be edited directly, the approach offers a high degree of flexibility. In addition, several example circuits are built into the application, allowing users to load and execute them immediately with a single button press. Simulation results are displayed on a disk diagram showing both probabilities and phases, providing an intuitive and user-friendly representation.

(3) The Mermin–Peres Magic Square Using Four Qubits
This example is somewhat more sophisticated than the previous two. It demonstrates a remarkable form of quantum "magic" that makes clever use of entanglement. Readers interested in the details are referred to [3].

In the Codexus app, circuits containing many gates can still be configured conveniently by scrolling horizontally across the screen. The output correctly shows that only eight of the sixteen possible four-qubit basis states appear, each with approximately equal probability.

At this point, I do have one feature request: for circuits of this length, it would be very useful to save the circuit and reload it later for further editing. I hope this capability will be added in a future version.

As with the previous examples, the Fujio app represents the circuit textually. The simulation results are displayed on the right side of the figure, where the probability and phase associated with each basis state are shown graphically on a disk diagram. The results are easy to interpret and match those produced by the Codexus simulator exactly.

Some readers may notice a small difference. For example, Codexus reports an amplitude of −0.354 for 0001, whereas Fujio reports −0.354 for 1000. This discrepancy is simply due to a different ordering convention for qubit indices. In other words, it reflects the difference between the conventions commonly used by Google Cirq and IBM Quantum.

🟢 Conclusion
Both the Codexus app and the Fujio app have their own strengths and distinctive features. They are enjoyable, convenient, and easy to use. As standalone quantum circuit simulators that run directly on Android mobile phones, they provide an accessible way to explore the fundamentals of quantum computing.

Such tools could serve as valuable educational resources for introductory quantum computing courses at both the high school and university levels.

References
[1]Quantum Circuit Simulator by Codexus Technologies (Sri Lanka)
https://play.google.com/store/apps/details?id=com.codexustechnologies.quantumcircuitsimulator&hl=en-US

[2] Redesigned Mobile Quantum Circuit Simulators by Fujio Yamamoto
https://sparse-dense.blogspot.com/2024/08/redesigned-mobile-quantum-circuit.html

[3] Mermin-Peres Magic
Exploring Quantum Entanglement through Visualization
https://sparse-dense.blogspot.com/2025/05/exploring-quantum-entanglement-through.html

0 件のコメント:

コメントを投稿