0% found this document useful (0 votes)
160 views42 pages

6.2 Quantum Computing and Machine Learning v3.5

The document discusses quantum computing and machine learning. It introduces quantum computing, covering basic concepts of quantum mechanics like quantum superposition, entanglement, and uncertainty. It outlines the development of quantum computing theories and technologies. Finally, it describes potential application scenarios for quantum computing in areas like AI, fintech, logistics, and biological computing by taking advantage of its ability to quickly search large datasets.

Uploaded by

Dany Sanchez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
160 views42 pages

6.2 Quantum Computing and Machine Learning v3.5

The document discusses quantum computing and machine learning. It introduces quantum computing, covering basic concepts of quantum mechanics like quantum superposition, entanglement, and uncertainty. It outlines the development of quantum computing theories and technologies. Finally, it describes potential application scenarios for quantum computing in areas like AI, fintech, logistics, and biological computing by taking advantage of its ability to quickly search large datasets.

Uploaded by

Dany Sanchez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Quantum Computing and Machine Learning

Contents

1. Introduction to Quantum Computing


 What Is Quantum?
 Basic Concepts of Quantum Mechanics
 Development of Quantum Computing
 Application Scenarios and Advantages of Quantum Computing

2. Basic Concepts of Quantum Computing

3. Quantum Machine Learning

4. Quantum Computing Software

1 Huawei Confidential
What Is Quantum?
Quantum is the minimum amount of any physical entity in a microphysical system, such as energy, angular momentum and electric charge.

Classical physics Quantum physics


The physical quantity is considered continuous and the The physical quantity is quantized and the system energy can only be a
system energy can be any value. For example, a ball is discrete value. For example, the energy of a quantum harmonic oscillator
Energy released at any position at the beginning, and the can only be ℏ /2 or 3ℏ /2, and the difference between the energy
system energy is a smooth and continuous parabola. values must be an integer multiple of ℏ .

The motion state in the system can be completely The uncertainty principle of quantum mechanics shows that we cannot
determined and predicted. For a classical harmonic determine the precise position and momentum of a system at the same
State of oscillator, its kinetic energy (velocity) and potential time. For quantum harmonic oscillators, the kinetic energy (velocity) and
motion energy (position) can be 0 at the same time. For potential energy (position) cannot be 0 at the same time. Therefore, the
example, the position of the ball to the spring is system energy has the minimum value ℏ /2 .
balanced, and the system energy is 0.

It is believed that microparticles can be composed of Quantum mechanics shows that particles have both the wave nature
Property particles. (wavefunction superposition) and particle nature (wavefunction collapse).

2 Huawei Confidential
What Is Quantum?
Classical physics Quantum physics
For example, the relationship between
1
= the system energy of a small ball For example, the vibration of a diatomic
2
(harmonic oscillator) bound to a spring =ℏ + = 0,1,2 … molecule can be approximated as a

and its initial position can be quantum harmonic oscillator, and its

expressed by a parabolic curve. vibrational energy needs to be expressed in


Energy Energy
Energy Unit discrete energy levels.


A B

ℏ /2
Position
Position

Harmonic oscillator energy Classical oscillator Harmonic oscillator energy Energy levels of molecular vibration
(classical theory) (quantum theory) of hydrogen chloride

3 Huawei Confidential
Basic Concepts of Quantum Mechanics

Quantum Superposition Quantum Entanglement Quantum Uncertainty


• Similar to waves in classical physics, the result of • Two particles can be in an entangled state: when the • The position and momentum of a
superposition of arbitrary quantum states will be an first particle spins upward, the second particle spins particle cannot be determined at the
effective quantum state. downward, and vice versa. Neither of the particles has same time. The smaller the uncertainty
• Quantum superposition embodies the wave a definite spin orientation before the measurement. of the position, the greater the
properties of quantum systems. • Now make the two particles in the entangled state uncertainty of the momentum, and vice
• Mathematically, quantum superposition comes from leave each other in the opposite direction. Regardless versa.
the linearity of the Schrodinger wave equation, that of the distance, the spin orientation of the other ℏ
• Mathematical expression: ∆x∆p ≥
is, the linear combination of equation solutions is particle can be determined immediately after the spin
also the solution of the equation. orientation of one particle is measured.
• Macro manifestation: double-slit interference
pattern

