Package: quocs-lib
The optimization libraryQuOCS (Quantum Optimal Control Suite) is a python software package for model- and experiment-based optimizations of quantum processes.
It uses the excellent Numpy and Scipy packages as numerical backends.
QuOCS aims to provide a user-friendly interface to solve optimization problems. A variety of popular optimal control algorithms are available:GRAPE (GRadient Ascent Pulse Engineering) AlgorithmdCRAB (dressed Chopped RAndom Basis) AlgorithmAD-GRAPE (Automatic Differentiation) Algorithm - for Mac and Linux onlyDirect Search Algorithm, i.e. Nelder Mead, CMA-ES...QuOCS is open source and its interface structure allows for user-friendly customizability. It can be used on all Unix-based platforms and on Windows.InstallationQuOCS is available onpip. You can install QuOCS by doingpipinstallquocs-libThe requirements are:setuptools >= 44.0.0numpy >= 1.19.1scipy >= 1.5.1If you want to use the AD Algorithm, the installation ofJAX(Autograd and XLA) is required. Please note that this package isn't available for Windows.Editable modeIf you want to customize the algortihm and basis inside QuOCS, the package has to be installed in the editable mode. You can easily do that with the following commands:gitclonehttps://github.com/Quantum-OCS/QuOCS.gitcdQuOCS
pipinstall-e.DocumentationThe possiblesettingsfor the JSON file can be foundhere.You can find the latest development documentationhere.A selection of demonstration notebooks is available, which demonstrate some of the many features of QuOCS. These are stored in theQuOCS/QuOCS-jupyternotebooks repositoryhere on GitHub.Example of usageUsing QuOCS is intuitive and simple. The main steps are:Create and load the optimization dictionary. This json file contains all the optimization settings (as an example seethis file).fromquocslib.utils.inputoutputimportreadjsonoptimization_dictionary=readjson("opt_dictionary.json"))Create Figure of Merit object. This is an instance of a class that contains the physical problem to be optimized. In the following, you can see an example of how to define this class. The input and output ofget_FoMshould not be changed.fromquocslib.utils.AbstractFoMimportAbstractFoM# Define problem classclassOneQubit(AbstractFoM):def__init__(self,args_dict:dict=None):""" Initialize the dynamics variables"""ifargs_dictisNone:args_dict={}...defget_FoM(self,pulses:list=[],parameters:list=[],timegrids:list=[])->dict:# Compute the dynamics and FoM...return{"FoM":fidelity}# Create Figure of Merit objectFoM_object=OneQubit()Define the optimizer by initializing it with the uploaded optimization dictionary and FoM object. After that the execution can be run.fromquocslib.OptimizerimportOptimizer# Define Optimizeroptimization_obj=Optimizer(optimization_dictionary,FoM_object)# Execute the optimizationoptimization_obj.execute()Complete examples are provided inQuOCS/QuOCS-jupyternotebooks repositoryor in thetestsfolders.Usage with QudiIf you want to use QuOCS in combination with Qudi, please have a look atthis repositorywith additional files, information and a tutorial.ContributeWould you like to implement a new algorithm or do you have in mind some new feature it would be cool to have in QuOCS?
You are most welcome to contribute to QuOCS development! You can do it by forking this repository and sending pull requests, or filing bug reports at theissues page.
All code contributions are acknowledged in thecontributorssection in the documentation. Thank you for your cooperation!Citing QuOCSIf you use QuOCS in your research, please cite ourintroductory software paper.@article{QuocsRossignolo2023,
     title = {{QuOCS: The Quantum Optimal Control Suite}},
     journal = {{C}omputer {P}hysics {C}ommunications},
     pages = {108782},
     year = {2023},
     issn = {0010-4655},
     doi = {https://doi.org/10.1016/j.cpc.2023.108782},
     url = {https://www.sciencedirect.com/science/article/pii/S0010465523001273},
     author = {Marco Rossignolo and Thomas Reisser and Alastair Marshall and Phila Rembold and Alice Pagano and Philipp J. Vetter and Ressa S. Said and Matthias M. Müller and Felix Motzoi and Tommaso Calarco and Fedor Jelezko and Simone Montangero}
}Authors and contributorsMarco RossignoloThomas ReisserAlastair MarshallPhila RemboldAlice Pagano