pyquiche 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyquiche-0.1.0/.clang-format +41 -0
- pyquiche-0.1.0/.clang-tidy +35 -0
- pyquiche-0.1.0/.github/workflows/build-wheels.yml +66 -0
- pyquiche-0.1.0/.github/workflows/cpp-lint.yml +38 -0
- pyquiche-0.1.0/.github/workflows/cpp-tests.yml +33 -0
- pyquiche-0.1.0/.github/workflows/publish-wheels.yml +38 -0
- pyquiche-0.1.0/.github/workflows/python-lint.yml +40 -0
- pyquiche-0.1.0/.github/workflows/python-tests.yml +49 -0
- pyquiche-0.1.0/.gitignore +19 -0
- pyquiche-0.1.0/CHANGELOG.md +88 -0
- pyquiche-0.1.0/CMakeLists.txt +220 -0
- pyquiche-0.1.0/CONTRIBUTING.md +101 -0
- pyquiche-0.1.0/LICENSE +177 -0
- pyquiche-0.1.0/PKG-INFO +128 -0
- pyquiche-0.1.0/README.md +92 -0
- pyquiche-0.1.0/bindings/CMakeLists.txt +9 -0
- pyquiche-0.1.0/bindings/bindings.cpp +28 -0
- pyquiche-0.1.0/bindings/quest.cpp +490 -0
- pyquiche-0.1.0/bindings/quiche.cpp +113 -0
- pyquiche-0.1.0/cmake/quicheConfig.cmake.in +6 -0
- pyquiche-0.1.0/cpp/CMakeLists.txt +9 -0
- pyquiche-0.1.0/cpp/examples/CMakeLists.txt +20 -0
- pyquiche-0.1.0/cpp/examples/qdrift.cpp +99 -0
- pyquiche-0.1.0/cpp/examples/qpe-iterative.cpp +87 -0
- pyquiche-0.1.0/cpp/examples/qpe-kitaev.cpp +92 -0
- pyquiche-0.1.0/cpp/examples/qpe-naive.cpp +91 -0
- pyquiche-0.1.0/cpp/examples/qpe-qubitised-optimised.cpp +104 -0
- pyquiche-0.1.0/cpp/examples/qpe-qubitised.cpp +103 -0
- pyquiche-0.1.0/cpp/examples/qpe-textbook.cpp +95 -0
- pyquiche-0.1.0/cpp/include/quiche/mappings.hpp +42 -0
- pyquiche-0.1.0/cpp/include/quiche/qdrift.hpp +51 -0
- pyquiche-0.1.0/cpp/include/quiche/qpe.hpp +64 -0
- pyquiche-0.1.0/cpp/include/quiche/qubitisation.hpp +93 -0
- pyquiche-0.1.0/cpp/include/quiche/quest-patches.hpp +49 -0
- pyquiche-0.1.0/cpp/include/quiche/utils.hpp +49 -0
- pyquiche-0.1.0/cpp/src/CMakeLists.txt +8 -0
- pyquiche-0.1.0/cpp/src/mappings.cpp +186 -0
- pyquiche-0.1.0/cpp/src/qdrift.cpp +90 -0
- pyquiche-0.1.0/cpp/src/qpe.cpp +312 -0
- pyquiche-0.1.0/cpp/src/qubitisation.cpp +288 -0
- pyquiche-0.1.0/cpp/src/quest-patches.cpp +175 -0
- pyquiche-0.1.0/cpp/tests/CMakeLists.txt +9 -0
- pyquiche-0.1.0/cpp/tests/main.cpp +38 -0
- pyquiche-0.1.0/cpp/tests/mappings.cpp +113 -0
- pyquiche-0.1.0/cpp/tests/qpe.cpp +305 -0
- pyquiche-0.1.0/cpp/tests/qubitisation.cpp +197 -0
- pyquiche-0.1.0/licenses/LICENSE-QuEST.txt +27 -0
- pyquiche-0.1.0/licenses/LICENSE-libgomp.txt +755 -0
- pyquiche-0.1.0/licenses/LICENSE-libomp.txt +367 -0
- pyquiche-0.1.0/licenses/LICENSE-msvc.txt +97 -0
- pyquiche-0.1.0/licenses/LICENSE-nanobind.txt +32 -0
- pyquiche-0.1.0/pyproject.toml +135 -0
- pyquiche-0.1.0/python/examples/H2/COPYRIGHT-NOTICE.txt +10 -0
- pyquiche-0.1.0/python/examples/H2/H2.hdf5 +0 -0
- pyquiche-0.1.0/python/examples/H2/qpespec.ipynb +2239 -0
- pyquiche-0.1.0/python/src/quiche/__init__.py +53 -0
- pyquiche-0.1.0/python/src/quiche/bindings/__init__.pyi +4 -0
- pyquiche-0.1.0/python/src/quiche/bindings/quest_bindings.pyi +565 -0
- pyquiche-0.1.0/python/src/quiche/bindings/quiche_bindings.pyi +32 -0
- pyquiche-0.1.0/python/src/quiche/chemistry.py +168 -0
- pyquiche-0.1.0/python/src/quiche/core/__init__.py +32 -0
- pyquiche-0.1.0/python/src/quiche/core/algorithms.py +49 -0
- pyquiche-0.1.0/python/src/quiche/core/electronic.py +168 -0
- pyquiche-0.1.0/python/src/quiche/core/errors.py +50 -0
- pyquiche-0.1.0/python/src/quiche/core/paulis.py +277 -0
- pyquiche-0.1.0/python/src/quiche/dispatch/__init__.py +19 -0
- pyquiche-0.1.0/python/src/quiche/dispatch/budget/__init__.py +19 -0
- pyquiche-0.1.0/python/src/quiche/dispatch/budget/estimation.py +30 -0
- pyquiche-0.1.0/python/src/quiche/dispatch/budget/simulation.py +58 -0
- pyquiche-0.1.0/python/src/quiche/dispatch/qpespec.py +361 -0
- pyquiche-0.1.0/python/src/quiche/io/__init__.py +19 -0
- pyquiche-0.1.0/python/src/quiche/io/_openfermion.py +119 -0
- pyquiche-0.1.0/python/src/quiche/io/fcidump.py +212 -0
- pyquiche-0.1.0/python/src/quiche/io/hamlib.py +38 -0
- pyquiche-0.1.0/python/src/quiche/py.typed +0 -0
- pyquiche-0.1.0/python/src/quiche/resources/__init__.py +29 -0
- pyquiche-0.1.0/python/src/quiche/resources/bloqs/__init__.py +49 -0
- pyquiche-0.1.0/python/src/quiche/resources/bloqs/estimation.py +649 -0
- pyquiche-0.1.0/python/src/quiche/resources/bloqs/simulation.py +725 -0
- pyquiche-0.1.0/python/src/quiche/resources/bloqs/state_prep.py +167 -0
- pyquiche-0.1.0/python/src/quiche/resources/logical.py +78 -0
- pyquiche-0.1.0/python/src/quiche/simulation/__init__.py +19 -0
- pyquiche-0.1.0/python/src/quiche/simulation/estimation.py +95 -0
- pyquiche-0.1.0/python/src/quiche/simulation/routine.py +50 -0
- pyquiche-0.1.0/python/src/quiche/simulation/state_prep.py +53 -0
- pyquiche-0.1.0/python/tests/__init__.py +17 -0
- pyquiche-0.1.0/python/tests/conftest.py +74 -0
- pyquiche-0.1.0/python/tests/test_bindings.py +102 -0
- pyquiche-0.1.0/python/tests/test_chemistry.py +135 -0
- pyquiche-0.1.0/python/tests/test_electronic.py +107 -0
- pyquiche-0.1.0/python/tests/test_estimation.py +213 -0
- pyquiche-0.1.0/python/tests/test_fcidump.py +145 -0
- pyquiche-0.1.0/python/tests/test_hamlib.py +198 -0
- pyquiche-0.1.0/python/tests/test_models.py +136 -0
- pyquiche-0.1.0/python/tests/test_simulation.py +568 -0
- pyquiche-0.1.0/python/tests/test_state_prep.py +73 -0
- pyquiche-0.1.0/uv.lock +3415 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
BasedOnStyle: LLVM
|
|
2
|
+
|
|
3
|
+
UseTab: Never
|
|
4
|
+
IndentWidth: 4
|
|
5
|
+
ContinuationIndentWidth: 4
|
|
6
|
+
|
|
7
|
+
ColumnLimit: 120
|
|
8
|
+
|
|
9
|
+
AllowAllArgumentsOnNextLine: false
|
|
10
|
+
AllowAllParametersOfDeclarationOnNextLine: false
|
|
11
|
+
AlignAfterOpenBracket: Align
|
|
12
|
+
AlwaysBreakTemplateDeclarations: Yes
|
|
13
|
+
|
|
14
|
+
PenaltyBreakBeforeFirstCallParameter: 100
|
|
15
|
+
|
|
16
|
+
FixNamespaceComments: true
|
|
17
|
+
ReflowComments: true
|
|
18
|
+
|
|
19
|
+
SortIncludes: true
|
|
20
|
+
IncludeBlocks: Regroup
|
|
21
|
+
IncludeCategories:
|
|
22
|
+
- Regex: '^<nanobind'
|
|
23
|
+
Priority: 3
|
|
24
|
+
|
|
25
|
+
- Regex: '^<catch2'
|
|
26
|
+
Priority: 4
|
|
27
|
+
|
|
28
|
+
- Regex: '^<quest'
|
|
29
|
+
Priority: 5
|
|
30
|
+
|
|
31
|
+
# QUICHE project headers
|
|
32
|
+
- Regex: '^"quiche/'
|
|
33
|
+
Priority: 6
|
|
34
|
+
|
|
35
|
+
# C headers
|
|
36
|
+
- Regex: '^<.*\.h>$'
|
|
37
|
+
Priority: 1
|
|
38
|
+
|
|
39
|
+
# C++ headers
|
|
40
|
+
- Regex: '^<.*>$'
|
|
41
|
+
Priority: 2
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Checks: >
|
|
2
|
+
bugprone-*,
|
|
3
|
+
-bugprone-easily-swappable-parameters,
|
|
4
|
+
|
|
5
|
+
clang-analyzer-*,
|
|
6
|
+
concurrency-*,
|
|
7
|
+
|
|
8
|
+
cppcoreguidelines-*,
|
|
9
|
+
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
|
|
10
|
+
-cppcoreguidelines-avoid-magic-numbers,
|
|
11
|
+
-cppcoreguidelines-non-private-member-variables-in-classes,
|
|
12
|
+
|
|
13
|
+
misc-*,
|
|
14
|
+
-misc-non-private-member-variables-in-classes,
|
|
15
|
+
-misc-no-recursion,
|
|
16
|
+
|
|
17
|
+
modernize-*,
|
|
18
|
+
-modernize-use-trailing-return-type,
|
|
19
|
+
|
|
20
|
+
performance-*,
|
|
21
|
+
portability-*,
|
|
22
|
+
|
|
23
|
+
readability-*,
|
|
24
|
+
-readability-braces-around-statements,
|
|
25
|
+
-readability-identifier-length,
|
|
26
|
+
-readability-implicit-bool-conversion,
|
|
27
|
+
-readability-magic-numbers,
|
|
28
|
+
-readability-math-missing-parentheses,
|
|
29
|
+
|
|
30
|
+
mpi-*,
|
|
31
|
+
openmp-*,
|
|
32
|
+
|
|
33
|
+
WarningsAsErrors: ''
|
|
34
|
+
HeaderFilterRegex: '.*'
|
|
35
|
+
FormatStyle: file
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
name: Build wheels and sdist
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- main
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
|
|
12
|
+
build-wheels:
|
|
13
|
+
name: Build wheels (${{ matrix.os }})
|
|
14
|
+
runs-on: ${{ matrix.os }}
|
|
15
|
+
timeout-minutes: 60
|
|
16
|
+
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
|
|
20
|
+
strategy:
|
|
21
|
+
fail-fast: false
|
|
22
|
+
matrix:
|
|
23
|
+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-15, windows-latest]
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- name: Check out repository
|
|
27
|
+
uses: actions/checkout@v7
|
|
28
|
+
|
|
29
|
+
- name: Install uv
|
|
30
|
+
uses: astral-sh/setup-uv@v10.0.1
|
|
31
|
+
|
|
32
|
+
- name: Run cibuildwheel
|
|
33
|
+
run: uvx cibuildwheel~=4.2.0 --output-dir dist
|
|
34
|
+
|
|
35
|
+
- name: Upload wheels
|
|
36
|
+
uses: actions/upload-artifact@v7
|
|
37
|
+
with:
|
|
38
|
+
name: dist-wheels-${{ matrix.os }}
|
|
39
|
+
path: dist/*.whl
|
|
40
|
+
if-no-files-found: error
|
|
41
|
+
|
|
42
|
+
build-sdist:
|
|
43
|
+
name: Build sdist
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
timeout-minutes: 15
|
|
46
|
+
|
|
47
|
+
permissions:
|
|
48
|
+
contents: read
|
|
49
|
+
|
|
50
|
+
steps:
|
|
51
|
+
- name: Check out repository
|
|
52
|
+
uses: actions/checkout@v7
|
|
53
|
+
|
|
54
|
+
- name: Install uv
|
|
55
|
+
uses: astral-sh/setup-uv@v10.0.1
|
|
56
|
+
|
|
57
|
+
- name: Build sdist
|
|
58
|
+
run: uv build --sdist --out-dir dist
|
|
59
|
+
|
|
60
|
+
- name: Upload sdist
|
|
61
|
+
uses: actions/upload-artifact@v7
|
|
62
|
+
with:
|
|
63
|
+
name: dist-sdist
|
|
64
|
+
path: dist/*.tar.gz
|
|
65
|
+
if-no-files-found: error
|
|
66
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: C++ lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
format:
|
|
18
|
+
name: clang-format
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
timeout-minutes: 15
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Check out repository
|
|
24
|
+
uses: actions/checkout@v7
|
|
25
|
+
|
|
26
|
+
- name: Install uv and Python
|
|
27
|
+
uses: astral-sh/setup-uv@v10.0.1
|
|
28
|
+
with:
|
|
29
|
+
python-version: "3.12"
|
|
30
|
+
enable-cache: true
|
|
31
|
+
|
|
32
|
+
- name: Install lint dependencies
|
|
33
|
+
run: uv sync --locked --only-group lint
|
|
34
|
+
|
|
35
|
+
- name: Run clang-format
|
|
36
|
+
run: |
|
|
37
|
+
find cpp bindings \( -name '*.cpp' -o -name '*.hpp' \) \
|
|
38
|
+
-exec uv run --no-sync clang-format --dry-run --Werror --verbose {} +
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: C++ tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
test:
|
|
18
|
+
name: C++ tests
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
timeout-minutes: 30
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Check out repository
|
|
24
|
+
uses: actions/checkout@v7
|
|
25
|
+
|
|
26
|
+
- name: Configure CMake project
|
|
27
|
+
run: cmake -B build -D QUICHE_BUILD_TESTS=ON
|
|
28
|
+
|
|
29
|
+
- name: Build CMake project
|
|
30
|
+
run: cmake --build build --parallel
|
|
31
|
+
|
|
32
|
+
- name: Run tests
|
|
33
|
+
run: ctest --test-dir build --output-on-failure --no-tests=error
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Publish wheels and sdist to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
tags:
|
|
7
|
+
- "v*"
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
|
|
11
|
+
build:
|
|
12
|
+
uses: ./.github/workflows/build-wheels.yml
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
|
|
17
|
+
pypi-publish:
|
|
18
|
+
name: Publish to PyPI
|
|
19
|
+
needs: build
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
timeout-minutes: 15
|
|
22
|
+
|
|
23
|
+
environment:
|
|
24
|
+
name: pypi
|
|
25
|
+
|
|
26
|
+
permissions:
|
|
27
|
+
id-token: write
|
|
28
|
+
|
|
29
|
+
steps:
|
|
30
|
+
- name: Download wheel and sdist artifacts
|
|
31
|
+
uses: actions/download-artifact@v8
|
|
32
|
+
with:
|
|
33
|
+
pattern: "dist-{wheels-*,sdist}"
|
|
34
|
+
path: dist
|
|
35
|
+
merge-multiple: true
|
|
36
|
+
|
|
37
|
+
- name: Publish to PyPI
|
|
38
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Python lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
lint:
|
|
18
|
+
name: Ruff
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
timeout-minutes: 15
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Check out repository
|
|
24
|
+
uses: actions/checkout@v7
|
|
25
|
+
|
|
26
|
+
- name: Install uv and Python
|
|
27
|
+
uses: astral-sh/setup-uv@v10.0.1
|
|
28
|
+
with:
|
|
29
|
+
python-version: "3.12"
|
|
30
|
+
enable-cache: true
|
|
31
|
+
|
|
32
|
+
- name: Install lint dependencies
|
|
33
|
+
run: uv sync --locked --only-group lint
|
|
34
|
+
|
|
35
|
+
- name: Run ruff check
|
|
36
|
+
run: uv run --no-sync ruff check --output-format=github
|
|
37
|
+
|
|
38
|
+
- name: Run ruff format
|
|
39
|
+
if: ${{ !cancelled() }}
|
|
40
|
+
run: uv run --no-sync ruff format --check --output-format=github
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: Python tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
# PR runs cancel older runs for the same branch. Non-PR runs group by the
|
|
10
|
+
# unique run_id, so pushes to main don't cancel each other.
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
test:
|
|
20
|
+
name: Python tests
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
timeout-minutes: 15
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- name: Check out repository
|
|
26
|
+
uses: actions/checkout@v7
|
|
27
|
+
|
|
28
|
+
# Cache QuEST and nanobind sources and their compiled objects.
|
|
29
|
+
- name: Cache CMake build directory
|
|
30
|
+
uses: actions/cache@v6
|
|
31
|
+
with:
|
|
32
|
+
path: build
|
|
33
|
+
key: ${{ runner.os }}-cmake-build-${{ hashFiles('CMakeLists.txt', 'cpp/**/CMakeLists.txt', 'bindings/CMakeLists.txt') }}
|
|
34
|
+
restore-keys: |
|
|
35
|
+
${{ runner.os }}-cmake-build-
|
|
36
|
+
|
|
37
|
+
- name: Install uv and Python
|
|
38
|
+
uses: astral-sh/setup-uv@v10.0.1
|
|
39
|
+
with:
|
|
40
|
+
python-version: "3.12"
|
|
41
|
+
enable-cache: true
|
|
42
|
+
|
|
43
|
+
- name: Install quiche with dev dependencies
|
|
44
|
+
working-directory: python
|
|
45
|
+
run: uv sync --locked --group dev
|
|
46
|
+
|
|
47
|
+
- name: Run pytest
|
|
48
|
+
working-directory: python
|
|
49
|
+
run: uv run --no-sync pytest
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Changelog format based on [Keep a Changelog](https://keepachangelog.com/).
|
|
4
|
+
Versioning based on [Semantic Versioning](https://semver.org/).
|
|
5
|
+
|
|
6
|
+
## [Unreleased]
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
### Deprecated
|
|
13
|
+
|
|
14
|
+
### Removed
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
### Security
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## [0.1.0] - 2026-09-13
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- Added `py.typed` marker for type checkers.
|
|
25
|
+
- Added `qpe::getEnergyFromTrotterPhase` and `qpe::getEnergyFromQubitisationPhase` functions for converting a QPE phase to an energy.
|
|
26
|
+
- Added `logical_rotations_to_tgates` to `quiche.resources` exports.
|
|
27
|
+
- Added `PauliSum.has_identity`, `PauliSum.n_terms_with_identity`, `PauliSum.without_identity()` and `PauliSum.split_identity()`.
|
|
28
|
+
- Added `SecondQuantisedHamiltonian` to `quiche.core` for electronic integrals.
|
|
29
|
+
- Added `quiche.io.fcidump` for reading FCIDUMP integral files.
|
|
30
|
+
- Added `openfermion` as a dependency.
|
|
31
|
+
- Added `pyquiche` package to PyPI, with prebuilt, multithreaded wheels for Linux, macOS and Windows (GPU, MPI and single/quad precision builds still require building from source).
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
- Renamed `applyMultiStateControlledPhaseShift` to `applyMultiQubitStatePhaseShift` and `applyMultiStateControlledQubitPhaseFlip` to `applyMultiQubitStatePhaseFlip`.
|
|
35
|
+
- Changed `quiche` submodule imports to lazy imports.
|
|
36
|
+
- Deferred `cirq` import in `quiche.core` to `PauliWord.to_cirq()`.
|
|
37
|
+
- Enabled bytecode compilation for `uv` installs.
|
|
38
|
+
- Raised minimum build requirements to CMake 3.26, scikit-build-core 1.0, and nanobind 2.10.
|
|
39
|
+
- Pinned fetched C++ dependencies (QuEST, Catch2, nanobind) using checksummed release archives where applicable.
|
|
40
|
+
- Exposed namespaced C++ library target `quiche::quiche`.
|
|
41
|
+
- Moved `pyproject.toml` to the repository root.
|
|
42
|
+
- Improved Windows build compatibility.
|
|
43
|
+
- `.controlled()` on `PauliWordRotation`, `QDRIFT` and `Trotterisation` now constructs the same bloq but with `is_controlled=True` rather than a separate class.
|
|
44
|
+
- `PauliWordRotation` now validates its target qubit range on construction rather than on decomposition.
|
|
45
|
+
- Tightened `PauliWord` validation to reject repeated target qubits.
|
|
46
|
+
- Tightened `PauliSum` validation to require at least one term.
|
|
47
|
+
- Added electron and qubit count validation to `getHartreeFockStateJW`, `getHartreeFockStateBK` and `getHartreeFockStateParity`.
|
|
48
|
+
- Made `cloneWithoutIdentity` reject `PauliStrSum`s containing only identity terms.
|
|
49
|
+
- Renamed the `QuESTEnv` binding methods `syncQuESTEnv` and `isQuESTEnvInit` to `sync` and `isInit`.
|
|
50
|
+
- Added missing `const` qualifiers to the control arguments of `applyMultiControlledCoeffsPrep` and `applyMultiControlledPauliStrSumPrep`.
|
|
51
|
+
- `PauliSum.identity_coefficient` now defaults to `0.0`.
|
|
52
|
+
- `PauliSum.lam` is now the 1-norm of the whole operator (including the identity coefficient).
|
|
53
|
+
- `PauliSum.to_quest()` now includes the identity term rather than dropping it. Call `PauliSum.without_identity()` first to recover the previous behaviour.
|
|
54
|
+
- Changed `QDRIFT` sampling to use its own `numpy` generator, requiring an explicit integer `seed` (sampled terms will differ for a given seed from previous sampling).
|
|
55
|
+
- `QPESpec` now takes `seed` as a field rather than an `extras` entry (required when simulating with `QDRIFT`).
|
|
56
|
+
- `PrepareFromStatePrep` now exposes the phase gradient as a junk register, adding a `phase_gradient` register to the block encoding signature.
|
|
57
|
+
- `QDRIFT` and `Trotterisation` now reject a zero evolution time.
|
|
58
|
+
- Moved `quiche.hamlib` into the new `quiche.io` subpackage.
|
|
59
|
+
- Renamed `hamlib.get_dataset` and `hamlib.parse_hamiltonian` to `hamlib.read_dataset` and `hamlib.parse`.
|
|
60
|
+
- Renamed the package from `quiche` to `pyquiche` to avoid PyPI clash (the import name `quiche` is unchanged).
|
|
61
|
+
|
|
62
|
+
### Removed
|
|
63
|
+
- Removed the C++ Hamlib module (keeping just the Python one), along with the corresponding example and unit tests.
|
|
64
|
+
- Removed the `QUICHE_BUILD_HAMLIB` build flag and the HDF5 dependency for the C++ backend.
|
|
65
|
+
- Removed `CTRLPauliWordRotation`, `CTRLQDRIFT` and `CTRLTrotterisation` (use `.controlled()` on the corresponding bloq instead).
|
|
66
|
+
- Removed the (empty) `quiche.dispatch.budget.state_prep` module.
|
|
67
|
+
- Removed the dangling `StatePrep` entry from `quiche.core.__all__`.
|
|
68
|
+
- Removed `QDRIFT.sample_term_indices()` (use the `sampled_indices` property instead).
|
|
69
|
+
|
|
70
|
+
### Fixed
|
|
71
|
+
- Removed zero-count sub-bloqs from call graphs.
|
|
72
|
+
- Fixed `QDRIFT` incorrectly ignoring a `0` seed.
|
|
73
|
+
- Fixed Python stable-ABI wheel builds (added missing `Development.SABIModule` component).
|
|
74
|
+
- Fixed `get_bk_state` raising `IndexError` for single-orbital systems.
|
|
75
|
+
- Fixed `get_jw_state` returning its input rather than an integer array as its signature declares.
|
|
76
|
+
- Fixed incorrectly bound `QuESTEnv.sync` and `QuESTEnv.isInit`.
|
|
77
|
+
- Rebound `PauliStrSum.fromFile`, `PauliStrSum.fromReversedFile` and the `Qureg` creation methods (`createDensityQureg`, `createForcedQureg`, `createForcedDensityQureg` and `createCustomQureg`) as static methods.
|
|
78
|
+
- Fixed `QDRIFT` dropping the evolution time from the identity term's global phase.
|
|
79
|
+
- Fixed `QDRIFT` sampling from the global `random` state.
|
|
80
|
+
- Fixed `LCUBlockEncodingWrapper` discarding the signs of negative coefficients.
|
|
81
|
+
- Fixed `LCUBlockEncodingWrapper` including the phase gradient qubits in the index register for SELECT.
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
## [0.0.1] - 2026-06-30
|
|
85
|
+
|
|
86
|
+
### Added
|
|
87
|
+
|
|
88
|
+
- Initial public release
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.26)
|
|
2
|
+
|
|
3
|
+
project(QuicheProject
|
|
4
|
+
VERSION 0.1.0
|
|
5
|
+
DESCRIPTION "QUantum Integrated CHEmistry toolkit"
|
|
6
|
+
LANGUAGES CXX C # QUICHE itself only uses C++ but QuEST requires C
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
include(FetchContent)
|
|
10
|
+
include(GNUInstallDirs)
|
|
11
|
+
include(CMakePackageConfigHelpers)
|
|
12
|
+
|
|
13
|
+
if(PROJECT_IS_TOP_LEVEL AND NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
14
|
+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
|
|
15
|
+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
|
16
|
+
endif()
|
|
17
|
+
|
|
18
|
+
if(PROJECT_IS_TOP_LEVEL)
|
|
19
|
+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
20
|
+
endif()
|
|
21
|
+
|
|
22
|
+
# --------------------------------------------------------------------------------
|
|
23
|
+
# Quiche config
|
|
24
|
+
|
|
25
|
+
message("
|
|
26
|
+
==================
|
|
27
|
+
QUICHE config
|
|
28
|
+
==================
|
|
29
|
+
")
|
|
30
|
+
|
|
31
|
+
option(QUICHE_BUILD_EXAMPLES "Build the QUICHE example scripts." OFF)
|
|
32
|
+
message(STATUS "Build QUICHE examples: ${QUICHE_BUILD_EXAMPLES}")
|
|
33
|
+
|
|
34
|
+
option(QUICHE_BUILD_TESTS "Build the QUICHE test suite." OFF)
|
|
35
|
+
message(STATUS "Build QUICHE tests: ${QUICHE_BUILD_TESTS}")
|
|
36
|
+
|
|
37
|
+
option(QUICHE_BUILD_BINDINGS "Build the QUICHE Python bindings." OFF)
|
|
38
|
+
message(STATUS "Build QUICHE bindings: ${QUICHE_BUILD_BINDINGS}")
|
|
39
|
+
|
|
40
|
+
option(QUICHE_INSTALL "Install the QUICHE C++ library." ${PROJECT_IS_TOP_LEVEL})
|
|
41
|
+
message(STATUS "Install QUICHE C++ library: ${QUICHE_INSTALL}")
|
|
42
|
+
|
|
43
|
+
if(PROJECT_IS_TOP_LEVEL)
|
|
44
|
+
option(BUILD_SHARED_LIBS "Build shared libraries." ON)
|
|
45
|
+
message(STATUS "Build with shared libraries: ${BUILD_SHARED_LIBS}")
|
|
46
|
+
endif()
|
|
47
|
+
|
|
48
|
+
if(QUICHE_BUILD_BINDINGS AND NOT BUILD_SHARED_LIBS)
|
|
49
|
+
message(FATAL_ERROR "QUICHE_BUILD_BINDINGS requires BUILD_SHARED_LIBS=ON.")
|
|
50
|
+
endif()
|
|
51
|
+
|
|
52
|
+
# --------------------------------------------------------------------------------
|
|
53
|
+
# Define dependencies
|
|
54
|
+
|
|
55
|
+
# QUICHE requires private QuEST headers, which are only exposed via the build
|
|
56
|
+
# interface and are not installed, so QuEST must come from FetchContent.
|
|
57
|
+
# Do not add FIND_PACKAGE_ARGS here.
|
|
58
|
+
FetchContent_Declare(
|
|
59
|
+
QuEST
|
|
60
|
+
URL https://github.com/QuEST-Kit/QuEST/archive/refs/tags/v4.2.0.tar.gz
|
|
61
|
+
URL_HASH SHA256=2c812a7ec4d727e0947ffd0daf05452963c3f1c10e428c8bc30c35164921fcba
|
|
62
|
+
OVERRIDE_FIND_PACKAGE
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Use git source to preserve required submodules
|
|
66
|
+
FetchContent_Declare(
|
|
67
|
+
nanobind
|
|
68
|
+
GIT_REPOSITORY https://github.com/wjakob/nanobind
|
|
69
|
+
GIT_TAG 11087dd7707c80ef85802c661ad459ace5bef671 # v2.10.0
|
|
70
|
+
GIT_PROGRESS TRUE
|
|
71
|
+
FIND_PACKAGE_ARGS 2.10
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
FetchContent_Declare(
|
|
75
|
+
Catch2
|
|
76
|
+
URL https://github.com/catchorg/Catch2/archive/refs/tags/v3.13.0.tar.gz
|
|
77
|
+
URL_HASH SHA256=650795f6501af514f806e78c554729847b98db6935e69076f36bb03ed2e985ef
|
|
78
|
+
FIND_PACKAGE_ARGS 3.13
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
# --------------------------------------------------------------------------------
|
|
82
|
+
# Fetch dependencies
|
|
83
|
+
|
|
84
|
+
message("
|
|
85
|
+
==================
|
|
86
|
+
QuEST config
|
|
87
|
+
==================
|
|
88
|
+
")
|
|
89
|
+
|
|
90
|
+
FetchContent_MakeAvailable(QuEST)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
if(QUICHE_BUILD_BINDINGS)
|
|
94
|
+
find_package(Python 3.12
|
|
95
|
+
COMPONENTS
|
|
96
|
+
Interpreter
|
|
97
|
+
Development.Module
|
|
98
|
+
Development.SABIModule
|
|
99
|
+
REQUIRED
|
|
100
|
+
)
|
|
101
|
+
FetchContent_MakeAvailable(nanobind)
|
|
102
|
+
endif()
|
|
103
|
+
|
|
104
|
+
if(QUICHE_BUILD_TESTS)
|
|
105
|
+
FetchContent_MakeAvailable(Catch2)
|
|
106
|
+
|
|
107
|
+
if(catch2_SOURCE_DIR)
|
|
108
|
+
list(APPEND CMAKE_MODULE_PATH "${catch2_SOURCE_DIR}/extras")
|
|
109
|
+
endif()
|
|
110
|
+
|
|
111
|
+
include(CTest)
|
|
112
|
+
include(Catch)
|
|
113
|
+
endif()
|
|
114
|
+
|
|
115
|
+
# --------------------------------------------------------------------------------
|
|
116
|
+
|
|
117
|
+
add_library(quiche)
|
|
118
|
+
add_library(quiche::quiche ALIAS quiche)
|
|
119
|
+
|
|
120
|
+
target_sources(quiche PUBLIC
|
|
121
|
+
FILE_SET HEADERS
|
|
122
|
+
BASE_DIRS ${PROJECT_SOURCE_DIR}/cpp/include
|
|
123
|
+
FILES
|
|
124
|
+
${PROJECT_SOURCE_DIR}/cpp/include/quiche/mappings.hpp
|
|
125
|
+
${PROJECT_SOURCE_DIR}/cpp/include/quiche/qdrift.hpp
|
|
126
|
+
${PROJECT_SOURCE_DIR}/cpp/include/quiche/qpe.hpp
|
|
127
|
+
${PROJECT_SOURCE_DIR}/cpp/include/quiche/qubitisation.hpp
|
|
128
|
+
${PROJECT_SOURCE_DIR}/cpp/include/quiche/quest-patches.hpp
|
|
129
|
+
${PROJECT_SOURCE_DIR}/cpp/include/quiche/utils.hpp
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
target_compile_features(quiche PUBLIC cxx_std_17)
|
|
133
|
+
target_link_libraries(quiche PUBLIC QuEST::QuEST)
|
|
134
|
+
set_target_properties(quiche PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
|
135
|
+
|
|
136
|
+
add_subdirectory(cpp)
|
|
137
|
+
|
|
138
|
+
if(QUICHE_BUILD_BINDINGS)
|
|
139
|
+
add_subdirectory(bindings)
|
|
140
|
+
endif()
|
|
141
|
+
|
|
142
|
+
# --------------------------------------------------------------------------------
|
|
143
|
+
# Install and package setup
|
|
144
|
+
|
|
145
|
+
if(APPLE)
|
|
146
|
+
set(RPATH_ORIGIN "@loader_path")
|
|
147
|
+
else()
|
|
148
|
+
set(RPATH_ORIGIN "$ORIGIN")
|
|
149
|
+
endif()
|
|
150
|
+
|
|
151
|
+
set_target_properties(quiche PROPERTIES INSTALL_RPATH "${RPATH_ORIGIN}")
|
|
152
|
+
|
|
153
|
+
if(QUICHE_INSTALL)
|
|
154
|
+
# Install library and public headers
|
|
155
|
+
install(TARGETS quiche
|
|
156
|
+
EXPORT quicheTargets
|
|
157
|
+
FILE_SET HEADERS
|
|
158
|
+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
159
|
+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
160
|
+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
# Install CMake target metadata
|
|
164
|
+
install(EXPORT quicheTargets
|
|
165
|
+
FILE quicheTargets.cmake
|
|
166
|
+
NAMESPACE quiche::
|
|
167
|
+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/quiche
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
# Generate package config file
|
|
171
|
+
configure_package_config_file(
|
|
172
|
+
${PROJECT_SOURCE_DIR}/cmake/quicheConfig.cmake.in
|
|
173
|
+
${CMAKE_CURRENT_BINARY_DIR}/quicheConfig.cmake
|
|
174
|
+
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/quiche
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
# Generate package version file
|
|
178
|
+
write_basic_package_version_file(
|
|
179
|
+
${CMAKE_CURRENT_BINARY_DIR}/quicheConfigVersion.cmake
|
|
180
|
+
COMPATIBILITY SameMinorVersion # update to SameMajorVersion post-1.0
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
# Install package files
|
|
184
|
+
install(FILES
|
|
185
|
+
${CMAKE_CURRENT_BINARY_DIR}/quicheConfig.cmake
|
|
186
|
+
${CMAKE_CURRENT_BINARY_DIR}/quicheConfigVersion.cmake
|
|
187
|
+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/quiche
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
endif()
|
|
191
|
+
|
|
192
|
+
if(QUICHE_BUILD_BINDINGS)
|
|
193
|
+
|
|
194
|
+
# For Linux and Mac can place in libs and locate via INSTALL_RPATH,
|
|
195
|
+
# for Windows simply place beside bindings since don't have RPATH
|
|
196
|
+
set_target_properties(bindings PROPERTIES INSTALL_RPATH "${RPATH_ORIGIN}/libs")
|
|
197
|
+
install(TARGETS QuEST quiche
|
|
198
|
+
LIBRARY DESTINATION quiche/libs COMPONENT quiche_wheel EXCLUDE_FROM_ALL
|
|
199
|
+
RUNTIME DESTINATION quiche COMPONENT quiche_wheel EXCLUDE_FROM_ALL
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
install(TARGETS bindings
|
|
203
|
+
LIBRARY DESTINATION quiche COMPONENT quiche_wheel EXCLUDE_FROM_ALL
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
# Generate stubs into the source tree for development builds
|
|
207
|
+
nanobind_add_stub(bindings_stub
|
|
208
|
+
INSTALL_TIME
|
|
209
|
+
COMPONENT quiche_wheel
|
|
210
|
+
MODULE quiche.bindings
|
|
211
|
+
PYTHON_PATH $<TARGET_FILE_DIR:bindings>
|
|
212
|
+
RECURSIVE
|
|
213
|
+
OUTPUT_PATH "${PROJECT_SOURCE_DIR}/python/src/quiche"
|
|
214
|
+
OUTPUT
|
|
215
|
+
bindings/__init__.pyi
|
|
216
|
+
bindings/quest_bindings.pyi
|
|
217
|
+
bindings/quiche_bindings.pyi
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
endif()
|