Quantum Scientific Library (QSL) structure  

[under construction]

The QSL project aims to provide an integrated suite of control and estimation codes to quantum engineers, given the aforementioned fundamentally different properties of quantum/classical estimation and control. The QSL estimation routines contain both frequentist and Bayesian algorithms (the latter based on efficient Markov Chain Monte Carlo (MCMC) techniques). QSL optimal control algorithms include stochastic (genetic and evolutionary) algorithms for open-loop control of open and closed quantum systems, as well as gradient-based algorithms for searching control landscapes. Hybrid stochastic(simulated annealing)/deterministic algorithms are also included for overcoming control landscape traps. QSL routines can be run either offline (in simulation mode) or online (in feedback control mode) to directly process laboratory data, thereby narrowing the gap between QC theory and experiment. The QSL will be open source, with freely available online documentation.

The Routines

A.      Numerical integration

 1. Runge-Kutta

2. Propagation toolkit


B.    Random number generation

C.     Hybrid deterministic / stochastic global optimization

1. Gradient/ simulated annealing hybrid algorithm

D.     Evolutionary algorithm support

E.    Quantum state estimation algorithms (stationary)
 

1. Maximum Likelihood library


2. Bayesian estimation library

F. Controllability & Observability

            1. Controllability assessment

             2. Observability assessment


G.     Continuation algorithms

            1.  Level set exploration

 

2.  Multiobjective control

      3.  Pareto front tracking

           

            4.  Fluence/free function

            5.  Hamiltonian morphing

            6.  ODD

H.  Robust control

    

I.     Simulation of open quantum systems


1. Master equation

2. Simulation of measurement

     

      3. Monte carlo simulation

J.       Filtering algorithms

1. Frequentist

            Kalman filtering

            Nonlinear filterinh

  2. Bayesian


K.      Dynamic programming


1.  Perturbative feedback control

L.    Root finding algorithms

GSL multiroot?

2. R library/package for num recipes global NR?




                                                QSL Containers: Vectors, Matrices

M.     Vector classes

(Allocation)

Main point of vector class is for mem alloc? (also size, easy assignment – may not be poss w c-type containers)

Accessing vector elements

N.  Matrix classes (types)

-         need to make non destructor QSLMat memfree function in class; can't wait for prog term since each time a fn called with a matrix, new memory will be allocated to a matrix, wasting space

-         may make alt versions of fns in QSLMat using direct array declarations to compare

fns don't have to have same arg names as their declarations

1.    Use of pointers

-         Not clear if operator[][] can be implemented without double pointer (i.e., there is no [][] so it can't be overloaded; dealing w/ array of arrays) – could check boost? They may make more use of iterators, unnecessarily complicated

Fewer compile errors, more runtime errors for matrix class than expected? Could be due to extensive use of ptrs?

2.   Allocation

include cstdlib for bad_alloc xa?

3.   Accessing matrix elements

our method of matrix indexing is analog to pg 104 C++ of first returning ptr to first element of row

            Need to provide array bounds checking in code

4.   Initializing matrix elements

5.   Reading/writing matrices from file

6.   Resizing

      Resizing to larger matrix is forcing values into undesired memory locations;

      downsize ok

           

7.  Addition/subtraction of matrices

8.  Range checking: range checking for array classes?

no 3d matrices in gsl? Nr uses triple ptrs

-         no matrix operations in nr? Matrix +, - handled by standalone fns in gsl; * handled through blas? (gemm, etc)

-         we need to write a c++ matrix class consistent version of blas.c in gsl blas dir

-         gsl uses size_t for dim, nr int

-         the cblas dir has the entire blas; there may be slight edits in gsl_cblas.h interface, but it is basically as provided by blas. We will use these almost w/o mods

-         we may add these to a c++ matrix class; could also add gsl matrix “views” to a c++ matrix class

-         DONT access privates through : . Make needed public

DO use templates

DO use inline


-   Code won't look much diff than GSL – but will have explicit calls to destructor
               what about more use of structs in main code, as in gsl

9.  Use of iterators?

            is STL used by either? Prob not (boost may). May not be a good idea since will reduce familiarity w/ low-level code. Note however that we do

note header <valarray> contains many array element-specific fns. These are sim to those defined in gsl (e.g. slices, fns on elements, etc). However, they are not defined for multidimensional arrays (?) and valarray objects cannot be used with blas, so it is good to write these fns specifically for user-defined container classes

note header <valarray> contains many array element-specific fns. These are sim to those defined in gsl (e.g. slices, fns on elements, etc). However, they are not defined for multidimensional arrays (?) and valarray objects cannot be used with blas, so it is good to write these fns specifically for user-defined container classes

           

O.    Matrix operations

1. Matrix inversion

2. Matrix diagonalization (complex) – Fortran interface

3.  Matrix exponentiation

           

Can we overload other operators for use in other matrix fns, like transpose?

Certainly overload +,-


            May not need copy constructor, just =

            DONT use multiple indirection. Follow method in GSL (no need for ptr arith)

            Code won't look much diff – but will have explicit calls to destructor

           

            Can't set elements to zero automatically in default constructor for vectors and matrices due to need for specifying dims; but DO set in the indexed constructors

QSL Error Handling and Debugging

P.    Error handling

1. Error codes

2. Custom handlers

revision of Debug class (attention to types that can be fed to <<)

writing new matrix, vector file write fns (using FILE * as gsl, or using streams?)

compare speeds of old (boost), new codes, w/ , w/o memory deallocation

pointers used with scalar objs in gsl structs, w/ explicit allocation, deallocation  - these should appear in our code as well

      3.  Debugging

=        What is the “gnu debugger” GDB? Like perl debugger, can execute program within debugger and follow line-by-line. Put “break qsl_error” within .gdbinit file. This is a 'breakpoint' – what does it mean?

-         gdb <executable>  will first start gdb and show breakpoints listed in .gdbinit

'Breakpoint 1, qsl_error (reason=<address> “reason”, file=.....)'

-         then type 'bt' for backtrace to see hwat caused prob, i.e., what called qsl_error

           Parallel programming with QSL

Q.      MPI support

-MCMC simulation

QSL Graphing / External Interfaces

R.    R interface

 

 

1. (Cluster-based) graphing

 

Sep graphing sect?

            2. Graphing through GnuPlot

S.    Macros?


T.  Interfacing w Labview