Binary system and Cbits

Lecture 1 1/21/2016

Binary number system

The modern binary number system is usually attributed to Leibniz (1646-1716) but its antecdent was known as far back as the origin of the  I-Ching.  It is a base 2 system whose “alphabet” is denoted by two symbols 0, 1.  Numbers are represented by
proper placement.

({{Decimal, Binary, Expansion}, {0, 0, 0}, {1, 1, (2^0)}, {2, 10,  1×(2^1)+ 0 × (2^0)}, {3, 11, 1 × (2^1)+ 1×(2^0)}, {4, 100, 1×(2^2)+0 × (2^1)+ 0×(2^0)}, {5, 101, 1×(2^2)+0 × (2^1)+ 1×(2^0)}, {6, 110, 1×(2^2)+1 × (2^1)+ 0×(2^0)}, {7, 111, 1×(2^2)+1 × (2^1)+ 1×(2^0)}, {8, 1000, 1×(2^3)+0 × (2^2)+ 0×(2^1)+ 0×(2^0)}, {9, 1001, 1×(2^3)+0 × (2^2)+ 0×(2^1)+ 0×(2^0)}})

Find the binary representation of the following integers

16
17
101

BaseForm[101,2]
FromDigits[RealDigits[1100101],2]

Fractions work in a similar, but more complicated,  manner

({{Decimal , Binary , Expansion}, {1/1,  0.1111..., 1/2 +1/4+1/8+1/16 + ...}, {1/2, 0.1000      , 1/2+0 ×1/4+0×1/8+0/16+...
}, {0.625, 0.101  , 1/2+0 ×1/4+1 × 1/8}})

BaseForm[13.625,2]
N[FromDigits[RealDigits[1101.101],2]]

Cbits

({{|000>, |001>, |010>, |011>}, {|0>, |1>, |2>, |3>}, {|0(Subscript[>, 3]), |1(Subscript[>, 3]), |2(Subscript[>, 3]), |3(Subscript[>, 3])}})

The  | a ⟩ notation is due to Paul Dirac, and is called the Bra-ket notation.
A Cbit is simply  a single ket that has two possible states  | 0 ⟩,    | 1 ⟩  and correspond to  0,1  as ordinary bits (binary alphabet)
This looks more cumbersum than the notation discussed above, but as we show below it has its advantages.

The ket  form (Subscript[| x ⟩, n]) = |a b ... c ⟩ is defined as follows 

(Subscript[|x ⟩, n]) = | (Subscript[y, n-1 ])⟩  ⊗ | (Subscript[y, n-2 ])⟩ ⊗ . . . | (Subscript[y, 1 ])⟩ ⊗ | (Subscript[y, 0 ])⟩ 

where the quantity x and the coefficients are related via

x  = (Underoverscript[ ∑  , (j=0), (n-1)])(Subscript[y, j ])(2^j)

Yet another way to represent Cbits

| 0 ⟩ =(({{1}, {0}}))

| 1 ⟩ =(({{0}, {1}}))

That is by column matrics, (also called the computational basis) but how do we represent something like  | 0 1 1 ⟩  ?   Answer: using the  direct, or Kronecker product for basis vectors.

| 0 1 ⟩  = (({{1}, {0}}))⊗(({{0}, {1}}))

(({{a}, {b}}))⊗(({{c}, {d}}))=(({{a c}, {a d}, {b c}, {b d}}))   and therefore


| 0 1 ⟩ = (({{1}, {0}}))⊗(({{0}, {1}}))= (({{0}, {1}, {0}, {0}}))

so how can   | 0 1 1 ⟩  be represented in column matrix form ?

First

 (({{1}, {0}}))⊗(({{0}, {1}}))= (({{0}, {1}, {0}, {0}}))    and so  we need to evaluate (({{0}, {1}, {0}, {0}}))⊗(({{0}, {1}}))=(({{0}, {0}, {0}, {0}, {0}, {1}, {0}, {0}}))

Using Mathematica to construct and manipulate cbits

zero={1,0}
MatrixForm[zero]
one={0,1}

product=KroneckerProduct[zero,one]
MatrixForm[product]

Flatten[product]
MatrixForm[%]

product=Flatten[KroneckerProduct[zero,one]]
MatrixForm[product]

(* now we can do more complicated things *)

Assignment 1: Due 1/28.

The above pictures represent three possible configurations (internal states) of a 4 bit (cbit) computer.  

(1)  If the bulb on represents the state  | 1 ⟩ and bulb off represent the state | 0 ⟩  which numbers in decimal format is the
computer storing. In principle how many numbers can this computer store?

(2)  Represent each configuration in the Dirac - bracket notation.

(3)  Represent each internal computer configuration as a single column matrix.  Give your answer as a column matrix and show
how the Mathematica Kronecker product command gives the correct  answer.

Repeat 1-3 by changing the roles of bulb on and bulb  off  i.e. bulb on represents the state  | 0 ⟩.

(4) We don’t  always need lightbulbs, they waste a lot of electricity and take up space. Think about building something that has
the same capabilities as the lightbulbs but are a lot smaller and economical.  Discuss what physical state, in your device,  manifest as  | 0 ⟩  and  | 1 ⟩. 

(5) In the above problems we translated a physical description into a mathematical representation. We can also reverse the analysis, so if we claim
that the internal state of a computer (not neccesarily the 4 bit computer above)  is given by 

(({{0}, {0}, {0}, {1}})) ,  decompose this column matrix as direct product of two cbits.  Draw a picture  (with lightbulbs) of this physical state.