Skip to content

Support ParameterExpressions with operations other then add, mul, div, and neg #153

@jcjaskula-aws

Description

@jcjaskula-aws

Steps to reproduce the problem

Translating circuits like:

qiskit_circuit = QuantumCircuit(1)
v = ParameterVector("v", 2)
qiskit_circuit.rx(Parameter("a")/Parameter("b"), 0)
braket_circuit = to_braket(qiskit_circuit)

will throw an error because we serialize and parse the ast to create a FreeParameterExpression instead of relying on Sympy.

What is the current behavior?

Throws an error.

ValueError: Unsupported binary operation: <class 'ast.Div'>

What is the expected behavior?

Create a correct FreeParameterExpression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions