Skip to content
Closed

Test #59

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
496e0b0
adjust version
Jun 8, 2024
01358ee
prepare for beta release
Jun 27, 2024
191c819
use patched qtrl for tests
Jun 29, 2024
8b489b6
limit numpy version <2
Jun 29, 2024
5392f6c
update setup with numpy version constraint
Jun 30, 2024
1ce4f3c
Merge commit '5392f6ccf9b32b44cc42d4c14fc84e08539f41ce'
Jul 8, 2024
4f6a5a3
some suggestions
Aug 6, 2024
1b86b14
state2state_rl implementation
LegionAtol Aug 8, 2024
2c6c302
Using QobjEvo with Hc, Hd and controls. Dimension action space variab…
LegionAtol Aug 10, 2024
9730959
added _solver.
LegionAtol Aug 11, 2024
2667b64
unitary evolution implementation
LegionAtol Aug 14, 2024
1943609
docstring added
LegionAtol Aug 18, 2024
13ddba0
added callback to stop training
LegionAtol Aug 20, 2024
f2f1d27
added RL algorithm
LegionAtol Aug 22, 2024
1fd9662
rendering update
LegionAtol Aug 22, 2024
0d2df6f
rendering update
LegionAtol Aug 22, 2024
fadb42e
update docstring
LegionAtol Aug 22, 2024
0c68405
update docstring
LegionAtol Aug 22, 2024
e66da0f
Added shorter_pulses to algorithm_kwargs and changed callback to stop…
LegionAtol Aug 24, 2024
6cee77c
Fixed final state saving
LegionAtol Aug 24, 2024
9d6fa29
small corrections
LegionAtol Aug 25, 2024
318081f
edit configuration files
LegionAtol Aug 26, 2024
5403809
Minor text fixes
LegionAtol Sep 9, 2024
4485f9d
Docstring fixes, use of __time__ parameter instead of shorter_pulses,…
LegionAtol Sep 14, 2024
c3c3adb
Merge pull request #18 from LegionAtol/update-guide-control
flowerthrower Sep 25, 2024
3889a63
added _backup_result to keep track of the result even if the algorith…
LegionAtol Sep 30, 2024
cd61877
get kwarg instead of pop
flowerthrower Oct 1, 2024
a5f0016
Merge pull request #22 from qutip/21-prevent-__time__-kwrd-loss
flowerthrower Oct 1, 2024
ceb1de2
automatically convert to superoperator
flowerthrower Oct 2, 2024
9d6ef32
Merge pull request #23 from qutip/20-autmatically-convert-to-superope…
flowerthrower Oct 2, 2024
8fe527b
back to 'shorter_pulses'
flowerthrower Oct 2, 2024
604b12e
pre-commit formating
flowerthrower Oct 2, 2024
d3ce1de
Merge pull request #19 from LegionAtol/ideas
flowerthrower Oct 4, 2024
c115a98
update changelog
flowerthrower Oct 4, 2024
138e3d8
Merge pull request #24 from qutip:prepare_release
flowerthrower Oct 4, 2024
fba6e25
Bump certifi in /doc in the pip group across 1 directory
dependabot[bot] Oct 29, 2024
2ef2db2
Bump urllib3 in /doc in the pip group across 1 directory
dependabot[bot] Oct 29, 2024
da869f6
Bump requests in /doc in the pip group across 1 directory
dependabot[bot] Oct 29, 2024
ec376e5
corrections in algorithm execution time
LegionAtol Dec 18, 2024
d43efb9
Merge pull request #31 from LegionAtol/rl_update
flowerthrower Jan 9, 2025
9d7f277
Make all JAX and machine learning related dependencies optional
pmenczel Jan 23, 2025
2f6c8a3
Fix minor bug
pmenczel Feb 13, 2025
8cc4e09
Update versions of action tools
pmenczel Feb 13, 2025
f403163
Merge pull request #35 from pmenczel/action-tools
pmenczel Feb 17, 2025
5a97ccc
Merge branch 'qutip:main' into dependency-cleanup
pmenczel Feb 17, 2025
1d2591e
Merge pull request #32 from pmenczel/dependency-cleanup
pmenczel Feb 19, 2025
b0fd00c
add check for operator input
rochisha0 Feb 26, 2025
37de33f
Fix objective for open system
rochisha0 Mar 10, 2025
e2781bc
add logic for gate synthesis
rochisha0 Mar 12, 2025
aec775f
Fixing README.md
jyotiraj-code Mar 14, 2025
02d361a
improve the clarity of the code
rochisha0 Mar 18, 2025
029d854
Updated link QuTiP contribution link
jyotiraj-code Mar 18, 2025
95252b2
Merge pull request #39 from jyotiraj-code/main
pmenczel Mar 19, 2025
ae447b6
fix trace
rochisha0 Mar 27, 2025
7981bb5
Merge pull request #36 from rochisha0/state-transfer
pmenczel Mar 28, 2025
5224a21
documentation fix
Akhils777 May 5, 2025
1536669
Merge pull request #28 from qutip/dependabot/pip/doc/pip-775dd686c6
hodgestar May 15, 2025
d91ff67
Merge pull request #27 from qutip/dependabot/pip/doc/pip-a8b23622d7
hodgestar May 15, 2025
6df2f62
Merge pull request #26 from qutip/dependabot/pip/doc/pip-f8e74f74f3
hodgestar May 15, 2025
9a1875c
Bump idna from 2.10 to 3.7 in /doc in the pip group across 1 directory
dependabot[bot] May 15, 2025
35fe0d9
Merge pull request #25 from qutip/dependabot/pip/doc/pip-a98e789dc2
hodgestar May 15, 2025
5402fb0
Bump jinja2 in /doc in the pip group across 1 directory
dependabot[bot] May 15, 2025
4feeea5
Merge pull request #45 from qutip/dependabot/pip/doc/pip-23b04c1fc7
ajgpitch May 16, 2025
ab2f132
Merge pull request #42 from Akhils777/fix-documentation
ajgpitch Jun 5, 2025
d5ff028
Fix: Enable JOPT to support open-system optimization with TRACEDIFF f…
Akhils777 Jul 2, 2025
ee0381f
Match grape infidelity with manually computed one (#51)
rochisha0 Aug 15, 2025
7fe9ce6
Add interactive test notebooks for closed systems (#43)
SeitherJulian Aug 15, 2025
bc385c2
Added requirements for interactive tests to setup.cfg
pmenczel Aug 21, 2025
3fa35c8
Merge pull request #53 from pmenczel/test-requirements
nwlambert Aug 25, 2025
896fcc8
Add file with family package info
veronikakurth Mar 5, 2026
ca2bc1b
Add entry points for family packages to setup.cfg
veronikakurth Mar 6, 2026
8adeb03
Merge pull request #56 from veronikakurth/family_package
pmenczel Mar 6, 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
213 changes: 32 additions & 181 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,199 +11,50 @@ on:
default: ""

jobs:
# The deploy_test job is part of the test of whether we should deploy to PyPI
# or test.PyPI. The job will succeed if either the confirmation reference is
# empty, 'test' or if the confirmation is the selected branch or tag name.
# It will fail if it is nonempty and does not match. All later jobs depend
# on this job, so that they will be immediately cancelled if the confirmation
# is bad. The dependency is currently necessary (2021-03) because GitHub
# Actions does not have a simpler method of cancelling an entire workflow---
# the normal use-case expects to try and run as much as possible despite one
# or two failures.
deploy_test:
name: Verify PyPI deployment confirmation
runs-on: ubuntu-latest
env:
GITHUB_REF: ${{ github.ref }}
CONFIRM_REF: ${{ github.event.inputs.confirm_ref }}
steps:
- name: Compare confirmation to current reference
shell: bash
run: |
[[ -z $CONFIRM_REF || $GITHUB_REF =~ ^refs/(heads|tags)/$CONFIRM_REF$ || $CONFIRM_REF == "test" ]]
if [[ $CONFIRM_REF == "test" ]]; then
echo "Build and deploy to test.pypi.org."
elif [[ -z $CONFIRM_REF ]]; then
echo "Build only. Nothing will be uploaded to PyPI."
else
echo "Full build and deploy. Wheels and source will be uploaded to PyPI."
fi

build_sdist:
name: Build sdist on Ubuntu
needs: deploy_test
runs-on: ubuntu-latest
env:
OVERRIDE_VERSION: ${{ github.event.inputs.override_version }}

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
name: Install Python
with:
# For the sdist we should be as conservative as possible with our
# Python version. This should be the lowest supported version. This
# means that no unsupported syntax can sneak through.
python-version: "3.10"

- name: Install pip build
run: |
python -m pip install 'build'

- name: Build sdist tarball
shell: bash
run: |
if [[ ! -z "$OVERRIDE_VERSION" ]]; then echo "$OVERRIDE_VERSION" > VERSION; fi
# The build package is the reference PEP 517 package builder. All
# dependencies are specified by our setup code.
python -m build --sdist .

# Zip files are not part of PEP 517, so we need to make our own.
- name: Create zipfile from tarball
shell: bash
working-directory: dist
run: |
# First assert that there is exactly one tarball, and find its name.
shopt -s failglob
tarball_pattern="*.tar.gz"
tarballs=($tarball_pattern)
[[ ${#tarballs[@]} == 1 ]]
tarball="${tarballs[0]}"
# Get the stem and make the zipfile name.
stem="${tarball%.tar.gz}"
zipfile="${stem}.zip"
# Extract the tarball and rezip it.
tar -xzf "$tarball"
zip "$zipfile" -r "$stem"
rm -r "$stem"

- uses: actions/upload-artifact@v3
with:
name: sdist
path: |
dist/*.tar.gz
dist/*.zip
if-no-files-found: error

build_wheels:
name: Build wheels on ${{ matrix.os }}
needs: deploy_test
build:
name: Build distribution 📦
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
env:
# Set up wheels matrix. This is CPython 3.10--3.12 for all OS targets.
CIBW_BUILD: "cp3{10,11,12}-*"
# Numpy and SciPy do not supply wheels for i686 or win32 for
# Python 3.10+, so we skip those:
CIBW_SKIP: "*-musllinux* cp3{10,11,12}-manylinux_i686 cp3{10,11,12}-win32"
OVERRIDE_VERSION: ${{ github.event.inputs.override_version }}
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
name: Install Python
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
# This is about the build environment, not the released wheel version.
python-version: "3.10"

- name: Install cibuildwheel
run: |
# cibuildwheel does the heavy lifting for us. Originally tested on
# 2.11.3, but should be fine at least up to any minor new release.
python -m pip install 'cibuildwheel==2.11.*'

- name: Build wheels
shell: bash
run: |
# If the version override was specified, then write it the VERSION
# file with it.
if [[ ! -z "$OVERRIDE_VERSION" ]]; then echo "$OVERRIDE_VERSION" > VERSION; fi
python -m cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@v3
run: >-
python3 -m
pip install
cibuildwheel
--user
- name: Build a binary wheel and a source tarball
run: python3 -m cibuildwheel --output-dir dist
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: wheels
path: ./wheelhouse/*.whl
name: python-package-distributions
path: dist/

deploy:
name: "Deploy to PyPI if desired"
# The confirmation is tested explicitly in `deploy_test`, so we know it is
# either a missing confirmation (so we shouldn't run this job), 'test' or a
# valid confirmation. We don't need to retest the value of the
# confirmation, beyond checking that one existed.
publish-to-pypi:
name: Publish Python 🐍 distribution 📦 to PyPI
if: ${{ github.event.inputs.confirm_ref != '' && github.event.inputs.confirm_ref != 'test' }}
needs: [deploy_test, build_sdist, build_wheels]
runs-on: ubuntu-latest
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_NON_INTERACTIVE: 1
TWINE_REPOSITORY: pypi

steps:
- name: Download build artifacts to local runner
uses: actions/download-artifact@v3

- uses: actions/setup-python@v4
name: Install Python
with:
python-version: "3.10"

- name: Verify this is not a dev version
shell: bash
run: |
python -m pip install wheels/*-cp310-cp310-manylinux*.whl
python -c 'import qutip_qoc; print(qutip_qoc.__version__); assert "dev" not in qutip_qoc.__version__; assert "+" not in qutip_qoc.__version__'

# We built the zipfile for convenience distributing to Windows users on
# our end, but PyPI only needs the tarball.
- name: Upload sdist and wheels to PyPI
run: |
python -m pip install "twine"
python -m twine upload --verbose wheels/*.whl sdist/*.tar.gz

deploy_testpypi:
name: "Deploy to TestPyPI if desired"
if: ${{ github.event.inputs.confirm_ref == 'test' }}
needs: [deploy_test, build_sdist, build_wheels]
needs:
- build
runs-on: ubuntu-latest
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }}
TWINE_NON_INTERACTIVE: 1
environment:
name: pypi
url: https://pypi.org/p/qutip-qoc
permissions:
id-token: write

steps:
- name: Download build artifacts to local runner
uses: actions/download-artifact@v3

- uses: actions/setup-python@v4
name: Install Python
- name: Download all the dists
uses: actions/download-artifact@v4
with:
python-version: "3.10"

- name: Verify this is not a dev version
shell: bash
run: |
python -m pip install wheels/*-cp310-cp310-manylinux*.whl
python -c 'import qutip_qoc; print(qutip_qoc.__version__); assert "dev" not in qutip_qoc.__version__; assert "+" not in qutip_qoc.__version__'

# We built the zipfile for convenience distributing to Windows users on
# our end, but PyPI only needs the tarball.
- name: Upload sdist and wheels to TestPyPI
run: |
python -m pip install "twine"
python -m twine upload --repository testpypi --verbose wheels/*.whl sdist/*.tar.gz
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 2 additions & 2 deletions .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
name: Install Python
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
# -T : display a full traceback if a Python exception occurs
- name: Upload built files
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: qutip_qoc_html_docs
path: doc/_build/html/*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
python-version: "3.12"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,5 @@ repos:
- jaxlib
- diffrax
- pytest
- gymnasium
- stable-baselines3
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include README.md
include VERSION
include LICENSE
include requirements.txt
include pyproject.toml
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ To install the package, use
pip install qutip-qoc
```

By default, the dependencies required for JOPT and for the RL (reinforcement learning) algorithm are omitted.
They can be included by using the targets `qutip-qoc[jopt]` and `qutip-qoc[rl]`, respectively (or `qutip-qoc[full]` for all dependencies).

## Documentation and tutorials

The documentation of `qutip-qoc` updated to the latest development version is hosted at [qutip-qoc.readthedocs.io](https://qutip-qoc.readthedocs.io/en/latest/).
The documentation of `qutip-qoc` updated to the latest development version is hosted at [qutip-qoc.readthedocs.io](https://qutip-qoc.readthedocs.io/latest/).
Tutorials related to using quantum optimal control in `qutip-qoc` can be found [_here_](https://qutip.org/qutip-tutorials/#optimal-control).

## Installation from source
Expand All @@ -40,7 +43,7 @@ pip install --upgrade pip
pip install -e .
```

which makes sure that you are up to date with the latest `pip` version. Contribution guidelines are available [_here_](https://qutip-qoc.readthedocs.io/en/latest/contribution-code.html).
which makes sure that you are up to date with the latest `pip` version. Contribution guidelines are available [_here_](https://qutip-qoc.readthedocs.io/latest/contribution/code.html).

To build and test the documentation, additional packages need to be installed:

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1
0.1.0.dev
24 changes: 24 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@ Changelog
*********


Version 0.0.2 (Oct 04, 2024)
+++++++++++++++++++++++++++++++++

This is an update to the beta release of ``qutip-qoc``.

It mainly introduces the new reinforcement learning algorithm ``qutip_qoc._rl``.

- Non-public facing functions have been renamed to start with an underscore.
- As with other QuTiP functions, ``optimize_pulses`` now takes a ``tlist`` argument instead of ``_TimeInterval``.
- The structure for the control guess and bounds has changed and now takes in an optional ``__time__`` keyword.
- The ``result`` does no longer return ``optimized_objectives`` but instead ``optimized_H``.

Features
--------

- New reinforcement learning algorithm, developed during GSOC24 (#19, #18, by LegionAtol)
- Automatic transfromation of initial and target operator to superoperator (#23, by flowerthrower)

Bug Fixes
---------

- Prevent loss of `__time__` keyword in optimize_pulses (#22, by flowerthrower)


Version 0.0.1 (May xx, 2024)
+++++++++++++++++++++++++++++++++

Expand Down
4 changes: 4 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def qutip_qoc_version():

html_theme = "sphinx_rtd_theme"
html_static_path = []
html_js_files = [
'https://code.jquery.com/jquery-3.6.0.min.js',
]


# -- Options for numpydoc ---------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion doc/contribution/code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Contributing to the source code
Build up an development environment
===================================

Please follow the instruction on the `QuTiP contribution guide <https://qutip.org/docs/latest/development/contributing.html#building>`_ to
Please follow the instruction on the `QuTiP contribution guide <https://qutip.readthedocs.io/en/latest/development/contributing.html>`_ to
build a conda environment.

You don't need to build ``qutip`` in the editable mode unless you also want to contribute to `qutip`.
Expand Down
Loading
Loading