Skip to content

Commit

Permalink
Merge branch 'main' into move-target
Browse files Browse the repository at this point in the history
  • Loading branch information
raynelfss authored May 29, 2024
2 parents 31cc1f1 + 473c3c2 commit 05ddc79
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 35 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/miri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ jobs:
name: Miri
runs-on: ubuntu-latest
env:
RUSTUP_TOOLCHAIN: nightly
RUSTUP_TOOLCHAIN: nightly-2024-05-24

steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-05-24
components: miri

- name: Prepare Miri
Expand Down
124 changes: 98 additions & 26 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 crates/accelerate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ num-traits = "0.2"
num-complex = "0.4"
num-bigint = "0.4"
rustworkx-core = "0.14"
faer = "0.18.2"
faer = "0.19.0"
itertools = "0.13.0"
qiskit-circuit.workspace = true

Expand Down Expand Up @@ -49,9 +49,9 @@ workspace = true
features = ["rayon"]

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

[dependencies.pulp]
version = "0.18.12"
version = "0.18.21"
features = ["macro"]
1 change: 0 additions & 1 deletion crates/accelerate/src/isometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ fn construct_basis_states(
} else if i == target_label {
e2 += 1;
} else {
assert!(j <= 1);
e1 += state_free[j] as usize;
e2 += state_free[j] as usize;
j += 1
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/fix-isometry-rust-adf0eed09c6611f1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixes:
- |
Fix a bug in :class:`~.library.Isometry` due to an unnecessary assertion,
that led to an error in :meth:`.UnitaryGate.control`
when :class:`~.library.UnitaryGate` had more that two qubits.
5 changes: 2 additions & 3 deletions test/python/circuit/test_controlled_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,10 +852,9 @@ def test_controlled_unitary(self, num_ctrl_qubits):
self.assertTrue(is_unitary_matrix(base_mat))
self.assertTrue(matrix_equal(cop_mat, test_op.data))

@data(1, 2, 3, 4, 5)
def test_controlled_random_unitary(self, num_ctrl_qubits):
@combine(num_ctrl_qubits=(1, 2, 3, 4, 5), num_target=(2, 3))
def test_controlled_random_unitary(self, num_ctrl_qubits, num_target):
"""Test the matrix data of an Operator based on a random UnitaryGate."""
num_target = 2
base_gate = random_unitary(2**num_target).to_instruction()
base_mat = base_gate.to_matrix()
cgate = base_gate.control(num_ctrl_qubits)
Expand Down

0 comments on commit 05ddc79

Please sign in to comment.