Skip to content

Commit

Permalink
code reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
vsoftco committed Dec 14, 2023
1 parent 4226026 commit 74f6348
Show file tree
Hide file tree
Showing 95 changed files with 245 additions and 232 deletions.
8 changes: 8 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Pre-release
- All header files are moved into "[include/staq]", so to include staq
headers one now must #include "staq/<header>.hpp". This change was made
for the sake of making the include statements look "uniform" in both
non-installed (compiling without having staq installed) and installed
(compiling with staq installed headers) modes.

Version 3.4 - 1 December 2023
- When configuring staq with `cmake -B build -DINSTALL_SOURCES=ON`,
`cmake --build build --target install` now installs staq's source code in
Expand All @@ -6,6 +13,7 @@ Version 3.4 - 1 December 2023
- Moved ["qpu_specs"] and ["scripts"] directories to ["misc"]
- Added standalone source code example (requires staq's source installation)
in the ["examples/standalone"] directory
- Added "staq_ionq" OpenQASM2 -> IonQ transpiler

Version 3.3 - 6 October 2023
- Implemented the grid synth rotation synthesizer algorithm
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ target_compile_definitions(libstaq INTERFACE -DSTAQ_VERSION_NUM=${STAQ_VERSION_N
target_compile_definitions(libstaq INTERFACE -DSTAQ_VERSION_STR="${STAQ_VERSION_STR}")
target_include_directories(libstaq INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
$<INSTALL_INTERFACE:include/>)
$<INSTALL_INTERFACE:include/staq>)
#### qasmtools library
target_include_directories(libstaq INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/qasmtools/include/>
$<INSTALL_INTERFACE:include/staq/>)
$<INSTALL_INTERFACE:include/>)
#### 3rd party libs
target_include_directories(libstaq INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libs>
Expand Down
27 changes: 2 additions & 25 deletions examples/standalone/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
/*
* This file is part of staq.
*
* Copyright (c) 2019 - 2023 softwareQ Inc. All rights reserved.
*
* MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Standalone example, assumes staq is installed in a system-wide visible
// directory

#include <sstream>

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include <gmpxx.h>

#include "gmp_functions.hpp"
#include "staq/grid_synth/gmp_functions.hpp"

namespace staq {
namespace grid_synth {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
#include <cmath>
#include <iostream>

#include "complex.hpp"
#include "gmp_functions.hpp"
#include "types.hpp"
#include "staq/grid_synth/complex.hpp"
#include "staq/grid_synth/gmp_functions.hpp"
#include "staq/grid_synth/types.hpp"

namespace staq {
namespace grid_synth {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
#include <cstdlib>
#include <random>

#include "constants.hpp"
#include "random_numbers.hpp"
#include "rings.hpp"
#include "types.hpp"
#include "staq/grid_synth/constants.hpp"
#include "staq/grid_synth/random_numbers.hpp"
#include "staq/grid_synth/rings.hpp"
#include "staq/grid_synth/types.hpp"

namespace staq {
namespace grid_synth {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

#include <cstdlib>

#include "matrix.hpp"
#include "types.hpp"
#include "staq/grid_synth/matrix.hpp"
#include "staq/grid_synth/types.hpp"

namespace staq {
namespace grid_synth {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include <gmpxx.h>

#include "utils.hpp"
#include "staq/grid_synth/utils.hpp"

namespace staq {
namespace gmpf {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
#include <stdexcept>
#include <string>

#include "constants.hpp"
#include "rings.hpp"
#include "types.hpp"
#include "staq/grid_synth/constants.hpp"
#include "staq/grid_synth/rings.hpp"
#include "staq/grid_synth/types.hpp"

namespace staq {
namespace grid_synth {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
#include <string>
#include <vector>

#include "constants.hpp"
#include "gmp_functions.hpp"
#include "regions.hpp"
#include "rings.hpp"
#include "states.hpp"
#include "staq/grid_synth/constants.hpp"
#include "staq/grid_synth/gmp_functions.hpp"
#include "staq/grid_synth/regions.hpp"
#include "staq/grid_synth/rings.hpp"
#include "staq/grid_synth/states.hpp"

namespace staq {
namespace grid_synth {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
#ifndef GRID_SYNTH_GRID_SYNTH_HPP_
#define GRID_SYNTH_GRID_SYNTH_HPP_

#include "exact_synthesis.hpp"
#include "matrix.hpp"
#include "rz_approximation.hpp"
#include "s3_table.hpp"
#include "types.hpp"
#include "staq/grid_synth/exact_synthesis.hpp"
#include "staq/grid_synth/matrix.hpp"
#include "staq/grid_synth/rz_approximation.hpp"
#include "staq/grid_synth/s3_table.hpp"
#include "staq/grid_synth/types.hpp"

namespace staq {
namespace grid_synth {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <unordered_map>
#include <vector>

#include "rings.hpp"
#include "staq/grid_synth/rings.hpp"

namespace staq {
namespace grid_synth {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@

#include <gmpxx.h>

#include "constants.hpp"
#include "gmp_functions.hpp"
#include "grid_operators.hpp"
#include "rings.hpp"
#include "utils.hpp"
#include "staq/grid_synth/constants.hpp"
#include "staq/grid_synth/gmp_functions.hpp"
#include "staq/grid_synth/grid_operators.hpp"
#include "staq/grid_synth/rings.hpp"
#include "staq/grid_synth/utils.hpp"

namespace staq {
namespace grid_synth {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
#include <string>
#include <vector>

#include "constants.hpp"
#include "gmp_functions.hpp"
#include "types.hpp"
#include "staq/grid_synth/constants.hpp"
#include "staq/grid_synth/gmp_functions.hpp"
#include "staq/grid_synth/types.hpp"

namespace staq {
namespace grid_synth {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@

#include <gmpxx.h>

#include "diophantine_solver.hpp"
#include "gmp_functions.hpp"
#include "grid_operators.hpp"
#include "grid_solvers.hpp"
#include "matrix.hpp"
#include "regions.hpp"
#include "rings.hpp"
#include "staq/grid_synth/diophantine_solver.hpp"
#include "staq/grid_synth/gmp_functions.hpp"
#include "staq/grid_synth/grid_operators.hpp"
#include "staq/grid_synth/grid_solvers.hpp"
#include "staq/grid_synth/matrix.hpp"
#include "staq/grid_synth/regions.hpp"
#include "staq/grid_synth/rings.hpp"

namespace staq {
namespace grid_synth {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

#include <string>

#include "matrix.hpp"
#include "rings.hpp"
#include "staq/grid_synth/matrix.hpp"
#include "staq/grid_synth/rings.hpp"

namespace staq {
namespace grid_synth {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@

#include <gmpxx.h>

#include "gmp_functions.hpp"
#include "grid_operators.hpp"
#include "regions.hpp"
#include "rings.hpp"
#include "staq/grid_synth/gmp_functions.hpp"
#include "staq/grid_synth/grid_operators.hpp"
#include "staq/grid_synth/regions.hpp"
#include "staq/grid_synth/rings.hpp"

namespace staq {
namespace grid_synth {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@

#include <gmpxx.h>

#include "complex.hpp"
#include "mat_vec_2x2.hpp"
#include "staq/grid_synth/complex.hpp"
#include "staq/grid_synth/mat_vec_2x2.hpp"

namespace staq {
namespace grid_synth {

using int_t = mpz_class;
using real_t = mpf_class;
using cplx_t = complex<real_t>;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@
#include <cstddef>
#include <unordered_map>

#include "mapping/device.hpp"
#include "qasmtools/ast/replacer.hpp"
#include "qasmtools/ast/traversal.hpp"
#include "transformations/substitution.hpp"

#include "staq/mapping/device.hpp"
#include "staq/transformations/substitution.hpp"

namespace staq {
namespace mapping {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@

#include <map>

#include "mapping/device.hpp"
#include "qasmtools/ast/traversal.hpp"

#include "staq/mapping/device.hpp"

namespace staq {
namespace mapping {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
#include <set>
#include <vector>

#include "mapping/device.hpp"
#include "qasmtools/ast/traversal.hpp"

#include "staq/mapping/device.hpp"

namespace staq {
namespace mapping {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@

#include <vector>

#include "mapping/device.hpp"
#include "qasmtools/ast/traversal.hpp"
#include "qasmtools/utils/templates.hpp"
#include "synthesis/cnot_dihedral.hpp"
#include "synthesis/linear_reversible.hpp"

#include "staq/mapping/device.hpp"
#include "staq/synthesis/cnot_dihedral.hpp"
#include "staq/synthesis/linear_reversible.hpp"

namespace staq {
namespace mapping {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@

#include <map>

#include "mapping/device.hpp"
#include "qasmtools/ast/replacer.hpp"
#include "transformations/substitution.hpp"

#include "staq/mapping/device.hpp"
#include "staq/transformations/substitution.hpp"

// TODO: figure out what to do with if statements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@

#include "qasmtools/ast/replacer.hpp"
#include "qasmtools/ast/visitor.hpp"
#include "synthesis/cnot_dihedral.hpp"

#include "staq/synthesis/cnot_dihedral.hpp"

namespace staq {
namespace optimization {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@
#include <sstream>
#include <unordered_map>

#include "gates/channel.hpp"
#include "qasmtools/ast/replacer.hpp"
#include "qasmtools/ast/visitor.hpp"

#include "staq/gates/channel.hpp"

namespace staq {
namespace optimization {

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@

#include "qasmtools/ast/ast.hpp"
#include "qasmtools/utils/angle.hpp"
#include "transformations/desugar.hpp"
#include "transformations/inline.hpp"

#include "staq/transformations/desugar.hpp"
#include "staq/transformations/inline.hpp"

namespace staq::output {

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
#include <variant>
#include <vector>

#include "mapping/device.hpp"
#include "qasmtools/ast/expr.hpp"
#include "synthesis/linear_reversible.hpp"

#include "staq/mapping/device.hpp"
#include "staq/synthesis/linear_reversible.hpp"

namespace staq {
namespace synthesis {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <list>
#include <vector>

#include "mapping/device.hpp"
#include "staq/mapping/device.hpp"

namespace staq {
namespace synthesis {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 74f6348

Please sign in to comment.