Slide 1

Slide 1 text

Introduction to Imaginary World NEW DEBUG!! ~ 転職してプログラマーになったら 一切エラーがでないんだが ~ // たふみ, DE LIKER // 2020·05·17

Slide 2

Slide 2 text

$ whoami たふみ ( @CreatorQsF ) Designer + Developer

Slide 3

Slide 3 text

$ whoami たふみ ( @CreatorQsF ) Designer + Developer

Slide 4

Slide 4 text

Go

Slide 5

Slide 5 text

Why Go? ● Nice Standard Pkgs? ● Clear Dependencies? ● Less Syntax Sugar? ● Single Binary? ● Cross Compile? ● Simple Syntax? ● Fast Build? ● gofmt?

Slide 6

Slide 6 text

No ( Actually, Definitely “Yes” )

Slide 7

Slide 7 text

Retrieved from https://golang.org/ref/spec#Types

Slide 8

Slide 8 text

Retrieved from https://golang.org/ref/spec#Types

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Complex Number v

Slide 11

Slide 11 text

Polar Coordinates System Complex Number

Slide 12

Slide 12 text

Polar Coordinates + Complex

Slide 13

Slide 13 text

Polar Coordinates + Complex

Slide 14

Slide 14 text

Fortran real re, im complex z z = (1.0,2.0) re = real(z) ! Re im = aimag(z) ! Im end

Slide 15

Slide 15 text

Python z = 1 + 2i

Slide 16

Slide 16 text

C99 // GNU Extention #include ... double _Complex x = 1.0 + 2.0i; // C99 Spec #include ... float _Complex x = 1.0 + 2.0 * _Complex_I; Ref https://cpplover.blogspot.com/2013/11/c99.html

Slide 17

Slide 17 text

C99 // GNU Extention #include ... double _Complex x = 1.0 + 2.0i; // C99 Spec #include ... float _Complex x = 1.0 + 2.0 * _Complex_I; Ref https://cpplover.blogspot.com/2013/11/c99.html

Slide 18

Slide 18 text

Perl Ruby OCaml Haskell etc... Need to include std lib (complex is not builtin type)

Slide 19

Slide 19 text

Go package main import ( "fmt" ) func main() { z := 1 + 2i fmt.Printf("%T", z) } // output: complex128

Slide 20

Slide 20 text

Retrieved from https://github.com/golang/go/issues/19921

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

You, the people have the power - the power to create machines. The power to create happiness! You, the people, have the power to make this life free and beautiful, to make this life a wonderful adventure. Retrieved from “The Great Dictator” (1940)

Slide 23

Slide 23 text

You, the people have the power - the power to create machines. The power to create happiness! You, the people, have the power to make this life free and beautiful, to make this life a wonderful adventure. Retrieved from “The Great Dictator” (1940)

Slide 24

Slide 24 text

Let’s Make Your Life Beautiful

Slide 25

Slide 25 text

Beautiful Life ≈ Creative, Imaginary Life

Slide 26

Slide 26 text

Beautiful Life ≈ Creative, Imaginary Life

Slide 27

Slide 27 text

Usage of Complex Number ● Quaternion ● Quantum Information Science → Let’s aGo !

Slide 28

Slide 28 text

Quaternion 4元数

Slide 29

Slide 29 text

Quaternion

Slide 30

Slide 30 text

Quaternion This needs 3 independent complex space, so it will be lil hard to express in Go…

Slide 31

Slide 31 text

Quaternion is used for 3D Graphics rotation, like Games. Another methods: - Euler angles (オイラー角) - Rotation Matrix (回転行列) FYI

Slide 32

Slide 32 text

Euler angles (オイラー角) Euler angles needs only 3 params. ...BUT, - the computation is heavy - The problem of Gimbal Lock FYI

Slide 33

Slide 33 text

FYI Rotation Matrix (回転行列) Rotation Matrix needs 9 params ← soooo many not good for memory resources

Slide 34

Slide 34 text

Quaternion (4元数) Quaternion needs 4 params. - No Gimbal Lock - Balanced for memory & computating resources FYI

Slide 35

Slide 35 text

Quantum Information 量子情報学

Slide 36

Slide 36 text

量子情報学入門 石坂 智 (著) 小川 朋宏 (著) 河内 亮周 (著) 木村 元 (著) 林 正人 (著) 共立出版 2012 References Retrieved from https://www.amazon.co.jp/%E9%87%8F%E5%AD%90%E6%83%85%E5%A0%B1%E7%A7%91%E5%AD%A6%E5% 85%A5%E9%96%80-%E7%9F%B3%E5%9D%82-%E6%99%BA/dp/4320122992

