Go to the source code of this file.
Defines | |
#define | CUT_ITER 1 |
Boolean to stop iteration if MLE function starts to decrease by some very small amount. | |
#define | DATA "/home/max/Desktop/2/" |
Output location for the matrices produced by the program. | |
#define | DO_MLE 1 |
Boolean to specify whether MLE should be performed. | |
#define | EPS 0.05 |
Experimental State Error value. | |
#define | KEEP_GOING 1 |
Boolean to cutoff MLE based on MAX_FIDELITY. | |
#define | MAX_FIDELITY 0.90 |
Max fidelity cutoff point. If fidelity is over this value, simulations stops. | |
#define | MAXCHAR 512 |
Defines the numerical value of a character - do not alter. | |
#define | MAXITER 100 |
Maximum number of iterations of MLE function, an integer. | |
#define | MILLION 1000000 |
Defines the numerical value of one million - do not alter. | |
#define | NQ 2 |
Number of Qubits. | |
#define | NUMTRIALS 1 |
Number of times tomography is repeated. | |
#define | STATE 5 |
Main control which selects what kind of tomography will be perfomred. | |
#define | VERBOSE 1 |
Boolean extra verboseness level toggle. | |
#define | WRITE_DENSITY 1 |
Boolean toggle for density matrices to be written to disc. | |
Functions | |
double | abs_val (gsl_vector *vec) |
Returns absolute value (length) of vector vec. | |
void | base_4_rep_inc (int counter[], int n) |
Input array has base-4 rep of n-1, it's incremented to n. | |
double | concurrence (gsl_matrix_complex *matrix) |
Returns concurrence of the input density matrix. | |
void | display_matrix (gsl_matrix_complex *data) |
Prints complex matrix to screen. | |
void | display_matrix_real (gsl_matrix *data) |
Prints real matrix to screen. | |
void | display_vector_real (gsl_vector *data) |
Prints real-valued vector to screen. | |
double | entropy_linear (gsl_matrix_complex *matrix) |
Returns entropy of the input complex-valued density matrix. | |
double | fidelity (gsl_matrix_complex *m1, gsl_matrix_complex *m2) |
Returns fidelity between two density matrices m1 and m2. | |
int | Fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream) |
Wrapper function for fwrite to handle return codes. | |
void | gsl_vector_add_element (gsl_vector *vector, double element) |
Adds element as last element in vector, after re-allocating size of vector. | |
void | kron (gsl_matrix_complex *a, gsl_matrix_complex *b, gsl_matrix_complex *c) |
Performs tensor product on matrices A and B storing the output into pre-allocated matrix C. | |
void | make_T (const gsl_vector *t, gsl_matrix_complex *T) |
Seeds in values from vector t into Cholesky lower-diagonal matrix T, like described in the paper. | |
void | matrix_complex_random_init (gsl_matrix_complex *random) |
Fills a pre-allocated matrix with random values sampled from U(-1,1). | |
void | mu_tensor (gsl_matrix_complex *mu_cell[], gsl_matrix_complex *mu_array[], int mu_counter[], int counter[]) |
Shortcut algorithm for tensoring on additional mu matrices to save computation time. | |
void | outer_product (gsl_vector_complex *a, gsl_matrix_complex *outp) |
Performs outer product |a><a| into pre-allocated output matrix. | |
void | PSI_matrix (gsl_matrix_complex *psi, double theta) |
Adjusts the density matrix psi to fall on the Werner state line by using the paramter theta, which is delta in the paper. | |
void | random_density_matrix (gsl_matrix_complex *density_random) |
Creates a random density matrix out of a pre-allocated complex matrix. | |
int | read_vector_real (char *fname, gsl_vector *data) |
Reads in real valued vector into data from ASCII file fname. | |
void | rho_MEMS (gsl_matrix_complex *rho_mems, double gamma) |
Density matrix rho_mems fall on MEMS line by varying parameter gamma, as described in the paper. | |
void | sig_tensor (gsl_matrix_complex *sigma_cell[], gsl_matrix_complex *sig_array[], int mu_counter[], int counter[]) |
Shortcut algorithm for tensoring on additional sigma matrices to save computation time, see mu_tensor function description. | |
void | sqrtm (gsl_matrix_complex *matrix) |
Computes square root of complex matrix, stores output in originally pre-allocated matrix. | |
gsl_complex | trace (gsl_matrix_complex *m) |
Computes trace of a complex matrix and returns a complex number. | |
void | W_state (gsl_matrix_complex *density) |
Creates a W state density matrix. | |
int | write_data (char *name, gsl_matrix_complex *data) |
Writes complex matrix data into ASCII file specified by name, standard return codes for write. | |
int | write_matrix_real (char *name, gsl_matrix *data) |
Writes real matrix data into ASCII file name. | |
int | write_vector_real (char *name, gsl_vector *data) |
Writes real vector into ASCII file specified by name char string. | |
Variables | |
gsl_matrix_complex * | mu_array [4] |
Stores the Stokes measurement basis matrices. | |
gsl_matrix_complex * | mu_cell [NQ] |
Stores tensored mu matrices to compute the projection operators for >1 qubits, as described in the paper. | |
double | N |
Specifies the simulated number of times an experiment is performed. | |
gsl_complex | one |
Computational constant. | |
gsl_matrix_complex * | ones |
Matrix full of ones. | |
gsl_matrix_complex * | sig_array [4] |
Stores the 4 Pauli matrices. | |
gsl_matrix_complex * | sigma_cell [NQ] |
Stores tensored sigma matrices to compute the Pauli operators for >1 qubits, as described in the paper. | |
double | theta_handle |
Used to adjust the tangle value. | |
double | Werner_handle |
State handle used to adjust the Werner state. | |
gsl_complex | zero |
Computational constant. |
Numerical State Tomography Using GSL -> www.gnu.org/software/gsl Copyright (C) 2007 Max S Kaznady
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
AUTHOR Max S Kaznady, [EMAIL PROTECTED] max.kaznady@gmail.com Summer, 2007
This header file is used to specify all the parameters for the program instead of using command line arguments. This is not a very good software practice but saved a lot of time while developing the code.
Definition in file header.h.
#define DATA "/home/max/Desktop/2/" |
Output location for the matrices produced by the program.
Valid directory with sufficient space and write permissions is a must for this setting. All the simulation data would be outputted there as ASCII files.
Definition at line 298 of file header.h.
Referenced by write_data(), write_matrix_real(), and write_vector_real().
#define EPS 0.05 |
Experimental State Error value.
Used to adjust the "coherence" of the state rho_out = (1-EPS)*rho_state + EPS*rho_random do not set equal to zero
Definition at line 329 of file header.h.
Referenced by measure_state().
#define KEEP_GOING 1 |
Boolean to cutoff MLE based on MAX_FIDELITY.
For MLE Optimisation routine
if 0, then will stop iterating as soon as fidelity will start to decrease
if 1, then will keep iterating until either MLE Objective function stops decreasing, or gradient is close to zero, or some other GSL-induced condition.
Definition at line 347 of file header.h.
Referenced by MLE().
#define NQ 2 |
Number of Qubits.
This is the main control used to specify the number of qubits. The amount of memory on a regular PC (2 GB) should handle 1-15 qubits with this setting. Going over 15 qubits may result in memory overflow, as the density matrix itself would become a problem.
Definition at line 296 of file header.h.
Referenced by apply_noise(), base_4_rep_inc(), concurrence(), entropy_linear(), fill_tangle_entropy_plane(), find_N(), init(), linear_estimate(), main(), make_T(), measure_state(), MLE(), mu_tensor(), my_df(), my_f(), my_fdf(), prepare_state(), quick_and_dirty(), quick_and_dirty_2(), random_density_matrix(), sig_tensor(), sqrtm(), states_1_to_10(), and W_state().
#define NUMTRIALS 1 |
Number of times tomography is repeated.
Used to define how many times tomography is performed on an identical state and has many uses in the code.
Definition at line 301 of file header.h.
Referenced by find_N(), and states_1_to_10().
#define STATE 5 |
Main control which selects what kind of tomography will be perfomred.
The numerical value of this variable selects the type of tomography:
1 - GHZ state -- obsolete: it's just state 5
2 - tau = 0, S_l = 0
3 - Werner state, epsilon ~= 0 (low tau, high S)
4 - Werner state, epsilon ~= 0.5-0.0123 (middle)
5 - Werner state, epsilon ~= 1 (high tau, low S)
6 - MEMS State - only available for 2 QB
7 - tau = 0; S_l = 1
8 - W state
9 - completely random state
10 - Werner state, epsilon is being adjusted from 0 to 1 each time
11 - not really a state - for 2 qubits, this is used to fill the tangle/entropy plane - only defined for 2 qubits
12 - cycle through all tangle values for a pure state (S_l = 0) and and apply a different Quick and Dirty routine
13 - not a state - vary experimental error for many pure states, see how this scales with the number of qubits
14 - middle tangle value, pure state
15 - determine value for N which results in 90% Fidelity for pure states
16 - W state density matrix
Definition at line 324 of file header.h.
Referenced by main(), prepare_state(), and states_1_to_10().
void mu_tensor | ( | gsl_matrix_complex * | mu_cell[], | |
gsl_matrix_complex * | mu_array[], | |||
int | mu_counter[], | |||
int | counter[] | |||
) |
Shortcut algorithm for tensoring on additional mu matrices to save computation time.
Mu_cell contains pointers to gsl mu matrices that make up the final mu matrix which corresponds to base-4 representation in mu_counter. The function corrects mu_cell to represent "counter" base-4 representation by location the index of the mu matrix in mu_cell starting from which new matrices need to be tensored on from mu_array.
Basically this is an update function which computes the final mu_matrix corresponding to the correct base-4 representation in counter without recomputing everything from scratch.
Definition at line 185 of file utilities.c.
Referenced by measure_state(), my_df(), my_f(), and my_fdf().
00185 { 00186 //gsl_matrix_complex *mu_nu = gsl_matrix_complex_alloc(pow(2, NQ), pow(2, NQ)); 00187 int i, j; 00188 for (i=0; i<NQ; i++) { 00189 if (counter[i]!=mu_counter[i]) { //locate place from which to update 00190 if (i==0) { //base case 00191 //mu_cell[i] = mu_array[0]; 00192 //mu_cell[0] = gsl_matrix_complex_alloc(2, 2); 00193 gsl_matrix_complex_memcpy(mu_cell[0], mu_array[counter[i]]); 00194 i++; 00195 } 00196 for (j=i; j<NQ; j++) { //update the rest of elements 00197 //gsl_matrix_complex_free(mu_cell[i]); 00198 //printf("mu_tensor, j=%d and i=%d, counter[j]=%d \n", j, i, counter[j]); 00199 //mu_cell[j] = gsl_matrix_complex_alloc((mu_cell[j-1]->size1)*2, (mu_cell[j-1]->size2)*2); 00200 kron(mu_cell[j-1], mu_array[counter[j]], mu_cell[j]); 00201 } 00202 break; // done updating 00203 } 00204 } 00205 }
double N |
Specifies the simulated number of times an experiment is performed.
Specifies the simulated number of times an experiment is performed, i.e. the number of times projection measurements were taken.
Definition at line 457 of file header.h.
Referenced by fill_tangle_entropy_plane(), find_N(), init(), my_df(), my_f(), my_fdf(), and states_1_to_10().