From bd2dc3cf8db461ac25b21a6ace0e576939248827 Mon Sep 17 00:00:00 2001 From: Vlad Gheorghiu Date: Fri, 26 May 2023 12:18:36 -0400 Subject: [PATCH] Version 3.2 (#59) Version 3.2 --- .github/workflows/cmake.yml | 6 ++++- CHANGES | 4 +++- CMakeLists.txt | 2 +- Dockerfile | 2 +- Doxyfile | 9 ++++---- INSTALL.md | 8 +++---- README.md | 2 +- VERSION | 2 +- include/gates/channel.hpp | 4 ++-- include/mapping/device.hpp | 10 ++++---- include/mapping/layout/basic.hpp | 8 +++---- include/mapping/layout/bestfit.hpp | 6 ++--- include/mapping/layout/eager.hpp | 6 ++--- include/mapping/mapping/steiner.hpp | 8 +++---- include/mapping/mapping/swap.hpp | 6 ++--- include/optimization/cnot_resynthesis.hpp | 8 +++---- include/optimization/rotation_folding.hpp | 8 +++---- include/optimization/simplify.hpp | 6 ++--- include/output/cirq.hpp | 4 ++-- include/output/lattice_surgery.hpp | 17 +++++++------- include/output/projectq.hpp | 4 ++-- include/output/qsharp.hpp | 4 ++-- include/synthesis/cnot_dihedral.hpp | 8 +++---- include/synthesis/linear_reversible.hpp | 4 ++-- include/synthesis/logic_synthesis.hpp | 8 +++---- include/tools/resource_estimator.hpp | 4 ++-- include/transformations/barrier_merge.hpp | 6 ++--- include/transformations/desugar.hpp | 4 ++-- .../transformations/expression_simplifier.hpp | 10 ++++---- include/transformations/inline.hpp | 6 ++--- include/transformations/substitution.hpp | 4 ++-- pyproject.toml | 2 +- pystaq/staq_wrapper.cpp | 22 ++++++++---------- qasmtools/include/qasmtools/ast/base.hpp | 7 +++--- qasmtools/include/qasmtools/ast/decl.hpp | 4 ++-- qasmtools/include/qasmtools/ast/expr.hpp | 18 +++++++-------- qasmtools/include/qasmtools/ast/replacer.hpp | 2 ++ qasmtools/include/qasmtools/ast/semantic.hpp | 12 +++++----- qasmtools/include/qasmtools/ast/stmt.hpp | 6 ++--- qasmtools/include/qasmtools/ast/var.hpp | 4 ++-- qasmtools/include/qasmtools/parser/lexer.hpp | 10 ++++---- qasmtools/include/qasmtools/parser/parser.hpp | 4 ++-- .../include/qasmtools/parser/preprocessor.hpp | 4 ++-- qasmtools/include/qasmtools/parser/token.hpp | 4 ++-- qasmtools/include/qasmtools/utils/angle.hpp | 10 ++++---- staq/main.cpp | 23 ++++++++++--------- tools/circ.cpp | 6 ++--- tools/device_generator.cpp | 3 ++- tools/inliner.cpp | 4 ++-- tools/lattice_surgery.cpp | 6 ++--- tools/mapper.cpp | 12 +++++----- tools/oracle_synthesizer.cpp | 1 + tools/projectq.cpp | 6 ++--- tools/qsharp.cpp | 6 ++--- tools/quil.cpp | 6 ++--- tools/resource_estimator.cpp | 6 ++--- tools/rotation_optimizer.cpp | 6 ++--- tools/simplifier.cpp | 6 ++--- unit_tests/tests/gates/channel.cpp | 1 + unit_tests/tests/mapping/device.cpp | 4 +++- unit_tests/tests/mapping/layout.cpp | 5 ++-- unit_tests/tests/mapping/mapping.cpp | 5 +++- .../tests/optimization/cnot_resynthesis.cpp | 2 ++ .../tests/optimization/rotation_folding.cpp | 2 ++ unit_tests/tests/optimization/simplify.cpp | 2 ++ unit_tests/tests/synthesis/cnot_dihedral.cpp | 8 ++++--- .../tests/synthesis/linear_reversible.cpp | 3 ++- .../tests/transformations/barrier_merge.cpp | 2 ++ unit_tests/tests/transformations/desugar.cpp | 2 ++ .../transformations/expression_simplifier.cpp | 2 ++ unit_tests/tests/transformations/inline.cpp | 2 ++ 71 files changed, 232 insertions(+), 196 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b9ff4c46..d819f034 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v3 - name: Configure staq - run: cmake -B ${{github.workspace}}/build + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - name: Build staq @@ -41,3 +41,7 @@ jobs: - name: Run unit tests working-directory: ${{github.workspace}}/build run: ctest -C ${{env.BUILD_TYPE}} + + - name: Install pystaq + working-directory: ${{github.workspace}} + run: pip3 install --user . diff --git a/CHANGES b/CHANGES index fa62c7c5..9b37e810 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ -Pre-release +Version 3.2 - 26 May 2023 + - This is a maintenance release - Migrated all continuous integration to GitHub actions + - Minor updates in qasmtools Version 3.1 - 13 May 2023 - staq is now available on Homebrew (macOS/Linux), and can be installed diff --git a/CMakeLists.txt b/CMakeLists.txt index 46627f2b..9e2414fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.15) -set(STAQ_VERSION_NUM 3.1) +set(STAQ_VERSION_NUM 3.2) set(STAQ_VERSION_STR "${STAQ_VERSION_NUM}") project(staq VERSION ${STAQ_VERSION_NUM} LANGUAGES CXX) set(CMAKE_CXX_STANDARD 17) diff --git a/Dockerfile b/Dockerfile index e42d23e7..0d2ec7e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN apt-get update && \ ln -fs /usr/share/zoneinfo/America/Toronto /etc/localtime && \ dpkg-reconfigure -f noninteractive tzdata -RUN apt-get install -y \ +RUN apt-get install -y \ build-essential \ python3.6 \ python3-pip \ diff --git a/Doxyfile b/Doxyfile index 0666bcbc..c2420b7b 100644 --- a/Doxyfile +++ b/Doxyfile @@ -48,7 +48,7 @@ PROJECT_NAME = staq # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = v3.1 +PROJECT_NUMBER = v3.2 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -184,7 +184,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = . # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -917,7 +917,8 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = include +INPUT = include \ + README.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -1652,7 +1653,7 @@ DISABLE_INDEX = NO # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_TREEVIEW = NO +GENERATE_TREEVIEW = YES # When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the # FULL_SIDEBAR option determines if the side bar is limited to only the treeview diff --git a/INSTALL.md b/INSTALL.md index 7b0b6f04..a79ab99b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -69,16 +69,16 @@ Building on Windows requires [Visual Studio](https://www.visualstudio.com) 2017 or later for CMake support. In Visual Studio, open [CMakeLists.txt](https://github.com/softwareQinc/staq/blob/main/CMakeLists.txt) as a CMake project, then simply build as a regular Visual Studio project or, -from an Administrator Developer Command Prompt, execute under the root directory +in a Command Prompt, execute under the root directory -``` +```shell cmake -B build cmake --build build --parallel 8 ``` -To (un)install, execute +To (un)install, execute in an Administrator Command Prompt -``` +```shell cmake --build build --target (UN)INSTALL ``` diff --git a/README.md b/README.md index e96f17a2..da9b6487 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # staq -## Version 3.1 - 13 May 2023 +## Version 3.2 - 26 May 2023 [![GitHub actions](https://github.com/softwareqinc/staq/actions/workflows/cmake.yml/badge.svg)](https://github.com/softwareQinc/staq/actions) diff --git a/VERSION b/VERSION index 87c68c7e..e49ad975 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 3.1 - 13 May 2023 +Version 3.2 - 26 May 2023 diff --git a/include/gates/channel.hpp b/include/gates/channel.hpp index 304ed160..a3494379 100644 --- a/include/gates/channel.hpp +++ b/include/gates/channel.hpp @@ -39,14 +39,14 @@ #ifndef GATES_CHANNEL_HPP_ #define GATES_CHANNEL_HPP_ -#include "qasmtools/utils/angle.hpp" - #include #include #include #include #include +#include "qasmtools/utils/angle.hpp" + namespace staq { namespace gates { diff --git a/include/mapping/device.hpp b/include/mapping/device.hpp index 24e45327..7b90f647 100644 --- a/include/mapping/device.hpp +++ b/include/mapping/device.hpp @@ -32,20 +32,20 @@ #ifndef MAPPING_DEVICE_HPP_ #define MAPPING_DEVICE_HPP_ -#include "qasmtools/ast/var.hpp" - -#include #include +#include #include #include +#include #include +#include #include #include #include #include #include -#include -#include + +#include "qasmtools/ast/var.hpp" namespace staq { namespace mapping { diff --git a/include/mapping/layout/basic.hpp b/include/mapping/layout/basic.hpp index bf15a40b..49908aa0 100644 --- a/include/mapping/layout/basic.hpp +++ b/include/mapping/layout/basic.hpp @@ -32,13 +32,13 @@ #ifndef MAPPING_LAYOUT_BASIC_HPP_ #define MAPPING_LAYOUT_BASIC_HPP_ +#include +#include + +#include "mapping/device.hpp" #include "qasmtools/ast/replacer.hpp" #include "qasmtools/ast/traversal.hpp" #include "transformations/substitution.hpp" -#include "mapping/device.hpp" - -#include -#include namespace staq { namespace mapping { diff --git a/include/mapping/layout/bestfit.hpp b/include/mapping/layout/bestfit.hpp index 049748ad..75683b19 100644 --- a/include/mapping/layout/bestfit.hpp +++ b/include/mapping/layout/bestfit.hpp @@ -32,11 +32,11 @@ #ifndef MAPPING_LAYOUT_BESTFIT_HPP_ #define MAPPING_LAYOUT_BESTFIT_HPP_ -#include "qasmtools/ast/traversal.hpp" -#include "mapping/device.hpp" - #include +#include "mapping/device.hpp" +#include "qasmtools/ast/traversal.hpp" + namespace staq { namespace mapping { diff --git a/include/mapping/layout/eager.hpp b/include/mapping/layout/eager.hpp index 4bc77a55..48e7185d 100644 --- a/include/mapping/layout/eager.hpp +++ b/include/mapping/layout/eager.hpp @@ -32,14 +32,14 @@ #ifndef MAPPING_LAYOUT_EAGER_HPP_ #define MAPPING_LAYOUT_EAGER_HPP_ -#include "qasmtools/ast/traversal.hpp" -#include "mapping/device.hpp" - #include #include #include #include +#include "mapping/device.hpp" +#include "qasmtools/ast/traversal.hpp" + namespace staq { namespace mapping { diff --git a/include/mapping/mapping/steiner.hpp b/include/mapping/mapping/steiner.hpp index c5d28335..743c952b 100644 --- a/include/mapping/mapping/steiner.hpp +++ b/include/mapping/mapping/steiner.hpp @@ -32,13 +32,13 @@ #ifndef MAPPING_MAPPING_STEINER_HPP_ #define MAPPING_MAPPING_STEINER_HPP_ +#include + +#include "mapping/device.hpp" #include "qasmtools/ast/traversal.hpp" #include "qasmtools/utils/templates.hpp" -#include "synthesis/linear_reversible.hpp" #include "synthesis/cnot_dihedral.hpp" -#include "mapping/device.hpp" - -#include +#include "synthesis/linear_reversible.hpp" namespace staq { namespace mapping { diff --git a/include/mapping/mapping/swap.hpp b/include/mapping/mapping/swap.hpp index 3f79e9ea..1fc6a3e4 100644 --- a/include/mapping/mapping/swap.hpp +++ b/include/mapping/mapping/swap.hpp @@ -32,11 +32,11 @@ #ifndef MAPPING_MAPPING_SWAP_HPP_ #define MAPPING_MAPPING_SWAP_HPP_ +#include + +#include "mapping/device.hpp" #include "qasmtools/ast/replacer.hpp" #include "transformations/substitution.hpp" -#include "mapping/device.hpp" - -#include // TODO: figure out what to do with if statements diff --git a/include/optimization/cnot_resynthesis.hpp b/include/optimization/cnot_resynthesis.hpp index 181a9a77..615d76fb 100644 --- a/include/optimization/cnot_resynthesis.hpp +++ b/include/optimization/cnot_resynthesis.hpp @@ -32,15 +32,15 @@ #ifndef OPTIMIZATION_CNOTRESYNTHESIS_HPP_ #define OPTIMIZATION_CNOTRESYNTHESIS_HPP_ -#include "qasmtools/ast/visitor.hpp" -#include "qasmtools/ast/replacer.hpp" -#include "synthesis/cnot_dihedral.hpp" - #include #include #include #include +#include "qasmtools/ast/replacer.hpp" +#include "qasmtools/ast/visitor.hpp" +#include "synthesis/cnot_dihedral.hpp" + namespace staq { namespace optimization { diff --git a/include/optimization/rotation_folding.hpp b/include/optimization/rotation_folding.hpp index af5eb305..6399a045 100644 --- a/include/optimization/rotation_folding.hpp +++ b/include/optimization/rotation_folding.hpp @@ -32,14 +32,14 @@ #ifndef OPTIMIZATION_ROTATIONFOLDING_HPP_ #define OPTIMIZATION_ROTATIONFOLDING_HPP_ -#include "qasmtools/ast/visitor.hpp" -#include "qasmtools/ast/replacer.hpp" -#include "gates/channel.hpp" - #include #include #include +#include "gates/channel.hpp" +#include "qasmtools/ast/replacer.hpp" +#include "qasmtools/ast/visitor.hpp" + namespace staq { namespace optimization { diff --git a/include/optimization/simplify.hpp b/include/optimization/simplify.hpp index 66c36b8d..a47842a2 100644 --- a/include/optimization/simplify.hpp +++ b/include/optimization/simplify.hpp @@ -32,11 +32,11 @@ #ifndef OPTIMIZATION_SIMPLIFY_HPP_ #define OPTIMIZATION_SIMPLIFY_HPP_ -#include "qasmtools/ast/visitor.hpp" -#include "qasmtools/ast/replacer.hpp" - #include +#include "qasmtools/ast/replacer.hpp" +#include "qasmtools/ast/visitor.hpp" + namespace staq { namespace optimization { diff --git a/include/output/cirq.hpp b/include/output/cirq.hpp index 9f3b3b8b..196d4bdd 100644 --- a/include/output/cirq.hpp +++ b/include/output/cirq.hpp @@ -32,10 +32,10 @@ #ifndef OUTPUT_CIRQ_HPP_ #define OUTPUT_CIRQ_HPP_ -#include "qasmtools/ast/ast.hpp" - #include +#include "qasmtools/ast/ast.hpp" + namespace staq { namespace output { diff --git a/include/output/lattice_surgery.hpp b/include/output/lattice_surgery.hpp index a8fcff64..ad611b15 100644 --- a/include/output/lattice_surgery.hpp +++ b/include/output/lattice_surgery.hpp @@ -32,17 +32,17 @@ #ifndef OUTPUT_LATTICESURGERY_HPP_ #define OUTPUT_LATTICESURGERY_HPP_ -#include "qasmtools/ast/ast.hpp" -#include "qasmtools/utils/angle.hpp" -#include "transformations/desugar.hpp" -#include "transformations/inline.hpp" - #include #include #include +#include #include #include -#include + +#include "qasmtools/ast/ast.hpp" +#include "qasmtools/utils/angle.hpp" +#include "transformations/desugar.hpp" +#include "transformations/inline.hpp" namespace staq::output { @@ -350,8 +350,9 @@ class LayeredPauliOpCircuit { for (auto const& op : c.ops_) { if (op.second == "1/8" || op.second == "-1/8") { if (expect_no_more_Ts) { - throw std::logic_error("π/8 rotations must come before all " - "π/4 rotations and measurements"); + throw std::logic_error( + "pi/8 rotations must come before all " + "pi/4 rotations and measurements"); } else { layers_.push_back({op}); } diff --git a/include/output/projectq.hpp b/include/output/projectq.hpp index 1e28cf40..5cef919b 100644 --- a/include/output/projectq.hpp +++ b/include/output/projectq.hpp @@ -32,10 +32,10 @@ #ifndef OUTPUT_PROJECTQ_HPP_ #define OUTPUT_PROJECTQ_HPP_ -#include "qasmtools/ast/ast.hpp" - #include +#include "qasmtools/ast/ast.hpp" + namespace staq { namespace output { diff --git a/include/output/qsharp.hpp b/include/output/qsharp.hpp index 0c485e20..93a31836 100644 --- a/include/output/qsharp.hpp +++ b/include/output/qsharp.hpp @@ -32,11 +32,11 @@ #ifndef OUTPUT_QSHARP_HPP_ #define OUTPUT_QSHARP_HPP_ -#include "qasmtools/ast/ast.hpp" - #include #include +#include "qasmtools/ast/ast.hpp" + namespace staq { namespace output { diff --git a/include/synthesis/cnot_dihedral.hpp b/include/synthesis/cnot_dihedral.hpp index 205101d7..877e30ab 100644 --- a/include/synthesis/cnot_dihedral.hpp +++ b/include/synthesis/cnot_dihedral.hpp @@ -32,15 +32,15 @@ #ifndef SYNTHESIS_CNOTDIHEDRAL_HPP_ #define SYNTHESIS_CNOTDIHEDRAL_HPP_ -#include "mapping/device.hpp" -#include "synthesis/linear_reversible.hpp" -#include "qasmtools/ast/expr.hpp" - #include #include #include #include +#include "mapping/device.hpp" +#include "qasmtools/ast/expr.hpp" +#include "synthesis/linear_reversible.hpp" + namespace staq { namespace synthesis { diff --git a/include/synthesis/linear_reversible.hpp b/include/synthesis/linear_reversible.hpp index efd0e7f7..0f7f8435 100644 --- a/include/synthesis/linear_reversible.hpp +++ b/include/synthesis/linear_reversible.hpp @@ -32,12 +32,12 @@ #ifndef SYNTHESIS_LINEARREVERSIBLE_HPP_ #define SYNTHESIS_LINEARREVERSIBLE_HPP_ -#include "mapping/device.hpp" - #include #include #include +#include "mapping/device.hpp" + namespace staq { namespace synthesis { diff --git a/include/synthesis/logic_synthesis.hpp b/include/synthesis/logic_synthesis.hpp index 2102ad11..00b23a2d 100644 --- a/include/synthesis/logic_synthesis.hpp +++ b/include/synthesis/logic_synthesis.hpp @@ -34,18 +34,18 @@ #define FMT_HEADER_ONLY = true -#include -#include -#include #include #include #include +#include +#include +#include #include #include -#include "qasmtools/parser/position.hpp" #include "qasmtools/ast/stmt.hpp" +#include "qasmtools/parser/position.hpp" #include "qasmtools/utils/angle.hpp" namespace staq { diff --git a/include/tools/resource_estimator.hpp b/include/tools/resource_estimator.hpp index 6833595e..273fb88e 100644 --- a/include/tools/resource_estimator.hpp +++ b/include/tools/resource_estimator.hpp @@ -34,10 +34,10 @@ // TODO: account for compound gates, i.e. qreg q[n]; reset q; -#include "qasmtools/ast/ast.hpp" - #include +#include "qasmtools/ast/ast.hpp" + namespace staq { namespace tools { diff --git a/include/transformations/barrier_merge.hpp b/include/transformations/barrier_merge.hpp index ed3b17db..73f75e8e 100644 --- a/include/transformations/barrier_merge.hpp +++ b/include/transformations/barrier_merge.hpp @@ -32,13 +32,13 @@ #ifndef TRANSFORMATIONS_BARRIERMERGE_HPP_ #define TRANSFORMATIONS_BARRIERMERGE_HPP_ -#include "qasmtools/ast/traversal.hpp" -#include "qasmtools/ast/replacer.hpp" - #include #include #include +#include "qasmtools/ast/replacer.hpp" +#include "qasmtools/ast/traversal.hpp" + namespace staq { namespace transformations { diff --git a/include/transformations/desugar.hpp b/include/transformations/desugar.hpp index 82b0fbe0..2f40fdeb 100644 --- a/include/transformations/desugar.hpp +++ b/include/transformations/desugar.hpp @@ -32,12 +32,12 @@ #ifndef TRANSFORMATIONS_DESUGAR_HPP_ #define TRANSFORMATIONS_DESUGAR_HPP_ -#include "qasmtools/ast/replacer.hpp" - #include #include #include +#include "qasmtools/ast/replacer.hpp" + namespace staq { namespace transformations { diff --git a/include/transformations/expression_simplifier.hpp b/include/transformations/expression_simplifier.hpp index 419addb5..93e83a05 100644 --- a/include/transformations/expression_simplifier.hpp +++ b/include/transformations/expression_simplifier.hpp @@ -32,12 +32,12 @@ #ifndef TRANSFORMATIONS_EXPRESSIONSIMPLIFIER_HPP_ #define TRANSFORMATIONS_EXPRESSIONSIMPLIFIER_HPP_ -#include "qasmtools/ast/visitor.hpp" -#include "qasmtools/utils/angle.hpp" - #include -#include #include +#include + +#include "qasmtools/ast/visitor.hpp" +#include "qasmtools/utils/angle.hpp" namespace staq { namespace transformations { @@ -53,7 +53,7 @@ namespace ast = qasmtools::ast; * LPE + LPE -> LPE * LPE - LPE -> LPE * LPE * LPE -> LPE only if one of the LPEs has no pi term - * (i.e. can't simplify π*π) + * (i.e. can't simplify pi*pi) * ... -> REAL otherwise * LPE / LPE -> LPE only if (i) the denominator has no pi term; or * (ii) we have (a*pi/b) / (c*pi/d) diff --git a/include/transformations/inline.hpp b/include/transformations/inline.hpp index c3a58ead..ecb27c75 100644 --- a/include/transformations/inline.hpp +++ b/include/transformations/inline.hpp @@ -32,12 +32,12 @@ #ifndef TRANSFORMATIONS_INLINE_HPP_ #define TRANSFORMATIONS_INLINE_HPP_ -#include "qasmtools/ast/replacer.hpp" -#include "substitution.hpp" - #include #include +#include "qasmtools/ast/replacer.hpp" +#include "substitution.hpp" + namespace staq { namespace transformations { diff --git a/include/transformations/substitution.hpp b/include/transformations/substitution.hpp index 94d5ef7b..e1ea11fa 100644 --- a/include/transformations/substitution.hpp +++ b/include/transformations/substitution.hpp @@ -32,14 +32,14 @@ #ifndef TRANSFORMATIONS_SUBSTITUTION_HPP_ #define TRANSFORMATIONS_SUBSTITUTION_HPP_ -#include "qasmtools/ast/replacer.hpp" - #include #include #include #include #include +#include "qasmtools/ast/replacer.hpp" + namespace staq { namespace transformations { diff --git a/pyproject.toml b/pyproject.toml index 88245937..05caacc7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta" [project] name = "pystaq" -version = "3.1" +version = "3.2" description = "Python 3 wrapper for staq" authors = [ {name = "softwareQ Inc.", email = "info@softwareq.ca"}, diff --git a/pystaq/staq_wrapper.cpp b/pystaq/staq_wrapper.cpp index e22a34f9..b42b6e52 100644 --- a/pystaq/staq_wrapper.cpp +++ b/pystaq/staq_wrapper.cpp @@ -33,31 +33,31 @@ #include "qasmtools/parser/parser.hpp" +#include "transformations/barrier_merge.hpp" #include "transformations/desugar.hpp" +#include "transformations/expression_simplifier.hpp" #include "transformations/inline.hpp" #include "transformations/oracle_synthesizer.hpp" -#include "transformations/barrier_merge.hpp" -#include "transformations/expression_simplifier.hpp" -#include "optimization/simplify.hpp" -#include "optimization/rotation_folding.hpp" #include "optimization/cnot_resynthesis.hpp" +#include "optimization/rotation_folding.hpp" +#include "optimization/simplify.hpp" #include "mapping/device.hpp" #include "mapping/layout/basic.hpp" -#include "mapping/layout/eager.hpp" #include "mapping/layout/bestfit.hpp" -#include "mapping/mapping/swap.hpp" +#include "mapping/layout/eager.hpp" #include "mapping/mapping/steiner.hpp" +#include "mapping/mapping/swap.hpp" -#include "tools/resource_estimator.hpp" #include "tools/qubit_estimator.hpp" +#include "tools/resource_estimator.hpp" +#include "output/cirq.hpp" +#include "output/lattice_surgery.hpp" #include "output/projectq.hpp" #include "output/qsharp.hpp" #include "output/quil.hpp" -#include "output/cirq.hpp" -#include "output/lattice_surgery.hpp" namespace py = pybind11; @@ -207,9 +207,7 @@ void cnot_resynth(Program& prog) { prog.cnot_resynth(); } void simplify(Program& prog, bool no_fixpoint) { prog.simplify(no_fixpoint); } void synthesize_oracles(Program& prog) { prog.synthesize_oracles(); } -std::string lattice_surgery(Program& prog) { - return prog.lattice_surgery(); -} +std::string lattice_surgery(Program& prog) { return prog.lattice_surgery(); } static double FIDELITY_1 = staq::mapping::FIDELITY_1; diff --git a/qasmtools/include/qasmtools/ast/base.hpp b/qasmtools/include/qasmtools/ast/base.hpp index 73b85369..234d70a8 100644 --- a/qasmtools/include/qasmtools/ast/base.hpp +++ b/qasmtools/include/qasmtools/ast/base.hpp @@ -32,13 +32,14 @@ #ifndef QASMTOOLS_AST_BASE_HPP_ #define QASMTOOLS_AST_BASE_HPP_ +#include +#include +#include + #include "../parser/position.hpp" #include "cloneable.hpp" #include "visitor.hpp" -#include -#include - namespace qasmtools { namespace ast { diff --git a/qasmtools/include/qasmtools/ast/decl.hpp b/qasmtools/include/qasmtools/ast/decl.hpp index df7df381..03c40122 100644 --- a/qasmtools/include/qasmtools/ast/decl.hpp +++ b/qasmtools/include/qasmtools/ast/decl.hpp @@ -32,10 +32,10 @@ #ifndef QASMTOOLS_AST_DECL_HPP_ #define QASMTOOLS_AST_DECL_HPP_ -#include "stmt.hpp" - #include +#include "stmt.hpp" + namespace qasmtools { namespace ast { diff --git a/qasmtools/include/qasmtools/ast/expr.hpp b/qasmtools/include/qasmtools/ast/expr.hpp index ca82f2ab..1eaad276 100644 --- a/qasmtools/include/qasmtools/ast/expr.hpp +++ b/qasmtools/include/qasmtools/ast/expr.hpp @@ -32,12 +32,12 @@ #ifndef QASMTOOLS_AST_EXPR_HPP_ #define QASMTOOLS_AST_EXPR_HPP_ -#include "../utils/angle.hpp" -#include "base.hpp" - #include #include +#include "../utils/angle.hpp" +#include "base.hpp" + namespace qasmtools { namespace ast { @@ -317,7 +317,7 @@ class UExpr final : public Expr { } void accept(Visitor& visitor) override { visitor.visit(*this); } std::ostream& pretty_print(std::ostream& os, bool ctx) const override { - (void) ctx; + (void)ctx; os << op_; if (op_ == UnaryOp::Neg) @@ -362,7 +362,7 @@ class PiExpr final : public Expr { std::optional constant_eval() const override { return utils::pi; } void accept(Visitor& visitor) override { visitor.visit(*this); } std::ostream& pretty_print(std::ostream& os, bool ctx) const override { - (void) ctx; + (void)ctx; os << "pi"; return os; @@ -404,11 +404,11 @@ class IntExpr final : public Expr { int value() const { return value_; } std::optional constant_eval() const override { - return (double) value_; + return (double)value_; } void accept(Visitor& visitor) override { visitor.visit(*this); } std::ostream& pretty_print(std::ostream& os, bool ctx) const override { - (void) ctx; + (void)ctx; os << value_; return os; @@ -452,7 +452,7 @@ class RealExpr final : public Expr { std::optional constant_eval() const override { return value_; } void accept(Visitor& visitor) override { visitor.visit(*this); } std::ostream& pretty_print(std::ostream& os, bool ctx) const override { - (void) ctx; + (void)ctx; std::streamsize ss = os.precision(); os << std::setprecision(15) << value_ << std::setprecision(ss); @@ -499,7 +499,7 @@ class VarExpr final : public Expr { } void accept(Visitor& visitor) override { visitor.visit(*this); } std::ostream& pretty_print(std::ostream& os, bool ctx) const override { - (void) ctx; + (void)ctx; os << var_; return os; } diff --git a/qasmtools/include/qasmtools/ast/replacer.hpp b/qasmtools/include/qasmtools/ast/replacer.hpp index ec0bbbb4..40ee4b70 100644 --- a/qasmtools/include/qasmtools/ast/replacer.hpp +++ b/qasmtools/include/qasmtools/ast/replacer.hpp @@ -32,6 +32,8 @@ #ifndef QASMTOOLS_AST_REPLACER_HPP_ #define QASMTOOLS_AST_REPLACER_HPP_ +#include + #include "program.hpp" #include "visitor.hpp" diff --git a/qasmtools/include/qasmtools/ast/semantic.hpp b/qasmtools/include/qasmtools/ast/semantic.hpp index c06b0bd3..2c683576 100644 --- a/qasmtools/include/qasmtools/ast/semantic.hpp +++ b/qasmtools/include/qasmtools/ast/semantic.hpp @@ -32,14 +32,14 @@ #ifndef QASMTOOLS_AST_SEMANTIC_HPP_ #define QASMTOOLS_AST_SEMANTIC_HPP_ -#include "ast.hpp" -#include "visitor.hpp" - #include #include #include #include +#include "ast.hpp" +#include "visitor.hpp" + namespace qasmtools { namespace ast { @@ -227,8 +227,8 @@ class SemanticChecker final : public Visitor { pop_scope(); // Add declaration - set(decl.id(), GateType{(int) decl.c_params().size(), - (int) decl.q_params().size()}); + set(decl.id(), GateType{(int)decl.c_params().size(), + (int)decl.q_params().size()}); } } void visit(OracleDecl& decl) { @@ -237,7 +237,7 @@ class SemanticChecker final : public Visitor { << "\" previously declared\n"; error_ = true; } else { - set(decl.id(), GateType{0, (int) decl.params().size()}); + set(decl.id(), GateType{0, (int)decl.params().size()}); } } void visit(RegisterDecl& decl) { diff --git a/qasmtools/include/qasmtools/ast/stmt.hpp b/qasmtools/include/qasmtools/ast/stmt.hpp index 3532eac9..0b3b93c5 100644 --- a/qasmtools/include/qasmtools/ast/stmt.hpp +++ b/qasmtools/include/qasmtools/ast/stmt.hpp @@ -32,13 +32,13 @@ #ifndef QASMTOOLS_AST_STMT_HPP_ #define QASMTOOLS_AST_STMT_HPP_ +#include +#include + #include "base.hpp" #include "expr.hpp" #include "var.hpp" -#include -#include - namespace qasmtools { namespace ast { diff --git a/qasmtools/include/qasmtools/ast/var.hpp b/qasmtools/include/qasmtools/ast/var.hpp index 9070f659..3f152bdc 100644 --- a/qasmtools/include/qasmtools/ast/var.hpp +++ b/qasmtools/include/qasmtools/ast/var.hpp @@ -32,11 +32,11 @@ #ifndef QASMTOOLS_AST_VAR_HPP_ #define QASMTOOLS_AST_VAR_HPP_ -#include "base.hpp" - #include #include +#include "base.hpp" + namespace qasmtools { namespace ast { diff --git a/qasmtools/include/qasmtools/parser/lexer.hpp b/qasmtools/include/qasmtools/parser/lexer.hpp index 35582429..37158474 100644 --- a/qasmtools/include/qasmtools/parser/lexer.hpp +++ b/qasmtools/include/qasmtools/parser/lexer.hpp @@ -34,11 +34,11 @@ #ifndef QASMTOOLS_PARSER_LEXER_HPP_ #define QASMTOOLS_PARSER_LEXER_HPP_ -#include "token.hpp" - #include #include +#include "token.hpp" + namespace qasmtools { namespace parser { @@ -282,7 +282,7 @@ class Lexer { << "Lexical error at " << tok_start << ": identifiers must start with lowercase letters\n"; return Token(tok_start, Token::Kind::error, - std::string({'C', (char) buf_->get()})); + std::string({'C', (char)buf_->get()})); case 'U': skip_char(); @@ -358,7 +358,7 @@ class Lexer { std::cerr << "Lexical error at " << tok_start << ": expected \"=\" after \"=\"\n"; return Token(tok_start, Token::Kind::error, - std::string({'=', (char) buf_->get()})); + std::string({'=', (char)buf_->get()})); case ',': skip_char(); @@ -371,7 +371,7 @@ class Lexer { default: skip_char(); return Token(tok_start, Token::Kind::error, - std::string({(char) buf_->get()})); + std::string({(char)buf_->get()})); } } }; diff --git a/qasmtools/include/qasmtools/parser/parser.hpp b/qasmtools/include/qasmtools/parser/parser.hpp index fd4a3492..11cbd6c3 100644 --- a/qasmtools/include/qasmtools/parser/parser.hpp +++ b/qasmtools/include/qasmtools/parser/parser.hpp @@ -34,11 +34,11 @@ #ifndef QASMTOOLS_PARSER_PARSER_HPP_ #define QASMTOOLS_PARSER_PARSER_HPP_ +#include + #include "../ast/ast.hpp" #include "preprocessor.hpp" -#include - namespace qasmtools { namespace parser { diff --git a/qasmtools/include/qasmtools/parser/preprocessor.hpp b/qasmtools/include/qasmtools/parser/preprocessor.hpp index f612398c..eac6b07a 100644 --- a/qasmtools/include/qasmtools/parser/preprocessor.hpp +++ b/qasmtools/include/qasmtools/parser/preprocessor.hpp @@ -34,12 +34,12 @@ #ifndef QASMTOOLS_PARSER_PREPROCESSOR_HPP_ #define QASMTOOLS_PARSER_PREPROCESSOR_HPP_ -#include "lexer.hpp" - #include #include #include +#include "lexer.hpp" + namespace qasmtools { namespace parser { diff --git a/qasmtools/include/qasmtools/parser/token.hpp b/qasmtools/include/qasmtools/parser/token.hpp index 6861a314..19504c26 100644 --- a/qasmtools/include/qasmtools/parser/token.hpp +++ b/qasmtools/include/qasmtools/parser/token.hpp @@ -34,11 +34,11 @@ #ifndef QASMTOOLS_PARSER_TOKEN_HPP_ #define QASMTOOLS_PARSER_TOKEN_HPP_ -#include "position.hpp" - #include #include +#include "position.hpp" + namespace qasmtools { namespace parser { diff --git a/qasmtools/include/qasmtools/utils/angle.hpp b/qasmtools/include/qasmtools/utils/angle.hpp index 9cf3d65f..314a8d7e 100644 --- a/qasmtools/include/qasmtools/utils/angle.hpp +++ b/qasmtools/include/qasmtools/utils/angle.hpp @@ -34,14 +34,14 @@ #ifndef QASMTOOLS_UTILS_ANGLE_HPP_ #define QASMTOOLS_UTILS_ANGLE_HPP_ -#include "templates.hpp" - #include #include #include #include #include +#include "templates.hpp" + namespace qasmtools { namespace utils { @@ -104,7 +104,7 @@ class Angle { constexpr double numeric_value() const { if (std::holds_alternative(value_)) { auto frac = std::get(value_); - return ((double) frac.first * pi) / (double) frac.second; + return ((double)frac.first * pi) / (double)frac.second; } else { return std::get(value_); } @@ -154,7 +154,7 @@ class Angle { normalize(); } else { auto a = numeric_value(); - value_ = a * (double) fac; + value_ = a * (double)fac; } return *this; @@ -167,7 +167,7 @@ class Angle { normalize(); } else { auto a = numeric_value(); - value_ = a / (double) div; + value_ = a / (double)div; } return *this; diff --git a/staq/main.cpp b/staq/main.cpp index 8aabf73d..6134aefb 100644 --- a/staq/main.cpp +++ b/staq/main.cpp @@ -24,35 +24,36 @@ * SOFTWARE. */ +#include + +#include + #include "qasmtools/parser/parser.hpp" +#include "transformations/barrier_merge.hpp" #include "transformations/desugar.hpp" +#include "transformations/expression_simplifier.hpp" #include "transformations/inline.hpp" #include "transformations/oracle_synthesizer.hpp" -#include "transformations/barrier_merge.hpp" -#include "transformations/expression_simplifier.hpp" -#include "optimization/simplify.hpp" -#include "optimization/rotation_folding.hpp" #include "optimization/cnot_resynthesis.hpp" +#include "optimization/rotation_folding.hpp" +#include "optimization/simplify.hpp" #include "mapping/device.hpp" #include "mapping/layout/basic.hpp" -#include "mapping/layout/eager.hpp" #include "mapping/layout/bestfit.hpp" -#include "mapping/mapping/swap.hpp" +#include "mapping/layout/eager.hpp" #include "mapping/mapping/steiner.hpp" +#include "mapping/mapping/swap.hpp" -#include "tools/resource_estimator.hpp" #include "tools/qubit_estimator.hpp" +#include "tools/resource_estimator.hpp" +#include "output/cirq.hpp" #include "output/projectq.hpp" #include "output/qsharp.hpp" #include "output/quil.hpp" -#include "output/cirq.hpp" - -#include -#include /** * \brief Compiler passes diff --git a/tools/circ.cpp b/tools/circ.cpp index 7e4265c1..a7ab8544 100644 --- a/tools/circ.cpp +++ b/tools/circ.cpp @@ -24,11 +24,11 @@ * SOFTWARE. */ +#include + +#include "output/cirq.hpp" #include "qasmtools/parser/parser.hpp" #include "transformations/desugar.hpp" -#include "output/cirq.hpp" - -#include int main(int argc, char** argv) { using namespace staq; diff --git a/tools/device_generator.cpp b/tools/device_generator.cpp index 0a8b368c..37702907 100644 --- a/tools/device_generator.cpp +++ b/tools/device_generator.cpp @@ -24,10 +24,11 @@ * SOFTWARE. */ -#include "mapping/device.hpp" #include #include +#include "mapping/device.hpp" + static double FIDELITY_1 = staq::mapping::FIDELITY_1; void write_to_stream(const std::vector>& adj, diff --git a/tools/inliner.cpp b/tools/inliner.cpp index b36d97aa..9d2d07d5 100644 --- a/tools/inliner.cpp +++ b/tools/inliner.cpp @@ -24,11 +24,11 @@ * SOFTWARE. */ +#include + #include "qasmtools/parser/parser.hpp" #include "transformations/inline.hpp" -#include - int main(int argc, char** argv) { using namespace staq; using qasmtools::parser::parse_stdin; diff --git a/tools/lattice_surgery.cpp b/tools/lattice_surgery.cpp index 4d7a3814..2b7dc29a 100644 --- a/tools/lattice_surgery.cpp +++ b/tools/lattice_surgery.cpp @@ -24,11 +24,11 @@ * SOFTWARE. */ -#include "qasmtools/parser/parser.hpp" -#include "output/lattice_surgery.hpp" - #include +#include "output/lattice_surgery.hpp" +#include "qasmtools/parser/parser.hpp" + int main(int argc, char** argv) { using namespace staq; using qasmtools::parser::parse_stdin; diff --git a/tools/mapper.cpp b/tools/mapper.cpp index 663ddb04..9659c468 100644 --- a/tools/mapper.cpp +++ b/tools/mapper.cpp @@ -24,19 +24,19 @@ * SOFTWARE. */ +#include + #include "qasmtools/parser/parser.hpp" -#include "transformations/inline.hpp" -#include "transformations/expression_simplifier.hpp" #include "tools/qubit_estimator.hpp" +#include "transformations/expression_simplifier.hpp" +#include "transformations/inline.hpp" #include "mapping/device.hpp" #include "mapping/layout/basic.hpp" -#include "mapping/layout/eager.hpp" #include "mapping/layout/bestfit.hpp" -#include "mapping/mapping/swap.hpp" +#include "mapping/layout/eager.hpp" #include "mapping/mapping/steiner.hpp" - -#include +#include "mapping/mapping/swap.hpp" // TODO: Find or create a format for reading machine definitions // and have this tool accept a machine definition as input for mapping diff --git a/tools/oracle_synthesizer.cpp b/tools/oracle_synthesizer.cpp index fd6da273..7a17ac57 100644 --- a/tools/oracle_synthesizer.cpp +++ b/tools/oracle_synthesizer.cpp @@ -25,6 +25,7 @@ */ #include "qasmtools/parser/parser.hpp" + #include "transformations/oracle_synthesizer.hpp" int main() { diff --git a/tools/projectq.cpp b/tools/projectq.cpp index 6c753cca..a53a2344 100644 --- a/tools/projectq.cpp +++ b/tools/projectq.cpp @@ -24,11 +24,11 @@ * SOFTWARE. */ +#include + +#include "output/projectq.hpp" #include "qasmtools/parser/parser.hpp" #include "transformations/desugar.hpp" -#include "output/projectq.hpp" - -#include int main(int argc, char** argv) { using namespace staq; diff --git a/tools/qsharp.cpp b/tools/qsharp.cpp index 204c1dc7..3f1922b3 100644 --- a/tools/qsharp.cpp +++ b/tools/qsharp.cpp @@ -24,11 +24,11 @@ * SOFTWARE. */ +#include + +#include "output/qsharp.hpp" #include "qasmtools/parser/parser.hpp" #include "transformations/desugar.hpp" -#include "output/qsharp.hpp" - -#include int main(int argc, char** argv) { using namespace staq; diff --git a/tools/quil.cpp b/tools/quil.cpp index f393d88d..dd28e66e 100644 --- a/tools/quil.cpp +++ b/tools/quil.cpp @@ -24,11 +24,11 @@ * SOFTWARE. */ +#include + +#include "output/quil.hpp" #include "qasmtools/parser/parser.hpp" #include "transformations/desugar.hpp" -#include "output/quil.hpp" - -#include int main(int argc, char** argv) { using namespace staq; diff --git a/tools/resource_estimator.cpp b/tools/resource_estimator.cpp index e7672d59..91076b09 100644 --- a/tools/resource_estimator.cpp +++ b/tools/resource_estimator.cpp @@ -24,11 +24,11 @@ * SOFTWARE. */ -#include "qasmtools/parser/parser.hpp" -#include "tools/resource_estimator.hpp" - #include +#include "tools/resource_estimator.hpp" +#include "qasmtools/parser/parser.hpp" + int main(int argc, char** argv) { using namespace staq; using namespace qasmtools; diff --git a/tools/rotation_optimizer.cpp b/tools/rotation_optimizer.cpp index aa46dac1..13471aff 100644 --- a/tools/rotation_optimizer.cpp +++ b/tools/rotation_optimizer.cpp @@ -24,11 +24,11 @@ * SOFTWARE. */ -#include "qasmtools/parser/parser.hpp" -#include "optimization/rotation_folding.hpp" - #include +#include "optimization/rotation_folding.hpp" +#include "qasmtools/parser/parser.hpp" + int main(int argc, char** argv) { using namespace staq; using qasmtools::parser::parse_stdin; diff --git a/tools/simplifier.cpp b/tools/simplifier.cpp index e2687b39..a3e281af 100644 --- a/tools/simplifier.cpp +++ b/tools/simplifier.cpp @@ -24,12 +24,12 @@ * SOFTWARE. */ -#include "qasmtools/parser/parser.hpp" +#include + #include "optimization/simplify.hpp" +#include "qasmtools/parser/parser.hpp" #include "transformations/expression_simplifier.hpp" -#include - int main(int argc, char** argv) { using namespace staq; using qasmtools::parser::parse_stdin; diff --git a/unit_tests/tests/gates/channel.cpp b/unit_tests/tests/gates/channel.cpp index 9a3206fb..77f80efa 100644 --- a/unit_tests/tests/gates/channel.cpp +++ b/unit_tests/tests/gates/channel.cpp @@ -1,4 +1,5 @@ #include "gtest/gtest.h" + #include "gates/channel.hpp" using namespace staq; diff --git a/unit_tests/tests/mapping/device.cpp b/unit_tests/tests/mapping/device.cpp index 731322c1..49337cb0 100644 --- a/unit_tests/tests/mapping/device.cpp +++ b/unit_tests/tests/mapping/device.cpp @@ -1,6 +1,8 @@ +#include + #include "gtest/gtest.h" + #include "mapping/device.hpp" -#include using namespace staq; diff --git a/unit_tests/tests/mapping/layout.cpp b/unit_tests/tests/mapping/layout.cpp index 2aec32a9..11d3afb1 100644 --- a/unit_tests/tests/mapping/layout.cpp +++ b/unit_tests/tests/mapping/layout.cpp @@ -1,10 +1,11 @@ #include "gtest/gtest.h" + #include "qasmtools/parser/parser.hpp" -#include "mapping/device.hpp" +#include "mapping/device.hpp" #include "mapping/layout/basic.hpp" -#include "mapping/layout/eager.hpp" #include "mapping/layout/bestfit.hpp" +#include "mapping/layout/eager.hpp" using namespace staq; using namespace qasmtools; diff --git a/unit_tests/tests/mapping/mapping.cpp b/unit_tests/tests/mapping/mapping.cpp index 74817a62..bd2a7798 100644 --- a/unit_tests/tests/mapping/mapping.cpp +++ b/unit_tests/tests/mapping/mapping.cpp @@ -1,9 +1,12 @@ #include "gtest/gtest.h" + #include "qasmtools/parser/parser.hpp" -#include "mapping/device.hpp" +// clang-format off +#include "mapping/device.hpp" #include "mapping/mapping/swap.hpp" #include "mapping/mapping/steiner.hpp" +// clang-format on using namespace staq; using namespace qasmtools; diff --git a/unit_tests/tests/optimization/cnot_resynthesis.cpp b/unit_tests/tests/optimization/cnot_resynthesis.cpp index f8d105d8..8b3bd30a 100644 --- a/unit_tests/tests/optimization/cnot_resynthesis.cpp +++ b/unit_tests/tests/optimization/cnot_resynthesis.cpp @@ -1,5 +1,7 @@ #include "gtest/gtest.h" + #include "qasmtools/parser/parser.hpp" + #include "optimization/cnot_resynthesis.hpp" using namespace staq; diff --git a/unit_tests/tests/optimization/rotation_folding.cpp b/unit_tests/tests/optimization/rotation_folding.cpp index 290504d7..fac49139 100644 --- a/unit_tests/tests/optimization/rotation_folding.cpp +++ b/unit_tests/tests/optimization/rotation_folding.cpp @@ -1,5 +1,7 @@ #include "gtest/gtest.h" + #include "qasmtools/parser/parser.hpp" + #include "optimization/rotation_folding.hpp" using namespace staq; diff --git a/unit_tests/tests/optimization/simplify.cpp b/unit_tests/tests/optimization/simplify.cpp index 0df2b3b6..67ddfe9d 100644 --- a/unit_tests/tests/optimization/simplify.cpp +++ b/unit_tests/tests/optimization/simplify.cpp @@ -1,5 +1,7 @@ #include "gtest/gtest.h" + #include "qasmtools/parser/parser.hpp" + #include "optimization/simplify.hpp" using namespace staq; diff --git a/unit_tests/tests/synthesis/cnot_dihedral.cpp b/unit_tests/tests/synthesis/cnot_dihedral.cpp index b4d1a905..c2f5a9f8 100644 --- a/unit_tests/tests/synthesis/cnot_dihedral.cpp +++ b/unit_tests/tests/synthesis/cnot_dihedral.cpp @@ -1,8 +1,10 @@ #include "gtest/gtest.h" -#include "mapping/device.hpp" -#include "synthesis/cnot_dihedral.hpp" -#include "qasmtools/utils/templates.hpp" + #include "qasmtools/ast/expr.hpp" +#include "qasmtools/utils/templates.hpp" + +#include "synthesis/cnot_dihedral.hpp" +#include "mapping/device.hpp" using namespace staq; using namespace qasmtools::utils; diff --git a/unit_tests/tests/synthesis/linear_reversible.cpp b/unit_tests/tests/synthesis/linear_reversible.cpp index 58290e9b..76b4b33f 100644 --- a/unit_tests/tests/synthesis/linear_reversible.cpp +++ b/unit_tests/tests/synthesis/linear_reversible.cpp @@ -1,6 +1,7 @@ #include "gtest/gtest.h" -#include "mapping/device.hpp" + #include "synthesis/linear_reversible.hpp" +#include "mapping/device.hpp" using namespace staq; using circuit = std::list>; diff --git a/unit_tests/tests/transformations/barrier_merge.cpp b/unit_tests/tests/transformations/barrier_merge.cpp index dbc9dee1..0017db1f 100644 --- a/unit_tests/tests/transformations/barrier_merge.cpp +++ b/unit_tests/tests/transformations/barrier_merge.cpp @@ -1,5 +1,7 @@ #include "gtest/gtest.h" + #include "qasmtools/parser/parser.hpp" + #include "transformations/barrier_merge.hpp" using namespace staq; diff --git a/unit_tests/tests/transformations/desugar.cpp b/unit_tests/tests/transformations/desugar.cpp index 0c9cd8b6..51d1cc54 100644 --- a/unit_tests/tests/transformations/desugar.cpp +++ b/unit_tests/tests/transformations/desugar.cpp @@ -1,5 +1,7 @@ #include "gtest/gtest.h" + #include "qasmtools/parser/parser.hpp" + #include "transformations/desugar.hpp" #include "transformations/barrier_merge.hpp" diff --git a/unit_tests/tests/transformations/expression_simplifier.cpp b/unit_tests/tests/transformations/expression_simplifier.cpp index 1c32bda2..7f9d5330 100644 --- a/unit_tests/tests/transformations/expression_simplifier.cpp +++ b/unit_tests/tests/transformations/expression_simplifier.cpp @@ -1,5 +1,7 @@ #include "gtest/gtest.h" + #include "qasmtools/parser/parser.hpp" + #include "transformations/expression_simplifier.hpp" using namespace staq; diff --git a/unit_tests/tests/transformations/inline.cpp b/unit_tests/tests/transformations/inline.cpp index a82a49ec..46606814 100644 --- a/unit_tests/tests/transformations/inline.cpp +++ b/unit_tests/tests/transformations/inline.cpp @@ -1,5 +1,7 @@ #include "gtest/gtest.h" + #include "qasmtools/parser/parser.hpp" + #include "transformations/inline.hpp" using namespace staq;