Skip to content

Commit

Permalink
Merge pull request #439 from sandialabs/bugfix-densitymx-slow
Browse files Browse the repository at this point in the history
Fix densitymx slow bug.
  • Loading branch information
coreyostrove committed May 15, 2024
2 parents fd0ce69 + c77f57d commit 41dc6fa
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 121 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/extras.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,7 @@ jobs:
# but still compile Cython extensions
python -m pip install -e .[testing]
python setup.py build_ext --inplace
- name: Run test_packages Ubuntu
if: ${{matrix.os == 'ubuntu-latest'}}
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -v -n auto --dist loadscope --ignore=test/test_packages/mpi --ignore=test/test_packages/notebooks test/test_packages
- name: Run test_packages Windows
if: ${{matrix.os == 'windows-latest'}}
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -v -n auto --dist loadscope --ignore=test/test_packages/mpi --ignore=test/test_packages/notebooks test/test_packages
- name: Run test_packages MacOS
if: ${{matrix.os == 'macos-latest'}}

- name: Run test_packages
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -v -n auto --dist loadscope --ignore=test/test_packages/mpi --ignore=test/test_packages/notebooks test/test_packages
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/main-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,13 @@ jobs:
python -m pip install flake8
python -m pip install -e .[testing]
python setup.py build_ext --inplace
# python -m pip freeze # this isn't relevant anymore since pip install builds a wheel separately
- name: Lint with flake8
run: |
# Critical errors, exit on failure
flake8 . --count --show-source --statistics --config=.flake8-critical
# Standard PEP8, allowed to fail since exit-zero treats all errors as warnings
flake8 . --exit-zero --statistics
- name: Run unit tests MacOS
if: ${{matrix.os == 'macos-latest'}}
- name: Run unit tests
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -n auto --dist loadscope --cov=pygsti test/unit
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/main-minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,14 @@ jobs:
python -m pip install flake8
python -m pip install -e .[testing]
python setup.py build_ext --inplace
# python -m pip freeze # this isn't relevant anymore since pip install builds a wheel separately
- name: Lint with flake8
if: ${{matrix.os != 'windows-latest'}}
run: |
# Critical errors, exit on failure
flake8 . --count --show-source --statistics --config=.flake8-critical
# Standard PEP8, allowed to fail since exit-zero treats all errors as warnings
flake8 . --exit-zero --statistics
- name: Run unit tests ubuntu
if: ${{matrix.os == 'ubuntu-latest'}}
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -n auto --dist loadscope --cov=pygsti test/unit
- name: Run unit tests windows
if: ${{matrix.os == 'windows-latest'}}
- name: Run unit tests
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -n auto --dist loadscope --cov=pygsti test/unit
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/main-no-cython.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Build and run tests (No Cython)

on:
push:
branches: [ "beta", "master" ]
pull_request:
branches: [ "**:**" ]
# Allow running manually from Actions tab
workflow_dispatch:

env:
SKIP_DEAP: 1

jobs:
build: # Main build + unit test check

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.8, 3.9, '3.10', '3.11']

steps:
- uses: actions/checkout@v4
- name: Set up installation environment (Ubuntu or Windows)
if: ${{matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest'}}
run: |
./.github/ci-scripts/before_install.sh
- name: Set up installation environment (MacOS)
if: ${{matrix.os == 'macos-latest'}}
run: |
./.github/ci-scripts/before_install_macos.sh
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ hashFiles('**/*requirements.txt') }}
- name: Install package
run: |
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install flake8
python -m pip install -e .[testing_no_cython]
- name: Run unit tests
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -n auto --dist loadscope --cov=pygsti test/unit
7 changes: 0 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:
python -m pip install flake8
python -m pip install -e .[testing]
python setup.py build_ext --inplace
# python -m pip freeze # this isn't relevant anymore since pip install builds a wheel separately
- name: Lint with flake8
if: ${{matrix.os != 'windows-latest'}}
run: |
Expand All @@ -54,12 +53,6 @@ jobs:
# Standard PEP8, allowed to fail since exit-zero treats all errors as warnings
flake8 . --exit-zero --statistics
- name: Run unit tests ubuntu
if: ${{matrix.os == 'ubuntu-latest'}}
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -n auto --dist loadscope --cov=pygsti test/unit
- name: Run unit tests windows
if: ${{matrix.os == 'windows-latest'}}
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -n auto --dist loadscope --cov=pygsti test/unit
Expand Down
76 changes: 0 additions & 76 deletions .github/workflows/manualdeploy.yml

This file was deleted.

13 changes: 1 addition & 12 deletions .github/workflows/notebook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,7 @@ jobs:
# but still compile Cython extensions
python -m pip install -e .[testing]
python setup.py build_ext --inplace
- name: Run notebook regression ubuntu
if: ${{matrix.os == 'ubuntu-latest'}}
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -n auto --nbval-lax --dist loadscope --nbval-current-env jupyter_notebooks
- name: Run notebook regression windows
if: ${{matrix.os == 'windows-latest'}}
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -n auto --nbval-lax --dist loadscope --nbval-current-env jupyter_notebooks
- name: Run notebook regression MacOS
if: ${{matrix.os == 'macos-latest'}}
- name: Run notebook regression
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -n auto --nbval-lax --dist loadscope --nbval-current-env jupyter_notebooks
Expand Down
2 changes: 1 addition & 1 deletion pygsti/evotypes/densitymx_slow/opreps.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def __init__(self, name, basis, state_space):
state_space = _StateSpace.cast(state_space)
assert(superop.shape[0] == state_space.dim)

super(OpRepStandard, self).__init__(superop, state_space)
super(OpRepStandard, self).__init__(superop, basis, state_space)


class OpRepKraus(OpRep):
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
# which is unavailable in some common environments.
extras['no_mpi'] = [e for e in extras['complete'] if e != 'mpi4py']

# Add testing_no_cython target, identical to `testing` but no cython
extras['testing_no_cython'] = [e for e in extras['testing'] if e != 'cython']


# Configure setuptools_scm to build the post-release version number
def custom_version():
Expand Down Expand Up @@ -131,7 +134,8 @@ def setup_with_extensions(extensions=None):
cmdclass={'build_ext': build_ext_compiler_check},
description='A python implementation of Gate Set Tomography',
long_description=descriptionTxt,
author='Erik Nielsen, Kenneth Rudinger, Timothy Proctor, John Gamble, Robin Blume-Kohout',
author='Erik Nielsen, Stefan Seritan, Corey Ostrove, Riley Murray, Jordan Hines, ' +\
'Kenneth Rudinger, Timothy Proctor, John Gamble, Robin Blume-Kohout',
author_email='pygsti@sandia.gov',
packages=[
'pygsti',
Expand Down

0 comments on commit 41dc6fa

Please sign in to comment.