Closed chunfuchen closed 4 years ago
This issue is preventing us merging a PR for parameterized ccts in Aqua to speed up performance. Any idea when a fix can be expected for this issue? Ideally we need it ASAP.
Thanks, the Aqua PR that needed this now passes and has been merged.
This issue seems fixed in the current master, probably via #3148
Information
What is the current behavior?
Since
ParameterExpression
does not supportunary
operand, a parameterized circuit might be crashed during transpile, e.g. a circuit with parameterized cu3.error for unsupporting unary operand.
On the other hand, the current parameter expression only the real number operations, is it possible to support the operation with the complex number? I know at the end the gate parameter could be real but it might be complex during the computations.
Steps to reproduce the problem
What is the expected behavior?
Transpiling without crash
Suggested solutions
Since the definition of cu3 gate uses unary operator, the
ParameterExpression
class needs to support it in order to be compiled to basis gates.like this
On the other hand, for supporting complex numbers in
ParameterExpression
. I think we can postpone the checking whether or not the parameter is complex at the very end. like here: https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/circuit/parameterexpression.py#L73 I think that since terra has already use sympy to support theParameterExpression
, it should not too difficult to support complex number? (Maybe I am wrong, please feel free to correct me)