Skip to content

Commit

Permalink
Merge branch 'main' into fix-name-transpile
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelishman authored Feb 24, 2025
2 parents e2d9967 + 8e6200a commit 9f206e7
Show file tree
Hide file tree
Showing 241 changed files with 3,152 additions and 11,098 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,15 @@ concurrency:
jobs:
tests:
if: github.repository_owner == 'Qiskit'
name: macOS-arm64-tests-Python-${{ matrix.python-version }}
runs-on: macOS-14
name: ${{ matrix.os }}-arm64-tests-Python-${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Normally we test min and max version but we can't run python
# 3.9 on arm64 until actions/setup-python#808 is resolved
python-version: ["3.10", "3.13"]
python-version: ["3.9", "3.13"]
os: ["macOS-14", "ubuntu-24.04-arm"]
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.70
if: matrix.python-version == '3.10'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -36,7 +32,7 @@ jobs:
python -m pip install -U -r requirements.txt -c constraints.txt
python -m pip install -U -r requirements-dev.txt -c constraints.txt
python -m pip install -c constraints.txt -e .
if: matrix.python-version == '3.10'
if: matrix.python-version == '3.9'
env:
QISKIT_NO_CACHE_GATES: 1
- name: 'Install dependencies'
Expand All @@ -49,6 +45,6 @@ jobs:
run: |
python -m pip install -r requirements-optional.txt -c constraints.txt
python tools/report_numpy_state.py
if: matrix.python-version == '3.10'
if: matrix.python-version == '3.9'
- name: 'Run tests'
run: stestr run
38 changes: 10 additions & 28 deletions .github/workflows/wheels-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ on:
default: "default"
required: false

wheels-linux-aarch64:
description: >-
The action to take for Linux AArch64 wheels.
Choose from 'default', 'build' or 'skip'.
type: string
default: "default"
required: false

artifact-prefix:
description: "A prefix to give all artifacts uploaded with 'actions/upload-artifact'."
type: string
Expand Down Expand Up @@ -85,12 +77,12 @@ jobs:
# Used for the ARM builds.
- macos-14
- windows-latest
- ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
architecture: ${{ matrix.os == 'macos-14' && 'arm64' || 'x64' }}
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
Expand All @@ -108,12 +100,19 @@ jobs:
run: |
set -e
mkdir -p "$PGO_WORK_DIR"
if [[ `uname -m` == "aarch64" ]] ; then
INSTALL_RUST_PATH=tools/install_rust_msrv.sh
RUST_TOOLCHAIN=1.79
else
INSTALL_RUST_PATH=tools/install_rust.sh
RUST_TOOLCHAIN=stable
fi
cat >>"$GITHUB_ENV" <<EOF
CIBW_BEFORE_ALL_LINUX=yum install -y wget && {package}/$INSTALL_RUST_PATH
CIBW_BEFORE_BUILD=bash ./tools/build_pgo.sh $PGO_WORK_DIR $PGO_OUT_PATH
CIBW_ENVIRONMENT=RUSTUP_TOOLCHAIN=stable RUSTFLAGS='-Cprofile-use=$PGO_OUT_PATH -Cllvm-args=-pgo-warn-missing-function'
CIBW_ENVIRONMENT_MACOS=MACOSX_DEPLOYMENT_TARGET='10.12' RUSTUP_TOOLCHAIN=stable RUSTFLAGS='-Cprofile-use=$PGO_OUT_PATH -Cllvm-args=-pgo-warn-missing-function'
CIBW_ENVIRONMENT_LINUX=RUSTUP_TOOLCHAIN=stable RUSTFLAGS='-Cprofile-use=$PGO_OUT_PATH -Cllvm-args=-pgo-warn-missing-function' PATH="\$PATH:\$HOME/.cargo/bin" CARGO_NET_GIT_FETCH_WITH_CLI="true"
CIBW_ENVIRONMENT_LINUX=RUSTUP_TOOLCHAIN=$RUST_TOOLCHAIN RUSTFLAGS='-Cprofile-use=$PGO_OUT_PATH -Cllvm-args=-pgo-warn-missing-function' PATH="\$PATH:\$HOME/.cargo/bin" CARGO_NET_GIT_FETCH_WITH_CLI="true"
EOF
env:
PGO_WORK_DIR: ${{ github.workspace }}/pgo-data
Expand All @@ -123,7 +122,6 @@ jobs:
with:
path: ./wheelhouse/*.whl
name: ${{ inputs.artifact-prefix }}wheels-tier-1-${{ matrix.os }}

wheels-linux-s390x:
name: "Wheels / Linux s390x"
if: (inputs.wheels-linux-s390x == 'default' && inputs.default-action || inputs.wheels-linux-s390x) == 'build'
Expand Down Expand Up @@ -170,22 +168,6 @@ jobs:
path: ./wheelhouse/*.whl
name: ${{ inputs.artifact-prefix }}wheels-linux-ppc64le

wheels-linux-aarch64:
name: "Wheels / Linux AArch64"
if: (inputs.wheels-linux-aarch64 == 'default' && inputs.default-action || inputs.wheels-linux-aarch64) == 'build'
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- uses: dtolnay/rust-toolchain@stable
- uses: pypa/cibuildwheel@v2.22.0
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: ${{ inputs.artifact-prefix }}wheels-linux-aarch64

sdist:
name: "sdist"
if: (inputs.sdist == 'default' && inputs.default-action || inputs.sdist) == 'build'
Expand Down
63 changes: 20 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resolver = "2"
[workspace.package]
version = "2.0.0"
edition = "2021"
rust-version = "1.79" # Keep in sync with README.md and rust-toolchain.toml.
rust-version = "1.79" # Keep in sync with README.md, rust-toolchain.toml, and tools/install_rust_msrv.sh
license = "Apache-2.0"

# Shared dependencies that can be inherited. This just helps a little with
Expand All @@ -21,9 +21,9 @@ hashbrown.version = "0.15.2"
num-bigint = "0.4"
num-complex = "0.4"
nalgebra = "0.33"
ndarray = "0.15"
numpy = "0.23"
smallvec = "1.13"
ndarray = "0.16"
smallvec = "1.14"
thiserror = "2.0"
rustworkx-core = "0.16"
approx = "0.5"
Expand Down
6 changes: 3 additions & 3 deletions crates/accelerate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ faer = "0.19.4"
itertools.workspace = true
qiskit-circuit.workspace = true
thiserror.workspace = true
ndarray_einsum_beta = "0.7"
ndarray-einsum = "0.8.0"
once_cell = "1.20.3"
rustiq-core = "0.0.10"
bytemuck.workspace = true
Expand All @@ -43,7 +43,7 @@ features = ["hashbrown", "indexmap", "num-complex", "num-bigint", "smallvec"]

[dependencies.ndarray]
workspace = true
features = ["rayon", "approx-0_5"]
features = ["rayon", "approx"]

[dependencies.approx]
workspace = true
Expand All @@ -58,7 +58,7 @@ workspace = true
features = ["rayon"]

[dependencies.faer-ext]
version = "0.2.0"
version = "0.3.0"
features = ["ndarray"]

[dependencies.pulp]
Expand Down
3 changes: 1 addition & 2 deletions crates/accelerate/src/barrier_before_final_measurement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use pyo3::prelude::*;
use rayon::prelude::*;
use rustworkx_core::petgraph::stable_graph::NodeIndex;

use qiskit_circuit::circuit_instruction::ExtraInstructionAttributes;
use qiskit_circuit::dag_circuit::{DAGCircuit, NodeType};
use qiskit_circuit::operations::{OperationRef, StandardInstruction};
use qiskit_circuit::packed_instruction::{PackedInstruction, PackedOperation};
Expand Down Expand Up @@ -150,7 +149,7 @@ pub fn barrier_before_final_measurements(
qargs.as_slice(),
&[],
None,
ExtraInstructionAttributes::new(label, None, None, None),
label,
#[cfg(feature = "cache_pygates")]
None,
)?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub(super) fn compose_transforms<'a>(
} else {
Some(gate_obj.params)
},
gate_obj.extra_attrs,
gate_obj.label.map(|x| *x),
#[cfg(feature = "cache_pygates")]
Some(gate.into()),
)?;
Expand Down Expand Up @@ -121,7 +121,7 @@ pub(super) fn compose_transforms<'a>(
op_node.bind(py),
&replace_dag,
None,
true,
None,
)?;
}
}
Expand Down
Loading

0 comments on commit 9f206e7

Please sign in to comment.