List of Files
-------------
quantum.cc, quantum.h		quantum libray for qubit manipulation (differs slightly from
				previous versions available), developed by Klaus Frahm (slight
				modifications I. Garcia-Mata)
				
complex.cc, complex.h		Complex number manipulation library (author: K. Frahm, slight
				modifications I. Garcia-Mata)

gcd.h				Computes GCD

random.cc, random.h		Random number generator (author: K. Frahm)

ipr_one_qubit.cc		Computes the IPR as a function of the imperfection parameter epsilon, as
				well as some quantities given in the appendix.

Makefile			make file.

Usage:
------

- To compile, type: make

- This gives the executable file ipr_one_qubit.out
- To run type: ./ipr_one_qubit.out [parameters]
- To know which parameters type: ./ipr_one_qubit.out 0
	this gives as output:
		syntax: x N count rel_err eps_max deps ipr_max
	
	where:
		x: the number chosen randomly for Shor.
		N: the number to factorize
		count: Minimal number of algorithm iterations
		rel_err: accepted relative error (typically, inthe paper is 0.02)
		eps_max: the program gives the IPR fro epsilon=0 up to epsilon=eps_max
		deps: delta epsilon. (step size)
		ipr_max: the program stops iterating when this value is reached.
		
The program was used to compute the numerical results in Phys. Rev. A. 78, 062323 (2008)

What the program does is compute the Inverse participation ratio of the probability function of
Eq. (19), by computing a histogram, and iterating until the accepted error tolerance is reached. The
computation of the IPR xi, is done following the Appendix.			

The results are given in a file ipr_[x]_[N]_[rel_err].dat and in the columns appear:

1st collumn: epsilon
2nd: 	normalized IPR
3rd 	number of iterations (measurements)
4th:	1/xiR (Eq. (A4))
5th:	1/xi  (Eq. (A4))
6th:	delta/xi
7th:	delta (if rel_err=rel_err stop iterating)
8th:	xi2-xi2^2 (Eq. (A13))

----------------------------------
Notice: the whole difference between the generic error model and the correlated one, lies in the way we
draw the random couplings between qubits. In this program it is set in the function 
		
		one_qubit_shor_err
		
when we call the function "stat_error_restricted" of the qubit_state class, we do:

Correlated:		 a.stat_error_restricted(0,nq,delta[0],J[0]);
	the 0 indicates that we draw the same value for everybody
	
Generic:
			 a.stat_error_restricted(0,nq,delta[i],J[i]);
	Here we have vectors delta and J with different values.



			

