12
Intermediate-Scale Full State Quantum Circuit Simulation by Using Lossy Data Compression Xin-Chuan Wu 1 , Sheng Di 2 , Franck Cappello 2 , Hal Finkel 2 , Yuri Alexeev 2 , and Frederic T. Chong 1 EPiQC@University of Chicago 1 Argonne National Laboratory 2

Intermediate-Scale Full State Quantum Circuit Simulation ...people.cs.uchicago.edu/~xinchuan/WU_APS_talk.pdf · Block [3] Compressed ... Project Number: 17-SC-20-SC, a collaborative

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Intermediate-Scale Full State Quantum Circuit Simulation ...people.cs.uchicago.edu/~xinchuan/WU_APS_talk.pdf · Block [3] Compressed ... Project Number: 17-SC-20-SC, a collaborative

Intermediate-Scale Full State Quantum Circuit Simulation by Using Lossy Data Compression

Xin-Chuan Wu1, Sheng Di2, Franck Cappello2, Hal Finkel2, Yuri Alexeev2, and Frederic T. Chong1

EPiQC@University of Chicago1

Argonne National Laboratory2

Page 2: Intermediate-Scale Full State Quantum Circuit Simulation ...people.cs.uchicago.edu/~xinchuan/WU_APS_talk.pdf · Block [3] Compressed ... Project Number: 17-SC-20-SC, a collaborative

Why Quantum Circuit Simulation?Physically realizing a quantum information processor is difficult as quantum systems are extremely sensitive to environmental effects.

Simulation of quantum circuits is vital for the study of quantum computing.◦ Validate the quantum circuit and quantify the circuit fidelity on real quantum machines.◦ Assess correctness and performance of new quantum algorithms.

Simulation: calculate quantum state amplitudes.◦ Using classical computing systems to simulate the behavior of quantum computers.

Advantages of full state vector update simulation◦ General circuits◦ Good at quantum software development and debugging

2

Page 3: Intermediate-Scale Full State Quantum Circuit Simulation ...people.cs.uchicago.edu/~xinchuan/WU_APS_talk.pdf · Block [3] Compressed ... Project Number: 17-SC-20-SC, a collaborative

Challenges of Quantum Circuit SimulationFor n-qubit systems, the number of amplitudes is 2n.

◦ Each amplitude is a double-precision complex number: 16 Bytes◦ For n-qubit system simulation, the state vector takes 2n+4 Bytes.◦ 50-qubit systems: The memory requirement of the state vector is 254 Bytes (16PB). ◦ People believe it is impossible to classically simulate a 50-qubit quantum computer.

3

System Memory (PB) Max qubits TACC Stampede 0.192 43

Titan 0.71 45

Theta 0.8 45

Sunway TaihuLight 1.3 46

K computer 1.4 46

Summit 2.8 47

Page 4: Intermediate-Scale Full State Quantum Circuit Simulation ...people.cs.uchicago.edu/~xinchuan/WU_APS_talk.pdf · Block [3] Compressed ... Project Number: 17-SC-20-SC, a collaborative

Data Compression on State Vector

4

Memory

n-qubit State Vector

MemoryCompressed State VectorCompressed State VectorCompressed State VectorCompressed State Vector

Compressed State Vector

Reduce memory requirement

+1 qubit in simulation

+2 qubits in simulation

+m qubits in simulation(Depending on the compression ratio)

Page 5: Intermediate-Scale Full State Quantum Circuit Simulation ...people.cs.uchicago.edu/~xinchuan/WU_APS_talk.pdf · Block [3] Compressed ... Project Number: 17-SC-20-SC, a collaborative

Error-Bounded Lossy Compressor: ANL SZApplying lossy compression to the state vector.

SZ is an error-bounded lossy data compressor allowing user-controlled loss of accuracy during the compression with significantly reduced data size.

◦ SZ allows user to set the error bound, denoted δ.◦ The decompressed data Diʹ must be in the range [Di − δ, Di + δ], where Diʹ is referred as the

decompressed value and Di is the original data value.◦ SZ can compress 1-D dataset efficiently.

δ ↑: Simulation accuracy↓, compression ratio↑

5

Simulation Accuracy Compression Ratio

Page 6: Intermediate-Scale Full State Quantum Circuit Simulation ...people.cs.uchicago.edu/~xinchuan/WU_APS_talk.pdf · Block [3] Compressed ... Project Number: 17-SC-20-SC, a collaborative

State Vector Update SimulationIntel-QS

◦ Full state vector update simulator (with MPI)◦ |Ѱt+1⟩ = At |Ѱt⟩

◦ We do not need to construct the entire A.◦ For example, applying a single-qubit gate to the first qubit

◦ Writing the amplitude indices in binary format.◦ Applying U to every pair of amplitudes, whose indices have 0 and 1 in the first bit, while all other bits remain the same.

◦ In n-qubit systems, apply U to the k-th qubit: a*…*0k-th*…*, and a*…1k-th*…*◦ 2n-1 pairs à 2n-1 matrix multiplications

6Smelyanskiy, Mikhail, et. al. "qHiPSTER: the quantum high performance software testing environment." arXiv preprint arXiv:1601.07195 (2016).

q0q1

q0q1

U

|Ѱ⟩ = a10

a00

a11

a01u11u21

u12u22

a00a01

u11u21

u12u22

a10a11

|Ѱ’⟩ = a'10

a’00

a'11

a'01a’00a’01

a’10a’11

=

=

Page 7: Intermediate-Scale Full State Quantum Circuit Simulation ...people.cs.uchicago.edu/~xinchuan/WU_APS_talk.pdf · Block [3] Compressed ... Project Number: 17-SC-20-SC, a collaborative

Getting the Pair of Amplitudes (a*0k-th*, a*1k-th*)

7

0n-1

Memory

n-qubit State Vector

RANK 0

State Vector [0]

RANK 1

State Vector [1]

RANK r-1

State Vector [R-1]

Message Passing Interface(total R ranks)

MemoryCompressed

Block [0]

Compressed Block [1]

Compressed Block [2]

Compressed Block [3]

Compressed Block [n_b-1]

Data Compression(Block size = B)

Amplitude index

log2Bn - log2R

Both amplitudes are in the same block.

Both amplitudes are in the same rank, different blocks.

The pair of amplitudes are in the different ranks.

000..000000…001000…010000…011

111..100111…101111…110111…111

Amplitude index

RANK 2

State Vector [2]

Page 8: Intermediate-Scale Full State Quantum Circuit Simulation ...people.cs.uchicago.edu/~xinchuan/WU_APS_talk.pdf · Block [3] Compressed ... Project Number: 17-SC-20-SC, a collaborative

Two-Qubit Gate

8

0n-1

Amplitude index

log2Bn - log2R

For C-th bit is 0, left the whole block unmodified.

For C-th bit is 0, left the whole rank unmodified.

In a control-U gate, control qubit position: C-th qubitIf the C-th qubit is 1, apply U to k-th qubit; otherwise left unmodified.

For C-th bit is 0, left the amplitudes unmodified.

Page 9: Intermediate-Scale Full State Quantum Circuit Simulation ...people.cs.uchicago.edu/~xinchuan/WU_APS_talk.pdf · Block [3] Compressed ... Project Number: 17-SC-20-SC, a collaborative

Compression Ratio (QFT)Set a compression ratio threshold θ. Relax the error bound to meet the threshold.

QFT results:

9

0.9998 0.9996 0.9995

0.1457

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

4 8 16 32

Fide

lity

Compression Ratio

20x performance overhead.

Fidelity

Page 10: Intermediate-Scale Full State Quantum Circuit Simulation ...people.cs.uchicago.edu/~xinchuan/WU_APS_talk.pdf · Block [3] Compressed ... Project Number: 17-SC-20-SC, a collaborative

ConclusionWe propose a lossy data compression strategy that could be used for quantum circuit simulation.

Our approach compresses the state vector to reduce the memory requirement, so we can simulate a larger quantum system with the same memory capacity.

◦ Trade computation time for memory capacity.◦ Trade fidelity for compression ratio.

For 50-qubit systems, our preliminary results suggest that we are able to reduce the memory requirement from 16PB to 1PB.

10

Page 11: Intermediate-Scale Full State Quantum Circuit Simulation ...people.cs.uchicago.edu/~xinchuan/WU_APS_talk.pdf · Block [3] Compressed ... Project Number: 17-SC-20-SC, a collaborative

Thank You!Acknowledgment:

This research used resources of the Argonne Leadership Computing Facility, which is a DOE Office of Science User Facility supported under Contract DE-AC02-06CH11357.This research was supported by the Exascale Computing Project (ECP), Project Number: 17-SC-20-SC, a collaborative effort of two DOE organizations the Office of Science and the National Nuclear Security Administration, responsible for the planning and preparation of a capable exascaleecosystem, including software, applications, hardware, advanced system engineering and early testbed platforms, to support the nations exascale computing imperative. The material was supported by the U.S. Department of Energy, Office of Science, and supported by the National Science Foundation under Grant No. 1619253. This work is funded in part by EPiQC, an NSF Expedition in Computing, under grant CCF-1730449. This work is also funded in part by NSF PHY-1818914 and a research gift from Intel.

11

https://www.epiqc.cs.uchicago.edu/

Page 12: Intermediate-Scale Full State Quantum Circuit Simulation ...people.cs.uchicago.edu/~xinchuan/WU_APS_talk.pdf · Block [3] Compressed ... Project Number: 17-SC-20-SC, a collaborative

Quantum State Vector Update Simulationn-qubit system

|Ѱ⟩ = a0|000000…000000⟩ + a1|000000…000001⟩ + … + a2n-1|111111…111111⟩

Simulation: |Ѱt+1⟩ = At |Ѱt⟩ , for t = 0, …, d at each layer◦ A is a unitary matrix◦ d is the depth of the circuit

12

-0.1

-0.05

0

0.05

0.1

0.15

0.2

0.25

0.3

110

721

331

942

553

163

774

384

995

510

6111

6712

7313

7914

8515

9116

9718

0319

0920

1521

2122

2723

3324

3925

4526

5127

5728

6329

6930

7531

8132

8733

9334

9936

0537

1138

1739

2340

29

Ampl

itude

Amplitude index