Skip to content

Commit

Permalink
Merge branch 'Qiskit:main' into mps-cutensor
Browse files Browse the repository at this point in the history
  • Loading branch information
MozammilQ authored Feb 6, 2025
2 parents 702ecd0 + 1e86d65 commit c325da0
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 44 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
os: ["macos-13", "ubuntu-latest", "windows-2019"]
steps:
- uses: actions/checkout@v4
- name: Set up Python Python '3.10'
- name: Set up Python Python '3.13'
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.13'
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
if: runner.os == 'Windows'
- name: Install deps
run: python -m pip install -U cibuildwheel==2.17.0
run: python -m pip install -U cibuildwheel==2.22.0
- name: Build Wheels
env:
AER_CMAKE_OPENMP_BUILD: 1
Expand All @@ -39,13 +39,13 @@ jobs:
os: ["macos-latest"]
steps:
- uses: actions/checkout@v4
- name: Set up Python Python 3.10
- name: Set up Python Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.13'
architecture: arm64
- name: Install deps
run: python -m pip install -U cibuildwheel==2.17.0
run: python -m pip install -U cibuildwheel==2.22.0
- name: Build Wheels
env:
CIBW_ARCHS_MACOS: arm64
Expand All @@ -70,10 +70,10 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
python-version: '3.13'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.17.0
python -m pip install cibuildwheel==2.22.0
- name: Build wheels
env:
CIBW_BEFORE_ALL: "sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' -e 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/*.repo && yum install -y yum-utils wget && wget -q https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-rhel7-11-8-local-11.8.0_520.61.05-1.x86_64.rpm && rpm -i cuda-repo-rhel7-11-8-local-11.8.0_520.61.05-1.x86_64.rpm && yum clean all && yum -y install cuda && yum -y install openblas-devel && yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo && yum clean all"
Expand Down Expand Up @@ -103,10 +103,10 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
python-version: '3.13'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.17.0
python -m pip install cibuildwheel==2.22.0
- name: Build wheels
env:
CIBW_BEFORE_ALL: "sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' -e 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/*.repo && yum install -y yum-utils wget && wget -q https://developer.download.nvidia.com/compute/cuda/12.5.1/local_installers/cuda-repo-rhel8-12-5-local-12.5.1_555.42.06-1.x86_64.rpm && rpm -i cuda-repo-rhel8-12-5-local-12.5.1_555.42.06-1.x86_64.rpm && yum clean all && yum -y install cuda-toolkit-12-5 && yum -y install openblas-devel && yum clean all"
Expand Down
43 changes: 25 additions & 18 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
python-version: '3.13'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.17.0
python -m pip install cibuildwheel==2.22.0
- name: Build wheels
env:
AER_CMAKE_OPENMP_BUILD: 1
run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: publish-shared-wheels
name: aer-deploy-shared-wheel-build-${{ matrix.os }}
build_wheels_aarch64:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -60,6 +60,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: aer-deploy-separate-build_wheels_aarch64-${{ matrix.os }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand All @@ -73,21 +74,21 @@ jobs:
environment: release
steps:
- uses: actions/checkout@v4
- name: Set up Python Python '3.10'
- name: Set up Python Python '3.13'
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.13'
architecture: arm64
- name: Install deps
run: python -m pip install -U cibuildwheel==2.17.0
run: python -m pip install -U cibuildwheel==2.22.0
- name: Build Wheels
env:
CIBW_ARCHS_MACOS: arm64
run: cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: publish-shared-wheels
name: aer-deploy-shared-wheel-arm64-macos-${{ matrix.os }}
sdist:
name: Publish qiskit-aer sdist
runs-on: ubuntu-latest
Expand All @@ -100,7 +101,7 @@ jobs:
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.10'
python-version: '3.13'
- name: Install Deps
run: pip install -U scikit-build wheel
- name: Build Artifacts
Expand All @@ -110,6 +111,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
path: ./dist/qiskit*
name: aer-deploy-separate-sdist-${{ matrix.os }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down Expand Up @@ -137,23 +139,24 @@ jobs:
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.10'
python-version: '3.13'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.16.2
python -m pip install cibuildwheel==2.22.0
- name: Build wheels
env:
CIBW_BEFORE_ALL: "sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' -e 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/*.repo && yum install -y yum-utils wget && wget -q https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-rhel7-11-8-local-11.8.0_520.61.05-1.x86_64.rpm && rpm -i cuda-repo-rhel7-11-8-local-11.8.0_520.61.05-1.x86_64.rpm && yum clean all && yum -y install cuda && yum -y install openblas-devel && yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo && yum clean all"
CIBW_BEFORE_BUILD : "pip install nvidia-cuda-runtime-cu11 nvidia-cublas-cu11 nvidia-cusolver-cu11 nvidia-cusparse-cu11 'cuquantum-cu11<24.11.0'"
CIBW_SKIP: "*-manylinux_i686 pp* cp36* cp37* *musllinux*"
CIBW_SKIP: "*-manylinux_i686 pp* cp36* cp37* cp38* *musllinux*"
CIBW_TEST_SKIP: "*"
CIBW_ENVIRONMENT: QISKIT_AER_PACKAGE_NAME=qiskit-aer-gpu-cu11 QISKIT_AER_CUDA_MAJOR=11 CMAKE_VERBOSE_MAKEFILE=true AER_THRUST_BACKEND=CUDA CUDACXX=/usr/local/cuda/bin/nvcc AER_CUDA_ARCH="7.0 7.2 7.5 8.0 8.6 8.7" AER_PYTHON_CUDA_ROOT=/opt/_internal AER_CIBUILD=true
CIBW_REPAIR_WHEEL_COMMAND: 'auditwheel repair --exclude libcudart.so.11.0 --exclude libcustatevec.so.1 --exclude libcutensornet.so.2 --exclude libcutensor.so.1 --exclude libcutensorMg.so.1 --exclude libcusolver.so.11 --exclude libcusolverMg.so.11 --exclude libcusparse.so.11 --exclude libcublas.so.11 --exclude libcublasLt.so.11 -w {dest_dir} {wheel}'
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: aer-deploy-separate-gpu-build-cuda11-${{ matrix.os }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down Expand Up @@ -184,20 +187,21 @@ jobs:
python-version: '3.10'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.16.2
python -m pip install cibuildwheel==2.22.0
- name: Build wheels
env:
CIBW_BEFORE_ALL: "sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' -e 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/*.repo && yum install -y yum-utils wget && wget -q https://developer.download.nvidia.com/compute/cuda/12.5.1/local_installers/cuda-repo-rhel8-12-5-local-12.5.1_555.42.06-1.x86_64.rpm && rpm -i cuda-repo-rhel8-12-5-local-12.5.1_555.42.06-1.x86_64.rpm && yum clean all && yum -y install cuda-toolkit-12-5 && yum -y install openblas-devel && yum clean all"
CIBW_BEFORE_BUILD : "pip install nvidia-cuda-runtime-cu12 nvidia-nvjitlink-cu12 nvidia-cublas-cu12 nvidia-cusolver-cu12 nvidia-cusparse-cu12 'cuquantum-cu12<24.11.0"
CIBW_SKIP: "*-manylinux_i686 pp* cp36* cp37* *musllinux*"
CIBW_SKIP: "*-manylinux_i686 pp* cp36* cp37* cp38* *musllinux*"
CIBW_TEST_SKIP: "*"
CIBW_ENVIRONMENT: QISKIT_AER_PACKAGE_NAME=qiskit-aer-gpu QISKIT_AER_CUDA_MAJOR=12 CMAKE_VERBOSE_MAKEFILE=true AER_THRUST_BACKEND=CUDA CUDACXX=/usr/local/cuda/bin/nvcc AER_CUDA_ARCH="7.0 7.2 7.5 8.0 8.6 8.7 9.0" AER_PYTHON_CUDA_ROOT=/opt/_internal AER_CIBUILD=true
CIBW_REPAIR_WHEEL_COMMAND: 'auditwheel repair --exclude libcudart.so.12 --exclude libcustatevec.so.1 --exclude libcutensornet.so.2 --exclude libcutensor.so.1 --exclude libcutensorMg.so.1 --exclude libcusolver.so.11 --exclude libcusolverMg.so.11 --exclude libcusolver.so.12 --exclude libcusolverMg.so.12 --exclude libcusparse.so.12 --exclude libcublas.so.12 --exclude libcublasLt.so.12 --exclude libnvJitLink.so.12 -w {dest_dir} {wheel}'
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: aer-deploy-separate-gpu-build-cuda12-${{ matrix.os }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down Expand Up @@ -234,6 +238,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: aer-deploy-separate-build_wheels_s390x-${{ matrix.os }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand All @@ -253,7 +258,7 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
python-version: '3.13'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand All @@ -270,6 +275,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: aer-deploy-separate-build_wheels_ppc64le-${{ matrix.os }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand All @@ -285,7 +291,8 @@ jobs:
- uses: actions/download-artifact@v4
with:
path: deploy
name: publish-shared-wheels
pattern: 'aer-deploy-shared-*'
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ jobs:
- name: Setup tutorials job
run: |
set -e
sudo apt install -y graphviz pandoc libblas-dev liblapack-dev
git clone https://github.com/Qiskit/qiskit-tutorials --depth=1
python -m pip install --upgrade pip wheel
pip install -U -r requirements-dev.txt -c constraints.txt
pip install -c constraints.txt git+https://github.com/Qiskit/qiskit
pip install -c constraints.txt .
sudo apt install -y graphviz pandoc libopenblas-dev
pip check
shell: bash
- name: Run Tutorials
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/neko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
with:
test_selection: backend
repo_install_command: |
sudo apt-get install -y libblas-dev liblapack-dev
pip install scipy==1.13.1
pip install conan
pip uninstall -y qiskit qiskit-terra qiskit-aer
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
needs: ["lint"]
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", '3.11', "3.12.0"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
platform: [
{ os: "ubuntu-latest", python-architecture: "x64" },
]
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12.0"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
qiskit-extra: [""]
include:
- python-version: "3.10"
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", '3.11', "3.12.0"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
env:
AER_THRUST_BACKEND: OMP
QISKIT_TEST_CAPTURE_STREAMS: 1
Expand Down Expand Up @@ -243,7 +243,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12.0"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
env:
AER_THRUST_BACKEND: OMP
QISKIT_TEST_CAPTURE_STREAMS: 1
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta"
[tool.cibuildwheel]
manylinux-x86_64-image = "manylinux2014"
manylinux-i686-image = "manylinux2014"
skip = "pp* cp36* cp37* *musllinux* cp38-macosx_arm64"
skip = "pp* cp36* cp37* cp38* *musllinux*"
test-skip = "cp3*-win32 cp3*-manylinux_i686"
test-command = "python {project}/tools/verify_wheels.py"
# We need to use pre-built versions of Numpy and Scipy in the tests; they have a
Expand All @@ -28,9 +28,9 @@ before-all = "sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' -
environment = { CMAKE_GENERATOR = "Visual Studio 16 2019"}

[[tool.cibuildwheel.overrides]]
select = "cp3{8,9,10,11,12}-manylinux_i686"
select = "cp3{9,10,11,12,13}-manylinux_i686"
before-all = "sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' -e 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/*.repo && yum install -y wget && bash {project}/tools/install_openblas_i686.sh && bash {project}/tools/install_rust.sh"

[tool.black]
line-length = 100
target-version = ['py38', 'py39', 'py310', 'py311']
target-version = ['py39', 'py310', 'py311', 'py312', 'py313']
3 changes: 2 additions & 1 deletion qiskit_aer/library/control_flow_instructions/jump.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class AerJump(Instruction):
def __init__(self, jump_to, num_qubits, num_clbits=0):
super().__init__("jump", num_qubits, num_clbits, [jump_to])
self.condition_expr = None
self.condition = None

def set_conditional(self, cond):
"""Set condition to perform this jump instruction.
Expand All @@ -42,5 +43,5 @@ def set_conditional(self, cond):
if isinstance(cond, Expr):
self.condition_expr = cond
else:
self.c_if(*cond)
self.condition = cond
return self
5 changes: 3 additions & 2 deletions qiskit_aer/noise/errors/quantum_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,9 @@ def to_dict(self):
inst_dict["params"] = inst.operation.params
if inst.operation.label:
inst_dict["label"] = inst.operation.label
if inst.operation.condition:
inst_dict["condition"] = inst.operation.condition
condition = getattr(inst.operation, "condition", None)
if condition:
inst_dict["condition"] = condition
circ_inst.append(inst_dict)
instructions.append(circ_inst)
# Construct error dict
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
features:
- |
Added support for running qiskit-aer with Python 3.13
deprecations:
- |
Python 3.8 is no longer supported as it is not supported in qiskit 1.3
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake!=3.17.1,!=3.17.0
conan<2.0.0
scikit-build>=0.11.0
asv
cvxpy<1.5.0
cvxpy<1.6.0
pylint
black[jupyter]~=24.1
clang-format~=15.0.7
Expand Down
4 changes: 2 additions & 2 deletions src/simulators/statevector/qubitvector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,10 +730,10 @@ void QubitVector<data_t>::check_vector(const cvector_t<data_t> &vec,

template <typename data_t>
void QubitVector<data_t>::check_dimension(const QubitVector &qv) const {
if (data_size_ != qv.size_) {
if (data_size_ != qv.data_size_) {
std::string error = "QubitVector: vectors are different shape " +
std::to_string(data_size_) +
" != " + std::to_string(qv.num_states_);
" != " + std::to_string(qv.data_size_);
throw std::runtime_error(error);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/simulators/statevector/qubitvector_thrust.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,10 @@ void QubitVectorThrust<data_t>::check_vector(const cvector_t<data_t> &vec,
template <typename data_t>
void QubitVectorThrust<data_t>::check_dimension(
const QubitVectorThrust &qv) const {
if (data_size_ != qv.size_) {
if (data_size_ != qv.data_size_) {
std::string error = "QubitVectorThrust: vectors are different shape " +
std::to_string(data_size_) +
" != " + std::to_string(qv.num_states_);
" != " + std::to_string(qv.data_size_);
throw std::runtime_error(error);
}
}
Expand Down

0 comments on commit c325da0

Please sign in to comment.