Quantum Circuit : Matrix Representation 
									
									
										
											| We list matrix representations of main elements of quantum circuit.One qubit basis states in vector representation are | 
											
												
											 | 
											
												
											 | 
											    
											 | 
										 
									 
									
										
											| One qubit identy I, .not. operator X, relative phase operation Z are  | 
										 
									 
									
									 
									These three matrices are symmetric with respect to the exchange of raw and column, and reduce to the identity when operated twice.  The condition is a result of unitarity of quantum operations which is shared by all operations considered here.  For the conaiseurs, the unitarity itself is a bit stringent:  product of a matrix and its Hermitioan conjugate has to be one.   
										 
										The two qubit basis states are 
									
										
											
												
													
														
															| 
																
															 | 
															
																 
																	
																	[1] 
															 | 
														 
														
															| 
																 
																	
																	| 0 0 > = 
															 | 
															
																 
																	
																	[0] 
															 | 
														 
														
															 | 
															
																 
																	
																	[0] 
															 | 
														 
														
															 | 
															
																 
																	
																	[0] 
															 | 
														 
													 
												 
											 | 
											
												
													
														
															| 
																
															 | 
															
																 
																	
																	[0] 
															 | 
														 
														
															| 
																 
																	
																	| 0 1 > = 
															 | 
															
																 
																	
																	[1] 
															 | 
														 
														
															 | 
															
																 
																	
																	[0] 
															 | 
														 
														
															 | 
															
																 
																	
																	[0] 
															 | 
														 
													 
												 
											 | 
											
												
													
														
															| 
																
															 | 
															
																 
																	
																	[0] 
															 | 
														 
														
															| 
																 
																	
																	| 1 0 > = 
															 | 
															
																 
																	
																	[0] 
															 | 
														 
														
															 | 
															
																 
																	
																	[1] 
															 | 
														 
														
															 | 
															
																 
																	
																	[0] 
															 | 
														 
													 
												 
											 | 
											
												
											 | 
										 
									 
									on which Control-Not operation is expressed as 
									 
									
										
											| 
												
											 | 
											
												
													
														
															| 
																
															 | 
															
																 
																	[ 1 
															 | 
															
																 
																	0 
															 | 
															
																 
																	0 
															 | 
															
																 
																	0 ] 
															 | 
														 
														
															| 
																 
																	Cn = 
															 | 
															
																 
																	[ 0 
															 | 
															
																 
																	1 
															 | 
															
																 
																	0 
															 | 
															
																 
																	0 ] 
															 | 
														 
														
															 | 
															
																 
																	[ 0 
															 | 
															
																 
																	
																	0 
															 | 
															
																 
																	0 
															 | 
															
																 
																	1 ] 
															 | 
														 
														
															 | 
															
																 
																	[ 0 
															 | 
															
																 
																	0 
															 | 
															
																 
																	1 
															 | 
															
																 
																	0 ] 
															 | 
														 
													 
												 
											 | 
											
												 
													or 
											 | 
											
												
											 | 
											 | 
										 
									 
									with obvious two-by-two element notation in the right expression.   
										 
										For three qubits states, with analogous 8 vector extension, the Control-Control-Not operation is expressed by the following eight-by-eight matrix Ccn.  We also define phae operation W here: 
									 
									
										
											| 
												
											 | 
											
												
													
														
															| 
																
															 | 
															
																 
																	[ I 
															 | 
															
																 
																	O 
															 | 
															
																 
																	O 
															 | 
															
																 
																	O ] 
															 | 
														 
														
															| 
																 
																	Ccn = 
															 | 
															
																 
																	[ O 
															 | 
															
																 
																	I 
															 | 
															
																 
																	O 
															 | 
															
																 
																	O ] 
															 | 
														 
														
															 | 
															
																 
																	[ O 
															 | 
															
																 
																	O 
															 | 
															
																 
																	I 
															 | 
															
																 
																	O ] 
															 | 
														 
														
															 | 
															
																 
																	[ O 
															 | 
															
																 
																	O 
															 | 
															
																 
																	O 
															 | 
															
																 
																	X ] 
															 | 
														 
													 
												 
											 | 
											
												
													
														
															| 
																
															 | 
															
																 
																	[ Z 
															 | 
															
																 
																	O 
															 | 
															
																 
																	O 
															 | 
															
																 
																	O ] 
															 | 
														 
														
															| 
																 
																	W = 
															 | 
															
																 
																	[ O 
															 | 
															
																 
																	Z 
															 | 
															
																 
																	O 
															 | 
															
																 
																	O ] 
															 | 
														 
														
															 | 
															
																 
																	[ O 
															 | 
															
																 
																	O 
															 | 
															
																 
																	Z 
															 | 
															
																 
																	O ] 
															 | 
														 
														
															 | 
															
																 
																	[ O 
															 | 
															
																 
																	O 
															 | 
															
																 
																	O 
															 | 
															
																 
																	Z ] 
															 | 
														 
													 
												 
											 | 
											
												
											 | 
										 
									 
									Further generalization should be straightforward although cumbersom. 
								 |