diff --git a/.github/workflows/build-without-conan.yml b/.github/workflows/build-without-conan.yml index 74b7583095..f6a6ac5492 100644 --- a/.github/workflows/build-without-conan.yml +++ b/.github/workflows/build-without-conan.yml @@ -40,10 +40,9 @@ jobs: - name: Install symengine run: | cd ${TMP_DIR} - wget https://github.com/symengine/symengine/archive/refs/tags/v0.14.0.tar.gz - tar xzvf v0.14.0.tar.gz - cd symengine-0.14.0/ - sed -i -e 's/cmake_minimum_required(VERSION 2.8.12)/cmake_minimum_required(VERSION 3.5)/g' cmake/SymEngineConfig.cmake.in + wget https://github.com/symengine/symengine/archive/refs/tags/v0.15.0.tar.gz + tar xzvf v0.15.0.tar.gz + cd symengine-0.15.0/ mkdir build cd build cmake -GNinja -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DBUILD_TESTS=OFF -DBUILD_BENCHMARKS=OFF -DWITH_SYMENGINE_THREAD_SAFE=ON .. diff --git a/TKET_VERSION b/TKET_VERSION index 613f02ec35..3611216b5f 100644 --- a/TKET_VERSION +++ b/TKET_VERSION @@ -1 +1 @@ -2.1.96 +2.1.97 diff --git a/build-without-conan.md b/build-without-conan.md index d6bdc962a7..12517b9938 100644 --- a/build-without-conan.md +++ b/build-without-conan.md @@ -48,10 +48,9 @@ make install ``` cd ${TMP_DIR} -wget https://github.com/symengine/symengine/archive/refs/tags/v0.14.0.tar.gz -tar xzvf v0.14.0.tar.gz -cd symengine-0.14.0/ -sed -i -e 's/cmake_minimum_required(VERSION 2.8.12)/cmake_minimum_required(VERSION 3.5)/g' cmake/SymEngineConfig.cmake.in +wget https://github.com/symengine/symengine/archive/refs/tags/v0.15.0.tar.gz +tar xzvf v0.15.0.tar.gz +cd symengine-0.15.0/ mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DBUILD_TESTS=OFF -DBUILD_BENCHMARKS=OFF -DWITH_SYMENGINE_THREAD_SAFE=ON .. diff --git a/pytket/conanfile.py b/pytket/conanfile.py index 72f6ef47f7..6e70aa539d 100644 --- a/pytket/conanfile.py +++ b/pytket/conanfile.py @@ -53,7 +53,7 @@ def requirements(self): self.requires("gmp/tci-6.3.0@tket/stable") self.requires("nlohmann_json/3.12.0") self.requires("nanobind/tci-3.0.0@tket/stable") - self.requires("symengine/tci-0.14.0.3@tket/stable") + self.requires("symengine/tci-0.15.0@tket/stable") self.requires("tkassert/0.3.6@tket/stable") self.requires(f"tket/{tket_version}@tket/stable") self.requires("tklog/0.3.5@tket/stable") diff --git a/tket/conanfile.py b/tket/conanfile.py index e6a2923435..7247d804e3 100644 --- a/tket/conanfile.py +++ b/tket/conanfile.py @@ -143,7 +143,7 @@ def requirements(self): self.requires("boost/tci-1.91.0@tket/stable", transitive_headers=True) self.requires("eigen/5.0.1", transitive_headers=True) self.requires("nlohmann_json/3.12.0", transitive_headers=True) - self.requires("symengine/tci-0.14.0.3@tket/stable", transitive_headers=True) + self.requires("symengine/tci-0.15.0@tket/stable", transitive_headers=True) self.requires("tkassert/0.3.6@tket/stable", transitive_headers=True) self.requires("tklog/0.3.5@tket/stable") self.requires("tkrng/0.3.5@tket/stable") diff --git a/tket/src/Gate/Rotation.cpp b/tket/src/Gate/Rotation.cpp index 461418ea5e..62e24edb6a 100644 --- a/tket/src/Gate/Rotation.cpp +++ b/tket/src/Gate/Rotation.cpp @@ -142,6 +142,11 @@ static std::tuple xyx_angles_from_coeffs( // 2 * atan2(B, A). // Finally, note that u must be well-defined because we have already dealt // with all cases where s = 0. + // + // NOTE: Although the above symengine issue is fixed as of version 0.15.0, we + // retain the "workaround" since it gives better simplifications: symengine is + // not good at evaluating expressions combining sign and trig functions (e.g. + // "sign(cos(pi/4))". TKET_ASSERT(!s_zero); if (approx_0(SymEngine::expand(i * j + s * k))) { Expr u = expr_div(i, s);