Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3.4 #71

Merged
merged 3 commits into from
Dec 1, 2023
Merged

V3.4 #71

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pre-release
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
addition to the binaries
Expand All @@ -7,7 +7,7 @@ Pre-release
- Added standalone source code example (requires staq's source installation)
in the ["examples/standalone"] directory

Version 3.3
Version 3.3 - 6 October 2023
- Implemented the grid synth rotation synthesizer algorithm
https://arxiv.org/abs/1403.2975, enabled only when the GNU MP library is
detected. When enabled, the build will include `staq_grid_synth` and
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.3)
set(STAQ_VERSION_NUM 3.4)
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.3
PROJECT_NUMBER = v3.4

# 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# staq

## Version 3.3 - 6 October 2023
## Version 3.4 - 1 December 2023

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

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Version 3.3 - 6 October 2023
Version 3.4 - 1 December 2023
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN apt-get update && \
dpkg-reconfigure -f noninteractive tzdata

RUN apt-get install -y build-essential python3.10 python3-pip python3-dev \
cmake sudo git vim
cmake sudo git vim libgmp-dev

# Install pystaq
RUN pip3 -q install pip --upgrade
Expand Down
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ docker run -p8889:8889 -it --workdir=/home/sq/notebooks softwareq-staq sh -c "ju
---

In case you want to use the Docker container as a development environment, mount
your directory (in this case the current directory) in a Docker container with
your directory (in this example the current directory) in a Docker container with

```shell
docker run --rm -it --workdir=/home/sq/hostdir -v ${PWD}:/home/sq/hostdir softwareq-staq /bin/bash
Expand Down
2 changes: 1 addition & 1 deletion include/grid_synth/gmp_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ inline mpf_class exp(const mpf_class& x) {
mpf_class s = 1;
mpf_class term = x;
// Use Taylor's remainder theorem bound on error
while (gmp_abs(term*s) > eps) {
while (gmp_abs(term * s) > eps) {
s += term;
i += 1;
term *= x;
Expand Down
3 changes: 2 additions & 1 deletion include/output/ionq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ class IonQOutputter final : public ast::Visitor {
// TODO: assert that this is a rotation gate
// TODO: Handle multiples of pi nicely
os_ << prefix_ << "\"angle\": " << std::fixed
<< gate.carg(0).constant_eval().value() / qasmtools::utils::pi << ",\n";
<< gate.carg(0).constant_eval().value() / qasmtools::utils::pi
<< ",\n";
}

os_ << prefix_ << "\"gate\": \"" << name << "\"\n"; // no comma
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.3"
version = "3.4"
description = "Python 3 wrapper for staq"
authors = [
{ name = "softwareQ Inc.", email = "[email protected]" },
Expand Down
14 changes: 7 additions & 7 deletions qasmtools/include/qasmtools/parser/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class Parser {
int bits_ = 0; ///< number of bits
int qubits_ = 0; ///< number of qubits
#ifdef EXPR_GMP
bool use_gmp_ = false; ///< whether to use gmp to parse reals
#endif /* EXPR_GMP */
bool use_gmp_ = false; ///< whether to use gmp to parse reals
#endif /* EXPR_GMP */

public:
/**
Expand All @@ -81,9 +81,9 @@ class Parser {
* \param pp_lexer The preprocessed lexer stream to be parsed
*/
#ifdef EXPR_GMP
Parser(Preprocessor& pp_lexer, bool use_gmp=false)
Parser(Preprocessor& pp_lexer, bool use_gmp = false)
: pp_lexer_(pp_lexer), current_token_(pp_lexer_.next_token()),
use_gmp_(use_gmp) {}
use_gmp_(use_gmp) {}
#else
Parser(Preprocessor& pp_lexer)
: pp_lexer_(pp_lexer), current_token_(pp_lexer_.next_token()) {}
Expand Down Expand Up @@ -747,11 +747,11 @@ class Parser {
case Token::Kind::real: {
auto real = current_token_;
consume_token();
#ifdef EXPR_GMP
#ifdef EXPR_GMP
if (use_gmp_) {
return ast::RealExpr::create(pos, mpf_class(real.raw()));
}
#endif /* EXPR_GMP */
#endif /* EXPR_GMP */
return ast::RealExpr::create(pos, real.as_real());
}

Expand Down Expand Up @@ -1029,7 +1029,7 @@ inline ast::ptr<ast::Program> parse_file(std::string fname) {
/**
* \brief Parse input from stdin
*/
inline ast::ptr<ast::Program> parse_stdin(std::string name = "",
inline ast::ptr<ast::Program> parse_stdin(std::string name = "",
bool use_gmp = false) {
Preprocessor pp;
#ifdef EXPR_GMP
Expand Down
3 changes: 1 addition & 2 deletions src/tools/grid_synth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ int main(int argc, char** argv) {
std::cerr << "Invalid angle provided: " << angle << std::endl;
return EXIT_FAILURE;
}
str_t op_str =
synthesizer.get_op_str(gmp_angle * gmpf::gmp_pi());
str_t op_str = synthesizer.get_op_str(gmp_angle * gmpf::gmp_pi());
for (char c : op_str) {
std::cout << c << ' ';
}
Expand Down