Categorical models of quantum computation Peter Selinger Dalhousie University Halifax, Canada 1
Part I: Quantum Computation 2
The QRAM abstract machine [Knill96] Classical device: control Quantum device: master slave (general purpose) results • General-purpose classical computer controls a special quantum hardware device • Quantum device provides a bank of individually addressable qubits. • Left-to-right: instructions. • Right-to-left: results. 3
Linear Algebra Review • Scalars λ ∈ C , column vectors u ∈ C n , matrices A ∈ C n × m . • Adjoint A ∗ = ( a ji ) ij , trace tr A = � i a ii , norm � A � 2 = � ij | a ij | 2 . • Unitary matrix S ∈ C n × n if S ∗ S = I . Change of basis: B = SAS ∗ ⇒ tr B = tr A , � B � = � A � . • Hermitian matrix A ∈ C n × n : if A = A ∗ . Hermitian positive: u ∗ Au ≥ 0 for all u ∈ C n . Diagonalization: A = SDS ∗ , S unitary, D real diagonal. � � � � 0 1 0 B • Tensor product A ⊗ B , e.g. ⊗ B = . − 1 0 − B 0 4
Quantum computation: States Consider the complex vector space C 2 , with basis {| 0 � , | 1 � } . • state of one qubit: α | 0 � + β | 1 � ( superposition of | 0 � and | 1 � ). • state of two qubits: α | 00 � + β | 01 � + γ | 10 � + δ | 11 � . ( a | 0 � + b | 1 � ) ( c | 0 � + d | 1 � ) = • independent : ⊗ ac | 00 � + ad | 01 � + bc | 10 � + bd | 11 � . • otherwise entangled . 5
Lexicographic convention Identify the basis states | 00 � , | 01 � , | 10 � , | 11 � with the standard basis vectors 1 0 0 0 0 1 0 0 , , , , 0 0 1 0 0 0 0 1 in the lexicographic order. Note: we use column vectors for states. α β = α | 00 � + β | 01 � + γ | 10 � + δ | 11 � . γ δ 6
Quantum computation: Operations • unitary transformation • measurement 7
Unitary operations Given an n -qubit state v ∈ C 2 ⊗ . . . ⊗ C 2 . To apply the unitary operation U : C 2 → C 2 to qubit i means v ′ = ( I ⊗ . . . ⊗ I ) v ⊗ U ⊗ I ⊗ . . . ⊗ I � �� � � �� � i − 1 n − i To apply the unitary operation W : C 4 → C 4 to qubits i, i + 1 means v ′ = ( I ⊗ . . . ⊗ I ) v ⊗ W ⊗ I ⊗ . . . ⊗ I � �� � � �� � i − 1 n − i − 1 8
Some standard unitary gates Unary: Binary: � � � � 0 1 I 0 N = , N c = , 1 0 0 N � � � � 1 1 I 0 1 H = H c = , , √ 1 − 1 0 H 2 � � � � 1 0 I 0 V = , V c = , 0 i 0 V 1 0 0 0 � � � � 1 0 I 0 0 0 1 0 √ W = W c = X = , , . 0 W 0 1 0 0 0 i 0 0 0 1 9
Measurement α | 0 � + β | 1 � 0 1 | α | 2 | β | 2 α | 0 � β | 1 � 10
Two Measurements α | 00 � + β | 01 � + γ | 10 � + δ | 11 � 0 1 | α | 2 + | β | 2 | γ | 2 + | δ | 2 α | 00 � + β | 01 � γ | 10 � + δ | 11 � 0 1 0 1 | α | 2 | β | 2 | γ | 2 | δ | 2 | α | 2 + | β | 2 | α | 2 + | β | 2 | γ | 2 + | δ | 2 | γ | 2 + | δ | 2 α | 00 � β | 01 � γ | 10 � δ | 11 � Note: Normalization convention. 11
Pure vs. mixed states A mixed state is a (classical) probability distribution on quantum states. Ad hoc notation: � � � � � � � � α ′ 1 + 1 α β ′ β 2 2 Note: A mixed state is a description of our knowledge of a state. An actual closed quantum system is always in a (possibly unknown) pure state. 12
Density matrices (von Neumann) � � α ∈ C 2 by the matrix Represent the pure state v = β � α α ¯ � α ¯ β vv ∗ = ∈ C 2 × 2 . α β ¯ β ¯ β Represent the mixed state λ 1 { v 1 } + . . . + λ n { v n } by λ 1 v 1 v ∗ 1 + . . . + λ n v n v ∗ n . This representation is not one-to-one, e.g. � � � � � � � � � � � � � � 1 + 1 = 1 + 1 1 0 1 0 0 0 .5 0 = 0 1 0 0 0 1 0 .5 2 2 2 2 � 1 � 1 � � � � � � � � � � � � 1 + 1 = 1 + 1 − .5 1 1 .5 .5 .5 .5 0 √ √ = 1 − 1 .5 .5 − .5 .5 0 .5 2 2 2 2 2 2 But these two mixed states are indistinguishable. 13
Quantum operations on density matrices Unitary: vv ∗ � → Uvv ∗ U ∗ A � → UAU ∗ v � → Uv Measurement: α α ¯ � � � � � � α ¯ α β a b α β ¯ β ¯ β β c d 0 1 0 1 0 1 | α | 2 | β | 2 β ¯ β a α ¯ α d � � � � � � � � � � � � α 0 α ¯ α 0 0 0 a 0 0 0 0 β ¯ 0 β 0 0 β 0 0 0 d 14
A complete partial order of density matrices Let D n = { A ∈ C n × n | A is positive hermitian and tr A ≤ 1 } . Definition. We write A ⊑ B if B − A is positive. Theorem. The density matrices form a complete partial order under ⊑ . • A ⊑ A • A ⊑ B and B ⊑ A ⇒ A = B • A ⊑ B and B ⊑ C ⇒ A ⊑ C • every increasing sequence A 1 ⊑ A 2 ⊑ . . . has a least upper bound 15
Part II: The Flow Chart Language 16
Earlier Quantum Programming Languages • Knill (1996): conventions for writing pseudo-code • ¨ Omer (1998): scratch space management, user defined operators • Sanders and Zuliani (2000): specification language, stepwise refinement • Bettelli, Calarco, and Serafini (2001): based on C ++ Imperative languages, run-time checks and errors, no formal semantics. 17
First: the classical case. A simple classical flow chart input b, c : bit b, c : bit branch b 0 1 b, c : bit b := c b, c : bit b, c : bit c := 0 b, c : bit ◦ b, c : bit output b, c : bit 18
Classical flow chart, with boolean variables expanded input b, c : bit 00 01 10 11 ◦ ◦ ◦ ◦ ( ∗ branch b ∗ ) ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ( ∗ b := c ∗ ) ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ( ∗ c := 0 ∗ ) ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ( ∗ merge ∗ ) ◦ ◦ ◦ ◦ output b, c : bit 00 01 10 11 19
Classical flow chart, with boolean variables expanded input b, c : bit 00 01 10 11 A B C D ◦ ◦ ◦ ◦ ( ∗ branch b ∗ ) ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 0 0 C D ◦ ◦ ◦ ◦ ( ∗ b := c ∗ ) ◦ ◦ ◦ ◦ A B 0 0 C 0 0 D ◦ ◦ ◦ ◦ ( ∗ c := 0 ∗ ) ◦ ◦ ◦ ◦ C 0 D 0 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ( ∗ merge ∗ ) ◦ ◦ ◦ ◦ A + C B D 0 output b, c : bit 00 01 10 11 19-a
A simple classical flow chart input b, c : bit b, c : bit branch b 0 1 b, c : bit b := c b, c : bit b, c : bit c := 0 b, c : bit ◦ b, c : bit output b, c : bit 20
A simple classical flow chart input b, c : bit b, c : bit = ( A, B, C, D ) branch b 0 1 b, c : bit = ( 0, 0, C, D ) b := c b, c : bit = ( A, B, 0, 0 ) b, c : bit = ( C, 0, 0, D ) c := 0 b, c : bit = ( C, 0, D, 0 ) ◦ b, c : bit = ( A + C, B, D, 0 ) output b, c : bit 20-a
Summary of classical flow chart components Allocate bit: Discard bit: b : bit , Γ = ( A, B ) Γ = A new bit b := 0 discard b b : bit , Γ = ( A, 0 ) Γ = A + B Assignment: Branching: b : bit , Γ = ( A, B ) b : bit , Γ = ( A, B ) b : bit , Γ = ( A, B ) b := 0 b := 1 branch b 0 1 b : bit , Γ = ( 0, B ) b : bit , Γ = ( A, 0 ) b : bit , Γ = ( A + B, 0 ) b : bit , Γ = ( 0, A + B ) Merge: Initial: Permutation: b 1 , . . . , b n : bit = A 0 , . . . , A 2 n − 1 Γ = A Γ = B ◦ ◦ permute φ Γ = A + B Γ = 0 b φ ( 1 ) , . . . , b φ ( n ) : bit = A 2 φ ( 0 ) , . . . , A 2 φ ( 2 n − 1 ) 21
The quantum case: A simple quantum flow chart input p, q : qbit p, q : qbit measure p 0 1 p, q : qbit p, q : qbit q ∗ = N p ∗ = N p, q : qbit p, q : qbit ◦ p, q : qbit output p, q : qbit 22
A simple quantum flow chart input p, q : qbit � � A B p, q : qbit = C D measure p � � 0 1 � � A 0 0 0 p, q : qbit = p, q : qbit = 0 0 0 D q ∗ = N p ∗ = N � � D 0 NAN ∗ 0 � � p, q : qbit = p, q : qbit = 0 0 0 0 ◦ NAN ∗ + D 0 � � p, q : qbit = 0 0 output p, q : qbit 22-a
Summary of quantum flow chart components Allocate qbit: Discard qbit: � A � B q : qbit , Γ = Γ = A C D discard q new qbit q := 0 � A � 0 q : qbit , Γ = Γ = A + D 0 0 Unitary transformation: Measurement: � A � B q : qbit , Γ = q : qbit , Γ = A ¯ C D measure q q ∗ = S ¯ � A � 0 � � 0 0 1 q : qbit , Γ = 0 q : qbit , Γ = q : qbit , Γ = ( S ⊗ I ) A ( S ⊗ I ) ∗ 0 0 0 D ¯ Merge: Initial: Permutation: q 1 , . . . , q n : qbit = ( a ij ) ij Γ = A Γ = B ◦ permute φ ◦ Γ = 0 q φ ( 1 ) , . . . , q φ ( n ) : qbit = ( a 2 φ ( i ) ,2 φ ( j ) ) ij Γ = A + B 23
Combining classical data with quantum data Consider typing contexts of the form b 1 : bit , . . . , b n : bit , q 1 : qbit , . . . , q m : qbit . Definition. A state for the above typing context is a tuple ( A 0 , . . . , A 2 n − 1 ) of 2 n density matrices of dimension 2 m × 2 m . 24
Recommend
More recommend