Cbit Gates

Lecture II

We would now like to construct transformations among Cbits.

Using Mathematica to construct and manipulate cbits

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

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

Question:  for the four bit computer in assignment I evaluate all possible configurations and represent those
states as a column matrix. Can you see a pattern here?

We can represent the above physical process in various forms.

| 1 1 ⟩  ⟶ |1 0 ⟩

(Subscript[| 3 ⟩, 2])  ⟶(Subscript[ | 2 ⟩, 2])


(({{0}, {1}})) ⊗ (({{0}, {1}})) ⟶ (({{0}, {1}})) ⊗(({{1}, {0}}))

column[Cbit1_,Cbit2_]:=Flatten[KroneckerProduct[Cbit1,Cbit2]]

on={0,1};
off={1,0};
(* Input Column *)
MatrixForm[column[on,on]]
(* Output Column *)
MatrixForm[column[on,off]]

So the above can also be written as

(({{0}, {0
0
1}}))  ⟶ (({{0}, {0
1
0}}))

In the above form we have a column matrix  a  being transformed into another column matrix b. We know from matrix algebra this can be accomplished by multiplying matrix a, from the left, by a square nxn matrix  where n is the dimension 
of the column matrix. In this case.

X={{0,0,0,0},{0,0,0,0},{0,0,0,1},{0,0,1,0}}
MatrixForm[X]

input=column[on,on]
MatrixForm[input]

X.input
MatrixForm[%]

Therefore we can represent the above transformation by the square matrix

(({{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}}))

Question: Is this matrix unique?  can you guess of another one that does the job?
What is the result of applying this matrix on all possible 2-Cbits.

zero=column[off,off]
one=column[off,on]
two=column[on,off]
three=column[on,on]

X.zero
X.one
X.two
X.three

This is weird!  Our operator X does the right thing for kets (Subscript[|2⟩, 2]), (Subscript[|3⟩ , 2])but it performs an undefined operation on kets
(Subscript[|0⟩, 2]), (Subscript[|1⟩ , 2]), so we have to be a little careful when defining operators.

Also note that its inverse does not exist.

Inverse[X]

Operators that have an inverse X are also reversible, i.e. every final state arises from a unique initial state.

(* Example *)

X={{1,0,0,0},{0,1,0,0},{0,0,0,1},{0,0,1,0}};
MatrixForm[X]
MatrixForm[Inverse[X]]

X.zero
X.one
X.two
X.three

X.X.zero
X.X.one
X.X.two
X.X.three

For cbits many gates are irreversible (as above) some important examples of the latter are:
The ERASE gate it takes any cbit and transforms it into the state |0⟩.

ERASE |1⟩=|0⟩
ERASE |0⟩=|0⟩

Note: ERASE is 1-cbit operator, it only acts on a single cbit. How is that different from X above?

ERASE={{1,1},{0,0}};
MatrixForm[ERASE]

MatrixForm[on]
MatrixForm[ERASE.on]

MatrixForm[off]
MatrixForm[ERASE.off]

So ERASE does map every possible state into another state (it is a valid gate) but it is not reversible.
Many gates for classical circuits are indeed irreversible.

The above description can also be expressed graphically in diagrams that look like



Here a 3-cbit register is the input but there is only a 1-cbit output

Question: Is this a reversible operation?
Must all reversible operations have as many leads out as there are input ?
If the latter is true, does that necessarily mean that we have a reversible gate?

Part II  Constructing reversible operators for n-cbits from individual cbits.

In the previous discussion we introduced the Kronecker or direct product in order to construct states (Subscript[|x⟩, n])  from direct
products of cbits. So we should be able to construct n-cbit operators from something like Kronecker products of cbit
operators

Consider the 2-cbit state |x y⟩

Let  A be an operator on the first cbit  i.e. x
Let  B be an operator on the second cbit i.e. y

Question: What is the dimensionality of of A, B ?

(A  ⊗ B) | x y⟩ = A|x⟩ ⊗ B|y⟩

General definition of Kronecker product of matrices

Hyperlink["http://mathworld.wolfram.com/KroneckerProduct.html"]

A={{1,0},{0,1}};
MatrixForm[A]
B={{0,1},{1,0}};
MatrixForm[B]

AcrossB=KroneckerProduct[A,B];
MatrixForm[AcrossB]

(* according to the above definition *)
column[A.off,B.off];
MatrixForm[%]

(*is this the same as the left hand side of (A ⊗ B)|x y⟩=A|x⟩⊗B|y⟩ ? *)

AcrossB.column[off,off];
MatrixForm[%]

Question: Are all possible 2-cbit reversible gates Kronecker products of a 1-cbit gates?

Show that (A  ⊗ B) | x y⟩ = A|x⟩ ⊗ B|y⟩   implies   (A  ⊗ B)  (C  ⊗ D)  = (A C)  ⊗ (B D)

where A C representation the ordinary matrix product of A with C.

For a general n-cbit states we can have direct products such as

A ⊗ B ⊗ C ....⊗

a special, common  case 

1 ⊗1⊗1⊗A⊗1⊗B⊗1⊗1

It is cumbersome to write out this 8-cbit operator so a shorthand notation (Subscript[A, 5])⊗(Subscript[B, 3]) is used.

Question what is the dimensionality of the above operator?