Programming Quantum Computers
Programming Quantum Computers
Computers
○ https://docs.microsoft.com/en-us/quantum
○ https://quantumexperience.ng.bluemix.net/qx/user-guide
○ http://pyquil.readthedocs.io/en/latest/
○ https://www.quantiki.org
2
Why learn quantum programming?
3
Major player in quantum computing
https://docs.microsoft.com/en-us/quantum
https://quantumexperience.ng.bluemix.net/qx/experience
https://www.dwavesys.com/
https://www.rigetti.com/forest
4
Few prerequisites in maths
5
Vectors
6
Matrices and tensors
7
Tensor product
8
Tensor product examples
9
A convention about notation
10
Eigenvalues and Eigenvectors
12
Wave-particle-quantum
13
Quantum superposition
14
Classical bits
15
Qubits and their basis states
● A qubit or quantum bit or qbit is the fundamental object
of information on a quantum computer
● One qubit can represent following values:
○ One of the two basis states (Something corresponding to one
classical bit i.e. 1 or 0)
○ A quantum superposition of the two basis states
● The two states in which a qubit may be measured are
known as basis states (or basis vectors)
Dirac or
“Bra-Ket”
notation
“Ket 0” “Ket 1”
16
Qubit system
17
Representation of qubit vectors
Where, 0 ≤ θ ≤ π
0 ≤ Φ ≤ 2π
18
Examples of valid qubit superposition
Basis states
● Any quantum state vector can be written as a sum of
these basis vectors
19
Operations on qubit states
20
Quantum gates
21
Multi-qubits states
22
Entangled states
23
Entanglement implications
○ https://en.wikipedia.org/wiki/Bell_state
○ https://en.wikipedia.org/wiki/EPR_paradox
24
Simple description of entanglement
25
Example of entangled state
27
Quantum logic gates
28
Grover’s algorithm
30
Providing input list to the quantum computer
31
Amplitude amplification
32
STEP-1 :: Initialize system state
33
STEP 2 :: Grover iteration step-a
● Apply the oracle reflection Uf to the state |ψt⟩ giving
|ψt′⟩ = Uf|ψt⟩
● Corresponds to a reflection of the state |ψt⟩ about −|w⟩
○ It means that amplitude in front of |w⟩ becomes negative,
which implies that average amplitude has been lowered
34
STEP 2 :: Grover iteration step-b
35
STEP 2 :: Grover iteration step-b
36
STEP 2 :: Grover iteration step-b
37