Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ on:
- '**'
merge_group:
workflow_dispatch:
inputs:
run_slow_tests:
description: Run slow tests
required: false
default: false
type: boolean

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -344,7 +350,7 @@ jobs:
- name: Run Python tests
env:
OMP_NUM_THREADS: ${{ matrix.python-test-threads }}
QDK_CHEMISTRY_RUN_SLOW_TESTS: 0
QDK_CHEMISTRY_RUN_SLOW_TESTS: ${{ inputs.run_slow_tests && '1' || '0' }}
Comment thread
lorisercole marked this conversation as resolved.
working-directory: python
run: |
set -e
Expand Down
5 changes: 5 additions & 0 deletions .pipelines/templates/test-pip-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ parameters:
- name: pyenvVersion
type: string
default: 2.6.31
- name: runSlowTests
type: boolean
default: true

steps:
- ${{ if eq(parameters.macBuild, 'OFF') }}:
Expand All @@ -26,6 +29,7 @@ steps:
--platform ${{ parameters.imageTag }} \
-e PIP_INDEX_URL \
-e QSHARP_PYTHON_TELEMETRY=false \
-e QDK_CHEMISTRY_RUN_SLOW_TESTS=${{ parameters.runSlowTests }} \
-v ${{ parameters.agentBuildDirectory }}:/workspace \
-w /workspace/qdk-chemistry/python \
${{ parameters.dockerImage }} \
Expand All @@ -38,6 +42,7 @@ steps:
- script: |
echo "Running wheel tests (native)..."
cd ${{ parameters.agentBuildDirectory }}/qdk-chemistry/python
export QDK_CHEMISTRY_RUN_SLOW_TESTS=${{ parameters.runSlowTests }}
bash ../.pipelines/pip-scripts/test-pip-wheels.sh ${{ parameters.pythonVersion }} \
${{ parameters.macBuild }} \
${{ parameters.pyenvVersion }}
Expand Down
6 changes: 3 additions & 3 deletions examples/qpe_stretched_n2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"\n",
"This notebook provides an example of `qdk-chemistry` functionality through an end-to-end workflow estimating the ground state energy of a multi-configurational quantum chemistry system. This is one example of a wide range of functionality in `qdk-chemistry`. Please see <https://github.com/microsoft/qdk-chemistry> for the full documentation.\n",
"\n",
"In addition to [installing `qdk-chemistry`](https://github.com/microsoft/qdk-chemistry/blob/main/INSTALL.md), you will need to install the `jupyter` extra to run this notebook:\n",
"In addition to [installing `qdk-chemistry`](https://github.com/microsoft/qdk-chemistry/blob/main/INSTALL.md), you will need to install the `jupyter` and `qiskit-extras` extras to run this notebook:\n",
"\n",
"```bash\n",
"pip install 'qdk-chemistry[jupyter]'\n",
"pip install 'qdk-chemistry[jupyter,qiskit-extras]'\n",
"```\n",
"\n",
"This installs the additional dependencies required by this notebook (ipykernel, pandas, and pyscf)."
"This installs the additional dependencies required by this notebook (ipykernel, pandas, pyscf, qiskit)."
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions examples/state_prep_energy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"This notebook demonstrates an end-to-end multi-configurational quantum chemistry workflow using `qdk-chemistry`.\n",
"It covers molecule loading and visualization, self-consistent-field (SCF) calculation, active-space selection, multi-configurational wavefunction generation, quantum state-preparation circuit construction, and measurement circuits for energy estimation.\n",
"\n",
"**Prerequisites:** In addition to [installing `qdk-chemistry`](https://github.com/microsoft/qdk-chemistry/blob/main/INSTALL.md), you will need to install the `jupyter` extra to run this notebook:\n",
"**Prerequisites:** In addition to [installing `qdk-chemistry`](https://github.com/microsoft/qdk-chemistry/blob/main/INSTALL.md), you will need to install the `jupyter` and `qiskit-extras` extras to run this notebook:\n",
"\n",
"```bash\n",
"pip install 'qdk-chemistry[jupyter]'\n",
"pip install 'qdk-chemistry[jupyter,qiskit-extras]'\n",
"```\n",
"\n",
"This installs the additional dependencies required by this notebook (ipykernel, pandas, and pyscf).\n",
"This installs the additional dependencies required by this notebook (ipykernel, pandas, pyscf, and qiskit).\n",
"\n",
"---\n",
"\n",
Expand Down
10 changes: 10 additions & 0 deletions python/tests/test_sample_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

import pytest

from qdk_chemistry.plugins.qiskit import QDK_CHEMISTRY_HAS_QISKIT

# Optional dependencies for notebook execution
try:
import nbformat
Expand Down Expand Up @@ -245,6 +247,10 @@ def test_factory_list():
not _HAS_JUPYTER_KERNEL,
reason="Jupyter kernel 'python3' not available. Install ipykernel and register the kernel.",
)
@pytest.mark.skipif(
not QDK_CHEMISTRY_HAS_QISKIT,
reason="Qiskit dependencies not available",
)
def test_state_prep_energy():
"""Test the examples/state_prep_energy.ipynb notebook executes without errors."""
notebook_path = EXAMPLES_DIR / "state_prep_energy.ipynb"
Expand All @@ -269,6 +275,10 @@ def test_state_prep_energy():
not _HAS_JUPYTER_KERNEL,
reason="Jupyter kernel 'python3' not available. Install ipykernel and register the kernel.",
)
@pytest.mark.skipif(
not QDK_CHEMISTRY_HAS_QISKIT,
reason="Qiskit dependencies not available",
)
def test_qpe_stretched_n2():
"""Test the examples/qpe_stretched_n2.ipynb notebook executes without errors."""
notebook_path = EXAMPLES_DIR / "qpe_stretched_n2.ipynb"
Expand Down
Loading