Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
31b8a91
Feat: Add the possibility to install a specific provider
JulienCalistoTD Nov 13, 2025
fe2c1d3
chore: Files formated
github-actions[bot] Nov 13, 2025
a274099
fix: triggers workflow on pull request an on `main` and `dev` + Corr…
JulienCalistoTD Nov 13, 2025
f2921bc
Merge branch 'feat-install-limited-providers' of https://github.com/C…
JulienCalistoTD Nov 13, 2025
b6b4d2b
fix: Remove unnecessary type ignore comments and clean up pyright
JulienCalistoTD Nov 13, 2025
b9ab93d
chore: Files formated
github-actions[bot] Nov 13, 2025
8a81006
test: Add echo statement to output providers_comma during dependency …
JulienCalistoTD Nov 13, 2025
acb8458
Merge branch 'feat-install-limited-providers' of https://github.com/C…
JulienCalistoTD Nov 13, 2025
7b89042
fix: Update providers directory path to requirements_providers
JulienCalistoTD Nov 13, 2025
b11e81b
refactor: Remove unnecessary warning context from run calls in tests
JulienCalistoTD Nov 14, 2025
0d9b4b6
chore: Files formated
github-actions[bot] Nov 14, 2025
13fd752
fix: pyright
JulienCalistoTD Nov 14, 2025
b26f509
Merge branch 'feat-install-limited-providers' of https://github.com/C…
JulienCalistoTD Nov 14, 2025
f93d6c4
fix: Workflow Update provider input type to choice
JulienCalistoTD Nov 24, 2025
cec1530
refactor: Update qiskit
JulienCalistoTD Nov 25, 2025
bcdee5b
fix: Update gphase handling in QASM conversion and circuit transpilation
JulienCalistoTD Dec 3, 2025
1039b20
chore: Update Python version to 3.10 in workflows, Dockerfile, and do…
JulienCalistoTD Dec 3, 2025
6eb91c0
chore: Remove unused badges
JulienCalistoTD Dec 3, 2025
4fa879d
test: Remove redundant transpilation parameters in replace_custom_gat…
JulienCalistoTD Dec 3, 2025
f23dba0
chore: Update dependencies and change qiskit order
JulienCalistoTD Jan 6, 2026
c20b4cd
chore: Files formated
github-actions[bot] Jan 29, 2026
e1fc90c
feat: Add account deletion and quantum qiskit channel
JulienCalistoTD Jan 29, 2026
8a81763
Merge branch 'chore-setup-connection-channel' of https://github.com/C…
JulienCalistoTD Jan 29, 2026
ca30a4e
chore: Files formated
github-actions[bot] Jan 29, 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
35 changes: 26 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ name: Tests

on:
push:
branches:
- main
- dev
pull_request:
workflow_dispatch:
inputs:
python_v:
description: "python version"
required: true
default: "3.9"
default: "3.10"
type: choice
options:
- "3.9"
- "3.10"
- "3.11"
commit_ref:
Expand All @@ -23,13 +26,24 @@ on:
required: false
default: false
type: boolean

