Skip to content

Commit

Permalink
Version 3.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vsoftco committed Jun 5, 2023
1 parent 9141eb1 commit b85aa14
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 90 deletions.
76 changes: 8 additions & 68 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,70 +1,10 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: true
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BreakBeforeBinaryOperators: false
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
BinPackParameters: true
BinPackArguments: true
ColumnLimit: 80
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
DerivePointerAlignment: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
IndentWrappedFunctionNames: false
IndentFunctionDeclarationAfterType: false
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: true
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
Language: Cpp
ColumnLimit: 80
Standard: c++17
IndentWidth: 4
TabWidth: 4
UseTab: Never
PointerAlignment: Left
SpacesBeforeTrailingComments: 1
Standard: Cpp11
IndentWidth: 4
TabWidth: 4
#UseTab: ForIndentation
UseTab: Never
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterCStyleCast: true
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
CommentPragmas: '^ IWYU pragma:'
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
SpaceBeforeParens: ControlStatements
DisableFormat: false
SortIncludes: false
...
IndentCaseLabels: true
AlwaysBreakTemplateDeclarations: Yes
3 changes: 2 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Pre-release
Version 3.2.1
- This is a maintenance release
- CMake dependent flag name changes
USE_OPENQASM2_SPECS -> QASMTOOLS_QASM2_SPECS

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.15)
set(STAQ_VERSION_NUM 3.2)
set(STAQ_VERSION_NUM 3.2.1)
set(STAQ_VERSION_STR "${STAQ_VERSION_NUM}")
project(staq VERSION ${STAQ_VERSION_NUM} LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.2
PROJECT_NUMBER = v3.2.1

# 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
Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# staq

## Version 3.2 - 26 May 2023
## Version 3.2.1 - 5 June 2023

[![GitHub actions](https://github.com/softwareqinc/staq/actions/workflows/cmake.yml/badge.svg)](https://github.com/softwareQinc/staq/actions)

Expand All @@ -9,11 +9,11 @@
## About

**staq** is a modern C++ library for the synthesis, transformation,
optimization and compilation of quantum circuits.
**staq** is written in standard C++17 and has very low external dependencies.
It is usable either through the provided binary tools, or as a header-only
library that can be included to provide direct support for
parsing & manipulating circuits written in the
optimization and compilation of quantum circuits.
**staq** is written in standard C++17 and has very low external dependencies.
It is usable either through the provided binary tools, or as a header-only
library that can be included to provide direct support for
parsing & manipulating circuits written in the
[OpenQASM](https://github.com/openqasm/openqasm) circuit description language.

Inspired by Clang, **staq** is designed to manipulate OpenQASM syntax trees
Expand All @@ -35,18 +35,21 @@ Copyright (c) 2013 - 2023 softwareQ Inc. All rights reserved.
## License

**staq** is distributed under the MIT license. Please see the
[`LICENSE`](https://github.com/softwareQinc/staq/blob/main/LICENSE) file for more details.
[`LICENSE`](https://github.com/softwareQinc/staq/blob/main/LICENSE) file for
more details.

---

## Installation instructions

Please see the installation guide
[`INSTALL.md`](https://github.com/softwareQinc/staq/blob/main/INSTALL.md) and the
[`INSTALL.md`](https://github.com/softwareQinc/staq/blob/main/INSTALL.md) and
the
comprehensive [Wiki](https://github.com/softwareQinc/staq/wiki) for further
documentation and detailed examples.

## Python 3 wrapper

[pystaq](https://github.com/softwareQinc/staq/blob/main/pystaq/) is a Python 3
wrapper for **staq**. pystaq can be installed using `pip`

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Version 3.2 - 26 May 2023
Version 3.2.1 - 5 June 2023
6 changes: 3 additions & 3 deletions include/synthesis/cnot_dihedral.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static std::list<cx_dihedral> gray_synth(std::list<phase_term>& f,

for (std::size_t ctrl = 0; ctrl < vec.size(); ctrl++) {
if (ctrl != tgt && vec[ctrl]) {
ret.emplace_back(std::make_pair((int) ctrl, (int) tgt));
ret.emplace_back(std::make_pair((int)ctrl, (int)tgt));

// Adjust remaining vectors & output function
adjust_vectors(static_cast<int>(ctrl),
Expand Down Expand Up @@ -265,7 +265,7 @@ static std::list<cx_dihedral> gray_steiner(std::list<phase_term>& f,
for (auto it = s_tree.begin(); it != s_tree.end(); it++) {
if (vec[it->second] == 0) {
ret.emplace_back(
std::make_pair((int) (it->second), (int) (it->first)));
std::make_pair((int)(it->second), (int)(it->first)));
adjust_vectors(it->second, it->first, stack);
for (std::size_t i = 0; i < A.size(); i++) {
A[i][it->second] = A[i][it->second] ^ A[i][it->first];
Expand All @@ -276,7 +276,7 @@ static std::list<cx_dihedral> gray_steiner(std::list<phase_term>& f,
// Zero out each row except for the root
for (auto it = s_tree.rbegin(); it != s_tree.rend(); it++) {
ret.emplace_back(
std::make_pair((int) (it->second), (int) (it->first)));
std::make_pair((int)(it->second), (int)(it->first)));
adjust_vectors(it->second, it->first, stack);
for (std::size_t i = 0; i < A.size(); i++) {
A[i][it->second] = A[i][it->second] ^ A[i][it->first];
Expand Down
4 changes: 2 additions & 2 deletions include/transformations/expression_simplifier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class ExprSimplifier final : public ast::Visitor {
bool is_zero() const { return n_ == 0; }
int numerator() const { return n_; }
int denominator() const { return d_; }
double value() const { return (double) n_ / (double) d_; }
double value() const { return (double)n_ / (double)d_; }

Rational operator-() const { return Rational(-n_, d_); }

Expand Down Expand Up @@ -549,7 +549,7 @@ class ExprSimplifier final : public ast::Visitor {

void visit(ast::IntExpr& expr) {
if (evaluate_all) {
temp_value = (double) expr.value();
temp_value = (double)expr.value();
} else {
temp_value = LinearPiExpr(0, expr.value());
}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pystaq"
version = "3.2"
version = "3.2.1"
description = "Python 3 wrapper for staq"
authors = [
{name = "softwareQ Inc.", email = "info@softwareq.ca"},
Expand Down
2 changes: 1 addition & 1 deletion tools/resource_estimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

#include <CLI/CLI.hpp>

#include "tools/resource_estimator.hpp"
#include "qasmtools/parser/parser.hpp"
#include "tools/resource_estimator.hpp"

int main(int argc, char** argv) {
using namespace staq;
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/tests/synthesis/cnot_dihedral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include "qasmtools/ast/expr.hpp"
#include "qasmtools/utils/templates.hpp"

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

using namespace staq;
using namespace qasmtools::utils;
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/tests/synthesis/linear_reversible.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "gtest/gtest.h"

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

using namespace staq;
using circuit = std::list<std::pair<int, int>>;
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/tests/transformations/desugar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include "qasmtools/parser/parser.hpp"

#include "transformations/desugar.hpp"
#include "transformations/barrier_merge.hpp"
#include "transformations/desugar.hpp"

using namespace staq;
using namespace qasmtools;
Expand Down

0 comments on commit b85aa14

Please sign in to comment.