Skip to content

Commit

Permalink
Fix: target not being recognized as a module
Browse files Browse the repository at this point in the history
- Add target to the pyext crate.
- Change placement of target import for alphabetical ordering.
- Other tweaks and fixes.
  • Loading branch information
raynelfss committed Apr 18, 2024
1 parent 22d1d05 commit 4b7aed3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion crates/pyext/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use qiskit_accelerate::{
error_map::error_map, euler_one_qubit_decomposer::euler_one_qubit_decomposer, nlayout::nlayout,
optimize_1q_gates::optimize_1q_gates, pauli_exp_val::pauli_expval, results::results,
sabre::sabre, sampled_exp_val::sampled_exp_val, sparse_pauli_op::sparse_pauli_op,
stochastic_swap::stochastic_swap, two_qubit_decompose::two_qubit_decompose, utils::utils,
stochastic_swap::stochastic_swap, target::target, two_qubit_decompose::two_qubit_decompose, utils::utils,
vf2_layout::vf2_layout,
};

Expand All @@ -39,6 +39,7 @@ fn _accelerate(m: &Bound<PyModule>) -> PyResult<()> {
m.add_wrapped(wrap_pymodule!(sampled_exp_val))?;
m.add_wrapped(wrap_pymodule!(sparse_pauli_op))?;
m.add_wrapped(wrap_pymodule!(stochastic_swap))?;
m.add_wrapped(wrap_pymodule!(target))?;
m.add_wrapped(wrap_pymodule!(two_qubit_decompose))?;
m.add_wrapped(wrap_pymodule!(utils))?;
m.add_wrapped(wrap_pymodule!(vf2_layout))?;
Expand Down
2 changes: 1 addition & 1 deletion qiskit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
sys.modules["qiskit._accelerate.sampled_exp_val"] = qiskit._accelerate.sampled_exp_val
sys.modules["qiskit._accelerate.sparse_pauli_op"] = qiskit._accelerate.sparse_pauli_op
sys.modules["qiskit._accelerate.stochastic_swap"] = qiskit._accelerate.stochastic_swap
sys.modules["qiskit._accelerate.two_qubit_decompose"] = qiskit._accelerate.two_qubit_decompose
sys.modules["qiskit._accelerate.target"] = qiskit._accelerate.target
sys.modules["qiskit._accelerate.two_qubit_decompose"] = qiskit._accelerate.two_qubit_decompose
sys.modules["qiskit._accelerate.vf2_layout"] = qiskit._accelerate.vf2_layout

from qiskit.exceptions import QiskitError, MissingOptionalLibraryError
Expand Down

0 comments on commit 4b7aed3

Please sign in to comment.