4 Huawei Confidential
Development of Quantum Computing

Establishment of Development of Quantum Computing


Quantum Computer Engineering
Quantum Mechanics Theories

1935: Einstein, et 1981: 1993: Andrew Yao 1996: Grover 2011: D-Wave Jan. 2017: D- Aug. 2018: D- Dec. 2020: Pan Jianwei
al., put forward Feynman put proved for the first time proposed the announced the Wave Wave team released nine
"EPR paradox". forward the equivalence quantum first commercial launched demonstrated chapters of optical
"quantum between the quantum search quantum 2000Q. topology phase quantum computing
Turing machine model
simulation". algorithm. annealer. transition using prototype machine to
and the quantum circuit
an annealing solve Gaussian wave color
model.
quantum sampling.
computer.

1930 1960 1980 1990 2000 2010 2020

1900–1930: 1964: Bell 1985: Deutsch 1994: Shor proposed 2016: IBM unveiled April 2018: Google October 2019: Google Nov. 2022: IBM
Establishment inequality explained the an algorithm for the 5-qubit released the 72- claimed its quantum released the 433-
of quantum concept of integer factorization. superconducting qubit computer achieved bit quantum chip.
mechanics quantum Turing quantum computer. superconducting "quantum
machine. computer chip supremacy".
Bristlecone.

5 Huawei Confidential
Application Scenarios and Advantages of Quantum Computing

The quantum-classical hybrid The quantum optimization algorithm


architecture is used to give full play can be used to quickly search for the
AI to the advantages of quantum Fintech optimal solution in the exponential
computing in the NISQ phase. parameter space.

The functions of biological Quantum Approximate Optimization


Biological macromolecules and drug molecules Logistics and Algorithm (QAOA) can be used to find
computing can be simulated more accurately by transportation the optimal solution in polynomial
general-purpose quantum time.
computers.

The Shor algorithm can get results in


polynomial time, whereas the
Quantum algorithms are used to classical algorithm needs exponential
Material calculate the energy potential energy time. The Shor algorithm can easily
Security
simulation surface of molecules, and the crack the existing RSA encryption
maximum exponential acceleration system, whereas the quantum
can be achieved. encryption algorithm has absolute
security.

6 Huawei Confidential
Contents

1. Introduction of Quantum Computing

2. Basic Concepts of Quantum Computing


 Quantum Bit and Quantum State
 Quantum Gate
 Quantum Circuit
 General-Purpose Quantum Algorithm
 Variational Quantum Algorithm

3. Quantum Machine Learning

4. Quantum Computing Software


7 Huawei Confidential
Quantum Bit and Quantum State
Base vectors for quantum computing: state 0 is denoted as 0 and state 1 is denoted
Bit
as 1 (|⟩ is a right vector symbol)
Bits are computing unit of classical
Quantum superposition state: A single-bit quantum state is a vector | ⟩ in a two-
1 1 computers for logical processing. The
dimensional complex vector space, and may be represented as:
classical bit that is either 0 or 1. The | ⟩ = |0⟩ + |1⟩
N classical bits can represent only
Herein, and are complex numbers, and | | + | | = 1 (the normalized single
one number at a time.
0 0 quantum bit state is a unit vector in the two-dimensional complex vector space).

Qubit The base vectors 0 and 1 are calculated and mapped to two orthogonal base
z 0 Qubits are computing unit of quantum
vectors in a two-dimensional Hilbert space:
computers for logical processing. The
1 0
| ⟩ qubit can be in state of 0 and 1, or a 0 = , 1 =
0 1
linear superposition state of 0 and 1.
y The N qubits can represent 2N number Any single-bit quantum state can be represented as:

x at the same time. 1 0


| ⟩ = |0⟩ + |1⟩ = + =
0 1
1
8 Huawei Confidential
Quantum Gate
Classical logic gate • Different from classical logic gates, quantum logic gates are based on unitary
transformation of qubits, which makes quantum gate operations reversible.
• Quantum gates often use the matrix representation. A single quantum gate can be
OR NOR AND NAND represented by a unitary matrix 2 × 2 . The number of input qubits of a gate must be
equal to that of the output qubits.

XOR XNOR Buffer NOT • Unitary transformation: a rotation of a quantum state, so that the inner product of the
quantum state remains unchanged before and after the transformation. In the real
Quantum logic gate number domain, it can be simplified as a classical rotation.

= ⇒ =
z 0 z 0
Pauli-X (X) Pauli-Y (Y) Pauli-Z (Z) Hadamard (H)
| ⟩ | ⟩

0 1 0 − 1 0 1 1 1 y y
= = = =
1 0 0 0 −1 2 1 −1 x x

1 1

9 Huawei Confidential
Basic Quantum Gates
Pauli-X (X) Pauli-Y (Y) Pauli-Z (Z) Hadamard (H) CNOT gate
The controlled-NOT (CNOT) gate is a two-qubit gate that
acts based on the input status of the control bit:
• If the control bit is 0, no operation is performed.
0 → 0 0 → 0 + 1
0 → 1 0 → 1 • If the control bit is 1, a gate is applied to the target
1 →− 1 1 → 0 − 1 bit.
1 → 0 1 →− 0

0 1 0 − 1 0 1 1 1 If the low level is the control bit, a If the high level is the control bit,
= = = = matrix is represented as: a matrix is represented as:
1 0 0 0 −1 2 1 −1
1 0 0 0 1 0 0 0
= 0 0 0 1 = 0 1 0 0
0 0 1 0 0 0 0 1
0 0 1 0
Measurement

0 1 0 0

Measures the built quantum circuits, collects statistics on


gate

the collapsed bits at each gate, and finally obtains the


statistical result.

10 Huawei Confidential
Quantum Circuit
Classical circuit
• Quantum circuits are some quantum gate sequences that act on qubits so that
the quantum states of qubits evolve into new quantum states.
• Quantum circuits can be divided into three parts: state preparation, quantum
state evolution, and quantum measurement.
• State preparation ensures that qubits evolve from state |0⟩.
• A quantum circuit with a series of quantum gates works on the qubits and
Quantum circuit the qubits evolve.
0 • The qubits are then measured to obtain the output result of the quantum
circuit.
0 Quantum
• Similar to a quantum gate, a quantum circuit may be considered as a larger
addition
0 circuit unitary transformation or may be represented as a large unitary matrix, because
0 the function of a quantum gate is equivalent to matrix multiplication, and the
result of multiplying a series of unitary matrices is still a unitary matrix.

State Quantum state Measurement


preparation evolution

11 Huawei Confidential
Preparation of Bell-state Quantum Circuits

The maximum entangled state of Generate Bell state The Bell states generated vary
two qubits is called the Bell state. To generate Bell state , prepare a depending on the initial states:
There are four Bell states: qubit in the 00 state, apply the
Input Output
00 + |11⟩ Hadamard gate to change it to the
= 00 00 + |11⟩ / 2 ≡
2 maximum superposed state, and then
use the CNOT gate. 01 01 + |10⟩ / 2 ≡
01 + |10⟩
= 10 00 − |11⟩ / 2 ≡
2
( ⊗ ) 00 11 01 − |10⟩ / 2 ≡
00 − |11⟩
= = 0 + |1⟩ 0 / 2
2

01 − |10⟩
=
2

12 Huawei Confidential
Basic Quantum Algorithms - Deutsch Algorithm
Problem Deutsch quantum algorithm
For ∈ 0, 1 , given an unknown 1. Generate the superposed state: 0 = (|0⟩ + |1⟩).
Boolean function ∈ 0, 1 , there are
2. Apply function :
two possibilities of :
1 ( ) |1⟩
−1 |0⟩ + −1
2
Case 1 (constant): 0 = (1)
For case 1, the generated quantum state is + ; for case 2, the generated quantum
state is |−⟩.
Case 2 (balance): 0 ≠ (1) 3. To discriminate between state + and state − , you can use the Hadamard
To know which case belongs to, the gate: + = |0⟩, − = |1⟩. Then, measure the quantum state. If state 0 is

classical algorithm needs to evolve obtained, it is case 1. If state 1 is obtained, it is case 2. With the quantum
algorithm, the function only needs to be evolved once.
the function at least twice for
comparison— 0 and 1 .

13 Huawei Confidential
General-Purpose Quantum Algorithms
Shor Grover HHL
, ≠
⋅ = = =
, = | ⟩=| ⟩
• Problem: integer factorization • Problem: unordered database search • Problem: linear equation solving
• Complexity • Complexity • Complexity
Classical: ( ) Classical: ( )
Classical: ( . )
Quantum: ( ) Quantum: (log )
Quantum: ( log )
• Application scenarios and advantages: • Application scenarios and advantages:
• Application scenarios and advantages:
The Grover algorithm is used to accelerate various Compared with classical algorithms, the HHL algorithm
The Shor algorithm can get results in polynomial
algorithms and can get results in sub-exponential achieves exponential acceleration in solving linear
time, whereas the classical algorithm needs
time, whereas the classical algorithm requires equations and has advantages in machine learning and
exponential time. The Shor algorithm can easily
exponential time. It provides asymptotic acceleration numerical computing scenarios. Combined with the
crack the existing RSA encryption system, whereas
for brute force cracking of the symmetric key algorithm Grover algorithm, it will be a key technology for
the quantum encryption algorithm has absolute
(including collision attacks and original image attacks) breakthroughs in fields such as quantum machine
security.
and can crack 128-bit symmetric encryption keys in learning and artificial intelligence in the future.
about 2^64 iterations, or 256-bit symmetric encryption
keys in about 2^128 iterations.

14 Huawei Confidential
Variational Quantum Algorithm
Classic Machine Learning Algorithm Flow Variational Quantum Algorithm Flow
Input Input
Training set Training set
Cost function Cost function
Ansatz Ansatz
Hybrid loop Hybrid loop
Classical computer Quantum computer
Updated parameters

Updated parameters
Classical computer Classical computer
Optimizer arg Optimizer
min Cost arg min Cost
Cost Cost

Output Output
Bitstring Bitstring probability distribution

15 Huawei Confidential
Application Scenarios of Variational Quantum Algorithms

Dynamical simulations Compilation

Error correction

Quantum
chemistry Classifiers

Finding Variational quantum


Machine learning
ground states algorithms

Condensed Generative
matter models

Mathematical Combinatorial New frontiers


applications optimization

Systems of Quantum Quantum


Factoring
equations information metrology

Principal Quantum
components foundations

16 Huawei Confidential
VQE for Quantum Chemistry
Challenge Quantum Chemistry VQE Algorithm Process
Quantum chemistry aims to apply quantum mechanics to chemical systems,
such as calculating the ground state energy of molecules by calculating the
numerical solution of the Schrodinger equation. Quantum chemistry has
become an important means to study the physical and chemical properties
of materials.
The exact solution of the Schrodinger equation has exponential complexity,
and the scale of the chemical system that can be simulated is severely
limited. However, only polynomial time is required for quantum computing.

Quantum Chemistry Computing Method Variational Quantum Eigensolver (VQE): Because a wavefunction needs to be constructed,
quantum computers based on quantum state evolution have natural advantages and can
The core problem of quantum chemistry is to solve the Schrodinger equation. efficiently evolve to obtain the trial wavefunction. After the output (the expected energy
In quantum chemistry simulation, the variational method is usually used, that value of the wavefunction) is obtained by using the quantum computer, the variational
is, a trial wavefunction containing parameters is constructed, and the parameters in the quantum circuit may be updated by using the classical optimizer, and
wavefunction with the lowest expected energy is found by continuously iterations are performed repeatedly until the ground state energy and the ground state
optimizing the parameters. wavefunction are found.
17 Huawei Confidential
Quantum Approximate Optimization Algorithm(1)
Quantum Approximate Optimization Algorithm

Quantum Approximation Optimization Algorithm (QAOA) is a quantum algorithm used to solve combinatorial optimization
problems. For a given NP-Hard problem, QAOA can find a good approximation solution in polynomial time. In addition, QAOA
has a better approximation rate than any known classical polynomial-time algorithm and can be used in various scenarios such
as transportation, logistics, and finance.