Slide 37

Slide 37 text

Quantum Physics Raymer, G. M. Oxford Univ. Press 2017 References Retrieved from https://www.amazon.co.jp/Quantum-Physics-What-Everyone-Needs/dp/0190250712

Slide 38

Slide 38 text

In classic Computer… A Long Time Ago, in the Galaxy Far Away...

Slide 39

Slide 39 text

0 1 &

Slide 40

Slide 40 text

In Quantum World,

Slide 41

Slide 41 text

0 1

Slide 42

Slide 42 text

Quantum Superposition 重ね合わせの状態

Slide 43

Slide 43 text

If all the inputs are superposition, then…?

Slide 44

Slide 44 text

- Dirac Notation - Bra-ket notation

Slide 45

Slide 45 text

Bra-ket Notation (Equation Editor++ does not support braket notation, so insteadly used \langle and \rangle.)

Slide 46

Slide 46 text

Unit Vector This is the corresponding 0, 1 to classic computing in qubit

Slide 47

Slide 47 text

Intermissions x can be anything are ugly

Slide 48

Slide 48 text

Bloch Sphere & Bloch Vector Retrieved from https://en.wikipedia.org/wiki/Bloch_ sphere

Slide 49

Slide 49 text

Unitary Evolution & Unitary Matrix * : Adjoint Matrix (随伴行列) This shows that |ψ> changes with time to |ψ>’

Slide 50

Slide 50 text

Significant Unitary Matrix ● Identity Matrix ● Pauli Matricies

Slide 51

Slide 51 text

Significant Unitary Matrix (cont.) ● Hadamard Matrix ● Also called “Hadamard Transform” when used as an operator ● Particularly make the basis superposition which the probability of |0> and |1> is the same

Slide 52

Slide 52 text

Hadamard Transform

Slide 53

Slide 53 text

Hadamard Transform

Slide 54

Slide 54 text

Deutsch- Jozsa Algorithm ● Multiply n+1’th bit by Pauli’s \sigma_x ● Multiply all the bits by Hadamard Operator ● Multiply all the bits by U_f ● Multiply first n bits by Hadamard Operator ● If the observed classical first n bit array is 0...0, then it is constant function, otherwise balanced function.

Slide 55

Slide 55 text

Deutsch- Jozsa Algorithm (cont.) ● f is Oracle, it is like black box ● So in classical computing, 2/n + 1 inputs must be evaluated. → must be asked 2^(n-1) + 1 times ● Deutsch-Jozsa needs 1 time ask

Slide 56

Slide 56 text

Deutsch- Jozsa Algorithm (cont.)

Slide 57

Slide 57 text

Retrieved from https://github.com/itsubaki/q

Slide 58

Slide 58 text

Deutsch- Jozsa Impl package main import ( "fmt" qsim "github.com/itsubaki/q" )

Slide 59

Slide 59 text

Deutsch- Jozsa Impl // deutschjozsa return is given f is constant, returns true. Otherwise retuens false. func deutschjozsa(size int, f func(_ *qsim.Q, _ ...qsim.Qubit)) string { q := qsim.New() is := make([]qsim.Qubit, size) for i := range is { is[i] = q.Zero() } o := q.One() // equivalent to `o := q.Zero(); q.X(o);` q.H(is...) q.H(o) // Apply func as Oracle Uf f(q, is...) q.H(is...) q.Measure(is...) return q.Binary() }

Slide 60

Slide 60 text

Deutsch- Jozsa Impl func constant(_ *qsim.Q, _ ...qsim.Qubit) { }

Slide 61

Slide 61 text

func balanced(space *qsim.Q, qs ...qsim.Qubit) { cnt := 0 for _, q := range qs { if cnt%2 == 0 { space.Z(q) } cnt++ } } Deutsch- Jozsa Impl

Slide 62

Slide 62 text

Deutsch- Jozsa Impl func main() { fmt.Println("balanced: ", deutschjozsa(8, balanced)) fmt.Println("constant: ", deutschjozsa(8, constant)) }

Slide 63

Slide 63 text

Deutsch- Jozsa Impl deutsch-jozsa $ make go run main.go balanced: 101010101 constant: 000000000

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

Introduction to Imaginary World NEW DEBUG!! ~ 転職してプログラマーになったら 一切エラーがでないんだが ~ // たふみ, DE LIKER // 2020·05·17 Follow me on Twitter → @CreatorQsF