Package: graph-state-generation
Substrate SchedulerAbout The ProjectSubstrate Scheduleris a tool with core functionalities to efficiently create the input graph state fault-tolerantly using the rules given by Litinski’s "A Game of Surface Codes: Large-Scale Quantum Computing with Lattice Surgery" (GOSC) paper with the goal of minimizing the space-time volume cost.  The space-time volume cost is defined to be the space multiplied by the time where space is defined by the area of patches in units of square tiles and time in units of time step as defined in the GoSC paper or one round of syndrome measurement.Substrate Scheduler is a product of theAQUA,QTSandZapatafor theBench-Qproject.FeaturesSubstrate Schedulercreates graph states using stabilizer formalism. In the current version, it provides 3 optimzers to reduce the time steps required to create a graph state via stabilizer formalism (note that the time step here is the total number of steps required to create the graph state considering the parallel measurement of the stabilizers) :pre_mapping_optimizerFrom the definition of graph state, we know that we can reduce the number of stabilizer generator to be measured by initializing the qubits in a way that they are already stabilized by some stabilizer generators. For example, initialize node a in X-basis (|+> state) while initializing neighbor nodes of a in Z basis (|0> state).By converting the problem of finding the optimal reduction to maximum independent set problem,pre_mapping_optimizerreduces the maximum number of stabilizer generators before mapping.node_to_patch_mappertbdstabilizer measurement schedulerSuppose we have already decided where each node in the graph is mapped to which patch, in order to measure a stabilizer generator in this configuration, we need an ancilla patch that covers all the nodes defined in the stabilizer generator. This means that any stabilizer generator which includes a node between the left-most and the right-most nodes of the stabilizer we are trying to measure cannot be measured at the same time.By knowing the start and end positions of each stabilizer generator,stabilizer_measurement_schedulerwill optimally schedule the stabilizer generators to be measured and reduce the time cost by parallelly measuring as many stabilizers as possible.| 006 | 005 | 003 | 000 | 002 | 008 | 001 | 009 | 004 | 007 |
|  X  |  Z  |  Z  |  X  |  X  |  X  |  Z  |  Z  |  X  |  Z  |
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
     ancilla start |---------------------| ancilla end
           One example of the layout after mappingInstallationTo installSubstrate Scheduler, you just need to rungit clone https://github.com/sfc-aqua/gosc-graph-state-generation.gitSubstrate Scheduleris written is Python, except for a Python3 compiler, you will also need the networkx, matplotlib and numpy packages.UsageFor an example of how to use methods fromSubstrate Scheduler, please runusage_example.pywith the following command.python usage_example.pyThe program optimized some graph examples with Substrate Scheduler and returns the following results:pre-mapping optimization took - 0.00037109400000001624s
node to patch mapping took    - 3.106400000008058e-05s
measurement scheduler took    - 2.7704999999933477e-05s
reduce from 10 to 5
| 006 | 005 | 003 | 000 | 002 | 008 | 001 | 009 | 004 | 007 |
|  X  |  Z  |  Z  |  X  |  X  |  X  |  Z  |  Z  |  X  |  Z  |
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
                   |---------------------|
                   |---------------------------|
             |---------------------------------------|
 |---------------------------------------------------|
 |---------------------------------------------------------|It contains:Time taken for each optimization process (here is the run time);Time step reduced by the optimization;An ASCII visualization of the layout (results of the mapping), as well as the starting and ending positions of the stabilizer generator for each step.Development and ContributionWe useGoogle-styledocstring format. If you'd like to specify types please usePEP 484type hints instead adding them to docstrings.There are codestyle-relatedGithub Actionsrunning for PRs.If you'd like to report a bug/issue please create a new issue in this repository.If you'd like to contribute, please create a pull request tomain.Running testsUnit tests for this project can be run usingmake coveragecommand from the main directory.
Alternatively you can also runpytest ..StyleWe are using automatic tools for style and type checking. In order to make sure the code is compliant with them please run:make stylefrom the main directory (this requiresdevdependencies).In-progress work:The performance of node_to_patch_mapper needs further testing and improvement.Tests are still being polished.See theopen issuesfor a full list of proposed features (and known issues).LicenseDistributed under the MIT License. SeeLICENSEfor more information.