Skip to content

ParameterExpression.sympy() is not working properly #14640

@ptristan3

Description

@ptristan3

Environment

  • Qiskit version: 2.1.0rc1
  • Python version: 3.11
  • Operating system: Macos

What is happening?

ParameterExpression.sympify is returning E TypeError: 'Symbol' object is not subscriptable

How can we reproduce the issue?

from qiskit.circuit import Parameter
from qiskit.circuit import ParameterVector

p_vec = ParameterVector("p", length=2)
theta = Parameter("theta")

expression = theta + 1
expression = expression.subs({theta: p_vec[0]})
expression.sympify()

What should happen?

Returning a symbolic expression that can then be converted to a symengine expression

Any suggestions?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions