I. Introduction
A. Notation
Bit Extraction Notation
represents the qubit of the binary basis
bit: 3 2 1 0
1 1 0 1
Negated Bit Notation
If represents the binary value of qubit in statevector , then ! represents flipping the value such that ! , and vice versa
Flipped Index Notation
If represents the statevector with unchanged, then represents the same statevector with the bit flipped
Multiple-bit Flip Notation
Similar to flipped index notation, except represents flipping both bit values in the binary string
Statevector Notation
For a qubit state
Computational bases are represented using binary decimal notation. For a qubit state
, , ,
And it is stored as
This is the statevector, where each index corresponds to the basis state
Prefix & Suffix Bits
Consider a node to be "one computer/machine participating in the simulation. Distributed simulation defines as the number of nodes being used, which assumes
(# of nodes available is a power of )
Every amplitude index has bits total:
Suppose . A statevector then would look like
q6 q5 q4 q3 q2 q1 q0
Now suppose . That is, we have nodes to work with. Since , that means we need bits to identify the node, i.e. the prefix bits. These prefix bits are defined as the rank bits
r1 r0 q4 q3 q2 q1 q0
The remaining suffix bits are local index bits, defined as . The key difference is
Suffix/local bits can be manipulated entirely within one node
Prefix/rank bits requires communication with other nodes, usually reassigning the statevector to a new node
global index (prefix bits)(suffix bits)
Moreover, global amplitude index can be decomposed into a combination of the node rank bit-shifted to the left by and the local-index
i = (r << lambda) + j
| |
|---|
| value of bit in index |
| |
| index after flipping bit |
| index after flipping bits , |
| amplitude stored at index |
| |
| |
| |
| number of suffix/local bits |
| |
| |
II. Local Statevector Algorithms
A. Local Costs
"Before we can discuss the challenges of distributed simulation, we must first understand the simpler problem of local (i.e. non-distributed), shared memory simulation." (Section II, first paragraph)
Recall that the simulation stores a full-state vector as an array
This notation gives a complete description of a quantum state, but the memory costs grow exponentially as increases
states bytes
states states bytes
Full statevector simulators are useful for researchers because resource utilization and runtime costs are roughly the same across circuits of equal size, irregardless of state properties, making resource prediction trivial
But there are two main drawbacks of full state simulation, which is that it requires simultaneously
Storing complex doubles
Simulating qubit operators, which required floating point operations
Thus, the authors use four local performance metrics to measure these costs
Basic Operations bops
Bitwise operations, integer arithmetic, logical checks, indexing, etc.
i ^ (1ULL << targ)
(i >> targ) & 1
if (ctrlBit == 1)
Floating Point Operations flops
Arithmetic operations on real or complex values
m00*beta + m01*gamma;
m10*beta + m11*gamma;
NOTE: The paper distinguishes bops from flops because complex arithmetic is much for expensive than logical or bit manipulation operations
Memory memory
Memory overhead, i.e. the size of temporary data structures created during an algorithm
Writes writes
The number of writes to heap/main memory, especially writes to statevectors
Moving amplitudes to and from memory is more often the bottleneck as opposed to performing arithmetic operations
Thus if an algorithm writes to fewer amplitudes, it may be much faster than other algorithms even if the math looks the same
Cost tags are summarized as:
[a bops][b flops][c memory][d writes]
NOTE: These metrics of course do not capture all local simulation considerations. Presented algorithms are optimized to avoid branching, enable auto-vectorization, cache efficiently, and avoid false sharing when possible in multithreaded settings. (Section pg. )
B. One Target Gate
Let denote a single qubit gate operating on qubit , described by a complex matrix
gets applied to the target qubit as follows
! here means logical bit flip on , where I will also be denoting it as . Putting it together:
This final equations reveals that applying a one target gate operator to a full-statevector linearly combines pairs of amplitudes. Thus, when applying the operator , the amplitudes of are simultaneously modified to become
Since the pairs of amplitudes are , and since , paired amplitudes are always a distance apart