Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
1efb481
chore: major cleaning + init separating binding modules
ludmilaasb Jan 9, 2026
9c531ed
devops: added devcontainer
ludmilaasb Jan 12, 2026
b705379
devops: building symengine in container
ludmilaasb Jan 12, 2026
e940b80
Merge branch 'main' into refact/reorganize-modules
ludmilaasb Jan 12, 2026
4bf2de3
chore: getting rid of conan
ludmilaasb Jan 12, 2026
f21695f
fix: fix input for binding function
ludmilaasb Jan 12, 2026
dba5173
chore: added init file
ludmilaasb Jan 12, 2026
5c4f078
chore(devcontainer): very minimal, from-source install of symengine
robertodr Jan 13, 2026
509a602
chore: changed cmake variables and binding names
ludmilaasb Jan 13, 2026
8596038
chore: import from binding to python module
ludmilaasb Jan 13, 2026
76d6a67
chore: more cmake changes
ludmilaasb Jan 13, 2026
303dbb1
chore: namefix
ludmilaasb Jan 13, 2026
19fa6a7
chore: add git_archival for cmake build
ludmilaasb Jan 13, 2026
47975ba
fix: solved the linking problem with symengine
ludmilaasb Jan 14, 2026
9f49273
chore: fixed binding namespace
ludmilaasb Jan 14, 2026
ed69731
Merge branch 'main' into refact/reorganize-modules
ludmilaasb Jan 15, 2026
f4812f1
chore: reorganize header files
ludmilaasb Feb 9, 2026
9983221
chore: fix stringification for QubitHamiltonian
ludmilaasb Feb 9, 2026
4ef6576
chore: comma in wrong place
ludmilaasb Feb 9, 2026
4725ff0
up
ludmilaasb Feb 11, 2026
4563315
ci: init deploy workflow
ludmilaasb Feb 16, 2026
5c829b2
devops: add separated instructions for installing symengine
ludmilaasb Feb 17, 2026
2a4fa6b
deploy: fixed gmp library name
ludmilaasb Feb 17, 2026
0e9a00b
go ninja
ludmilaasb Feb 17, 2026
dce40de
deploy: add gmp-devel dependency
ludmilaasb Feb 17, 2026
ec307c6
deploy: damn symengine
ludmilaasb Feb 17, 2026
d84fc40
typo on updagrading cmake
ludmilaasb Feb 17, 2026
6132089
deploy: remove tests for now
ludmilaasb Feb 17, 2026
0752ba4
changed symengine version
ludmilaasb Feb 17, 2026
c0e81a5
deploy: remove blas shenanigans and change cmake install path
ludmilaasb Feb 17, 2026
d04a904
:poop: forgot to remove from cmakelist the shenanigans
ludmilaasb Feb 17, 2026
ac22db3
trying to install symegine locally
ludmilaasb Feb 17, 2026
a865360
deploy: add option for different installation path because macos sucks
ludmilaasb Feb 17, 2026
c4a734e
chore: remove unused header
ludmilaasb Feb 18, 2026
66ee5b4
make symengine even more optional
ludmilaasb Feb 18, 2026
cbb7271
once again problems with gmp
ludmilaasb Feb 18, 2026
1d5d7e4
stupid mac cant find already installed libraries
ludmilaasb Feb 18, 2026
40d5cdd
ugly fix
ludmilaasb Feb 18, 2026
4374b32
lets go
ludmilaasb Feb 18, 2026
25b3b2a
fix identation
ludmilaasb Feb 18, 2026
1b5cd0f
refact: symengine is optional now
ludmilaasb Feb 18, 2026
5d760f8
refact: removing symengine from macos wheels
ludmilaasb Feb 18, 2026
001eec6
revert last commit to see what happens
ludmilaasb Feb 18, 2026
1a462d1
symengine is really optional, trust me
ludmilaasb Feb 18, 2026
579ee5b
fix: fixing no need overload
ludmilaasb Feb 18, 2026
d45aa5a
c'mon
ludmilaasb Feb 18, 2026
3459c7f
deploy: adding windows wheels. trying with symengine
ludmilaasb Feb 18, 2026
ad02fe0
deploy: adding windows wheels. trying without symengine
ludmilaasb Feb 18, 2026
5dc7506
pyproject override for windows
ludmilaasb Feb 18, 2026
3db05ff
horrible hack
ludmilaasb Feb 18, 2026
2ab53b0
wrong name
ludmilaasb Feb 18, 2026
2796999
c'mon
ludmilaasb Feb 18, 2026
cc985fb
deploy: add test top wheels
ludmilaasb Feb 19, 2026
bf6c015
Update .github/workflows/deploy.yml
ludmilaasb Feb 19, 2026
aca0e68
fix in the wrong place
ludmilaasb Feb 19, 2026
8d24344
chore: removing pytest-datadir for now
ludmilaasb Feb 19, 2026
83b5461
up
ludmilaasb Feb 19, 2026
aab06e5
checking if the problem is syntax
ludmilaasb Feb 19, 2026
fceec5e
chore: move changes from another branch here
ludmilaasb Feb 19, 2026
7f01143
test: init PauliString tests
ludmilaasb Feb 19, 2026
8bc87e5
conan is back
ludmilaasb Feb 20, 2026
7f3b473
making wheels build conan friendly
ludmilaasb Feb 20, 2026
197f708
fix: conan profile
ludmilaasb Feb 20, 2026
ec4cc8b
fix: conan profile again
ludmilaasb Feb 20, 2026
d4967b7
deploy: commenting out mac and windows for now
ludmilaasb Feb 20, 2026
b39a916
deploy: adding back windows and mac
ludmilaasb Feb 20, 2026
4da1ecd
deploy: fix windows variable
ludmilaasb Feb 20, 2026
4723430
deploy: where is the syntax errror
ludmilaasb Feb 20, 2026
32da3f6
let's gooooooooooooo
ludmilaasb Feb 20, 2026
7635a67
test: smal fix
ludmilaasb Feb 20, 2026
258d253
add keychain env val
ludmilaasb Feb 20, 2026
74d7c15
ridiculous backslash for windows
ludmilaasb Feb 21, 2026
c6329d6
testing why windows dont get conan profile
ludmilaasb Feb 21, 2026
187689b
the hell
ludmilaasb Feb 21, 2026
0374492
more annoying syntax
ludmilaasb Feb 21, 2026
daf1152
cant read lines
ludmilaasb Feb 21, 2026
f0f50a7
new lines are ignored, trying this
ludmilaasb Feb 21, 2026
c74aa4c
chore: all os are back, fixed test parameters
ludmilaasb Feb 21, 2026
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
16 changes: 16 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ghcr.io/astral-sh/uv:latest AS uv

