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

Statevector.evolve fails for repeated calls on non-qubit statevectors #8897

Closed
chriseclectic opened this issue Oct 13, 2022 · 0 comments · Fixed by #8900
Closed

Statevector.evolve fails for repeated calls on non-qubit statevectors #8897

chriseclectic opened this issue Oct 13, 2022 · 0 comments · Fixed by #8900
Labels
bug Something isn't working

Comments

@chriseclectic
Copy link
Member

Environment

  • Qiskit Terra version: 0.22
  • Python version: All
  • Operating system: All

What is happening?

Repeat calls of Statevector/DensityMatrix.evolve on subsystems for non-qubit states raises numpy axis errors.

How can we reproduce the issue?

import qiskit.quantum_info as qi
import numpy as np

mat = np.eye(3)

state = qi.random_statevector((3, 3, 3), seed=123)
state.evolve(mat, [0]).evolve(mat, [1])
Some long traceback to...
ValueError: axes don't match array

This doesn't happen for qubit subsystems.

What should happen?

No error

Any suggestions?

I think I have identified the bug in the OpShape.compose method where an attribute is not being set correctly for non-qubit subsystems.

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
1 participant