Researchers from Wells Fargo introduce Spinoza, a high-speed Quantum Simulator.

Researchers From Wells Fargo Introduce Spinoza, A High-Speed Quantum Simulator.

Quantum researchers from Wells Fargo published a study last March 2, 2023, on the overview of the design and implementation of Spinoza, a fast and adaptable simulator for developing the state of a quantum system utilizing quantum gates. The study, featured in Cornell University, was based on the fundamental principle that a single-qubit gate applied to a target qubit preserves the likelihood of amplitude pairs corresponding to measurement outcomes that differ only in the target qubit.

Primarily, the researcher’s focus was on the single-threaded implementation. The study’s experimental design was based on single-qubit gate modifications working on amplitude pairs while preserving the probability of individual pairs is crucial to the design. This technique enables simple parallelization of gate applications by dividing pairs among many processes or threads.

Spinoza’s implementation of the evolution of a quantum system’s state using a (controlled) gate consists of two parts. The first is to pick the pairs of amplitudes that are updated together. The researchers observed that for some gates (P, Z, RZ), only one side of the pair is required; second, the gate formula is applied to update one or both sides of each such pair.

The efficiency of the Rust programming language for the creation of a high-speed Quantum Simulator

Creating a rapid quantum simulator necessitates the employment of a programming language with lightning-quick performance, efficient memory consumption, and a low degree of control. The Rust programming language meets all of the above requirements for a rapid quantum simulator and provides extra benefits.

The borrow checker, which helps remove memory safety problems plaguing projects written in C and C++, is the primary benefit of Rust. Given that quantum calculations are parallelizable, Rust’s type and ownership systems give an additional benefit.

Spinoza Quantum Simulator Designed with Single-precision Complex numbers

Spinoza can be easily built and installed using single-precision complex numbers using the one feature flag. In our study, single-precision complex numbers yielded a 30% performance boost. Using single precision, more of the state vector can fit into the cache.

The researcher has also emphasized that using a single-precision complex number results in a state vector that takes half the memory necessary for double-precision complex numbers. As a result, using single-precision complex numbers allows users to include an extra qubit into their quantum state simulation at the expense of precision.

Spinoza defines the state as a structure comprising two vectors of single or double-precision floating-point types—one for the real and one for the imaginary components of each amplitude—and an integer value for n, or the number of qubits represented by the state.

Spinoza’s Quantum Circuit & State Representation

Spinoza offers functions that allow for the building of quantum circuits using a circuit syntax similar to that of Qiskit. Because the order and quantity of gates may be known before execution, using the circuit implementation provides extra optimizations. One or more registers of qubits can be used to initialize a circuit, but only one state structure is defined in the implementation.

Spinoza contains an inverse quantum Fourier transform function that may be added to a circuit (or applied to a state) with the same syntax as a single gate application for ease of designing quantum circuits. The transformations are not applied to the state until the run function is called.

Additionally, for Spinoza, a quantum state can be represented as a complex number vector. Spinoza defines the state as a structure comprising two vectors of single or double-precision floating-point types—one for the real and one for the imaginary components of each amplitude—and an integer value for n, or the number of qubits represented by the state.

Also, in the study, the researchers also indicated the state vector could be defined as a simple vector of single or double-precision complex numbers. However, dividing the real and imaginary components into two independent vectors allows for optimizations that are not achievable with a single vector.

Spinoza Simulation Performance against Other Quantum Simulators

The research study examined the performance of executing single gates and parameterized quantum circuits in Rust against Qulacs in C++ to evaluate the performance of Spinoza. Compared to other open-source quantum simulators in relevant benchmarks, Spinoza is one of, if not the finest, performing simulators when simulating quantum processes with five to twenty-five qubits utilizing a single thread.

The researchers also conducted a performance comparison analysis in the study. Comparing Spinoza’s performance to those of many freely available quantum simulators. The benchmarks described in this part were generated with the help of the public GitHub repository, where benchmarking code was reviewed by developers from various libraries.

The researchers compare the repository’s environment setup and configurations to Spinoza’s corresponding settings. Then they compared Qulacs to the most recent Python library version. As a result, for both convenience and relevant comparability, they benchmark Spinoza using the Python function.

Finally, the researchers showed that the Spinoza contains capabilities that enable quantum circuit construction with a circuit syntax similar to that of Qiskit.

Based on their data and experiments, the paper concluded that Spinoza is currently capable of fast quantum state simulation on a wide range of processors when only one thread of execution is available. Furthermore, Spinoza has an advantage over other simulations. Yet, Spinoza has to be tweaked better to use newer machines with unprecedented L3 cache sizes. Furthermore, such computers provide many cores at the expense of single-core speed. Spinoza will be modified to accommodate users who run simulations on the latest high-speed, server-class CPUs.

Read the full paper here.