FROM mcr.microsoft.com/devcontainers/base:2-ubuntu24.04

# install needed packages
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install \
build-essential \
cmake \
gcc \
gdb \
libgmp-dev \
ninja-build


COPY --from=uv --chown=vscode /uv /uvx /bin/
57 changes: 57 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "PauliEngine development environment",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"capAdd": [
"SYS_PTRACE"
],
"securityOpt": [
"seccomp=unconfined"
],
"remoteUser": "vscode",
"customizations": {
"vscode": {
"settings": {
"python.defaultInterpreterPath": "${containerEnv:UV_PROJECT_ENVIRONMENT}/bin/python",
"python.terminal.activateEnvInCurrentTerminal": true,
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/bin/zsh"
}
}
},
"extensions": [
"MS-vsliveshare.vsliveshare",
"benjamin-simmonds.pythoncpp-debug",
"charliermarsh.ruff",
"cschlosser.doxdocgen",
"ms-python.python",
"ms-toolsai.jupyter",
"ms-vscode.cmake-tools",
"ms-vscode.cpptools",
"ms-vscode.cpptools-themes",
"mutantdino.resourcemonitor",
"njpwerner.autodocstring",
"streetsidesoftware.code-spell-checker",
"streetsidesoftware.code-spell-checker-scientific-terms",
"tamasfe.even-better-toml",
"vivaxy.vscode-conventional-commits"
]
}
},
"containerEnv": {
"PYTHONUNBUFFERED": "True",
"WORKSPACE": "${containerWorkspaceFolder}",
"UV_LINK_MODE": "copy",
"UV_PROJECT_ENVIRONMENT": "/home/vscode/.venv"
},
"postCreateCommand": "./.devcontainer/postCreateCommand.sh",
"postStartCommand": "./.devcontainer/postStartCommand.sh",
"hostRequirements": {
"cpus": 4,
"memory": "6gb"
}
}
27 changes: 27 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

set -euxo pipefail

# install uv and uvx shell completions
echo 'eval "$(uv generate-shell-completion zsh)"' >> /home/vscode/.zshrc
echo 'eval "$(uvx --generate-shell-completion zsh)"' >> /home/vscode/.zshrc

# set up GDB to view contents of STL containers
gcc_version="$(gcc --version | awk 'NR==1 {print $NF}')"
cat <<EOT >> ~/.gdbinit
python
import sys
sys.path.insert(0, "/usr/share/gcc-$gcc_version/python")
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end
EOT

# install conan
uv venv
source /home/vscode/.venv/bin/activate
uv pip install conan