providers:
description: "Providers to enable (space-separated) e.g., 'qiskit cirq myqlm braket')"
required: false
default: "all"
type: choice
options:
- "all"
- "qiskit"
- "cirq"
- "braket"
- "myqlm"
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ${{ fromJSON(github.event_name == 'workflow_dispatch' && format('["{0}"]', github.event.inputs.python_v) || '["3.9", "3.10", "3.11"]') }}
python-version: ${{ fromJSON(github.event_name == 'workflow_dispatch' && format('["{0}"]', github.event.inputs.python_v) || '["3.10", "3.11"]') }}
provider: ${{ fromJSON(github.event_name == 'workflow_dispatch' && format('["{0}"]', github.event.inputs.providers) || (github.ref_name == 'main' && '["all", "qiskit", "cirq", "braket", "myqlm"]' || '["all"]')) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -44,25 +58,27 @@ jobs:
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt
providers_comma=$(echo "${{ matrix.provider }}" | sed 's/ /,/g')
echo $providers_comma
pip install .[$providers_comma]
- name: Install os specific dependencies
if: ${{ github.event.inputs.long == 'true' || github.ref_name == 'main' }}
run: |
pip install .
sudo apt-get update
sudo apt install -y poppler-utils
sudo apt-get install -y texlive-latex-base texlive-pictures texlive-latex-extra
- name: Run tests
run: |
if [ "${{ github.event.inputs.long }}" == "true" ] || [ "${{ github.ref_name }}" == "main" ]; then
python -m pytest --long-local
if [[ "${{ github.event.inputs.long }}" == "true" || "${{ github.ref_name }}" == "main" ]]; then
python -m pytest --long-local
else
python -m pytest
python -m pytest --providers ${{ matrix.provider }}
fi
typechecks:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ${{ fromJSON(github.event_name == 'workflow_dispatch' && format('["{0}"]', github.event.inputs.python_v) || '["3.9", "3.10", "3.11"]') }}
python-version: ${{ fromJSON(github.event_name == 'workflow_dispatch' && format('["{0}"]', github.event.inputs.python_v) || '["3.10", "3.11"]') }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -77,5 +93,6 @@ jobs:
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -r requirements-all.txt
- name: Run type checker
run: pyright
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Stage 1: Build dependencies
FROM python:3.9 AS builder
FROM python:3.10 AS builder

WORKDIR /usr/src/app

COPY requirements.txt requirements-dev.txt ./
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements-dev.txt

FROM python:3.9
FROM python:3.10

RUN apt update && \
apt install -y \
Expand All @@ -27,7 +27,7 @@ RUN chmod +x linux_awscli_install.sh && ./linux_awscli_install.sh

WORKDIR /usr/src/app/mpqp

COPY --from=builder /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
COPY .. /usr/src/app/mpqp/

COPY requirements.txt requirements-dev.txt /usr/src/app/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ On this page, you will find:

## Install

For now, we support python versions 3.9 to 3.11, and every major OS (Windows,
For now, we support python versions 3.10 to 3.12, and every major OS (Windows,
Linux and MacOS). We are dependant on the SDKs we support to enable various
python versions and OS support, for instance, MPQP was validated on Ubuntu LTS
20.04, while Ubuntu 18.04 is not supported because myQLM does not support it.
Expand Down
36 changes: 32 additions & 4 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ def pytest_addoption(parser: pytest.Parser):
type=int,
help="Set a global random seed for tests (default is None for random behavior).",
)
parser.addoption(
"--providers",
action="store",
nargs="*",
type=str,
help="List of providers to enable (e.g. --providers cirq qiskit azure)",
)


def pytest_configure(config: Any):
Expand All @@ -31,11 +38,15 @@ def pytest_configure(config: Any):
This hook is called for every plugin and initial conftest
file after command line options have been parsed.
"""
if (
not config.getoption("--long")
or not config.getoption("--long-costly")
or not config.getoption("--long-local")
):
from tests.local_storage.test_local_storage import create_test_local_storage

from tests.local_storage.test_local_storage import create_test_local_storage

print("Creating local storage for tests")
create_test_local_storage()
print("Creating local storage for tests")
create_test_local_storage()


@pytest.fixture(autouse=True)
Expand All @@ -52,3 +63,20 @@ def stable_random(*args: Any, **kwargs: Any):
return default_rng(user_seed or seed)

monkeypatch.setattr('numpy.random.default_rng', stable_random)


def pytest_runtest_setup(item: pytest.Function):

providers = item.config.getoption("--providers")
if TYPE_CHECKING:
assert isinstance(providers, list) or isinstance(providers, type(None))
if providers is None:
providers = ["all"]
elif not providers:
providers = []

provider_marker = item.get_closest_marker("provider")
if provider_marker:
required = provider_marker.args[0]
if "all" not in providers and required not in providers:
pytest.skip(f"Skipping test: provider '{required}' not active")
4 changes: 1 addition & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,7 @@ def __init__(self, **options): # type: ignore

PygmentsBridge.latex_formatter = CustomLatexFormatter

latex_elements[
"preamble"
] += r"""
latex_elements["preamble"] += r"""
% One-column index
\makeatletter
\renewenvironment{theindex}{
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Installation
.. TODO: grab the compatibility matrix from MyQLM and relax our requirements
.. when possible, test on many different configurations (tox or other ?)

For now, we support Python versions 3.9 to 3.11, and all of Windows, Linux and
For now, we support Python versions 3.10 to 3.11, and all of Windows, Linux and
MacOS (specifically, Linux was validated on Ubuntu LTS 20.04, while Ubuntu 18.04
is not supported, so your milage may vary).

Expand Down Expand Up @@ -36,7 +36,7 @@ version, run instead
$ curl -L https://raw.githubusercontent.com/ColibrITD-SAS/mpqp/main/mac-install.sh | bash -s -- <your-python-bin>

where ``<your-python-bin>`` is the binary you use to invoke python. For instance, it could
be ``python``, ``python3``, or ``python3.9``.
be ``python``, ``python3``, or ``python3.10``.

.. warning::
The migration from ``qiskit`` version ``0.x`` to ``1.x`` caused a few issues.
Expand Down
1 change: 0 additions & 1 deletion examples/scripts/noisy_simulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from mpqp.noise import *
from mpqp.execution import *


circuit = QCircuit(
[Rx(0.3, 2), H(0), CNOT(1, 0), SWAP(2, 1), U(0.9, 0.2, 1, 1), BasisMeasure()]
)
Expand Down
Loading