HiQ Quantum Computing Cloud Platform recently launched a high-performance QuPack quantum simulation acceleration engine to accelerate quantum algorithm research

background and introduction

In recent years, breakthrough new developments have emerged in the field of quantum computing, from algorithm development to hardware implementation. At present, quantum computing is in the Noisy Intermediate Scale (NISQ) stage. Large-scale quantum simulators have limited fault tolerance and have not yet formed effective applications. The research of quantum simulators is of great significance.
Various quantum computing suites in the industry, including Shengsi MindSpore Quantum, can easily simulate quantum circuits. However, for specific problems and specific hardware platforms, we can adopt more efficient simulation algorithms. Therefore, the HiQ quantum computing team launched QuPack, a well-designed quantum simulation acceleration engine. QuPack uses the latest and most cutting-edge technology in the industry to provide researchers with more powerful quantum simulation tools . Currently, the QuPack engine has a self-developed VQE quantum chemistry simulator and QAOA quantum combinatorial optimization algorithm simulator, which can accelerate the corresponding algorithm simulation by an order of magnitude, helping researchers to discover new quantum algorithms.

01 Advantages

As a simple, efficient, flexible and powerful quantum simulation acceleration engine , QuPack is far superior to similar software at home and abroad in terms of operating efficiency and functional design. QuPack has super scalability, and can customize the number of qubits, Ansatz circuit layers, and Hamiltonian to meet customized needs; it can set or obtain the real-time quantum state of the quantum circuit, and obtain the expected value and gradient of the Hamiltonian.

The functions and performance advantages of QuPack in different application scenarios will be introduced in detail below.

1. VQE dedicated simulator

Main advantages: Fewer memory resources, computing larger bits of numerator

The QuPack quantum simulation acceleration engine provides a VQE dedicated simulator to achieve VQE algorithm acceleration. Compared with the industry's quantum software framework, it is significantly innovative. QuPack adopts a more powerful memory compression technology, which reduces the memory space occupation from exponential to polynomial level, and can run ultra-large-scale quantum chemical simulations with fewer computing resources, thus greatly reducing the running time. 

[VQE solves the ground state energy of chemical molecules]

The performance comparison of VQE for solving the ground state energy of chemical molecules (take H6 molecule/12 qubits as an example), as shown in Figure 1 below, QuPack achieves tens of thousands of times faster than Qiskit . QuPack can complete the end-to-end simulation of the ground state energy solution of a 12-qubit hydrogen chain system in 0.5s .

  Figure 1 Comparison of quantum simulator VQE performance

End-to-end time (including loading molecular model, constructing quantum circuit, Hamiltonian, calculating expected value and gradient, and iterative calculation) software version: Qiskit 0.43.0, TensorFlow Quantum 0.7.2, MindQuantum0.9.0, QuPack 0.1. 1

Compared with Qiskit and TensorFlow Quantum, the mainstream software in the industry, QuPack can calculate more large-bit molecules. At present, the calculation of 32 or more qubits can be supported on a general-purpose computer . The 32U128G environment can support a maximum of 32 qubits, the 8U32G environment can support a maximum of 30 qubits, and the 2U8G environment can support a maximum of 28 qubits. This makes QuPack ideal for tackling large-scale quantum computing problems.

 Figure 2: Benchmark end-to-end time of the hydrogen chain system

*Hardware information: Intel(R) Xeon(R) CPU E5-2620, 8U32G; software version information is the same as that in Figure 1

Log in to the HiQ quantum computing cloud platform, start using it immediately, and experience it online for free (the experience environment is currently 2U8G). https://hiq.huaweicloud.com/portal/home

2. QAOA dedicated simulator

Main advantages: ultra-fast line simulation, efficient solution to combinatorial optimization problems

QuPack provides a dedicated QAOA simulator to accelerate the QAOA algorithm. For the fully connected graph problem, the iteration speed is significantly improved, and the Hamiltonian of the high-order binary optimization problem is seamlessly connected, so as to efficiently solve the combinatorial optimization problem.

[QAOA solves the Max-Cut problem]

The performance comparison of QAOA solving the MAX-Cut problem (taking the fully connected graph of 16 nodes/16 qubits as an example), as shown in Figure 3 below, compared with the mainstream software Qiskit, the performance of QuPack is more than 88 times higher .

 Figure 3: Quantum simulator QAOA performance comparison chart