# setup conan profile and install dependencies
conan profile detect --force
conan install . --output-folder=build --build=missing -pr ./conan_profile
7 changes: 7 additions & 0 deletions .devcontainer/postStartCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

# install project with all dependencies
uv sync --all-groups --all-extras

# install pre-commit hooks
# uv run pre-commit install --install-hooks
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
160 changes: 160 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
name: Publish PauliEngine Python sdist and wheels to PyPI

on:
workflow_dispatch:
inputs:
force-upload:
description: 'Upload artifacts without a corresponding release'
required: false
default: false
type: boolean
release:
types:
- published
pull_request:
# PRs trigger for the "opened", "reopened", "synchronize" events (default) and
# "ready_for_review"
paths:
- .github/workflows/deploy.yml
types:
- opened
- reopened
- synchronize # when new commits are pushed to the PR
- ready_for_review # when the PR is un-drafted

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
COLUMNS: 120
FORCE_COLOR: 3

jobs:
build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # such that setuptools_scm can do its job correctly

- name: Build SDist
run: |
pipx install uv
pipx run build --verbose --sdist --installer=uv

- uses: actions/upload-artifact@v6
with:
name: cibw-sdist
path: dist/*.tar.gz

build-wheels:
# in combination with the PR types selection, this top-level if statement
# skips running the workflow for Draft PRs
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
name: Build Python wheels for ${{ matrix.os }}
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
os: [ linux-intel, linux-arm, macos-arm, windows-intel, windows-arm]
include:
- archs: native
platform: auto
- os: linux-intel
runs-on: ubuntu-latest
- os: linux-arm
runs-on: ubuntu-24.04-arm
- os: macos-arm
runs-on: macos-latest
- os: windows-intel
runs-on: windows-latest
- os: windows-arm
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- uses: pypa/cibuildwheel@v3.3.1
with:
extras: "uv"
env:
# target platform
CIBW_PLATFORM: ${{ matrix.platform }}
# architectures to build
CIBW_ARCHS: ${{ matrix.archs }}
# use uv and build
CIBW_BUILD_FRONTEND: "build[uv]"
# increase pip debugging output
CIBW_BUILD_VERBOSITY: 1
CIBW_DEBUG_TRACEBACK: TRUE
CIBW_BEFORE_ALL_LINUX: |
dnf install -y ninja-build
# install conan and C++ dependencies for the project
pip install conan
conan profile detect --force

# install symengine
conan install . --output-folder=build --build=missing -pr ./conan_profile
CIBW_BEFORE_ALL_MACOS: |
# install conan and C++ dependencies for the project
pip install conan
conan profile detect --force

# install symengine
conan install . --output-folder=build --build=missing -pr ./conan_profile
CIBW_BEFORE_ALL_WINDOWS: |
pip install delvewheel conan && conan profile detect --force && conan install . --output-folder=build --build=missing -pr conan_profile
# do not activate architecture-dependent compiler flags
# 4 jobs in parallel, but do not start new ones if load average exceeds 5
CIBW_ENVIRONMENT_LINUX:
CMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake
CIBW="true"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the CIBW environment variable used anywhere?

Suggested change
CIBW="true"
CIBW="true"
SKBUILD_CMAKE_ARGS="-DPAULIENGINE_ENABLE_ARCH_FLAGS=OFF"

SKBUILD_BUILD_TOOL_ARGS="-j4;-l5"
# set deployment target for C++20 compatibility
# do not activate architecture-dependent compiler flags
# 4 jobs in parallel, but do not start new ones if load average exceeds 5
CIBW_ENVIRONMENT_MACOS: >
CIBW="true"
MACOSX_DEPLOYMENT_TARGET=15.0
SKBUILD_BUILD_TOOL_ARGS="-j4;-l5"
CIBW_ENVIRONMENT_WINDOWS: >
CIBW="true"
SKBUILD_BUILD_TOOL_ARGS="/m:4"
CMAKE_TOOLCHAIN_FILE=build\conan_toolchain.cmake
# build 3.10, 3.11, 3.12, 3.13 (with GIL), and 3.14 (with GIL)
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*"
# skip musl builds, and PyPy builds
CIBW_SKIP: "*-musllinux_*"
# use abi3audit to catch issues with Limited API wheels
CIBW_REPAIR_WHEEL_COMMAND_LINUX: |
auditwheel repair -w {dest_dir} {wheel}
if [[ "{wheel}" == *abi3* ]]; then
pipx run abi3audit --strict --report {wheel}
else
echo "{wheel} is not abi3, skipping abi3audit"
fi
# use abi3audit to catch issues with Limited API wheels
CIBW_REPAIR_WHEEL_COMMAND_MACOS: |
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
if [[ "{wheel}" == *abi3* ]]; then
pipx run abi3audit --strict --report {wheel}
else
echo "{wheel} is not abi3, skipping abi3audit"
fi
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: |
delvewheel repair -w {dest_dir} {wheel}
if [[ "{wheel}" == *abi3* ]]; then
pipx run abi3audit --strict --report {wheel}
else
echo "{wheel} is not abi3, skipping abi3audit"
fi
CIBW_TEST_COMMAND: python -m pytest {package}/tests
CIBW_TEST_GROUPS: "test"

- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: wheelhouse/*.whl
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ Thumbs.db
.bat
.cmake
.env
config.json
config.json

__pycache__/
File renamed without changes.
104 changes: 104 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
cmake_minimum_required(VERSION 3.28...4.2.1)

if(SKBUILD)
# this value doesn't really matter, as it will be set by scikit-build-core
set(PROJECT_VERSION "0.1.0")
else()
include(FetchContent)
FetchContent_Declare(
CMakeExtraUtils
QUIET
URL
https://github.com/LecrisUT/CMakeExtraUtils/archive/refs/tags/v0.4.1.tar.gz
SOURCE_DIR
${CMAKE_CURRENT_BINARY_DIR}/external/upstream/_srcs/CMakeExtraUtils
)
FetchContent_MakeAvailable(CMakeExtraUtils)

include(DynamicVersion)
dynamic_version(PROJECT_PREFIX pauliengine_)
endif()

project(pauliengine LANGUAGES CXX VERSION ${PROJECT_VERSION})

# if CMAKE_BUILD_TYPE undefined, we set it to Release
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()


# Options handling utilities Macro for printing an option in a consistent manner
# Written by Lori A. Burns (@loriab) and Ryan M. Richard (@ryanmrichard) Syntax:
# print_option(<option to print> <was specified>)
macro(print_option variable default)
if(NOT DEFINED ${variable} OR "${${variable}}" STREQUAL "")
message(STATUS "Setting (unspecified) option ${variable}: ${default}")
else()
message(STATUS "Setting option ${variable}: ${${variable}}")
endif()
endmacro()

# Wraps an option with default ON/OFF. Adds nice messaging to option() Written
# by Lori A. Burns (@loriab) and Ryan M. Richard (@ryanmrichard) Syntax:
# option_with_print(<option name> <description> <default value>)
macro(option_with_print variable msge default)
print_option(${variable} ${default})
option(${variable} ${msge} ${default})
endmacro()

# Wraps an option with a default other than ON/OFF and prints it Written by Lori
# A. Burns (@loriab) and Ryan M. Richard (@ryanmrichard) NOTE: Can't combine
# with above b/c CMake handles ON/OFF options specially NOTE2: CMake variables
# are always defined so need to further check for if they are the NULL string.
# This is also why we need the force Syntax: option_with_default(<option name>
# <description> <default value>)
macro(option_with_default variable msge default)
print_option(${variable} "${default}")
if(NOT DEFINED ${variable} OR "${${variable}}" STREQUAL "")
set(${variable} "${default}" CACHE STRING ${msge} FORCE)
endif()
endmacro()

set(CMAKE_CXX_STANDARD 20 CACHE STRING "C++ standard")
set(CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL "C++ standard required")
set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "C++ extensions")

include(${PROJECT_SOURCE_DIR}/cmake/compiler_flags/CXXFlags.cmake)

message(STATUS "${PROJECT_NAME} version: ${PROJECT_VERSION_FULL}")

# report on compiler flags in use
message(STATUS "Configuring a ${CMAKE_BUILD_TYPE} build")
string(TOUPPER ${CMAKE_BUILD_TYPE} _cmake_build_type_upper)

message(STATUS "Compiler flags for ${CMAKE_CXX_COMPILER_ID}")
message(STATUS " From environment : ${CMAKE_CXX_FLAGS}")
set(
_cmake_build_type_specific_flags
"${CMAKE_CXX_FLAGS_${_cmake_build_type_upper}}"
)
message(
STATUS
" Build-type-specific : ${_cmake_build_type_specific_flags}"
)
message(STATUS " Vectorization flag : ${ARCH_FLAG}")
message(
STATUS
" Project defaults : ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION} ${pauliengine_CXX_FLAGS}"
)
message(STATUS " User-appended : ${EXTRA_CXXFLAGS}")

include(GNUInstallDirs)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})

configure_file(
${PROJECT_SOURCE_DIR}/include/pauliengine/Info.h.in
${PROJECT_BINARY_DIR}/include/pauliengine/Info.h
)

# Conan Toolchain einbinden (nach: conan install .. --install-folder=build --build=missing)
include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake OPTIONAL RESULT_VARIABLE _found)

add_subdirectory(src)

File renamed without changes.
Loading
Loading