Max-Cut Problem Quantization


1. Each vertex in the graph is assigned a qubit. When the vertex is distributed to the left, the vertex is set to the |0⟩ state. When the vertex is
distributed to the right, the vertex is set to the |1⟩ state.
2. A proper Hamiltonian quantity is selected, so that when connected vertices are in the same quantum state (on the same side), the expected value
of the Hamiltonian quantity is 0, and when connected vertices are in different quantum states (on different sides), the expected value of the
Hamiltonian quantity is –1.
3. An approximate optimal solution can be obtained by minimizing the expected value of the Hamiltonian quantity.
Overall, we turn the max-cut problem into finding the ground state of the Hamiltonian quantity. So, all we need to do is setting up a proper ansatz
circuit based on the Hamiltonian quantity and continuously optimize the circuit parameters until the optimal solution is found. The figure on the
right shows the detailed process.

18 Huawei Confidential
Quantum Approximate Optimization Algorithm(2)
Max-Cut Problem

The max-cut problem is an NP-complete problem in the graph


1
theory. It needs to divide vertices of a graph into two parts and 2 3 3
make the most edges be cut, as shown in the figure on the 1 2
0 4 0
right. 4

Max-Cut Problem Solving Process


Set up a parameterized circuit.

Initialize parameters.

Execute the circuit to obtain the quantum state | ⟩.

Optimize parameters.
Calculate ⟨ | | ⟩.

No
Does the loss function converge?
Yes
Obtain the optimal approximation solution through calculation.

19 Huawei Confidential
Contents

1. Development of Quantum Computing

2. Basic Concepts of Quantum Computing

3. Quantum Machine Learning


 Classical Machine Learning
 Quantum Machine Learning
 Advantages of Quantum Machine Learning
 Iris Classification Algorithm

4. Quantum Computing Software

20 Huawei Confidential
Classical Machine Learning
Classical machine learning includes supervised learning, unsupervised learning, and reinforcement learning, and is widely used in
various fields such as classification, image recognition, and behavior learning.

• Bottlenecks faced by classical machine


learning: As data grows, the volumes overload
classical computers.
• The unique superposed state and state
entanglement properties of qubits can
implement exponential parallelism to reduce
computing complexity and improve data
processing capability.
In 2017, AlphaGo trained in deep In 2020, the accuracy of protein
• For a 28 x 28 MNIST dataset, only 10 qubits
reinforcement learning defeated Ke Jie, structure prediction using AlphaFlod 2
who is the world's number one Go reaches 1.6 Å. are required for encoding, outcompeting
player.
classical 784 bits.

21 Huawei Confidential
Quantum Machine Learning

Machine learning can be classified into the • CC: classical data + classical algorithm (traditional machine learning)
• CQ (AI4Quantum): classical data + quantum algorithm, that is, classical machine learning is applied to
following four types by data and algorithm:
the quantum field. Quantum data, such as quantum states and Hamiltonian quantities, can be
represented by classical neural networks and tasks can be completed by training the parameters of the
classical neural networks.

Type of Algorithm • QC (Quantum4AI): quantum data + classical algorithm , which is classified into two types:
• A quantum version of traditional machine learning algorithms, such as quantum principal
Classical Quantum component analysis (QPCA), quantum support vector machine (QSVM), and quantum
reinforcement learning. These algorithms can obtain quantum acceleration from corresponding

CC CQ
Classical

quantum algorithms, but are not suitable for near-term quantum devices.
• QNN: Parameterized quantum circuits replace neural networks. For example, quantum
Type of Data

convolutional neural networks (QCNNs) are used for classification, and quantum generative
adversarial networks (QGANs) are used for generation.
QQ: quantum data + quantum algorithm, that is, fully quantum machine learning.

QC QQ
Quantum

Application scenario: Quantum data is unknown, and the data can be regenerated in other quantum systems
through quantum machine learning.

22 Huawei Confidential
Advantages of Quantum Machine Learning

• By using properties such as quantum state superposition


and entanglement in quantum computing, a plurality of Algorithm Complexity
qubits can represent more complex states or implement Bayesian inference Ο( )
more complex operations, thereby implementing quantum Online perceptron Ο( )
acceleration. Least-squares fitting Ο(log )
• Quantum systems are more suitable for linear algebra Classical Boltzmann machine Ο( )
operations (distance estimation of high-dimensional
Quantum Boltzmann machine Ο(log )
vectors).
Quantum PCA Ο(log )
• Quantum algorithms with polynomial or exponential
Quantum SVM Ο(log )
acceleration: HHL, quantum PCA (qPCA), quantum-
Quantum reinforcement learning Ο( )
enhanced SVM (QSVM), Grover search, etc.
• The NISQ phase requires a QC hybrid architecture that uses
classical machine learning to control parameters in
quantum circuits.

23 Huawei Confidential
Iris Classification Algorithm
Solution Process of Classification Algorithm Based on the Quantum Neural
Challenge
Network
The iris dataset is widely used in classical machine Divide the dataset into a training set and a test set and shuffle the dataset to
Preprocessing
increase randomness.
learning. By using the quantum neural network, a
classifier can be trained to solve the classification
Encode data to quantum states using a parameterized quantum circuit
Encoding
problem of the dataset. (encoding circuit).

The dataset consists of 150 samples from three species


According to the problem type and characteristics, select a proper
of Iris (Iris setosa, Iris virginica and Iris versicolor). Each Ansatz setup parameterized quantum circuit as ansatz.
sample contains four characteristics: calyx length, calyx
width, petal length, and petal width. Obtain the Hamiltonian quantity from the quantum state evolved from the
Hamiltonian
quantum circuits (encoding and ansatz circuits) that are set up in the previous
quantity steps and calculate the loss function and the parameter gradient.

• Evolve qubits through the quantum circuits and obtain the expected value of Hamiltonian
quantity as the output.
Training • Calculate the loss function and parameter gradient, and use the classical optimizer to
update the parameters of the ansatz circuit to complete an iteration. Repeat iterations
until the loss function converges.

Testing Apply the trained model to the test set to test the accuracy of the model.

24 Huawei Confidential
Contents

1. Development of Quantum Computing

2. Basic Concepts of Quantum Computing

3. Quantum Machine Learning

4. Quantum Computing Software


 MindSpore Quantum Computing Framework
 HiQ Quantum Computing Cloud Platform
 Quantum Software Programming Practice

25 Huawei Confidential
HiQ Quantum Computing Full-Stack Solution
Quantum Biological Material Logistics and Open
AI
applications computing simulation transportation Rich APIs, facilitating
development and

Quantum integration and enabling


Jupyter Notebook
computing cloud HiQ Composer CloudIDE industry applications
( ModelArts )
platform

HPC framework
MindSpore Quantum
Variational algorithm General algorithm Quantum Computing Integrated with AI
Quantum library library Simulation Acceleration development and DL
computing Engine
Quantum Simulator platforms to achieve
framework
industry-leading
MindSpore deep learning framework performance

Quantum Euler Quantum


operating
system Task scheduling Virtual QPU Pulse optimization Autocalibration Full-stack
Integrated software and
Quantum Electronics CPU GPU Ascend Superconducting Ion-trapped hardware solution
Quantum
Design Automation
hardware
(QEDA) Classical computers Quantum computers

26 Huawei Confidential
MindSpore Quantum

Predict Cost
MindSpore
Search Quantum
Quantum
Update computing framework
Optimization
CPU/GPU/Ascend/QPU

Predict Cost

Search

Update Deep learning framework


Optimization
CPU/GPU/Ascend

27 Huawei Confidential
Evolution of MindSpore Quantum: Pursuing Excellence and Continuous
Innovation
CPS International Young
Quantum Physics and
HDC 2021 HC 2021 APTQS 2022 Scientists Forum on
Logic 2022
Quantum Computing

 Provides the quantum noise simulation capability,


 Provides various ansatz circuits.
supporting multiple channels.
 Provides multiple quantum neural network
 New CPU/GPU quantum
 Provides SVG drawing of quantum circuits and
operators.
circuit simulator
sampling results.
 Provides unique quantum circuit operators.

2022.07

V0.7

 Provides quantum circuit simulation  Completed framework  Optimizes the construction process of quantum neural networks.

capabilities. refactoring.  Releases more simulator interfaces.


 Provides variational quantum algorithm  Simplified the quantum  Implements efficient quantum Fisher information computing.
simulation capabilities, including VQE, machine learning process.  Provides the dynamic display capability of the Bloch sphere.
QAOA, and QNN.

28 Huawei Confidential
MindSpore Quantum: Making Quantum Computing Reachable

Superb experience Ultimate performance Simplified development


• Industry-leading variational quantum computing • Pre-integrated with HiQ cloud services,
• Rich variational circuit algorithm libraries, performance installation-free, and out-of-the-box
enabling frontiers • Industry-leading 28-qubit quantum chemical • One-click PIP installation, supporting various
• Efficient and convenient template-based simulation and 32-qubit acceleration (QuPack) operating systems
quantum neural networks • High-performance simulator, supporting analog • Built-in quantum machine learning, chemical
• In-depth integration with MindSpore computing of 30+ qubits. simulation, and combinatorial optimization
• Various hardware platforms • Up to 10x and 2x increase in GPU and CPU modules, providing rich tutorials
• Visualized circuit rendering performance (compared with version 0.7) • Rich programming interfaces and development
• Non-Hermitian operations such as gradient instances, simple and easy to use
calculation of expected values

29 Huawei Confidential
Superb Experience of MindSpore Quantum

Rich variational circuit In-depth integration Various hardware Multi-format visualized


algorithm libraries with MindSpore platforms circuit rendering

CPU/GPU/Ascend/QPU
max-cut
Hardware Auto
efficient differentiation
max-2-sat

uccsd/uccsd0 Quantum neural


network
training & inference
IQPencoding

Based on the high-performance in-depth AI development platform, MindSpore Quantum provides a rich algorithm library, enabling
developers to easily develop quantum software and algorithms based on the framework.

30 Huawei Confidential
Ultimate Performance of MindSpore Quantum: Industry-leading Variational
Quantum Algorithms
VQE performance improved QAOA performance improved QNN performance
3+ times 5+ times improved 4+ times
3125 10000
10000

625
1000
1000
125

Time (s)
100
Time (s)

Time (s)
25 100

10
5
10
1
1

0.2 1 0.1
H2(4 qubits) LiH(12 qubits) BeH2(14 qubits) 4 qubits(6 6 qubits(6 8 qubits(6 10 qubits(6 4 qubits 6 qubits 8 qubits 10 12 14
layers) layers) layers) layers) qubits qubits qubits
MindQuantum TensorFlow Quantum MindQuantum TensorFlow Quantum MindQuantum TensorFlow Quantum
Qiskit Pennylane Qiskit Pennylane Qiskit Pennylane

Quantum Research on Logistics and


Molecular Classification
material new Max-Cut TSP transportation NLP GAN
simulation problems
simulation materials problems

MindQuantum 0.5.0 (2022.02.28) TensorFlow Quantum 0.6.1 (2022.02.04)


Beta version
31 Huawei Confidential qiskit-terra 0.19.2 (2022.02.09) Pennylane 0.21.0 (2022.02.08)
Simplified Development on MindSpore Quantum
Pre-integration, installation-free One-click installation, efficient and fast

PIP installation command:


pip install mindquantum

Linux Windows macOS

Rich tutorials, easy to get started Easy-to-use APIs

Iris
Quantum QAO Grov
Classifica
circuit A er
tion
Quantum
measurem Bloch VQE HHL
ent
Phase
Gradient
estimatio NLP Shor
calculatio
n

32 Huawei Confidential
MindSpore Quantum Provides Rich Tutorials for Learning and Scientific
Research
Step 1 Step 2 Step 3
Academic papers and solution verification,
Quantum computing beginner and advanced tutorials Tutorial for solving typical application problems
providing cases for quantum software research
& training videos of quantum computing
and innovation

2022 QWorld Quantum Computing MindSpore Quantum Tutorial and MindSpore Quantum papers, open source
and Programming Course Developer Guide code

https://hiq.huaweicloud.com/tutorial https://hiq.huaweicloud.com/tutorial

https://hiq.huaweicloud.com/consult/paper

33 Huawei Confidential
HiQ Quantum Computing Cloud Platform Provides Various Frontend
and Backend Services
HiQ Composer Jupyter Notebook
GUI tool Interactive IDE
(For beginners) (Teaching)

Drag-and-drop quantum Interactive programming IDE to


circuit setup, easy to use. facilitate quantum algorithm
development.

CloudIDE ModelArts
Cloud Native IDE AI development platform
(Lightweight development) (High-performance
computing)

A professional programming Paid services with more powerful


interface similar to VS Code computing resources to meet the
and highly integrated with requirements of large-scale
tools such as Git algorithm research

34 Huawei Confidential
Contents

1. Development of Quantum Computing

2. Basic Concepts of Quantum Computing

3. Quantum Machine Learning

4. Quantum Computing Software


 MindSpore Quantum Computing Framework
 HiQ Quantum Computing Cloud Platform
 MindSpore Quantum Programming Practice

35 Huawei Confidential
Creating a Quantum Programming Development Environment

Step 1 Step 3

Log in to the HiQ platform Create a Notebook file.


and create an instance.

https://hiq.huaweicloud.com/portal/home

Step 2
Start the instance.

36 Huawei Confidential
Practice 1: Setting Up a Quantum Circuit

1. Import the dependency package. 3. Print the quantum circuit.


import numpy as np print(circ)
# import quantum gate
from mindquantum.core.gates import X, H, RY
# import quantum circuit
from mindquantum.core.circuit import Circuit

2. Create a quantum circuit and add a quantum gate.

circ = Circuit() # Create a quantum circuit.


circ += RY('a').on(0) # Add a RY gate to bit 0 of the circuit.
circ += X.on(1, 0) # Add an H gate to bit 1 of the circuit.

37 Huawei Confidential
Practice 2: Variational Quantum Computing

4. Create the Hamiltonian quantity.

ops = QubitOperator('X0 X1') # Create the Hamiltonian quantity wrapper.


ham = Hamiltonian(ops) #Create the Hamiltonian quantity.
print(ham) # Print the Hamiltonian quantity.

1 [X0 X1]

5. Calculate the expected value and gradient.

sim = Simulator('projectq', 2) # Create a 2-qubit simulator.


# Obtain a function that returns the forward value and the gradient of the circuit parameter.
grad_ops = sim.get_expectation_with_grad(ham, circ)
grad_ops(np.array([1.0])) # Calculate the gradient and expected value.

(array([[0.84147098+0.j]]), Expected value


array([[[0.54030231+0.j]]])) Gradient

38 Huawei Confidential
Quiz
1. (True or false) The Shor algorithm can efficiently perform integer factorization, which is
much faster than the classical algorithm.

A. True

B. False

2. (Single-choice) Which of the following quantum circuits corresponds to MindSpore


Quantum X.on (0,1)?

A. B.

39 Huawei Confidential
Recommendations

 Huawei official websites:


 HiQ quantum computing: https://hiq.huaweicloud.com/home
 MindSpore: https://mindspore.cn/
HiQ official website MindSpore official
 Quantum software website

 MindQuantum: https://gitee.com/mindspore/mindquantum
 HiQ quantum computing cloud platform:
https://hiq.huaweicloud.com/portal/home

MindQuantum HiQ Platform


community

40 Huawei Confidential
Thank you. 把数字世界带入每个人、每个家庭、
每个组织,构建万物互联的智能世界。
Bring digital to every person, home, and
organization for a fully connected,
intelligent world.

Copyright©2023 Huawei Technologies Co., Ltd.


All Rights Reserved.

The information in this document may contain predictive


statements including, without limitation, statements regarding the
future financial and operating results, future product portfolio, new
technology, etc. There are a number of factors that could cause
actual results and developments to differ materially from those
expressed or implied in the predictive statements. Therefore, such
information is provided for reference purpose only and constitutes
neither an offer nor an acceptance. Huawei may change the
information at any time without notice.

You might also like