End-to-end time (including loading fully connected graph model, constructing quantum circuit, Hamiltonian, calculating expected value and gradient, and iterative calculation) software version: Qiskit 0.43.0, TensorFlow Quantum 0.7.2, MindQuantum0.9.0, QuPack 0.1.1

02 Get started

1.  Understand QuPack

QuPack Tutorial Documentation:

https://hiq.huaweicloud.com/document/QAOA

https://hiq.huaweicloud.com/document/VQE

QuPack API documentation:

https://hiq.huaweicloud.com/document/qupack/index.html


QuPack usage guide:

https://www.hiascend.com/forum/thread-0253120736407765026-1-1.html?fid=0106101385921175002

2. Online experience

Currently, the following two usage methods are provided to allow developers to quickly experience QuPack. Click the link to experience it online for free: https://hiq.huaweicloud.com/portal/home

  • The HiQ quantum computing cloud platform enters CloudIDE, ready to use, free online experience (select "sample project" when creating an instance).

  • HiQ Quantum Computing Cloud Platform enters JupyterLab for free experience.

3. Sample code

We take the most commonly used VQE algorithm to solve the ground state energy of chemical molecules as an example to quickly understand the API overview of QuPack.

from openfermion.chem import MolecularData
from openfermionpyscf import run_pyscf
from scipy.optimize import minimize

from mindquantum.core.circuit import Circuit
from mindquantum.algorithm.nisq import uccsd_singlet_generator
from mindquantum.core.operators import InteractionOperator, FermionOperator, normal_ordered
from qupack.vqe import ESConservation, ExpmPQRSFermionGate, ESConserveHam

# 定义分子结构
geometry = [["Li", [0.0, 0.0, 0.0 * 1.5]],["H", [0.0, 0.0, 1.0 * 1.5]],]
molecule_of = MolecularData(geometry, "sto3g", multiplicity=2 * 0 + 1)
mol = run_pyscf(molecule_of, run_ccsd=1,)

# 实例化模拟器,并生成uccsd方法的费米算符,然后用该算符生成量子线路。
sim = ESConservation(mol.n_qubits, mol.n_electrons)
ucc_fermion_ops = uccsd_singlet_generator(mol.n_qubits, mol.n_electrons, anti_hermitian=False)
circ = Circuit()
for term in ucc_fermion_ops:
    circ += ExpmPQRSFermionGate(term)

# 用分子对应的哈密顿量构造相互作用算符,然后构造费米算符,进而得到哈密顿量。
ham_of = mol.get_molecular_hamiltonian()
inter_ops = InteractionOperator(*ham_of.n_body_tensors.values())
ham = ESConserveHam(normal_ordered(FermionOperator(inter_ops)).real)

# 构造计算哈密顿量期望值和参数梯度的算子,然后优化线路参数直到期望值最小化,即得到基态能量。
grad_ops = sim.get_expectation_with_grad(ham, circ)

def func(x, grad_ops):
    f, g = grad_ops(x)
    return f.real, g.real

init_amp = [1e-6 for i in range(len(circ.params_name))]
res = minimize(func, init_amp, args=grad_ops, method='bfgs', jac=True)

03 Empowering Ecology

Welcome everyone to experience the brand new quantum simulation acceleration engine QuPack and feel the ultimate performance and super fast speed. At the same time, we also sincerely invite you to actively participate in the "2023 MindSpore Quantum Computing Hackathon National Competition" to showcase your talents and innovations. The registration deadline for the competition is July 15, 2023, so stay tuned.

Three highlights of this year's competition:

  • A new warm-up track has been added to the Hackathon competition, and Xiaobai and experts will participate in the challenge together.

  • Experience the new generation of general-purpose quantum computing suite MindSpore Quantum and the first quantum simulation acceleration engine QuPack.

  • The hall of honor exhibition, hackathon final award, encouragement award, promotion award and other multiple awards can be superimposed.

During the competition, we will invite senior experts from Huawei to interact live online, providing developers with a new model of "learning-practicing-competition" to help everyone better experience quantum computing software programming. A brand-new competition experience, excellent framework performance, and an active open source community, come and sign up for the competition and challenge the national championship!

Competition registration link: https://competition.huaweicloud.com/information/1000041884/introduction
If you want to use QuPack in teaching or activities, please contact us directly.
Thank you for your continued attention to HiQ quantum computing, and welcome your valuable opinions. Official email: [email protected]
Welcome to reprint and quote the content of this article.

Guess you like

Origin blog.csdn.net/Kenji_Shinji/article/details/131417992