Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError when Constructing PauliList from Pauli data #380

Closed
robotastray opened this issue Aug 10, 2023 · 1 comment
Closed

ValueError when Constructing PauliList from Pauli data #380

robotastray opened this issue Aug 10, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@robotastray
Copy link
Contributor

robotastray commented Aug 10, 2023

Steps to reproduce the problem

  1. Install the qiskit-qec as per instruction
  2. Navigate to the repository: cd qiskit-qec
  3. Run the test suite: tox -epy311 -- -n ./test/operators/test_pauli_list.py

What is the expected behavior?

The test suite should run without errors, and the test cases should pass successfully.

Actual Behavior:

During the execution of tox -epy311 -- -n ./test/operators/test_pauli_list.py there are several errors of the same type. An error is raised with the following traceback:

DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated...
...
ValueError: setting an array element with a sequence.

Additional Information:

  • The error occurs specifically within the _from_paulis method in the pauli_list.py file.
  • The error seems to be related to how the _phase_exp attribute of the Pauli object is being used within the loop.
  • It appears that _phase_exp might be an array-like object, and the error is caused when trying to assign its values to the phase_exp NumPy array.
  • it is attempting to assign a sequence (e.g. a list or an array) to an individual element within a NumPy array.

Environment:

Python version: 3.11
NumPy version: 1.25.2
qiskit-qec version: latest

@grace-harper
Copy link
Collaborator

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants